diff --git a/ChangeLog b/ChangeLog index 610904befc..0c47a61033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 610904befc..0c47a61033 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sat Feb 28 15:18:36 1998 Tim Janik + + * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with + srcx/srcy != 0, gtk-shige-980127-0.patch.gz by + AOSASA Shigeru . + + * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region + support in Gdk, by Robert Roebling . + Fri Feb 27 15:31:55 1998 Tim Janik * gtk/gtktipsquery.c: we make an active server grab now, this way we diff --git a/docs/widget_system.txt b/docs/widget_system.txt index f03121cf61..a11580c0fa 100644 --- a/docs/widget_system.txt +++ b/docs/widget_system.txt @@ -133,7 +133,14 @@ GTK_BASIC: disallow to act as a container for another GtkButton. Now the gnit is, one can add a GtkHBox (which is a `basic' widget) to the first button, and put the second into the box. - + +GTK_RESERVED_3: + +GTK_RC_STYLE: + This flag indicates that its style has been looked up through + the rc mechanism. It does not imply that the widget actually + had a style defined through the rc mechanism. + GtkWidget, private flags: diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 30152085b5..8dabd8da4e 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -24,6 +24,7 @@ libgdk_la_SOURCES = \ gdkpixmap.c \ gdkproperty.c \ gdkrectangle.c \ + gdkregion.c \ gdkselection.c \ gdkvisual.c \ gdkwindow.c \ diff --git a/gdk/gdk.h b/gdk/gdk.h index f684fc359a..6c2cb59bdc 100644 --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -29,56 +29,56 @@ extern "C" { /* Initialization, exit and events */ -void gdk_init (int *argc, +void gdk_init (int *argc, char ***argv); -void gdk_exit (int error_code); -gchar* gdk_set_locale (void); +void gdk_exit (int error_code); +gchar* gdk_set_locale (void); -gint gdk_events_pending (void); -GdkEvent *gdk_event_get (void); +gint gdk_events_pending (void); +GdkEvent *gdk_event_get (void); GdkEvent *gdk_event_get_graphics_expose (GdkWindow *window); -void gdk_event_put (GdkEvent *event); +void gdk_event_put (GdkEvent *event); GdkEvent *gdk_event_copy (GdkEvent *event); -void gdk_event_free (GdkEvent *event); +void gdk_event_free (GdkEvent *event); -void gdk_set_show_events (gint show_events); -void gdk_set_use_xshm (gint use_xshm); +void gdk_set_show_events (gint show_events); +void gdk_set_use_xshm (gint use_xshm); gint gdk_get_show_events (void); -gint gdk_get_use_xshm (void); +gint gdk_get_use_xshm (void); gchar *gdk_get_display (void); -guint32 gdk_time_get (void); -guint32 gdk_timer_get (void); -void gdk_timer_set (guint32 milliseconds); -void gdk_timer_enable (void); -void gdk_timer_disable (void); +guint32 gdk_time_get (void); +guint32 gdk_timer_get (void); +void gdk_timer_set (guint32 milliseconds); +void gdk_timer_enable (void); +void gdk_timer_disable (void); -gint gdk_input_add_full (gint source, +gint gdk_input_add_full (gint source, GdkInputCondition condition, GdkInputFunction function, - gpointer data, + gpointer data, GdkDestroyNotify destroy); -#define gdk_input_add_interp gdk_input_add_full -gint gdk_input_add (gint source, +#define gdk_input_add_interp gdk_input_add_full +gint gdk_input_add (gint source, GdkInputCondition condition, GdkInputFunction function, - gpointer data); -void gdk_input_remove (gint tag); + gpointer data); +void gdk_input_remove (gint tag); -gint gdk_pointer_grab (GdkWindow * window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - GdkCursor * cursor, - guint32 time); -void gdk_pointer_ungrab (guint32 time); +gint gdk_pointer_grab (GdkWindow * window, + gint owner_events, + GdkEventMask event_mask, + GdkWindow * confine_to, + GdkCursor * cursor, + guint32 time); +void gdk_pointer_ungrab (guint32 time); -gint gdk_keyboard_grab (GdkWindow * window, - gint owner_events, - guint32 time); -void gdk_keyboard_ungrab (guint32 time); +gint gdk_keyboard_grab (GdkWindow * window, + gint owner_events, + guint32 time); +void gdk_keyboard_ungrab (guint32 time); gint gdk_pointer_is_grabbed (void); @@ -94,90 +94,90 @@ void gdk_key_repeat_restore (void); /* Visuals */ -gint gdk_visual_get_best_depth (void); -GdkVisualType gdk_visual_get_best_type (void); -GdkVisual* gdk_visual_get_system (void); -GdkVisual* gdk_visual_get_best (void); -GdkVisual* gdk_visual_get_best_with_depth (gint depth); +gint gdk_visual_get_best_depth (void); +GdkVisualType gdk_visual_get_best_type (void); +GdkVisual* gdk_visual_get_system (void); +GdkVisual* gdk_visual_get_best (void); +GdkVisual* gdk_visual_get_best_with_depth (gint depth); GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type); -GdkVisual* gdk_visual_get_best_with_both (gint depth, +GdkVisual* gdk_visual_get_best_with_both (gint depth, GdkVisualType visual_type); /* Actually, these are no-ops... */ GdkVisual* gdk_visual_ref (GdkVisual *visual); -void gdk_visual_unref (GdkVisual *visual); +void gdk_visual_unref (GdkVisual *visual); -void gdk_query_depths (gint **depths, - gint *count); +void gdk_query_depths (gint **depths, + gint *count); void gdk_query_visual_types (GdkVisualType **visual_types, - gint *count); -void gdk_query_visuals (GdkVisual **visuals, - gint *count); + gint *count); +void gdk_query_visuals (GdkVisual **visuals, + gint *count); /* Windows */ -GdkWindow* gdk_window_new (GdkWindow *parent, +GdkWindow* gdk_window_new (GdkWindow *parent, GdkWindowAttr *attributes, - gint attributes_mask); + gint attributes_mask); -GdkWindow * gdk_window_foreign_new (guint32 anid); -void gdk_window_destroy (GdkWindow *window); -GdkWindow* gdk_window_ref (GdkWindow *window); -void gdk_window_unref (GdkWindow *window); +GdkWindow * gdk_window_foreign_new (guint32 anid); +void gdk_window_destroy (GdkWindow *window); +GdkWindow* gdk_window_ref (GdkWindow *window); +void gdk_window_unref (GdkWindow *window); -void gdk_window_show (GdkWindow *window); -void gdk_window_hide (GdkWindow *window); -void gdk_window_withdraw (GdkWindow *window); -void gdk_window_move (GdkWindow *window, - gint x, - gint y); -void gdk_window_resize (GdkWindow *window, - gint width, - gint height); -void gdk_window_move_resize (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_reparent (GdkWindow *window, - GdkWindow *new_parent, - gint x, - gint y); -void gdk_window_clear (GdkWindow *window); -void gdk_window_clear_area (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_clear_area_e(GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_copy_area (GdkWindow *window, - GdkGC *gc, - gint x, - gint y, - GdkWindow *source_window, - gint source_x, - gint source_y, - gint width, - gint height); -void gdk_window_raise (GdkWindow *window); -void gdk_window_lower (GdkWindow *window); +void gdk_window_show (GdkWindow *window); +void gdk_window_hide (GdkWindow *window); +void gdk_window_withdraw (GdkWindow *window); +void gdk_window_move (GdkWindow *window, + gint x, + gint y); +void gdk_window_resize (GdkWindow *window, + gint width, + gint height); +void gdk_window_move_resize (GdkWindow *window, + gint x, + gint y, + gint width, + gint height); +void gdk_window_reparent (GdkWindow *window, + GdkWindow *new_parent, + gint x, + gint y); +void gdk_window_clear (GdkWindow *window); +void gdk_window_clear_area (GdkWindow *window, + gint x, + gint y, + gint width, + gint height); +void gdk_window_clear_area_e(GdkWindow *window, + gint x, + gint y, + gint width, + gint height); +void gdk_window_copy_area (GdkWindow *window, + GdkGC *gc, + gint x, + gint y, + GdkWindow *source_window, + gint source_x, + gint source_y, + gint width, + gint height); +void gdk_window_raise (GdkWindow *window); +void gdk_window_lower (GdkWindow *window); -void gdk_window_set_user_data (GdkWindow *window, - gpointer user_data); -void gdk_window_set_override_redirect(GdkWindow *window, +void gdk_window_set_user_data (GdkWindow *window, + gpointer user_data); +void gdk_window_set_override_redirect(GdkWindow *window, gboolean override_redirect); -void gdk_window_add_filter (GdkWindow *window, - GdkFilterFunc function, - gpointer data); -void gdk_window_remove_filter (GdkWindow *window, - GdkFilterFunc function, - gpointer data); +void gdk_window_add_filter (GdkWindow *window, + GdkFilterFunc function, + gpointer data); +void gdk_window_remove_filter (GdkWindow *window, + GdkFilterFunc function, + gpointer data); /* * This allows for making shaped (partially transparent) windows @@ -185,10 +185,10 @@ void gdk_window_remove_filter (GdkWindow *window, * The shape_mask can be the mask * from gdk_pixmap_create_from_xpm. Stefan Wille */ -void gdk_window_shape_combine_mask (GdkWindow *window, - GdkBitmap *shape_mask, - gint offset_x, - gint offset_y); +void gdk_window_shape_combine_mask (GdkWindow *window, + GdkBitmap *shape_mask, + gint offset_x, + gint offset_y); /* * Drag & Drop @@ -204,19 +204,19 @@ void gdk_window_shape_combine_mask (GdkWindow *window, * sets the list of types supported. The list of types passed in * should be in order of decreasing preference. */ -void gdk_window_dnd_drag_set (GdkWindow *window, - guint8 drag_enable, - gchar **typelist, - guint numtypes); +void gdk_window_dnd_drag_set (GdkWindow *window, + guint8 drag_enable, + gchar **typelist, + guint numtypes); /* *XXX todo: add a GDK_DROP_ENTER which can look at actual data */ -void gdk_window_dnd_drop_set (GdkWindow *window, - guint8 drop_enable, - gchar **typelist, - guint numtypes, - guint8 destructive_op); +void gdk_window_dnd_drop_set (GdkWindow *window, + guint8 drop_enable, + gchar **typelist, + guint numtypes, + guint8 destructive_op); /* * This is used by the GDK_DRAG_BEGIN handler. An example of usage would be a @@ -224,11 +224,11 @@ void gdk_window_dnd_drop_set (GdkWindow *window, * The icon that the drag actually began on would gdk_dnd_drag_addwindow * for all the other icons that were being dragged... */ -void gdk_dnd_drag_addwindow (GdkWindow *window); -void gdk_window_dnd_data_set (GdkWindow *window, - GdkEvent *event, - gpointer data, - gulong data_numbytes); +void gdk_dnd_drag_addwindow (GdkWindow *window); +void gdk_window_dnd_data_set (GdkWindow *window, + GdkEvent *event, + gpointer data, + gulong data_numbytes); void gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, GdkCursor *goahead_cursor); void gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin, @@ -236,159 +236,161 @@ void gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin, GdkWindow *goahead_pixmapwin, GdkPoint *goahead_hotspot); -void gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags); -void gdk_window_set_title (GdkWindow *window, - const gchar *title); -void gdk_window_set_background (GdkWindow *window, - GdkColor *color); -void gdk_window_set_back_pixmap (GdkWindow *window, - GdkPixmap *pixmap, - gint parent_relative); -void gdk_window_set_cursor (GdkWindow *window, - GdkCursor *cursor); -void gdk_window_set_colormap (GdkWindow *window, - GdkColormap *colormap); -void gdk_window_get_user_data (GdkWindow *window, - gpointer *data); -void gdk_window_get_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *depth); -void gdk_window_get_position (GdkWindow *window, - gint *x, - gint *y); -void gdk_window_get_size (GdkWindow *window, - gint *width, - gint *height); -GdkVisual* gdk_window_get_visual (GdkWindow *window); -GdkColormap* gdk_window_get_colormap (GdkWindow *window); -GdkWindowType gdk_window_get_type (GdkWindow *window); -gint gdk_window_get_origin (GdkWindow *window, - gint *x, - gint *y); -GdkWindow* gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, +void gdk_window_set_hints (GdkWindow *window, + gint x, + gint y, + gint min_width, + gint min_height, + gint max_width, + gint max_height, + gint flags); +void gdk_window_set_title (GdkWindow *window, + const gchar *title); +void gdk_window_set_background (GdkWindow *window, + GdkColor *color); +void gdk_window_set_back_pixmap (GdkWindow *window, + GdkPixmap *pixmap, + gint parent_relative); +void gdk_window_set_cursor (GdkWindow *window, + GdkCursor *cursor); +void gdk_window_set_colormap (GdkWindow *window, + GdkColormap *colormap); +void gdk_window_get_user_data (GdkWindow *window, + gpointer *data); +void gdk_window_get_geometry (GdkWindow *window, + gint *x, + gint *y, + gint *width, + gint *height, + gint *depth); +void gdk_window_get_position (GdkWindow *window, + gint *x, + gint *y); +void gdk_window_get_size (GdkWindow *window, + gint *width, + gint *height); +GdkVisual* gdk_window_get_visual (GdkWindow *window); +GdkColormap* gdk_window_get_colormap (GdkWindow *window); +GdkWindowType gdk_window_get_type (GdkWindow *window); +gint gdk_window_get_origin (GdkWindow *window, + gint *x, + gint *y); +GdkWindow* gdk_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, GdkModifierType *mask); -GdkWindow* gdk_window_get_parent (GdkWindow *window); -GdkWindow* gdk_window_get_toplevel (GdkWindow *window); -GList* gdk_window_get_children (GdkWindow *window); -GdkEventMask gdk_window_get_events (GdkWindow *window); -void gdk_window_set_events (GdkWindow *window, - GdkEventMask event_mask); +GdkWindow* gdk_window_get_parent (GdkWindow *window); +GdkWindow* gdk_window_get_toplevel (GdkWindow *window); +GList* gdk_window_get_children (GdkWindow *window); +GdkEventMask gdk_window_get_events (GdkWindow *window); +void gdk_window_set_events (GdkWindow *window, + GdkEventMask event_mask); -void gdk_window_set_icon (GdkWindow *window, - GdkWindow *icon_window, - GdkPixmap *pixmap, - GdkBitmap *mask); -void gdk_window_set_icon_name (GdkWindow *window, - gchar *name); -void gdk_window_set_group (GdkWindow *window, - GdkWindow *leader); -void gdk_window_set_decorations (GdkWindow *window, +void gdk_window_set_icon (GdkWindow *window, + GdkWindow *icon_window, + GdkPixmap *pixmap, + GdkBitmap *mask); +void gdk_window_set_icon_name (GdkWindow *window, + gchar *name); +void gdk_window_set_group (GdkWindow *window, + GdkWindow *leader); +void gdk_window_set_decorations (GdkWindow *window, GdkWMDecoration decorations); -void gdk_window_set_functions (GdkWindow *window, - GdkWMFunction functions); +void gdk_window_set_functions (GdkWindow *window, + GdkWMFunction functions); /* Cursors */ -GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); -GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, - GdkPixmap *mask, - GdkColor *fg, - GdkColor *bg, - gint x, - gint y); -void gdk_cursor_destroy (GdkCursor *cursor); +GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); +GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, + GdkPixmap *mask, + GdkColor *fg, + GdkColor *bg, + gint x, + gint y); +void gdk_cursor_destroy (GdkCursor *cursor); /* GCs */ -GdkGC* gdk_gc_new (GdkWindow *window); -GdkGC* gdk_gc_new_with_values (GdkWindow *window, - GdkGCValues *values, +GdkGC* gdk_gc_new (GdkWindow *window); +GdkGC* gdk_gc_new_with_values (GdkWindow *window, + GdkGCValues *values, GdkGCValuesMask values_mask); -GdkGC* gdk_gc_ref (GdkGC *gc); -void gdk_gc_unref (GdkGC *gc); -void gdk_gc_destroy (GdkGC *gc); -void gdk_gc_get_values (GdkGC *gc, - GdkGCValues *values); -void gdk_gc_set_foreground (GdkGC *gc, - GdkColor *color); -void gdk_gc_set_background (GdkGC *gc, - GdkColor *color); -void gdk_gc_set_font (GdkGC *gc, - GdkFont *font); -void gdk_gc_set_function (GdkGC *gc, - GdkFunction function); -void gdk_gc_set_fill (GdkGC *gc, - GdkFill fill); -void gdk_gc_set_tile (GdkGC *gc, - GdkPixmap *tile); -void gdk_gc_set_stipple (GdkGC *gc, - GdkPixmap *stipple); -void gdk_gc_set_ts_origin (GdkGC *gc, - gint x, - gint y); -void gdk_gc_set_clip_origin (GdkGC *gc, - gint x, - gint y); -void gdk_gc_set_clip_mask (GdkGC *gc, - GdkBitmap *mask); -void gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle); -void gdk_gc_set_subwindow (GdkGC *gc, +GdkGC* gdk_gc_ref (GdkGC *gc); +void gdk_gc_unref (GdkGC *gc); +void gdk_gc_destroy (GdkGC *gc); +void gdk_gc_get_values (GdkGC *gc, + GdkGCValues *values); +void gdk_gc_set_foreground (GdkGC *gc, + GdkColor *color); +void gdk_gc_set_background (GdkGC *gc, + GdkColor *color); +void gdk_gc_set_font (GdkGC *gc, + GdkFont *font); +void gdk_gc_set_function (GdkGC *gc, + GdkFunction function); +void gdk_gc_set_fill (GdkGC *gc, + GdkFill fill); +void gdk_gc_set_tile (GdkGC *gc, + GdkPixmap *tile); +void gdk_gc_set_stipple (GdkGC *gc, + GdkPixmap *stipple); +void gdk_gc_set_ts_origin (GdkGC *gc, + gint x, + gint y); +void gdk_gc_set_clip_origin (GdkGC *gc, + gint x, + gint y); +void gdk_gc_set_clip_mask (GdkGC *gc, + GdkBitmap *mask); +void gdk_gc_set_clip_rectangle (GdkGC *gc, + GdkRectangle *rectangle); +void gdk_gc_set_clip_region (GdkGC *gc, + GdkRegion *region); +void gdk_gc_set_subwindow (GdkGC *gc, GdkSubwindowMode mode); -void gdk_gc_set_exposures (GdkGC *gc, - gint exposures); -void gdk_gc_set_line_attributes (GdkGC *gc, - gint line_width, - GdkLineStyle line_style, - GdkCapStyle cap_style, - GdkJoinStyle join_style); -void gdk_gc_copy (GdkGC *dst_gc, - GdkGC *src_gc); +void gdk_gc_set_exposures (GdkGC *gc, + gint exposures); +void gdk_gc_set_line_attributes (GdkGC *gc, + gint line_width, + GdkLineStyle line_style, + GdkCapStyle cap_style, + GdkJoinStyle join_style); +void gdk_gc_copy (GdkGC *dst_gc, + GdkGC *src_gc); /* Pixmaps */ -GdkPixmap* gdk_pixmap_new (GdkWindow *window, - gint width, - gint height, - gint depth); -GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window, - gchar *data, - gint width, - gint height); -GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window, - gchar *data, - gint width, - gint height, - gint depth, +GdkPixmap* gdk_pixmap_new (GdkWindow *window, + gint width, + gint height, + gint depth); +GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window, + gchar *data, + gint width, + gint height); +GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window, + gchar *data, + gint width, + gint height, + gint depth, GdkColor *fg, GdkColor *bg); -GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window, +GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, const gchar *filename); GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window, GdkBitmap **mask, GdkColor *transparent_color, - gchar **data); -GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap); -void gdk_pixmap_unref (GdkPixmap *pixmap); + gchar **data); +GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap); +void gdk_pixmap_unref (GdkPixmap *pixmap); -GdkBitmap *gdk_bitmap_ref (GdkBitmap *pixmap); -void gdk_bitmap_unref (GdkBitmap *pixmap); +GdkBitmap *gdk_bitmap_ref (GdkBitmap *pixmap); +void gdk_bitmap_unref (GdkBitmap *pixmap); /* Images @@ -396,228 +398,228 @@ void gdk_bitmap_unref (GdkBitmap *pixmap); GdkImage* gdk_image_new_bitmap(GdkVisual *, gpointer, gint, - gint); + gint); GdkImage* gdk_image_new (GdkImageType type, GdkVisual *visual, - gint width, - gint height); + gint width, + gint height); GdkImage* gdk_image_get (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_image_put_pixel (GdkImage *image, - gint x, - gint y, - guint32 pixel); -guint32 gdk_image_get_pixel (GdkImage *image, - gint x, - gint y); -void gdk_image_destroy (GdkImage *image); + gint x, + gint y, + gint width, + gint height); +void gdk_image_put_pixel (GdkImage *image, + gint x, + gint y, + guint32 pixel); +guint32 gdk_image_get_pixel (GdkImage *image, + gint x, + gint y); +void gdk_image_destroy (GdkImage *image); /* Color */ -GdkColormap* gdk_colormap_new (GdkVisual *visual, - gint allocate); -GdkColormap* gdk_colormap_ref (GdkColormap *cmap); -void gdk_colormap_unref (GdkColormap *cmap); +GdkColormap* gdk_colormap_new (GdkVisual *visual, + gint allocate); +GdkColormap* gdk_colormap_ref (GdkColormap *cmap); +void gdk_colormap_unref (GdkColormap *cmap); -GdkColormap* gdk_colormap_get_system (void); -gint gdk_colormap_get_system_size (void); +GdkColormap* gdk_colormap_get_system (void); +gint gdk_colormap_get_system_size (void); -void gdk_colormap_change (GdkColormap *colormap, - gint ncolors); -void gdk_colors_store (GdkColormap *colormap, - GdkColor *colors, - gint ncolors); -gint gdk_colors_alloc (GdkColormap *colormap, - gint contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels); -void gdk_colors_free (GdkColormap *colormap, - gulong *pixels, - gint npixels, - gulong planes); -gint gdk_color_white (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_black (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_parse (const gchar *spec, - GdkColor *color); -gint gdk_color_alloc (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_change (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_equal (GdkColor *colora, - GdkColor *colorb); +void gdk_colormap_change (GdkColormap *colormap, + gint ncolors); +void gdk_colors_store (GdkColormap *colormap, + GdkColor *colors, + gint ncolors); +gint gdk_colors_alloc (GdkColormap *colormap, + gint contiguous, + gulong *planes, + gint nplanes, + gulong *pixels, + gint npixels); +void gdk_colors_free (GdkColormap *colormap, + gulong *pixels, + gint npixels, + gulong planes); +gint gdk_color_white (GdkColormap *colormap, + GdkColor *color); +gint gdk_color_black (GdkColormap *colormap, + GdkColor *color); +gint gdk_color_parse (const gchar *spec, + GdkColor *color); +gint gdk_color_alloc (GdkColormap *colormap, + GdkColor *color); +gint gdk_color_change (GdkColormap *colormap, + GdkColor *color); +gint gdk_color_equal (GdkColor *colora, + GdkColor *colorb); /* Fonts */ -GdkFont* gdk_font_load (const gchar *font_name); +GdkFont* gdk_font_load (const gchar *font_name); GdkFont* gdk_fontset_load (gchar *fontset_name); -GdkFont* gdk_font_ref (GdkFont *font); -void gdk_font_unref (GdkFont *font); -gint gdk_font_id (GdkFont *font); -gint gdk_font_equal (GdkFont *fonta, +GdkFont* gdk_font_ref (GdkFont *font); +void gdk_font_unref (GdkFont *font); +gint gdk_font_id (GdkFont *font); +gint gdk_font_equal (GdkFont *fonta, GdkFont *fontb); -gint gdk_string_width (GdkFont *font, +gint gdk_string_width (GdkFont *font, const gchar *string); -gint gdk_text_width (GdkFont *font, +gint gdk_text_width (GdkFont *font, const gchar *text, gint text_length); -gint gdk_char_width (GdkFont *font, +gint gdk_char_width (GdkFont *font, + gchar character); +gint gdk_string_measure (GdkFont *font, + const gchar *string); +gint gdk_text_measure (GdkFont *font, + const gchar *text, + gint text_length); +gint gdk_char_measure (GdkFont *font, gchar character); -gint gdk_string_measure (GdkFont *font, - const gchar *string); -gint gdk_text_measure (GdkFont *font, - const gchar *text, - gint text_length); -gint gdk_char_measure (GdkFont *font, - gchar character); /* Drawing */ -void gdk_draw_point (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y); -void gdk_draw_line (GdkDrawable *drawable, - GdkGC *gc, - gint x1, - gint y1, - gint x2, - gint y2); -void gdk_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height); -void gdk_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2); -void gdk_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gint filled, +void gdk_draw_point (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y); +void gdk_draw_line (GdkDrawable *drawable, + GdkGC *gc, + gint x1, + gint y1, + gint x2, + gint y2); +void gdk_draw_rectangle (GdkDrawable *drawable, + GdkGC *gc, + gint filled, + gint x, + gint y, + gint width, + gint height); +void gdk_draw_arc (GdkDrawable *drawable, + GdkGC *gc, + gint filled, + gint x, + gint y, + gint width, + gint height, + gint angle1, + gint angle2); +void gdk_draw_polygon (GdkDrawable *drawable, + GdkGC *gc, + gint filled, GdkPoint *points, - gint npoints); -void gdk_draw_string (GdkDrawable *drawable, + gint npoints); +void gdk_draw_string (GdkDrawable *drawable, GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *string); -void gdk_draw_text (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + const gchar *string); +void gdk_draw_text (GdkDrawable *drawable, GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length); -void gdk_draw_pixmap (GdkDrawable *drawable, - GdkGC *gc, + GdkGC *gc, + gint x, + gint y, + const gchar *text, + gint text_length); +void gdk_draw_pixmap (GdkDrawable *drawable, + GdkGC *gc, GdkDrawable *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -void gdk_draw_bitmap (GdkDrawable *drawable, - GdkGC *gc, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); +void gdk_draw_bitmap (GdkDrawable *drawable, + GdkGC *gc, GdkDrawable *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -void gdk_draw_image (GdkDrawable *drawable, - GdkGC *gc, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); +void gdk_draw_image (GdkDrawable *drawable, + GdkGC *gc, GdkImage *image, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -void gdk_draw_points (GdkDrawable *drawable, - GdkGC *gc, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); +void gdk_draw_points (GdkDrawable *drawable, + GdkGC *gc, GdkPoint *points, - gint npoints); -void gdk_draw_segments (GdkDrawable *drawable, - GdkGC *gc, + gint npoints); +void gdk_draw_segments (GdkDrawable *drawable, + GdkGC *gc, GdkSegment *segs, - gint nsegs); + gint nsegs); /* Selections */ -gint gdk_selection_owner_set (GdkWindow *owner, - GdkAtom selection, - guint32 time, - gint send_event); -GdkWindow* gdk_selection_owner_get (GdkAtom selection); -void gdk_selection_convert (GdkWindow *requestor, - GdkAtom selection, - GdkAtom target, - guint32 time); -gint gdk_selection_property_get (GdkWindow *requestor, - guchar **data, - GdkAtom *prop_type, - gint *prop_format); -void gdk_selection_send_notify (guint32 requestor, - GdkAtom selection, - GdkAtom target, - GdkAtom property, - guint32 time); +gint gdk_selection_owner_set (GdkWindow *owner, + GdkAtom selection, + guint32 time, + gint send_event); +GdkWindow* gdk_selection_owner_get (GdkAtom selection); +void gdk_selection_convert (GdkWindow *requestor, + GdkAtom selection, + GdkAtom target, + guint32 time); +gint gdk_selection_property_get (GdkWindow *requestor, + guchar **data, + GdkAtom *prop_type, + gint *prop_format); +void gdk_selection_send_notify (guint32 requestor, + GdkAtom selection, + GdkAtom target, + GdkAtom property, + guint32 time); -gint gdk_text_property_to_text_list (GdkAtom encoding, gint format, - guchar *text, gint length, +gint gdk_text_property_to_text_list (GdkAtom encoding, gint format, + guchar *text, gint length, gchar ***list); -void gdk_free_text_list (gchar **list); -gint gdk_string_to_compound_text (gchar *str, - GdkAtom *encoding, gint *format, - guchar **ctext, gint *length); +void gdk_free_text_list (gchar **list); +gint gdk_string_to_compound_text (gchar *str, + GdkAtom *encoding, gint *format, + guchar **ctext, gint *length); void gdk_free_compound_text (guchar *ctext); /* Properties */ -GdkAtom gdk_atom_intern (const gchar *atom_name, - gint only_if_exists); -gchar* gdk_atom_name (GdkAtom atom); -gint gdk_property_get (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gulong offset, - gulong length, - gint pdelete, - GdkAtom *actual_property_type, - gint *actual_format, - gint *actual_length, - guchar **data); +GdkAtom gdk_atom_intern (const gchar *atom_name, + gint only_if_exists); +gchar* gdk_atom_name (GdkAtom atom); +gint gdk_property_get (GdkWindow *window, + GdkAtom property, + GdkAtom type, + gulong offset, + gulong length, + gint pdelete, + GdkAtom *actual_property_type, + gint *actual_format, + gint *actual_length, + guchar **data); -void gdk_property_change (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gint format, +void gdk_property_change (GdkWindow *window, + GdkAtom property, + GdkAtom type, + gint format, GdkPropMode mode, - guchar *data, - gint nelements); -void gdk_property_delete (GdkWindow *window, - GdkAtom property); + guchar *data, + gint nelements); +void gdk_property_delete (GdkWindow *window, + GdkAtom property); /* Rectangle utilities @@ -631,27 +633,27 @@ gint gdk_rectangle_intersect (GdkRectangle *src1, void gdk_input_init (void); void gdk_input_exit (void); -GList *gdk_input_list_devices (void); -void gdk_input_set_extension_events (GdkWindow *window, +GList *gdk_input_list_devices (void); +void gdk_input_set_extension_events (GdkWindow *window, gint mask, GdkExtensionMode mode); -void gdk_input_set_source (guint32 deviceid, +void gdk_input_set_source (guint32 deviceid, GdkInputSource source); -gint gdk_input_set_mode (guint32 deviceid, +gint gdk_input_set_mode (guint32 deviceid, GdkInputMode mode); -void gdk_input_set_axes (guint32 deviceid, +void gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes); -void gdk_input_set_key (guint32 deviceid, - guint index, - guint keyval, - GdkModifierType modifiers); +void gdk_input_set_key (guint32 deviceid, + guint index, + guint keyval, + GdkModifierType modifiers); void gdk_input_window_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, + guint32 deviceid, + gdouble *x, + gdouble *y, + gdouble *pressure, + gdouble *xtilt, + gdouble *ytilt, GdkModifierType *mask); GdkTimeCoord *gdk_input_motion_events (GdkWindow *window, @@ -663,80 +665,112 @@ GdkTimeCoord *gdk_input_motion_events (GdkWindow *window, /* International Input Method Support Functions */ -gint gdk_im_ready (void); +gint gdk_im_ready (void); void gdk_im_begin (GdkIC ic, GdkWindow* window); void gdk_im_end (void); -GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style); +GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style); GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style); GdkIC gdk_ic_new (GdkWindow* client_window, GdkWindow* focus_window, GdkIMStyle style, ...); void gdk_ic_destroy (GdkIC ic); -GdkIMStyle gdk_ic_get_style (GdkIC ic); +GdkIMStyle gdk_ic_get_style (GdkIC ic); void gdk_ic_set_values (GdkIC ic, ...); void gdk_ic_get_values (GdkIC ic, ...); void gdk_ic_set_attr (GdkIC ic, const char *target, ...); void gdk_ic_get_attr (GdkIC ic, const char *target, ...); -GdkEventMask gdk_ic_get_events (GdkIC ic); +GdkEventMask gdk_ic_get_events (GdkIC ic); /* Miscellaneous */ void gdk_event_send_clientmessage_toall(GdkEvent *event); /* Color Context */ -GdkColorContext *gdk_color_context_new (GdkVisual *visual, - GdkColormap *colormap); +GdkColorContext *gdk_color_context_new (GdkVisual *visual, + GdkColormap *colormap); -GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual, - GdkColormap *colormap); +GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual, + GdkColormap *colormap); -void gdk_color_context_free (GdkColorContext *cc); +void gdk_color_context_free (GdkColorContext *cc); -gulong gdk_color_context_get_pixel (GdkColorContext *cc, - gushort red, - gushort green, - gushort blue, - gint *failed); -void gdk_color_context_get_pixels (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gulong *colors, - gint *nallocated); -void gdk_color_context_get_pixels_incremental (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gint *used, - gulong *colors, - gint *nallocated); +gulong gdk_color_context_get_pixel (GdkColorContext *cc, + gushort red, + gushort green, + gushort blue, + gint *failed); +void gdk_color_context_get_pixels (GdkColorContext *cc, + gushort *reds, + gushort *greens, + gushort *blues, + gint ncolors, + gulong *colors, + gint *nallocated); +void gdk_color_context_get_pixels_incremental (GdkColorContext *cc, + gushort *reds, + gushort *greens, + gushort *blues, + gint ncolors, + gint *used, + gulong *colors, + gint *nallocated); -gint gdk_color_context_query_color (GdkColorContext *cc, - GdkColor *color); -gint gdk_color_context_query_colors (GdkColorContext *cc, - GdkColor *colors, - gint num_colors); +gint gdk_color_context_query_color (GdkColorContext *cc, + GdkColor *color); +gint gdk_color_context_query_colors (GdkColorContext *cc, + GdkColor *colors, + gint num_colors); -gint gdk_color_context_add_palette (GdkColorContext *cc, - GdkColor *palette, - gint num_palette); +gint gdk_color_context_add_palette (GdkColorContext *cc, + GdkColor *palette, + gint num_palette); -void gdk_color_context_init_dither (GdkColorContext *cc); -void gdk_color_context_free_dither (GdkColorContext *cc); +void gdk_color_context_init_dither (GdkColorContext *cc); +void gdk_color_context_free_dither (GdkColorContext *cc); -gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, - gushort *red, - gushort *green, - gushort *blue, - gint *failed); -guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc, - gint *red, - gint *green, - gint *blue, - gint *failed); +gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, + gushort *red, + gushort *green, + gushort *blue, + gint *failed); +guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc, + gint *red, + gint *green, + gint *blue, + gint *failed); +/* Regions + */ + +GdkRegion* gdk_region_new (void); +void gdk_region_destroy (GdkRegion *region); + +gboolean gdk_region_empty (GdkRegion *region); +gboolean gdk_region_equal (GdkRegion *region1, + GdkRegion *region2); +gboolean gdk_region_point_in (GdkRegion *region, + int x, + int y); +GdkOverlapType gdk_region_rect_in (GdkRegion *region, + GdkRectangle *rect); + +void gdk_region_offset (GdkRegion *region, + gint dx, + gint dy); +void gdk_region_shrink (GdkRegion *region, + gint dx, + gint dy); + +GdkRegion* gdk_region_union_with_rect (GdkRegion *region, + GdkRectangle *rect); +GdkRegion* gdk_regions_intersect (GdkRegion *source1, + GdkRegion *source2); +GdkRegion* gdk_regions_union (GdkRegion *source1, + GdkRegion *source2); +GdkRegion* gdk_regions_subtract (GdkRegion *source1, + GdkRegion *source2); +GdkRegion* gdk_regions_xor (GdkRegion *source1, + GdkRegion *source2); #ifdef __cplusplus diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c index a26dc6cdae..43ded9a094 100644 --- a/gdk/gdkgc.c +++ b/gdk/gdkgc.c @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -28,9 +28,9 @@ gdk_gc_new (GdkWindow *window) } GdkGC* -gdk_gc_new_with_values (GdkWindow *window, - GdkGCValues *values, - GdkGCValuesMask values_mask) +gdk_gc_new_with_values (GdkWindow *window, + GdkGCValues *values, + GdkGCValuesMask values_mask) { GdkWindowPrivate *window_private; GdkGC *gc; @@ -366,7 +366,7 @@ gdk_gc_get_values (GdkGC *gc, } void -gdk_gc_set_foreground (GdkGC *gc, +gdk_gc_set_foreground (GdkGC *gc, GdkColor *color) { GdkGCPrivate *private; @@ -379,7 +379,7 @@ gdk_gc_set_foreground (GdkGC *gc, } void -gdk_gc_set_background (GdkGC *gc, +gdk_gc_set_background (GdkGC *gc, GdkColor *color) { GdkGCPrivate *private; @@ -392,7 +392,7 @@ gdk_gc_set_background (GdkGC *gc, } void -gdk_gc_set_font (GdkGC *gc, +gdk_gc_set_font (GdkGC *gc, GdkFont *font) { GdkGCPrivate *gc_private; @@ -412,7 +412,7 @@ gdk_gc_set_font (GdkGC *gc, } void -gdk_gc_set_function (GdkGC *gc, +gdk_gc_set_function (GdkGC *gc, GdkFunction function) { GdkGCPrivate *private; @@ -436,7 +436,7 @@ gdk_gc_set_function (GdkGC *gc, } void -gdk_gc_set_fill (GdkGC *gc, +gdk_gc_set_fill (GdkGC *gc, GdkFill fill) { GdkGCPrivate *private; @@ -463,7 +463,7 @@ gdk_gc_set_fill (GdkGC *gc, } void -gdk_gc_set_tile (GdkGC *gc, +gdk_gc_set_tile (GdkGC *gc, GdkPixmap *tile) { GdkGCPrivate *private; @@ -535,7 +535,7 @@ gdk_gc_set_clip_origin (GdkGC *gc, } void -gdk_gc_set_clip_mask (GdkGC *gc, +gdk_gc_set_clip_mask (GdkGC *gc, GdkBitmap *mask) { GdkGCPrivate *private; @@ -562,8 +562,8 @@ gdk_gc_set_clip_mask (GdkGC *gc, void -gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle) +gdk_gc_set_clip_rectangle (GdkGC *gc, + GdkRectangle *rectangle) { GdkGCPrivate *private; XRectangle xrectangle; @@ -587,8 +587,29 @@ gdk_gc_set_clip_rectangle (GdkGC *gc, } void -gdk_gc_set_subwindow (GdkGC *gc, - GdkSubwindowMode mode) +gdk_gc_set_clip_region (GdkGC *gc, + GdkRegion *region) +{ + GdkGCPrivate *private; + + g_return_if_fail (gc != NULL); + + private = (GdkGCPrivate*) gc; + + if (region) + { + GdkRegionPrivate *region_private; + + region_private = (GdkRegionPrivate*) region; + XSetRegion (private->xdisplay, private->xgc, region_private->xregion); + } + else + XSetClipMask (private->xdisplay, private->xgc, None); +} + +void +gdk_gc_set_subwindow (GdkGC *gc, + GdkSubwindowMode mode) { GdkGCPrivate *private; @@ -613,10 +634,10 @@ gdk_gc_set_exposures (GdkGC *gc, } void -gdk_gc_set_line_attributes (GdkGC *gc, - gint line_width, +gdk_gc_set_line_attributes (GdkGC *gc, + gint line_width, GdkLineStyle line_style, - GdkCapStyle cap_style, + GdkCapStyle cap_style, GdkJoinStyle join_style) { GdkGCPrivate *private; diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h index 967c87406b..e205241aeb 100644 --- a/gdk/gdkprivate.h +++ b/gdk/gdkprivate.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -25,9 +25,9 @@ #define DND_PROTOCOL_VERSION 0 -#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid)) -#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid)) -#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid)) +#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid)) +#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid)) +#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid)) #ifdef __cplusplus @@ -37,14 +37,15 @@ extern "C" { typedef struct _GdkWindowPrivate GdkWindowPrivate; typedef struct _GdkWindowPrivate GdkPixmapPrivate; -typedef struct _GdkImagePrivate GdkImagePrivate; -typedef struct _GdkGCPrivate GdkGCPrivate; +typedef struct _GdkImagePrivate GdkImagePrivate; +typedef struct _GdkGCPrivate GdkGCPrivate; typedef struct _GdkColormapPrivate GdkColormapPrivate; typedef struct _GdkVisualPrivate GdkVisualPrivate; -typedef struct _GdkFontPrivate GdkFontPrivate; +typedef struct _GdkFontPrivate GdkFontPrivate; typedef struct _GdkCursorPrivate GdkCursorPrivate; -typedef struct _GdkEventFilter GdkEventFilter; +typedef struct _GdkEventFilter GdkEventFilter; typedef struct _GdkColorContextPrivate GdkColorContextPrivate; +typedef struct _GdkRegionPrivate GdkRegionPrivate; struct _GdkWindowPrivate @@ -89,14 +90,14 @@ struct _GdkImagePrivate gpointer x_shm_info; void (*image_put) (GdkDrawable *window, - GdkGC *gc, - GdkImage *image, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); + GdkGC *gc, + GdkImage *image, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); }; struct _GdkGCPrivate @@ -142,23 +143,23 @@ struct _GdkCursorPrivate }; struct _GdkDndCursorInfo { - Cursor gdk_cursor_dragdefault, gdk_cursor_dragok; - GdkWindow *drag_pm_default, *drag_pm_ok; - GdkPoint default_hotspot, ok_hotspot; + Cursor gdk_cursor_dragdefault, gdk_cursor_dragok; + GdkWindow *drag_pm_default, *drag_pm_ok; + GdkPoint default_hotspot, ok_hotspot; }; typedef struct _GdkDndCursorInfo GdkDndCursorInfo; struct _GdkDndGlobals { - GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest; - GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel; - GdkAtom gdk_XdeTypelist; + GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest; + GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel; + GdkAtom gdk_XdeTypelist; GdkDndCursorInfo *c; - GdkWindow **drag_startwindows; - guint drag_numwindows; - gboolean drag_really, drag_perhaps, dnd_grabbed; - Window dnd_drag_target; - GdkPoint drag_dropcoords; + GdkWindow **drag_startwindows; + guint drag_numwindows; + gboolean drag_really, drag_perhaps, dnd_grabbed; + Window dnd_drag_target; + GdkPoint drag_dropcoords; }; typedef struct _GdkDndGlobals GdkDndGlobals; @@ -186,6 +187,12 @@ struct _GdkColorContextPrivate XStandardColormap std_cmap; }; +struct _GdkRegionPrivate +{ + GdkRegion region; + Region xregion; +}; + typedef enum { GDK_DEBUG_MISC = 1<<0, GDK_DEBUG_EVENTS = 1 << 1, @@ -201,15 +208,15 @@ void gdk_image_init (void); void gdk_image_exit (void); GdkColormap* gdk_colormap_lookup (Colormap xcolormap); -GdkVisual* gdk_visual_lookup (Visual *xvisual); +GdkVisual* gdk_visual_lookup (Visual *xvisual); void gdk_window_add_colormap_windows (GdkWindow *window); -void gdk_window_destroy_notify (GdkWindow *window); +void gdk_window_destroy_notify (GdkWindow *window); -void gdk_xid_table_insert (XID *xid, - gpointer data); -void gdk_xid_table_remove (XID xid); -gpointer gdk_xid_table_lookup (XID xid); +void gdk_xid_table_insert (XID *xid, + gpointer data); +void gdk_xid_table_remove (XID xid); +gpointer gdk_xid_table_lookup (XID xid); /* If you pass x = y = -1, it queries the pointer to find out where it currently is. @@ -222,35 +229,35 @@ void gdk_dnd_display_drag_cursor(gint x, gboolean change_made); -extern gint gdk_debug_level; -extern gint gdk_show_events; -extern gint gdk_use_xshm; -extern gint gdk_stack_trace; -extern gchar *gdk_display_name; -extern Display *gdk_display; -extern gint gdk_screen; -extern Window gdk_root_window; -extern Window gdk_leader_window; -extern GdkWindowPrivate gdk_root_parent; -extern Atom gdk_wm_delete_window; -extern Atom gdk_wm_take_focus; -extern Atom gdk_wm_protocols; -extern Atom gdk_wm_window_protocols[]; -extern Atom gdk_selection_property; -extern GdkDndGlobals gdk_dnd; -extern GdkWindow *selection_owner[]; -extern gchar *gdk_progname; -extern gchar *gdk_progclass; -extern gint gdk_error_code; -extern gint gdk_error_warnings; +extern gint gdk_debug_level; +extern gint gdk_show_events; +extern gint gdk_use_xshm; +extern gint gdk_stack_trace; +extern gchar *gdk_display_name; +extern Display *gdk_display; +extern gint gdk_screen; +extern Window gdk_root_window; +extern Window gdk_leader_window; +extern GdkWindowPrivate gdk_root_parent; +extern Atom gdk_wm_delete_window; +extern Atom gdk_wm_take_focus; +extern Atom gdk_wm_protocols; +extern Atom gdk_wm_window_protocols[]; +extern Atom gdk_selection_property; +extern GdkDndGlobals gdk_dnd; +extern GdkWindow *selection_owner[]; +extern gchar *gdk_progname; +extern gchar *gdk_progclass; +extern gint gdk_error_code; +extern gint gdk_error_warnings; /* Debugging support */ #ifdef G_ENABLE_DEBUG -#define GDK_NOTE(type,action) G_STMT_START { \ - if (gdk_debug_flags & GDK_DEBUG_##type) \ - { action; }; } G_STMT_END +#define GDK_NOTE(type,action) G_STMT_START { \ + if (gdk_debug_flags & GDK_DEBUG_##type) \ + { action; }; } G_STMT_END #else /* !G_ENABLE_DEBUG */ diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 1a07bfae4b..8d82f599d1 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -8,7 +8,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -24,7 +24,7 @@ #include -#define GDK_NONE 0L +#define GDK_NONE 0L #define GDK_CURRENT_TIME 0L #define GDK_PARENT_RELATIVE 1L @@ -40,52 +40,53 @@ extern "C" { /* Type definitions for the basic structures. */ -typedef gulong GdkAtom; -typedef struct _GdkColor GdkColor; -typedef struct _GdkColormap GdkColormap; -typedef struct _GdkVisual GdkVisual; -typedef struct _GdkWindowAttr GdkWindowAttr; -typedef struct _GdkWindow GdkWindow; -typedef struct _GdkWindow GdkPixmap; -typedef struct _GdkWindow GdkBitmap; -typedef struct _GdkWindow GdkDrawable; -typedef struct _GdkImage GdkImage; -typedef struct _GdkGCValues GdkGCValues; -typedef struct _GdkGC GdkGC; -typedef struct _GdkPoint GdkPoint; -typedef struct _GdkRectangle GdkRectangle; -typedef struct _GdkSegment GdkSegment; -typedef struct _GdkFont GdkFont; -typedef struct _GdkCursor GdkCursor; +typedef gulong GdkAtom; +typedef struct _GdkColor GdkColor; +typedef struct _GdkColormap GdkColormap; +typedef struct _GdkVisual GdkVisual; +typedef struct _GdkWindowAttr GdkWindowAttr; +typedef struct _GdkWindow GdkWindow; +typedef struct _GdkWindow GdkPixmap; +typedef struct _GdkWindow GdkBitmap; +typedef struct _GdkWindow GdkDrawable; +typedef struct _GdkImage GdkImage; +typedef struct _GdkGCValues GdkGCValues; +typedef struct _GdkGC GdkGC; +typedef struct _GdkPoint GdkPoint; +typedef struct _GdkRectangle GdkRectangle; +typedef struct _GdkSegment GdkSegment; +typedef struct _GdkFont GdkFont; +typedef struct _GdkCursor GdkCursor; typedef struct _GdkColorContextDither GdkColorContextDither; -typedef struct _GdkColorContext GdkColorContext; +typedef struct _GdkColorContext GdkColorContext; -typedef struct _GdkEventAny GdkEventAny; -typedef struct _GdkEventExpose GdkEventExpose; +typedef struct _GdkEventAny GdkEventAny; +typedef struct _GdkEventExpose GdkEventExpose; typedef struct _GdkEventNoExpose GdkEventNoExpose; typedef struct _GdkEventVisibility GdkEventVisibility; -typedef struct _GdkEventMotion GdkEventMotion; -typedef struct _GdkEventButton GdkEventButton; -typedef struct _GdkEventKey GdkEventKey; -typedef struct _GdkEventFocus GdkEventFocus; +typedef struct _GdkEventMotion GdkEventMotion; +typedef struct _GdkEventButton GdkEventButton; +typedef struct _GdkEventKey GdkEventKey; +typedef struct _GdkEventFocus GdkEventFocus; typedef struct _GdkEventCrossing GdkEventCrossing; typedef struct _GdkEventConfigure GdkEventConfigure; typedef struct _GdkEventProperty GdkEventProperty; typedef struct _GdkEventSelection GdkEventSelection; typedef struct _GdkEventProximity GdkEventProximity; -typedef struct _GdkEventOther GdkEventOther; +typedef struct _GdkEventOther GdkEventOther; typedef struct _GdkEventDragBegin GdkEventDragBegin; typedef struct _GdkEventDragRequest GdkEventDragRequest; typedef struct _GdkEventDropEnter GdkEventDropEnter; typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable; typedef struct _GdkEventDropLeave GdkEventDropLeave; -typedef struct _GdkEventClient GdkEventClient; -typedef union _GdkEvent GdkEvent; -typedef struct _GdkDeviceKey GdkDeviceKey; -typedef struct _GdkDeviceInfo GdkDeviceInfo; -typedef struct _GdkTimeCoord GdkTimeCoord; +typedef struct _GdkEventClient GdkEventClient; +typedef union _GdkEvent GdkEvent; +typedef struct _GdkDeviceKey GdkDeviceKey; +typedef struct _GdkDeviceInfo GdkDeviceInfo; +typedef struct _GdkTimeCoord GdkTimeCoord; +typedef struct _GdkRegion GdkRegion; typedef gint (*GdkEventFunc) (GdkEvent *event, - gpointer data); + gpointer data); typedef void* GdkIC; typedef void* GdkIM; @@ -93,22 +94,22 @@ typedef void* GdkIM; /* Types of windows. * Root: There is only 1 root window and it is initialized - * at startup. Creating a window of type GDK_WINDOW_ROOT - * is an error. + * at startup. Creating a window of type GDK_WINDOW_ROOT + * is an error. * Toplevel: Windows which interact with the window manager. * Child: Windows which are children of some other type of window. - * (Any other type of window). Most windows are child windows. + * (Any other type of window). Most windows are child windows. * Dialog: A special kind of toplevel window which interacts with - * the window manager slightly differently than a regular - * toplevel window. Dialog windows should be used for any - * transient window. + * the window manager slightly differently than a regular + * toplevel window. Dialog windows should be used for any + * transient window. * Pixmap: Pixmaps are really just another kind of window which - * doesn't actually appear on the screen. It can't have - * children, either and is really just a convenience so - * that the drawing functions can work on both windows - * and pixmaps transparently. (ie. You shouldn't pass a - * pixmap to any procedure which accepts a window with the - * exception of the drawing functions). + * doesn't actually appear on the screen. It can't have + * children, either and is really just a convenience so + * that the drawing functions can work on both windows + * and pixmaps transparently. (ie. You shouldn't pass a + * pixmap to any procedure which accepts a window with the + * exception of the drawing functions). */ typedef enum { @@ -122,12 +123,12 @@ typedef enum /* Classes of windows. * InputOutput: Almost every window should be of this type. Such windows - * receive events and are also displayed on screen. + * receive events and are also displayed on screen. * InputOnly: Used only in special circumstances when events need to be - * stolen from another window or windows. Input only windows - * have no visible output, so they are handy for placing over - * top of a group of windows in order to grab the events (or - * filter the events) from those windows. + * stolen from another window or windows. Input only windows + * have no visible output, so they are handy for placing over + * top of a group of windows in order to grab the events (or + * filter the events) from those windows. */ typedef enum { @@ -137,13 +138,13 @@ typedef enum /* Types of images. * Normal: Normal X image type. These are slow as they involve passing - * the entire image through the X connection each time a draw - * request is required. + * the entire image through the X connection each time a draw + * request is required. * Shared: Shared memory X image type. These are fast as the X server - * and the program actually use the same piece of memory. They - * should be used with care though as there is the possibility - * for both the X server and the program to be reading/writing - * the image simultaneously and producing undesired results. + * and the program actually use the same piece of memory. They + * should be used with care though as there is the possibility + * for both the X server and the program to be reading/writing + * the image simultaneously and producing undesired results. */ typedef enum { @@ -190,12 +191,12 @@ typedef enum */ typedef enum { - GDK_WA_TITLE = 1 << 1, - GDK_WA_X = 1 << 2, - GDK_WA_Y = 1 << 3, - GDK_WA_CURSOR = 1 << 4, + GDK_WA_TITLE = 1 << 1, + GDK_WA_X = 1 << 2, + GDK_WA_Y = 1 << 3, + GDK_WA_CURSOR = 1 << 4, GDK_WA_COLORMAP = 1 << 5, - GDK_WA_VISUAL = 1 << 6, + GDK_WA_VISUAL = 1 << 6, GDK_WA_WMCLASS = 1 << 7, GDK_WA_NOREDIR = 1 << 8 } GdkWindowAttributesType; @@ -204,7 +205,7 @@ typedef enum */ typedef enum { - GDK_HINT_POS = 1 << 0, + GDK_HINT_POS = 1 << 0, GDK_HINT_MIN_SIZE = 1 << 1, GDK_HINT_MAX_SIZE = 1 << 2 } GdkWindowHints; @@ -283,9 +284,9 @@ typedef enum } GdkCursorType; typedef enum { - GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ - GDK_FILTER_TRANSLATE, /* Translated event stored */ - GDK_FILTER_REMOVE /* Terminate processing, removing event */ + GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ + GDK_FILTER_TRANSLATE, /* Translated event stored */ + GDK_FILTER_REMOVE /* Terminate processing, removing event */ } GdkFilterReturn; typedef enum { @@ -297,7 +298,7 @@ typedef enum { /* Event types. * Nothing: No event occurred. * Delete: A window delete event was sent by the window manager. - * The specified window should be deleted. + * The specified window should be deleted. * Destroy: A window has been destroyed. * Expose: Part of a window has been uncovered. * NoExpose: Same as expose, but no expose event was generated. @@ -310,46 +311,46 @@ typedef enum { * EnterNotify: A window was entered. * LeaveNotify: A window was exited. * FocusChange: The focus window has changed. (The focus window gets - * keyboard events). + * keyboard events). * Resize: A window has been resized. * Map: A window has been mapped. (It is now visible on the screen). * Unmap: A window has been unmapped. (It is no longer visible on - * the screen). + * the screen). */ typedef enum { - GDK_NOTHING = -1, - GDK_DELETE = 0, - GDK_DESTROY = 1, - GDK_EXPOSE = 2, - GDK_MOTION_NOTIFY = 3, - GDK_BUTTON_PRESS = 4, - GDK_2BUTTON_PRESS = 5, - GDK_3BUTTON_PRESS = 6, - GDK_BUTTON_RELEASE = 7, - GDK_KEY_PRESS = 8, - GDK_KEY_RELEASE = 9, - GDK_ENTER_NOTIFY = 10, - GDK_LEAVE_NOTIFY = 11, - GDK_FOCUS_CHANGE = 12, - GDK_CONFIGURE = 13, - GDK_MAP = 14, - GDK_UNMAP = 15, - GDK_PROPERTY_NOTIFY = 16, - GDK_SELECTION_CLEAR = 17, + GDK_NOTHING = -1, + GDK_DELETE = 0, + GDK_DESTROY = 1, + GDK_EXPOSE = 2, + GDK_MOTION_NOTIFY = 3, + GDK_BUTTON_PRESS = 4, + GDK_2BUTTON_PRESS = 5, + GDK_3BUTTON_PRESS = 6, + GDK_BUTTON_RELEASE = 7, + GDK_KEY_PRESS = 8, + GDK_KEY_RELEASE = 9, + GDK_ENTER_NOTIFY = 10, + GDK_LEAVE_NOTIFY = 11, + GDK_FOCUS_CHANGE = 12, + GDK_CONFIGURE = 13, + GDK_MAP = 14, + GDK_UNMAP = 15, + GDK_PROPERTY_NOTIFY = 16, + GDK_SELECTION_CLEAR = 17, GDK_SELECTION_REQUEST = 18, - GDK_SELECTION_NOTIFY = 19, - GDK_PROXIMITY_IN = 20, - GDK_PROXIMITY_OUT = 21, + GDK_SELECTION_NOTIFY = 19, + GDK_PROXIMITY_IN = 20, + GDK_PROXIMITY_OUT = 21, GDK_DRAG_BEGIN = 22, - GDK_DRAG_REQUEST = 23, - GDK_DROP_ENTER = 24, - GDK_DROP_LEAVE = 25, - GDK_DROP_DATA_AVAIL = 26, - GDK_CLIENT_EVENT = 27, + GDK_DRAG_REQUEST = 23, + GDK_DROP_ENTER = 24, + GDK_DROP_LEAVE = 25, + GDK_DROP_DATA_AVAIL = 26, + GDK_CLIENT_EVENT = 27, GDK_VISIBILITY_NOTIFY = 28, - GDK_NO_EXPOSE = 29, - GDK_OTHER_EVENT = 9999 /* Deprecated, use filters instead */ + GDK_NO_EXPOSE = 29, + GDK_OTHER_EVENT = 9999 /* Deprecated, use filters instead */ } GdkEventType; /* Event masks. (Used to select what types of events a window @@ -357,26 +358,26 @@ typedef enum */ typedef enum { - GDK_EXPOSURE_MASK = 1 << 1, - GDK_POINTER_MOTION_MASK = 1 << 2, - GDK_POINTER_MOTION_HINT_MASK = 1 << 3, - GDK_BUTTON_MOTION_MASK = 1 << 4, - GDK_BUTTON1_MOTION_MASK = 1 << 5, - GDK_BUTTON2_MOTION_MASK = 1 << 6, - GDK_BUTTON3_MOTION_MASK = 1 << 7, - GDK_BUTTON_PRESS_MASK = 1 << 8, - GDK_BUTTON_RELEASE_MASK = 1 << 9, - GDK_KEY_PRESS_MASK = 1 << 10, - GDK_KEY_RELEASE_MASK = 1 << 11, - GDK_ENTER_NOTIFY_MASK = 1 << 12, - GDK_LEAVE_NOTIFY_MASK = 1 << 13, - GDK_FOCUS_CHANGE_MASK = 1 << 14, - GDK_STRUCTURE_MASK = 1 << 15, - GDK_PROPERTY_CHANGE_MASK = 1 << 16, - GDK_VISIBILITY_NOTIFY_MASK = 1 << 17, - GDK_PROXIMITY_IN_MASK = 1 << 18, - GDK_PROXIMITY_OUT_MASK = 1 << 19, - GDK_ALL_EVENTS_MASK = 0x07FFFF + GDK_EXPOSURE_MASK = 1 << 1, + GDK_POINTER_MOTION_MASK = 1 << 2, + GDK_POINTER_MOTION_HINT_MASK = 1 << 3, + GDK_BUTTON_MOTION_MASK = 1 << 4, + GDK_BUTTON1_MOTION_MASK = 1 << 5, + GDK_BUTTON2_MOTION_MASK = 1 << 6, + GDK_BUTTON3_MOTION_MASK = 1 << 7, + GDK_BUTTON_PRESS_MASK = 1 << 8, + GDK_BUTTON_RELEASE_MASK = 1 << 9, + GDK_KEY_PRESS_MASK = 1 << 10, + GDK_KEY_RELEASE_MASK = 1 << 11, + GDK_ENTER_NOTIFY_MASK = 1 << 12, + GDK_LEAVE_NOTIFY_MASK = 1 << 13, + GDK_FOCUS_CHANGE_MASK = 1 << 14, + GDK_STRUCTURE_MASK = 1 << 15, + GDK_PROPERTY_CHANGE_MASK = 1 << 16, + GDK_VISIBILITY_NOTIFY_MASK = 1 << 17, + GDK_PROXIMITY_IN_MASK = 1 << 18, + GDK_PROXIMITY_OUT_MASK = 1 << 19, + GDK_ALL_EVENTS_MASK = 0x07FFFF } GdkEventMask; /* Types of enter/leave notifications. @@ -389,12 +390,12 @@ typedef enum */ typedef enum { - GDK_NOTIFY_ANCESTOR = 0, - GDK_NOTIFY_VIRTUAL = 1, - GDK_NOTIFY_INFERIOR = 2, - GDK_NOTIFY_NONLINEAR = 3, - GDK_NOTIFY_NONLINEAR_VIRTUAL = 4, - GDK_NOTIFY_UNKNOWN = 5 + GDK_NOTIFY_ANCESTOR = 0, + GDK_NOTIFY_VIRTUAL = 1, + GDK_NOTIFY_INFERIOR = 2, + GDK_NOTIFY_NONLINEAR = 3, + GDK_NOTIFY_NONLINEAR_VIRTUAL = 4, + GDK_NOTIFY_UNKNOWN = 5 } GdkNotifyType; /* Types of modifiers. @@ -402,13 +403,13 @@ typedef enum typedef enum { GDK_SHIFT_MASK = 1 << 0, - GDK_LOCK_MASK = 1 << 1, + GDK_LOCK_MASK = 1 << 1, GDK_CONTROL_MASK = 1 << 2, - GDK_MOD1_MASK = 1 << 3, - GDK_MOD2_MASK = 1 << 4, - GDK_MOD3_MASK = 1 << 5, - GDK_MOD4_MASK = 1 << 6, - GDK_MOD5_MASK = 1 << 7, + GDK_MOD1_MASK = 1 << 3, + GDK_MOD2_MASK = 1 << 4, + GDK_MOD3_MASK = 1 << 5, + GDK_MOD4_MASK = 1 << 6, + GDK_MOD5_MASK = 1 << 7, GDK_BUTTON1_MASK = 1 << 8, GDK_BUTTON2_MASK = 1 << 9, GDK_BUTTON3_MASK = 1 << 10, @@ -418,7 +419,7 @@ typedef enum typedef enum { - GDK_CLIP_BY_CHILDREN = 0, + GDK_CLIP_BY_CHILDREN = 0, GDK_INCLUDE_INFERIORS = 1 } GdkSubwindowMode; @@ -431,11 +432,11 @@ typedef enum typedef enum { - GDK_OK = 0, - GDK_ERROR = -1, + GDK_OK = 0, + GDK_ERROR = -1, GDK_ERROR_PARAM = -2, GDK_ERROR_FILE = -3, - GDK_ERROR_MEM = -4 + GDK_ERROR_MEM = -4 } GdkStatus; typedef enum @@ -448,10 +449,10 @@ typedef enum { GDK_GC_FOREGROUND = 1 << 0, GDK_GC_BACKGROUND = 1 << 1, - GDK_GC_FONT = 1 << 2, + GDK_GC_FONT = 1 << 2, GDK_GC_FUNCTION = 1 << 3, - GDK_GC_FILL = 1 << 4, - GDK_GC_TILE = 1 << 5, + GDK_GC_FILL = 1 << 4, + GDK_GC_TILE = 1 << 5, GDK_GC_STIPPLE = 1 << 6, GDK_GC_CLIP_MASK = 1 << 7, GDK_GC_SUBWINDOW = 1 << 8, @@ -564,15 +565,15 @@ typedef enum typedef enum { - GdkIMPreeditArea = 0x0001L, + GdkIMPreeditArea = 0x0001L, GdkIMPreeditCallbacks = 0x0002L, - GdkIMPreeditPosition = 0x0004L, - GdkIMPreeditNothing = 0x0008L, - GdkIMPreeditNone = 0x0010L, - GdkIMStatusArea = 0x0100L, - GdkIMStatusCallbacks = 0x0200L, - GdkIMStatusNothing = 0x0400L, - GdkIMStatusNone = 0x0800L + GdkIMPreeditPosition = 0x0004L, + GdkIMPreeditNothing = 0x0008L, + GdkIMPreeditNone = 0x0010L, + GdkIMStatusArea = 0x0100L, + GdkIMStatusCallbacks = 0x0200L, + GdkIMStatusNothing = 0x0400L, + GdkIMStatusNone = 0x0800L } GdkIMStyle; /* The next two enumeration values current match the @@ -582,23 +583,23 @@ typedef enum */ typedef enum { - GDK_DECOR_ALL = 1 << 0, - GDK_DECOR_BORDER = 1 << 1, - GDK_DECOR_RESIZEH = 1 << 2, - GDK_DECOR_TITLE = 1 << 3, - GDK_DECOR_MENU = 1 << 4, - GDK_DECOR_MINIMIZE = 1 << 5, - GDK_DECOR_MAXIMIZE = 1 << 6 + GDK_DECOR_ALL = 1 << 0, + GDK_DECOR_BORDER = 1 << 1, + GDK_DECOR_RESIZEH = 1 << 2, + GDK_DECOR_TITLE = 1 << 3, + GDK_DECOR_MENU = 1 << 4, + GDK_DECOR_MINIMIZE = 1 << 5, + GDK_DECOR_MAXIMIZE = 1 << 6 } GdkWMDecoration; typedef enum { - GDK_FUNC_ALL = 1 << 0, - GDK_FUNC_RESIZE = 1 << 1, - GDK_FUNC_MOVE = 1 << 2, - GDK_FUNC_MINIMIZE = 1 << 3, - GDK_FUNC_MAXIMIZE = 1 << 4, - GDK_FUNC_CLOSE = 1 << 5 + GDK_FUNC_ALL = 1 << 0, + GDK_FUNC_RESIZE = 1 << 1, + GDK_FUNC_MOVE = 1 << 2, + GDK_FUNC_MINIMIZE = 1 << 3, + GDK_FUNC_MAXIMIZE = 1 << 4, + GDK_FUNC_CLOSE = 1 << 5 } GdkWMFunction; #define GdkIMPreeditMask \ @@ -610,8 +611,8 @@ typedef enum ( GdkIMStatusArea | GdkIMStatusCallbacks | \ GdkIMStatusNothing | GdkIMStatusNone ) -typedef void (*GdkInputFunction) (gpointer data, - gint source, +typedef void (*GdkInputFunction) (gpointer data, + gint source, GdkInputCondition condition); typedef void (*GdkDestroyNotify) (gpointer data); @@ -619,11 +620,11 @@ typedef void (*GdkDestroyNotify) (gpointer data); /* Color Context modes. * * GDK_CC_MODE_UNDEFINED - unknown - * GDK_CC_MODE_BW - default B/W - * GDK_CC_MODE_STD_CMAP - has a standard colormap - * GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual - * GDK_CC_MODE_MY_GRAY - my grayramp - * GDK_CC_MODE_PALETTE - has a pre-allocated palette + * GDK_CC_MODE_BW - default B/W + * GDK_CC_MODE_STD_CMAP - has a standard colormap + * GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual + * GDK_CC_MODE_MY_GRAY - my grayramp + * GDK_CC_MODE_PALETTE - has a pre-allocated palette */ typedef enum @@ -636,6 +637,19 @@ typedef enum GDK_CC_MODE_PALETTE } GdkColorContextMode; +/* Types of overlapping between a rectangle and a region + * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region + * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region + * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region + */ + +typedef enum +{ + GDK_OVERLAP_RECTANGLE_IN, + GDK_OVERLAP_RECTANGLE_OUT, + GDK_OVERLAP_RECTANGLE_PART +} GdkOverlapType; + /* The color type. * A color consists of red, green and blue values in the * range 0-65535 and a pixel value. The pixel value is highly @@ -716,37 +730,37 @@ struct _GdkWindow struct _GdkImage { - GdkImageType type; - GdkVisual *visual; /* visual used to create the image */ - GdkByteOrder byte_order; - guint16 width; - guint16 height; - guint16 depth; - guint16 bpp; /* bytes per pixel */ - guint16 bpl; /* bytes per line */ - gpointer mem; + GdkImageType type; + GdkVisual *visual; /* visual used to create the image */ + GdkByteOrder byte_order; + guint16 width; + guint16 height; + guint16 depth; + guint16 bpp; /* bytes per pixel */ + guint16 bpl; /* bytes per line */ + gpointer mem; }; struct _GdkGCValues { - GdkColor foreground; - GdkColor background; - GdkFont *font; - GdkFunction function; - GdkFill fill; - GdkPixmap *tile; - GdkPixmap *stipple; - GdkPixmap *clip_mask; + GdkColor foreground; + GdkColor background; + GdkFont *font; + GdkFunction function; + GdkFill fill; + GdkPixmap *tile; + GdkPixmap *stipple; + GdkPixmap *clip_mask; GdkSubwindowMode subwindow_mode; - gint ts_x_origin; - gint ts_y_origin; - gint clip_x_origin; - gint clip_y_origin; - gint graphics_exposures; - gint line_width; - GdkLineStyle line_style; - GdkCapStyle cap_style; - GdkJoinStyle join_style; + gint ts_x_origin; + gint ts_y_origin; + gint clip_x_origin; + gint clip_y_origin; + gint graphics_exposures; + gint line_width; + GdkLineStyle line_style; + GdkCapStyle cap_style; + GdkJoinStyle join_style; }; struct _GdkGC @@ -878,7 +892,7 @@ struct _GdkTimeCoord /* Event filtering */ -typedef void GdkXEvent; /* Can be cast to XEvent */ +typedef void GdkXEvent; /* Can be cast to XEvent */ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, GdkEvent *event, @@ -1141,29 +1155,35 @@ struct _GdkEventOther union _GdkEvent { - GdkEventType type; - GdkEventAny any; - GdkEventExpose expose; - GdkEventNoExpose no_expose; - GdkEventVisibility visibility; - GdkEventMotion motion; - GdkEventButton button; - GdkEventKey key; - GdkEventCrossing crossing; - GdkEventFocus focus_change; - GdkEventConfigure configure; - GdkEventProperty property; - GdkEventSelection selection; - GdkEventProximity proximity; - GdkEventDragBegin dragbegin; - GdkEventDragRequest dragrequest; - GdkEventDropEnter dropenter; - GdkEventDropLeave dropleave; + GdkEventType type; + GdkEventAny any; + GdkEventExpose expose; + GdkEventNoExpose no_expose; + GdkEventVisibility visibility; + GdkEventMotion motion; + GdkEventButton button; + GdkEventKey key; + GdkEventCrossing crossing; + GdkEventFocus focus_change; + GdkEventConfigure configure; + GdkEventProperty property; + GdkEventSelection selection; + GdkEventProximity proximity; + GdkEventDragBegin dragbegin; + GdkEventDragRequest dragrequest; + GdkEventDropEnter dropenter; + GdkEventDropLeave dropleave; GdkEventDropDataAvailable dropdataavailable; - GdkEventClient client; - GdkEventOther other; + GdkEventClient client; + GdkEventOther other; }; +struct _GdkRegion +{ + gpointer user_data; +}; + + #ifdef __cplusplus } diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c index 269c9fe706..1af2e73d9c 100644 --- a/gtk/gtkpreview.c +++ b/gtk/gtkpreview.c @@ -312,13 +312,13 @@ gtk_preview_put (GtkPreview *preview, widget = GTK_WIDGET (preview); - r1.x = srcx; - r1.y = srcy; + r1.x = 0; + r1.y = 0; r1.width = preview->buffer_width; r1.height = preview->buffer_height; - r2.x = destx; - r2.y = desty; + r2.x = srcx; + r2.y = srcy; r2.width = width; r2.height = height; @@ -418,7 +418,9 @@ gtk_preview_put (GtkPreview *preview, } gdk_draw_image (window, gc, - image, 0, 0, x, y, + image, 0, 0, + destx + (r3.x - srcx) + (x - r3.x), + desty + (r3.y - srcy) + (y - r3.y), xe - x, ye - y); gdk_flush (); } @@ -693,15 +695,17 @@ gtk_preview_expose (GtkWidget *widget, if (GTK_WIDGET_DRAWABLE (widget)) { preview = GTK_PREVIEW (widget); - + gtk_preview_put (GTK_PREVIEW (widget), widget->window, widget->style->black_gc, - (widget->allocation.width - preview->buffer_width) / 2, - (widget->allocation.height - preview->buffer_height) / 2, + event->area.x - + (widget->allocation.width - preview->buffer_width)/2, + event->area.y - + (widget->allocation.height - preview->buffer_height)/2, event->area.x, event->area.y, event->area.width, event->area.height); } - + return FALSE; }