Index: [thread] [date] [subject] [author]
  From: elmert <elmert@ipoline.com>
  To  : ggi-develop@eskimo.com
  Date: Fri, 17 Jul 1998 17:33:48 -0400

ggiSetFlags patch (was Re: triggered some probs with libAA-target)

On Fri, 17 Jul 1998, Marcus Sundberg wrote:

> > I had a much cleaner version of this mansync business sitting around, but it
> > requires ggiSetFlags passed to targets.  Should we implement that now?
> 
> Yes, definitely!

Okay, what do you think of this patch:

[------ cut here ------]

--- stubs.c.orig	Fri Jul 17 16:48:24 1998
+++ stubs.c	Fri Jul 17 16:45:12 1998
@@ -159,9 +159,7 @@
 
 int ggiSetFlags(ggi_visual *vis,ggi_flags flags)
 {  
-	LIBGGI_FLAGS(vis)=flags;
-	/* BUGBUG - we should do something.. */
-	return 0;
+	return vis->opdisplay->setflags(vis,flags);
 }
 ggi_flags ggiGetFlags(ggi_visual *vis)
 {  
--- include/structs.h.orig	Fri Jul 17 16:39:30 1998
+++ include/structs.h	Fri Jul 17 16:42:58 1998
@@ -144,8 +144,10 @@
 	int (*kgicommand)(ggi_visual *vis,int cmd,void *args);
 	/* Get current list of active APIs */
 	int (*getapi)(ggi_visual *vis,int num, char *apiname, char *arguments);
+	/* Set various flags for visual, e.g. ASYNC mode */
+	int (*setflags)(ggi_visual *vis,ggi_flags flags);
 
-	int (*dummy_miscman[2])(void);	/* Place holder */
+	int (*dummy_miscman[1])(void);	/* Place holder */
 
 /*------- Section: Mode management (3/5 slots) -------------*/
 	/* Get the display mode */
--- include/ggi-dl.h.orig	Fri Jul 17 16:55:18 1998
+++ include/ggi-dl.h	Fri Jul 17 16:56:02 1998
@@ -36,6 +36,9 @@
 int GGIsetmode(ggi_visual *vis,ggi_mode *tm);
 int GGIcheckmode(ggi_visual *vis,ggi_mode *tm);
 
+/* Flag settings */
+int GGIsetflags(ggi_visual *vis,ggi_flags flags);
+
 /* Accel management 
  */
 int GGIflush(ggi_visual *vis);

[------ cut here ------]

0. It belongs in "misc management".  Okay?

1. Is it necessary for targets to override ggiGetFlags() too?

2. I don't think it's proper for ggiSetFlags to go in generic-stubs.  So we
   just require targets to include this code if they don't do anything
   special with the flags (like they do with other misc management stuff):

int GGIsetflags(ggi_visual *vis, ggi_flags flags)
{
	LIBGGI_FLAGS(vis)=flags;
	return 0;
}

Of course, for mansync targets we can cut out all the flags detection stuff
from GGIflush and move it to GGIsetflags.

If this is good, could someone please commit the changes for me?  It'll
temporarily break things and I won't have time to fix them in the next 3
days.  Thanks.

--
Steve Cheng               

email: steve@ggi-project.org   
www: <http://shell.ipoline.com/~elmert/>;

Index: [thread] [date] [subject] [author]