Re: [patch] binary compatibility considerations wrt multihead support



Erwann Chenede <Erwann Chenede Sun COM> writes:

> Hi all,
> 
> Here is a patch to add padding to structs that will be using
> GdkScreen or GdkDisplay for multihead support.
> I've also added dummy pointer to GdkPointerHooks window_at_pointer
> for the same reason.
> 
> Is it ok ? If so can I (or somebody else) commit ?

I've committed the window_at_pointer() changes with one small
difference - I used a dummy GdkScreen typedef rather than
a gpointer. See below for notes on the other changes ... I
don't think they are necessary.
 
> Also Owen, you've added 4 reserved function pointers to
> GdkDrawableClass. Multihead currently adds only 2 function pointers,
> so have the 2 extra ones a forseen use or there here just has 
> a precautionary mesure ?

These pointers were not in particular for multihead. The particular
use I had in mind was adding functions to accelerate drawing
of alpha-composited images. But any sort of additional drawing
op would have to go into here. I've upped it to 6 pointers just
to be safe now.

[ Note that I think there is still an outstanding comment from me that
  there should only be _one_ extra pointer in GdkDrawableClass
  ... that we shouldn't virtualize both get_screen() and get_display() ]

> Index: gdk/x11/gdkinputprivate.h
> Index: gtk/gtkclipboard.c
> Index: gtk/gtkselection.c

We don't need to do these changes now -- they only affect
structures not visible to the outside world.

> Index: gdk/gdkcolor.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkcolor.h,v
> retrieving revision 1.10
> diff -u -r1.10 gdkcolor.h
> --- gdk/gdkcolor.h	2001/09/07 22:33:08	1.10
> +++ gdk/gdkcolor.h	2001/11/16 17:22:09
> @@ -48,6 +48,7 @@
>    GdkVisual *visual;
>    
>    gpointer windowing_data;
> +  gpointer   gdk_reserved1; /* For Future GdkScreen * */
>  };
>  
>  struct _GdkColormapClass
> Index: gdk/gdkvisual.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkvisual.h,v
> retrieving revision 1.4
> diff -u -r1.4 gdkvisual.h
> --- gdk/gdkvisual.h	2001/06/30 02:56:50	1.4
> +++ gdk/gdkvisual.h	2001/11/16 17:22:09
> @@ -67,6 +67,8 @@
>    guint32 blue_mask;
>    gint blue_shift;
>    gint blue_prec;
> +  
> +  gpointer gdk_reserved1; /* For Future GdkScreen * */
>  };
>  
>  GType         gdk_visual_get_type            (void);
> Index: gtk/gtksettings.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtksettings.h,v
> retrieving revision 1.5
> diff -u -r1.5 gtksettings.h
> --- gtk/gtksettings.h	2001/06/30 16:08:24	1.5
> +++ gtk/gtksettings.h	2001/11/16 17:22:11
> @@ -48,6 +48,7 @@
>    GValue *property_values;
>  
>    GtkRcContext *rc_context;
> +  gpointer gtk_reserved1;	/* For future GdkScreen * */
>  };
>  struct _GtkSettingsClass
>  {

None of these matter because these objects are not derivable,
so we can always extend them at the end later. Unfortunately,
this isn't completely obvious from the interface, but if 
you tried to derive from, say, GtkSettings, things sure wouldn't
work well.

> Index: gtk/gtkselection.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtkselection.h,v
> retrieving revision 1.15
> diff -u -r1.15 gtkselection.h
> --- gtk/gtkselection.h	2001/10/31 23:49:09	1.15
> +++ gtk/gtkselection.h	2001/11/16 17:22:11
> @@ -58,6 +58,7 @@
>    gint	  format;
>    guchar *data;  
>    gint	  length;
> +  gpointer gtk_reserved1; /* For Future GdkDisplay * */
>  };
>  
>  struct _GtkTargetEntry {

Again, we can extend this structure at the end later since you
can never allocate one on the heap - gtk_selection_data_copy()
is the only way you can allocate a new one.

> Index: gdk/gdkwindow.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.c,v
> retrieving revision 1.124
> diff -u -r1.124 gdkwindow.c
> --- gdk/gdkwindow.c	2001/11/04 22:57:02	1.124
> +++ gdk/gdkwindow.c	2001/11/16 17:22:09
> @@ -2637,7 +2637,7 @@
>  gdk_window_at_pointer (gint *win_x,
>  		       gint *win_y)
>  {
> -  return current_pointer_hooks->window_at_pointer (win_x, win_y);
> +  return current_pointer_hooks->window_at_pointer (NULL, win_x, win_y);
>  }
>  
>  /**
> Index: gdk/gdkwindow.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.h,v
> retrieving revision 1.34
> diff -u -r1.34 gdkwindow.h
> --- gdk/gdkwindow.h	2001/11/04 22:57:02	1.34
> +++ gdk/gdkwindow.h	2001/11/16 17:22:09
> @@ -204,7 +204,8 @@
>  			           gint	           *x,
>  			           gint   	   *y,
>  			           GdkModifierType *mask);
> -  GdkWindow* (*window_at_pointer) (gint            *win_x,
> +  GdkWindow* (*window_at_pointer) (gpointer        gdk_reserved1, /*for future GdkScreen **/
> +                                   gint            *win_x,
>                                     gint            *win_y);
>  };
>  
> Index: gdk/gdkinternals.h
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/gdkinternals.h,v
> retrieving revision 1.11
> diff -u -r1.11 gdkinternals.h
> --- gdk/gdkinternals.h	2001/09/07 21:49:49	1.11
> +++ gdk/gdkinternals.h	2001/11/16 17:22:09
> @@ -195,7 +195,8 @@
>  						 gint        width,
>  						 gint        height);
>  
> -GdkWindow* _gdk_windowing_window_at_pointer  (gint            *win_x,
> +GdkWindow* _gdk_windowing_window_at_pointer  (gpointer        gdk_reserved1, /* future GdkScreen * */
> +                                              gint            *win_x,
>  					      gint            *win_y);
>  GdkWindow* _gdk_windowing_window_get_pointer (GdkWindow       *window,
>  					      gint            *x,
> Index: gdk/x11/gdkwindow-x11.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
> retrieving revision 1.134
> diff -u -r1.134 gdkwindow-x11.c
> --- gdk/x11/gdkwindow-x11.c	2001/11/05 17:48:58	1.134
> +++ gdk/x11/gdkwindow-x11.c	2001/11/16 17:22:10
> @@ -2397,7 +2397,8 @@
>  }
>  
>  GdkWindow*
> -_gdk_windowing_window_at_pointer (gint *win_x,
> +_gdk_windowing_window_at_pointer (gpointer gdk_reserved1, /* future GdkScreen */
> +                                  gint *win_x,
>  				  gint *win_y)
>  {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]