diff options
122 files changed, 2232 insertions, 4783 deletions
@@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 59fed525e1..7968494872 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,145 @@ +Fri Sep 7 11:51:44 2001 Owen Taylor <otaylor@redhat.com> + + Make gdkx.h the only installed header from gdk/x11. + All structures in gdk/x11 are opaque. + + * gdk/x11/Makefile.am gdk/x11/gdkx.h gdk/x11/gdkprivate-x11.h: + Don't install gdk{drawable,pixmap,window}-x11.h. + + * gdk/x11/{gdkcolormap-x11.c, gdkfont-x11.c, gdkx.h, gdkvisual-x11.c: + Move GdkColormapPrivateX11, GdkFontPrivateX GdkImagePrivateX11, + GdkVisualClass into C files. + + * gdk/gdkpixmap-x11.[ch]: Make gdk_pixmap_impl_get_type() static. + + * gdk/x11/{gdkcolor-x11.c, gdkcursor-x11.c, gdkdrawable-x11.c, + gdkfont-x11.c, gdkgc-x11.c, gdkx.h, gdkimage-x11,gdkvisual-x11.c} + Add public functions to replace previously exported direct + structure access. + gdk_x11_colormap_get_{xdisplay,xcolormap} + gdk_x11_cursor_get_{xdisplay,xcursor}, + gdk_x11_drawable_get_{xdisplay,xcursor,gdk_x11_visual_get_xvisual, + gdk_x11_font_get_{xdisplay,xfont}, gdk_x11_image_get_{xdisplay,ximage}, + gdk_x11_gc_get_{xdisplay,ximage} + + * gdk/gdkprivate.h gdk/gdkinternals.h: Move GdkColorInfo, + GdkEventFilter, GdkClientFilter, GdkFontPrivate to gdkinternals. + + Fix a number of variables and functions that were exported + "accidentally" from GDK. + + * gdk/**.[ch]: gdk => _gdk for gdk_visual_init, + gdk_events_init, gdk_input_init, gdk_dnd_init, gdk_image_exit, + gdk_input_exit, gdk_windowing_exit, gdk_event_func, gdk_event_data, + gdk_event_notify, gdk_queued_events, gdk_queued_tail, + gdk_event_new, gdk_events_queue, gdk_events_unqueue, + gdk_event_queue_find_first, gdk_event_queue_remove_link, + gdk_event_queue_append, gdk_event_button_generate, + gdk_debug_flags, gdk_default_filters, gdk_parent_root. + + * gdk/x11/{gdkevents-x11.c, gdkglobals-x11.c, gdkimage-x11.c, + gdkmain-x11.c, gdkprivate-x11.h, gdk/x11/gdkwindow-x11.c}: + gdk => _gdk for gdk_event_mask_table, gkd_nevent_masks, + gdk_wm_window_protocols, gdk_leader_window, gdk_xgrab_window, + gdk_use_xshm, gdk_input_ignore_core. + + * gdk/x11/xsettings-common.h (xsettings_list_insert): Add + #defines to namespace functions into the private _gdk_ + namespace. + + * gdk/gdkwindow.[ch] gdk/x11/gdkx.h: Add gdk_get_default_root_window () + to replace gdk_parent_root exported variable. Adjust and + deprecate GDK_ROOT_PARENT(). + + * demos/{testpixbuf-drawable.c,testpixbuf-save.c}: Fix + GDK_ROOT_PARENT usage, remove includes of port-specific + headers. + + * gdk/{win32,x11,fb}/gdkinput*.[ch]: s/gdk/_gdk/ for + _gdk_input_gxid_host, _gdk_input_gxid_port, _gdk_input_ignore_core, + gdk_input_devices, _gdk_input_windows, gdk_init_input_core. + + * gdk/x11/{gdkevents-x11.,c gdkglobals-x11.c, gdkmain-x11.c} + docs/Changes-2.0.txt: Remove gdk_wm_protocols, + gdk_wm_delete_window functions, gdk_wm_take_focus, + use gdk_atom_intern() instead. + + * gdk/linux-fb/{gdkselection-fb.c, gdkmain-fb.c, gdkprivatefb.h} + gdk/win32/{gdkselection-win32.c, gdkmgdkwin32.h, gdkprivate-win32.h} + gdk/x11/{gdkselection-x11.c gdkx.h, gtkprivate-x11.h} + gtk/gtkselection.c + Unexport gdk_selection_property, just use + gdk_atom_intern ("GDK_SELECTION"). + + * gdk/x11/{gdkprivate-x11.h,gdkdrawable-x11h,gdkgc-x11.c,gdkx.h}: + Unexport gdk_drawable_impl_x11_get_type, gdk_gc_x11_get_type, + GDK_GC_X11 cast macros, GdkGCX11 structures, GdkCursorPrivate, + GdkVisualprivate, gdk_x11_gc_flush. + + Make a number of public exports of variables into functions + to increase encapsulation. + + * gdk/gdkinternals.h gdk/gdkinput.h gdk/gdkevents.h + gdk/linux-fb/gdkmouse-fb.c: gdk_core_pointer => _gdk_core_pointer, + move to gdkinternals.h. Add gdk_device_get_core_pointer (). + + * gdk/gdkprivate.h gdk/gdkpango.c gdk/gdkinternals.h + docs/Changes-2.0.txt: Unexport gdk_parent_root, gdk_error_code, + gdk_error_warnings. + + * gdk/x11/{gdkcolormap-x11.c, gdkmain-x11.c, gdkx.h} + docs/Changes-2.0.txt: + s/gdk_screen/_gdk_screen/, add gdk_x11_get_default_screen() + s/gdk_root_window/_gdk_root_window/, add gdk_x11_get_default_root_xwindow() + Add gdk_x11_get_default_xdisplay(). + + * gdk/gdk.h gdk/gdk.c linux-fb/gdkfb.h linux-fb/gdkglobals-fb.c + win32/gdkwin32.h x11/gdkglobals-x11.c gdk/x11/gdkmain-x11.c + gdk/x11/gdkx.h: gdk/gdk.def: Add gdk_get/set_program_class, + Don't export gdk_progclass, move --class command line + option and handling to common portion of GDK. + + Miscellaneous fixes: + + * gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): Fix + g_return_val_if_fail that should have been g_return_if_fail. + + * gdk/gdkinternals.h gdk/gdkprivate.h: Move + gdk_synthesize_window_state() to the semi-public gdkprivate.h. + + * gtk/gtkdnd.c (_gtk_drag_source_handle_event): Remove uneeded + X11 dependency. + + * gdk/linux-fb/gdkmain-fb.c gdk/win32/gdkmain-win32.c gdk/TODO: + Remove unused gdk_key_repeat_disable/restore. + + * linux-fb/gdkglobals-fb.c win32/gdkglobals-win32.c + x11/gdkglobals-x11.c x11/gdkprivate-x11.h gdk/gdk.def: + Remove unused gdk_null_window_warnings variable. + + * gdk/Makefile.am (DIST_SUBDIRS) nanox/*: cvs remove nanox; + it can be retrieved from the repository; it is too far + from functional to be worth having people check out; + it would be easier to start from scratch, I suspect. + + * gdk/x11/gdkpixmap-x11.c: Fix lvalue usage of GDK_PIXMAP_XID(). + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + * gdk/x11/gdkkeys-x11.c gdk/gdkrgb.c gdk/gdkwindow.c + gdk/x11/gdkpango-x11.c gdk/x11/gdkselection-x11.c: + Fix some accidentally global variables and unused global variables. + + Add some space for future expansion to multihead. + + * gdk/gdkdrawable.h: Add four reserved function pointers + for future expansion of GdkDrawableClass. + + * gtk/gtkwindow.h gtk/gtkinvisible.h: Add reserved pointer + where we can put a GdkScreen * later. + 2001-09-07 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_flush_scroll): update diff --git a/demos/testpixbuf-drawable.c b/demos/testpixbuf-drawable.c index 6581d47749..fa98d0e037 100644 --- a/demos/testpixbuf-drawable.c +++ b/demos/testpixbuf-drawable.c @@ -1,12 +1,5 @@ #include <config.h> #include <gtk/gtk.h> -#ifdef GDK_WINDOWING_X11 -#include <gdk/x11/gdkx.h> -#elif defined (GDK_WINDOWING_WIN32) -#include <gdk/win32/gdkwin32.h> -#elif defined (GDK_WINDOWING_FB) -#include <gdk/linux-fb/gdkfb.h> -#endif int close_app(GtkWidget *widget, gpointer data) { @@ -62,7 +55,7 @@ int configure_cb(GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data) GdkWindow *root; GdkPixbuf *new_pixbuf; - root = GDK_ROOT_PARENT(); + root = gdk_get_default_root_window (); new_pixbuf = gdk_pixbuf_get_from_drawable(NULL, root, NULL, 0, 0, 0, 0, evt->width, evt->height); gtk_object_set_data(GTK_OBJECT(drawing_area), "pixbuf", new_pixbuf); @@ -89,7 +82,7 @@ int main(int argc, char **argv) gtk_widget_set_default_colormap(gdk_rgb_get_colormap()); - root = GDK_ROOT_PARENT(); + root = gdk_get_default_root_window (); pixbuf = gdk_pixbuf_get_from_drawable(NULL, root, NULL, 0, 0, 0, 0, 150, 160); diff --git a/demos/testpixbuf-save.c b/demos/testpixbuf-save.c index 9847d9c17f..6c6a1da70d 100644 --- a/demos/testpixbuf-save.c +++ b/demos/testpixbuf-save.c @@ -4,15 +4,6 @@ #include <gtk/gtk.h> -#ifdef GDK_WINDOWING_X11 -#include <gdk/x11/gdkx.h> -#elif defined (GDK_WINDOWING_WIN32) -#include <gdk/win32/gdkwin32.h> -#elif defined (GDK_WINDOWING_FB) -#include <gdk/linux-fb/gdkfb.h> -#endif - - void keypress_check (GtkWidget *widget, GdkEventKey *evt, gpointer data) { @@ -105,7 +96,7 @@ configure_cb (GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data) GdkWindow *root; GdkPixbuf *new_pixbuf; - root = GDK_ROOT_PARENT (); + root = gdk_get_default_root_window (); new_pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL, 0, 0, 0, 0, evt->width, evt->height); gtk_object_set_data (GTK_OBJECT (drawing_area), "pixbuf", new_pixbuf); @@ -128,7 +119,7 @@ main (int argc, char **argv) gtk_widget_set_default_colormap (gdk_rgb_get_colormap ()); - root = GDK_ROOT_PARENT (); + root = gdk_get_default_root_window (); pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL, 0, 0, 0, 0, 150, 160); diff --git a/docs/Changes-2.0.txt b/docs/Changes-2.0.txt index 97799cb952..e4260eabf0 100644 --- a/docs/Changes-2.0.txt +++ b/docs/Changes-2.0.txt @@ -459,3 +459,25 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0: GtkList/GtkTree nor the GtkCList/GtkCTree support GTK_SELECTION_EXTENDED anymore. However, the old extended behavior replaces MULTIPLE behavior. + +* The following variables are no longer exported from GDK. (Other variables + are also no longer exported; the following are the ones found used + externally in a large sample of GTK+ code.) + + Variable Replacement + ======== =========== + gdk_null_window_warnings None - did nothing in GTK+-1.2. + gdk_leader_window None - private variable + gdk_screen gdk_x11_get_default_screen () + gdk_root_window gdk_x11_get_default_root_xwindow () + gdk_root_parent gdk_get_default_root_window () + gdk_error_code/gdk_error_warnings gdk_error_trap_push()/pop() + gdk_display_name gdk_get_display () + gdk_wm_delete_window gdk_atom_intern ("WM_DELETE_WINDOW", FALSE) + gdk_wm_take_focus gdk_atom_intern ("WM_TAKE_FOCUS", FALSE) + gdk_wm_protocols gdk_atom_intern ("WM_PROTOCOLS", FALSE) + + + + + diff --git a/docs/reference/gdk/tmpl/gdk-unused.sgml b/docs/reference/gdk/tmpl/gdk-unused.sgml index de291a61e2..c36789a6ca 100644 --- a/docs/reference/gdk/tmpl/gdk-unused.sgml +++ b/docs/reference/gdk/tmpl/gdk-unused.sgml @@ -145,6 +145,20 @@ the device ID for the core pointer device. </para> +<!-- ##### MACRO GDK_GC_X11 ##### --> +<para> + +</para> + +@object: + +<!-- ##### MACRO GDK_GC_X11_GET_CLASS ##### --> +<para> + +</para> + +@obj: + <!-- ##### STRUCT GdkColorContext ##### --> <para> @@ -531,6 +545,18 @@ status information, so the application does not need to do anything. @num_colors: @Returns: +<!-- ##### VARIABLE gdk_core_pointer ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdk_display_name ##### --> +<para> + +</para> + + <!-- ##### FUNCTION gdk_ic_attr_destroy ##### --> <para> Destroys the given #GdkICAttr struct, freeing the allocated memory. @@ -768,3 +794,27 @@ they will be ignored. @ytilt: location to store current tilt in the y direction. @mask: location to store the current modifier state. +<!-- ##### VARIABLE gdk_leader_window ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdk_progclass ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdk_screen ##### --> +<para> + +</para> + + +<!-- ##### VARIABLE gdk_selection_property ##### --> +<para> + +</para> + + diff --git a/docs/reference/gdk/tmpl/input_devices.sgml b/docs/reference/gdk/tmpl/input_devices.sgml index fae924b331..9cdcbba945 100644 --- a/docs/reference/gdk/tmpl/input_devices.sgml +++ b/docs/reference/gdk/tmpl/input_devices.sgml @@ -176,12 +176,6 @@ types that GTK+ understands. @Returns: -<!-- ##### VARIABLE gdk_core_pointer ##### --> -<para> - -</para> - - <!-- ##### FUNCTION gdk_device_set_source ##### --> <para> diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml index 710277fbcc..84ad3f61de 100644 --- a/docs/reference/gdk/tmpl/x_interaction.sgml +++ b/docs/reference/gdk/tmpl/x_interaction.sgml @@ -14,22 +14,6 @@ X Window System Interaction </para> -<!-- ##### MACRO GDK_GC_X11 ##### --> -<para> - -</para> - -@object: - - -<!-- ##### MACRO GDK_GC_X11_GET_CLASS ##### --> -<para> - -</para> - -@obj: - - <!-- ##### MACRO GDK_ROOT_WINDOW ##### --> <para> @@ -186,36 +170,6 @@ X Window System Interaction -<!-- ##### VARIABLE gdk_screen ##### --> -<para> - -</para> - - -<!-- ##### VARIABLE gdk_display_name ##### --> -<para> - -</para> - - -<!-- ##### VARIABLE gdk_leader_window ##### --> -<para> - -</para> - - -<!-- ##### VARIABLE gdk_selection_property ##### --> -<para> - -</para> - - -<!-- ##### VARIABLE gdk_progclass ##### --> -<para> - -</para> - - <!-- ##### FUNCTION gdkx_visual_get ##### --> <para> diff --git a/gdk/Makefile.am b/gdk/Makefile.am index ecfb04ed9c..095019f4d4 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -1,7 +1,7 @@ ## Makefile.am for gtk+/gdk SUBDIRS=$(gdktarget) -DIST_SUBDIRS=linux-fb nanox win32 x11 +DIST_SUBDIRS=linux-fb win32 x11 EXTRA_DIST = \ gdkconfig.h.win32 \ @@ -255,9 +255,6 @@ gint gdk_screen_height_mm (void); void gdk_beep (void); -void gdk_key_repeat_disable (void); -void gdk_key_repeat_restore (void); - gint gdk_visual_get_best_depth (void); GdkVisualType gdk_visual_get_best_type (void); GdkVisual* gdk_visual_get_system (void); @@ -51,14 +51,6 @@ struct _GdkErrorTrap gint error_code; }; -/* - * Private function declarations - */ - -GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, - GdkEvent *event, - gpointer data); - /* Private variable declarations */ static int gdk_initialized = 0; /* 1 if the library is initialized, @@ -68,6 +60,8 @@ static int gdk_initialized = 0; /* 1 if the library is initialized, static GSList *gdk_error_traps = NULL; /* List of error traps */ static GSList *gdk_error_trap_free_list = NULL; /* Free list */ +static gchar *gdk_progclass = NULL; + #ifdef G_ENABLE_DEBUG static const GDebugKey gdk_debug_keys[] = { {"events", GDK_DEBUG_EVENTS}, @@ -214,27 +208,34 @@ gdk_arg_context_parse (GdkArgContext *context, gint *argc, gchar ***argv) static void gdk_arg_debug_cb (const char *key, const char *value, gpointer user_data) { - gdk_debug_flags |= g_parse_debug_string (value, - (GDebugKey *) gdk_debug_keys, - gdk_ndebug_keys); + _gdk_debug_flags |= g_parse_debug_string (value, + (GDebugKey *) gdk_debug_keys, + gdk_ndebug_keys); } static void gdk_arg_no_debug_cb (const char *key, const char *value, gpointer user_data) { - gdk_debug_flags &= ~g_parse_debug_string (value, - (GDebugKey *) gdk_debug_keys, - gdk_ndebug_keys); + _gdk_debug_flags &= ~g_parse_debug_string (value, + (GDebugKey *) gdk_debug_keys, + gdk_ndebug_keys); } #endif /* G_ENABLE_DEBUG */ static void +gdk_arg_class_cb (const char *key, const char *value, gpointer user_data) +{ + gdk_set_program_class (value); +} + +static void gdk_arg_name_cb (const char *key, const char *value, gpointer user_data) { g_set_prgname (value); } static GdkArgDesc gdk_args[] = { + { "class" , GDK_ARG_STRING, NULL, gdk_arg_class_cb }, { "name", GDK_ARG_STRING, NULL, gdk_arg_name_cb }, #ifdef G_ENABLE_DEBUG { "gdk-debug", GDK_ARG_CALLBACK, NULL, gdk_arg_debug_cb }, @@ -307,7 +308,7 @@ gdk_init_check (int *argc, { gchar *debug_string = getenv("GDK_DEBUG"); if (debug_string != NULL) - gdk_debug_flags = g_parse_debug_string (debug_string, + _gdk_debug_flags = g_parse_debug_string (debug_string, (GDebugKey *) gdk_debug_keys, gdk_ndebug_keys); } @@ -332,12 +333,12 @@ gdk_init_check (int *argc, if (!result) return FALSE; - gdk_visual_init (); + _gdk_visual_init (); _gdk_windowing_window_init (); _gdk_windowing_image_init (); - gdk_events_init (); - gdk_input_init (); - gdk_dnd_init (); + _gdk_events_init (); + _gdk_input_init (); + _gdk_dnd_init (); gdk_initialized = 1; @@ -419,11 +420,10 @@ gdk_exit_func (void) if (gdk_initialized) { - gdk_image_exit (); - gdk_input_exit (); - gdk_key_repeat_restore (); + _gdk_image_exit (); + _gdk_input_exit (); - gdk_windowing_exit (); + _gdk_windowing_exit (); gdk_initialized = 0; } @@ -462,11 +462,11 @@ gdk_error_trap_push (void) gdk_error_traps = node; trap = node->data; - trap->error_code = gdk_error_code; - trap->error_warnings = gdk_error_warnings; + trap->error_code = _gdk_error_code; + trap->error_warnings = _gdk_error_warnings; - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; } /************************************************************* @@ -493,11 +493,11 @@ gdk_error_trap_pop (void) node->next = gdk_error_trap_free_list; gdk_error_trap_free_list = node; - result = gdk_error_code; + result = _gdk_error_code; trap = node->data; - gdk_error_code = trap->error_code; - gdk_error_warnings = trap->error_warnings; + _gdk_error_code = trap->error_code; + _gdk_error_warnings = trap->error_warnings; return result; } @@ -514,3 +514,23 @@ gdk_threads_leave () GDK_THREADS_LEAVE (); } +G_CONST_RETURN char * +gdk_get_program_class (void) +{ + if (gdk_progclass == NULL) + { + gdk_progclass = g_strdup (g_get_prgname ()); + gdk_progclass[0] = g_ascii_toupper (gdk_progclass[0]); + } + + return gdk_progclass; +} + +void +gdk_set_program_class (const char *program_class) +{ + if (gdk_progclass) + g_free (gdk_progclass); + + gdk_progclass = g_strdup (program_class); +} diff --git a/gdk/gdk.def b/gdk/gdk.def index f687d6b9f0..8df1653d6a 100644 --- a/gdk/gdk.def +++ b/gdk/gdk.def @@ -228,7 +228,6 @@ EXPORTS gdk_mbstowcs gdk_modifier_type_get_type gdk_notify_type_get_type - gdk_null_window_warnings gdk_overlap_type_get_type gdk_pango_attr_embossed_new gdk_pango_attr_stipple_new @@ -252,7 +251,6 @@ EXPORTS gdk_pointer_grab gdk_pointer_is_grabbed gdk_pointer_ungrab - gdk_progclass gdk_prop_mode_get_type gdk_property_change gdk_property_delete @@ -67,6 +67,9 @@ void gdk_exit (gint error_code); #endif /* GDK_DISABLE_DEPRECATED */ gchar* gdk_set_locale (void); +G_CONST_RETURN char *gdk_get_program_class (void); +void gdk_set_program_class (const char *program_class); + /* Push and pop error handlers for X errors */ void gdk_error_trap_push (void); diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index 06d79e2452..7fb518696b 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -81,7 +81,7 @@ struct _GdkDrawableClass GdkGC *gc, GdkSegment *segs, gint nsegs); - void (*draw_lines) (GdkDrawable *drawable, + void (*draw_lines) (GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints); @@ -131,6 +131,10 @@ struct _GdkDrawableClass gint *composite_x_offset, gint *composite_y_offset); + void (*_gdk_reserved1) (void); + void (*_gdk_reserved2) (void); + void (*_gdk_reserved3) (void); + void (*_gdk_reserved4) (void); }; GType gdk_drawable_get_type (void); diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 5650694f71..7b9d3dccb6 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -52,14 +52,6 @@ struct _GdkEventPrivate guint flags; }; -/* - * Private function declarations - */ - -GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, - GdkEvent *event, - gpointer data); - /* Private variable declarations */ @@ -73,11 +65,9 @@ static GdkWindow *button_window[2] = { NULL, NULL}; /* The last 2 windows to rec */ static guint button_number[2] = { -1, -1 }; /* The last 2 buttons to be pressed. */ -GdkEventFunc gdk_event_func = NULL; /* Callback for events */ -gpointer gdk_event_data = NULL; -GDestroyNotify gdk_event_notify = NULL; - -GPollFD event_poll_fd; +GdkEventFunc _gdk_event_func = NULL; /* Callback for events */ +gpointer _gdk_event_data = NULL; +GDestroyNotify _gdk_event_notify = NULL; static guint double_click_time = 250; #define TRIPLE_CLICK_TIME (2*double_click_time) @@ -89,7 +79,7 @@ static guint double_click_time = 250; *********************************************/ /************************************************************* - * gdk_event_queue_find_first: + * _gdk_event_queue_find_first: * Find the first event on the queue that is not still * being filled in. * arguments: @@ -99,9 +89,9 @@ static guint double_click_time = 250; *************************************************************/ GList* -gdk_event_queue_find_first (void) +_gdk_event_queue_find_first (void) { - GList *tmp_list = gdk_queued_events; + GList *tmp_list = _gdk_queued_events; while (tmp_list) { @@ -116,7 +106,7 @@ gdk_event_queue_find_first (void) } /************************************************************* - * gdk_event_queue_remove_link: + * _gdk_event_queue_remove_link: * Remove a specified list node from the event queue. * arguments: * node: Node to remove. @@ -124,21 +114,21 @@ gdk_event_queue_find_first (void) *************************************************************/ void -gdk_event_queue_remove_link (GList *node) +_gdk_event_queue_remove_link (GList *node) { if (node->prev) node->prev->next = node->next; else - gdk_queued_events = node->next; + _gdk_queued_events = node->next; if (node->next) node->next->prev = node->prev; else - gdk_queued_tail = node->prev; + _gdk_queued_tail = node->prev; } /************************************************************* - * gdk_event_queue_append: + * _gdk_event_queue_append: * Append an event onto the tail of the event queue. * arguments: * event: Event to append. @@ -146,14 +136,14 @@ gdk_event_queue_remove_link (GList *node) *************************************************************/ void -gdk_event_queue_append (GdkEvent *event) +_gdk_event_queue_append (GdkEvent *event) { - gdk_queued_tail = g_list_append (gdk_queued_tail, event); + _gdk_queued_tail = g_list_append (_gdk_queued_tail, event); - if (!gdk_queued_events) - gdk_queued_events = gdk_queued_tail; + if (!_gdk_queued_events) + _gdk_queued_events = _gdk_queued_tail; else - gdk_queued_tail = gdk_queued_tail->next; + _gdk_queued_tail = _gdk_queued_tail->next; } /************************************************************* @@ -172,12 +162,12 @@ gdk_event_handler_set (GdkEventFunc func, gpointer data, GDestroyNotify notify) { - if (gdk_event_notify) - (*gdk_event_notify) (gdk_event_data); + if (_gdk_event_notify) + (*_gdk_event_notify) (_gdk_event_data); - gdk_event_func = func; - gdk_event_data = data; - gdk_event_notify = notify; + _gdk_event_func = func; + _gdk_event_data = data; + _gdk_event_notify = notify; } /* @@ -201,9 +191,9 @@ gdk_event_handler_set (GdkEventFunc func, GdkEvent* gdk_event_get (void) { - gdk_events_queue (); + _gdk_events_queue (); - return gdk_event_unqueue (); + return _gdk_event_unqueue (); } /* @@ -230,7 +220,7 @@ gdk_event_peek (void) { GList *tmp_list; - tmp_list = gdk_event_queue_find_first (); + tmp_list = _gdk_event_queue_find_first (); if (tmp_list) return gdk_event_copy (tmp_list->data); @@ -247,7 +237,7 @@ gdk_event_put (GdkEvent *event) new_event = gdk_event_copy (event); - gdk_event_queue_append (new_event); + _gdk_event_queue_append (new_event); } /* @@ -271,7 +261,7 @@ gdk_event_put (GdkEvent *event) static GMemChunk *event_chunk = NULL; GdkEvent* -gdk_event_new (void) +_gdk_event_new (void) { GdkEventPrivate *new_event; @@ -294,7 +284,7 @@ gdk_event_copy (GdkEvent *event) g_return_val_if_fail (event != NULL, NULL); - new_event = gdk_event_new (); + new_event = _gdk_event_new (); *new_event = *event; if (new_event->any.window) @@ -776,15 +766,15 @@ void gdk_set_show_events (gboolean show_events) { if (show_events) - gdk_debug_flags |= GDK_DEBUG_EVENTS; + _gdk_debug_flags |= GDK_DEBUG_EVENTS; else - gdk_debug_flags &= ~GDK_DEBUG_EVENTS; + _gdk_debug_flags &= ~GDK_DEBUG_EVENTS; } gboolean gdk_get_show_events (void) { - return (gdk_debug_flags & GDK_DEBUG_EVENTS) != 0; + return (_gdk_debug_flags & GDK_DEBUG_EVENTS) != 0; } static void @@ -874,17 +864,17 @@ gdk_input_remove (gint tag) } GdkEvent* -gdk_event_unqueue (void) +_gdk_event_unqueue (void) { GdkEvent *event = NULL; GList *tmp_list; - tmp_list = gdk_event_queue_find_first (); + tmp_list = _gdk_event_queue_find_first (); if (tmp_list) { event = tmp_list->data; - gdk_event_queue_remove_link (tmp_list); + _gdk_event_queue_remove_link (tmp_list); g_list_free_1 (tmp_list); } @@ -906,7 +896,7 @@ gdk_synthesize_click (GdkEvent *event, } void -gdk_event_button_generate (GdkEvent *event) +_gdk_event_button_generate (GdkEvent *event) { if ((event->button.time < (button_click_time[1] + TRIPLE_CLICK_TIME)) && (event->button.window == button_window[1]) && @@ -1016,3 +1006,9 @@ gdk_event_get_type (void) FALSE); return our_type; } + +GdkDevice * +gdk_device_get_core_pointer (void) +{ + return _gdk_core_pointer; +} diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c index 379bf9362e..e30d171972 100644 --- a/gdk/gdkglobals.c +++ b/gdk/gdkglobals.c @@ -25,17 +25,18 @@ */ #include <stdio.h> + #include "gdktypes.h" #include "gdkprivate.h" #include "config.h" -guint gdk_debug_flags = 0; -GdkWindow *gdk_parent_root = NULL; -gint gdk_error_code = 0; -gint gdk_error_warnings = TRUE; -GList *gdk_default_filters = NULL; -GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */ -GList *gdk_queued_events = NULL; -GList *gdk_queued_tail = NULL; +guint _gdk_debug_flags = 0; +GdkWindow *_gdk_parent_root = NULL; +gint _gdk_error_code = 0; +gint _gdk_error_warnings = TRUE; +GList *_gdk_default_filters = NULL; +GList *_gdk_queued_events = NULL; +GList *_gdk_queued_tail = NULL; +GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */ diff --git a/gdk/gdkinput.h b/gdk/gdkinput.h index ecd8be5891..b5b004d9c0 100644 --- a/gdk/gdkinput.h +++ b/gdk/gdkinput.h @@ -136,7 +136,7 @@ void gdk_input_set_extension_events (GdkWindow *window, gint mask, GdkExtensionMode mode); -GDKVAR GdkDevice *gdk_core_pointer; +GdkDevice *gdk_device_get_core_pointer (void); #ifdef __cplusplus } diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 086fcfcb9e..47f72645de 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -38,6 +38,31 @@ /* Debugging support */ +typedef struct _GdkColorInfo GdkColorInfo; +typedef struct _GdkEventFilter GdkEventFilter; +typedef struct _GdkClientFilter GdkClientFilter; + +typedef enum { + GDK_COLOR_WRITEABLE = 1 << 0 +} GdkColorInfoFlags; + +struct _GdkColorInfo +{ + GdkColorInfoFlags flags; + guint ref_count; +}; + +struct _GdkEventFilter { + GdkFilterFunc function; + gpointer data; +}; + +struct _GdkClientFilter { + GdkAtom type; + GdkFilterFunc function; + gpointer data; +}; + typedef enum { GDK_DEBUG_MISC = 1 << 0, GDK_DEBUG_EVENTS = 1 << 1, @@ -45,16 +70,29 @@ typedef enum { GDK_DEBUG_XIM = 1 << 3 } GdkDebugFlag; -extern gint gdk_debug_level; -extern gboolean gdk_show_events; -extern GList *gdk_default_filters; +#ifndef GDK_DISABLE_DEPRECATED + +typedef struct _GdkFontPrivate GdkFontPrivate; + +struct _GdkFontPrivate +{ + GdkFont font; + guint ref_count; +}; + +#endif /* GDK_DISABLE_DEPRECATED */ -GDKVAR guint gdk_debug_flags; +extern GList *_gdk_default_filters; +extern GdkWindow *_gdk_parent_root; +extern gint _gdk_error_code; +extern gint _gdk_error_warnings; + +extern guint _gdk_debug_flags; #ifdef G_ENABLE_DEBUG #define GDK_NOTE(type,action) G_STMT_START { \ - if (gdk_debug_flags & GDK_DEBUG_##type) \ + if (_gdk_debug_flags & GDK_DEBUG_##type) \ { action; }; } G_STMT_END #else /* !G_ENABLE_DEBUG */ @@ -95,30 +133,29 @@ struct _GdkArgDesc /* Event handling */ -extern GdkEventFunc gdk_event_func; /* Callback for events */ -extern gpointer gdk_event_data; -extern GDestroyNotify gdk_event_notify; +extern GdkEventFunc _gdk_event_func; /* Callback for events */ +extern gpointer _gdk_event_data; +extern GDestroyNotify _gdk_event_notify; /* FIFO's for event queue, and for events put back using * gdk_event_put(). */ -extern GList *gdk_queued_events; -extern GList *gdk_queued_tail; +extern GList *_gdk_queued_events; +extern GList *_gdk_queued_tail; + +extern GdkDevice *_gdk_core_pointer; -GdkEvent* gdk_event_new (void); +GdkEvent* _gdk_event_new (void); -void gdk_events_init (void); -void gdk_events_queue (void); -GdkEvent* gdk_event_unqueue (void); +void _gdk_events_init (void); +void _gdk_events_queue (void); +GdkEvent* _gdk_event_unqueue (void); -GList* gdk_event_queue_find_first (void); -void gdk_event_queue_remove_link (GList *node); -void gdk_event_queue_append (GdkEvent *event); +GList* _gdk_event_queue_find_first (void); +void _gdk_event_queue_remove_link (GList *node); +void _gdk_event_queue_append (GdkEvent *event); -void gdk_event_button_generate (GdkEvent *event); -void gdk_synthesize_window_state (GdkWindow *window, - GdkWindowState unset_flags, - GdkWindowState set_flags); +void _gdk_event_button_generate (GdkEvent *event); /************************************* * Interfaces used by windowing code * @@ -202,16 +239,16 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST; ************************************/ void _gdk_windowing_window_init (void); -void gdk_visual_init (void); -void gdk_dnd_init (void); +void _gdk_visual_init (void); +void _gdk_dnd_init (void); void _gdk_windowing_image_init (void); -void gdk_image_exit (void); +void _gdk_image_exit (void); -void gdk_input_init (void); -void gdk_input_exit (void); +void _gdk_input_init (void); +void _gdk_input_exit (void); -void gdk_windowing_exit (void); +void _gdk_windowing_exit (void); #ifdef __cplusplus } diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index d4f11d9876..9611cca7d8 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -95,7 +95,7 @@ gdk_pango_get_gc (PangoContext *context, return NULL; } - result = gdk_gc_new (gdk_parent_root); + result = gdk_gc_new (gdk_get_default_root_window ()); gdk_gc_copy (result, base_gc); if (fg_color) diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h index 1bc8cc8626..4dcbfe6d60 100644 --- a/gdk/gdkprivate.h +++ b/gdk/gdkprivate.h @@ -44,48 +44,11 @@ G_BEGIN_DECLS #define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type) #define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed) -typedef struct _GdkColorInfo GdkColorInfo; -typedef struct _GdkEventFilter GdkEventFilter; -typedef struct _GdkClientFilter GdkClientFilter; - -typedef enum { - GDK_COLOR_WRITEABLE = 1 << 0 -} GdkColorInfoFlags; - -struct _GdkColorInfo -{ - GdkColorInfoFlags flags; - guint ref_count; -}; - -struct _GdkEventFilter { - GdkFilterFunc function; - gpointer data; -}; - -struct _GdkClientFilter { - GdkAtom type; - GdkFilterFunc function; - gpointer data; -}; - void gdk_window_destroy_notify (GdkWindow *window); -GDKVAR GdkWindow *gdk_parent_root; -GDKVAR gint gdk_error_code; -GDKVAR gint gdk_error_warnings; - -#ifndef GDK_DISABLE_DEPRECATED - -typedef struct _GdkFontPrivate GdkFontPrivate; - -struct _GdkFontPrivate -{ - GdkFont font; - guint ref_count; -}; - -#endif /* GDK_DISABLE_DEPRECATED */ +void gdk_synthesize_window_state (GdkWindow *window, + GdkWindowState unset_flags, + GdkWindowState set_flags); G_END_DECLS diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c index 2cc9eec3f8..bedce4067c 100644 --- a/gdk/gdkrgb.c +++ b/gdk/gdkrgb.c @@ -3419,8 +3419,6 @@ gdk_draw_gray_image (GdkDrawable *drawable, image_info->conv_gray_d, NULL, 0, 0); } -guchar lut[256]; /* for 8-bit modes */ - static GdkRgbCmapInfo * gdk_rgb_cmap_get_info (GdkRgbCmap *cmap, GdkRgbInfo *image_info) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 2f82576c03..7bb66ba54c 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -48,7 +48,7 @@ static const GdkPointerHooks default_pointer_hooks = { _gdk_windowing_window_at_pointer }; -const GdkPointerHooks *current_pointer_hooks = &default_pointer_hooks; +static const GdkPointerHooks *current_pointer_hooks = &default_pointer_hooks; static GdkGC *gdk_window_create_gc (GdkDrawable *drawable, GdkGCValues *values, @@ -495,7 +495,7 @@ gdk_window_add_filter (GdkWindow *window, if (private) tmp_list = private->filters; else - tmp_list = gdk_default_filters; + tmp_list = _gdk_default_filters; while (tmp_list) { @@ -512,7 +512,7 @@ gdk_window_add_filter (GdkWindow *window, if (private) private->filters = g_list_append (private->filters, filter); else - gdk_default_filters = g_list_append (gdk_default_filters, filter); + _gdk_default_filters = g_list_append (_gdk_default_filters, filter); } void @@ -531,7 +531,7 @@ gdk_window_remove_filter (GdkWindow *window, if (private) tmp_list = private->filters; else - tmp_list = gdk_default_filters; + tmp_list = _gdk_default_filters; while (tmp_list) { @@ -544,7 +544,7 @@ gdk_window_remove_filter (GdkWindow *window, if (private) private->filters = g_list_remove_link (private->filters, node); else - gdk_default_filters = g_list_remove_link (gdk_default_filters, node); + _gdk_default_filters = g_list_remove_link (_gdk_default_filters, node); g_list_free_1 (node); g_free (filter); @@ -559,7 +559,7 @@ gdk_window_get_toplevels (void) GList *new_list = NULL; GList *tmp_list; - tmp_list = ((GdkWindowObject *)gdk_parent_root)->children; + tmp_list = ((GdkWindowObject *)_gdk_parent_root)->children; while (tmp_list) { new_list = g_list_prepend (new_list, tmp_list->data); @@ -607,7 +607,7 @@ gdk_window_is_viewable (GdkWindow *window) g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); while (private && - (private != (GdkWindowObject *)gdk_parent_root) && + (private != (GdkWindowObject *)_gdk_parent_root) && (GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN)) { if (!GDK_WINDOW_IS_MAPPED (window)) @@ -1805,7 +1805,7 @@ gdk_window_process_updates_internal (GdkWindow *window) GdkRegion *update_area = private->update_area; private->update_area = NULL; - if (gdk_event_func && gdk_window_is_viewable (window)) + if (_gdk_event_func && gdk_window_is_viewable (window)) { GdkEvent event; GdkRectangle window_rect; @@ -1847,7 +1847,7 @@ gdk_window_process_updates_internal (GdkWindow *window) if (!gdk_region_empty (expose_region)) { - (*gdk_event_func) (&event, gdk_event_data); + (*_gdk_event_func) (&event, _gdk_event_data); } if (expose_region != update_area) @@ -2385,3 +2385,10 @@ gdk_window_at_pointer (gint *win_x, { return current_pointer_hooks->window_at_pointer (win_x, win_y); } + +GdkWindow * +gdk_get_default_root_window (void) +{ + return _gdk_parent_root; +} + diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 75a83fe4d9..b9c68b402c 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -516,8 +516,10 @@ void gdk_window_get_internal_paint_info (GdkWindow *window, GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); +GdkWindow *gdk_get_default_root_window (); #ifndef GDK_DISABLE_DEPRECATED +#define GDK_ROOT_PARENT() (gdk_get_default_root_window ()) #define gdk_window_get_size gdk_drawable_get_size #define gdk_window_get_type gdk_window_get_window_type #define gdk_window_get_colormap gdk_drawable_get_colormap diff --git a/gdk/linux-fb/gdkcursor-fb.c b/gdk/linux-fb/gdkcursor-fb.c index c0f3e3d30d..a46f2a15d8 100644 --- a/gdk/linux-fb/gdkcursor-fb.c +++ b/gdk/linux-fb/gdkcursor-fb.c @@ -206,14 +206,14 @@ gdk_cursor_new (GdkCursorType cursor_type) GdkGC *copy_gc; char *data; - tmp_pm = gdk_bitmap_create_from_data (gdk_parent_root, + tmp_pm = gdk_bitmap_create_from_data (_gdk_parent_root, stock_cursors[cursor_type].bits, stock_cursors[cursor_type].width, stock_cursors[cursor_type].height); /* Create an empty bitmap the size of the mask */ data = g_malloc0 (((stock_cursors[cursor_type+1].width+7)/8) * stock_cursors[cursor_type+1].height); - pm = gdk_bitmap_create_from_data (gdk_parent_root, + pm = gdk_bitmap_create_from_data (_gdk_parent_root, data, stock_cursors[cursor_type+1].width, stock_cursors[cursor_type+1].height); @@ -230,7 +230,7 @@ gdk_cursor_new (GdkCursorType cursor_type) g_free (data); gdk_gc_unref (copy_gc); - mask = gdk_bitmap_create_from_data (gdk_parent_root, + mask = gdk_bitmap_create_from_data (_gdk_parent_root, stock_cursors[cursor_type+1].bits, stock_cursors[cursor_type+1].width, stock_cursors[cursor_type+1].height); @@ -303,7 +303,7 @@ gdk_fb_cursor_dc_reset (void) gdk_fb_cursor_dc = &cursor_dc_dat; gdk_fb_drawing_context_init (gdk_fb_cursor_dc, - GDK_DRAWABLE_IMPL(gdk_parent_root), + GDK_DRAWABLE_IMPL(_gdk_parent_root), cursor_gc, TRUE, FALSE); @@ -329,7 +329,7 @@ gdk_fb_cursor_hide (void) { gdk_gc_set_clip_mask (cursor_gc, NULL); /* Restore old picture */ - gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(gdk_parent_root), + gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(_gdk_parent_root), cursor_gc, GDK_DRAWABLE_IMPL(last_contents), mydc, @@ -381,16 +381,16 @@ gdk_fb_cursor_unhide() if (last_contents) gdk_pixmap_unref (last_contents); - last_contents = gdk_pixmap_new (gdk_parent_root, + last_contents = gdk_pixmap_new (_gdk_parent_root, pixmap_last->width, pixmap_last->height, - GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->depth); + GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->depth); } gdk_gc_set_clip_mask (cursor_gc, NULL); gdk_fb_draw_drawable_2 (GDK_DRAWABLE_IMPL (last_contents), cursor_gc, - GDK_DRAWABLE_IMPL (gdk_parent_root), + GDK_DRAWABLE_IMPL (_gdk_parent_root), last_location.x, last_location.y, 0, 0, @@ -406,7 +406,7 @@ gdk_fb_cursor_unhide() last_location.y); gdk_fb_cursor_dc_reset (); - gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL (gdk_parent_root), + gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL (_gdk_parent_root), cursor_gc, GDK_DRAWABLE_IMPL (last_private->cursor), mydc, @@ -479,7 +479,7 @@ gdk_fb_cursor_move (gint x, gint y, GdkWindow *in_window) if (!cursor_gc) { GdkColor white, black; - cursor_gc = gdk_gc_new (gdk_parent_root); + cursor_gc = gdk_gc_new (_gdk_parent_root); gdk_color_black (gdk_colormap_get_system (), &black); gdk_color_white (gdk_colormap_get_system (), &white); gdk_gc_set_foreground (cursor_gc, &black); diff --git a/gdk/linux-fb/gdkdnd-fb.c b/gdk/linux-fb/gdkdnd-fb.c index 816ae34e3f..6b0bfe58de 100644 --- a/gdk/linux-fb/gdkdnd-fb.c +++ b/gdk/linux-fb/gdkdnd-fb.c @@ -184,7 +184,7 @@ gdk_drag_context_find (gboolean is_source, *************************************************************/ void -gdk_dnd_init (void) +_gdk_dnd_init (void) { } @@ -406,7 +406,7 @@ get_toplevel_window_at (GdkWindow *ignore, GdkWindowObject *child; GList *ltmp, *ltmp2; - private = (GdkWindowObject *)gdk_parent_root; + private = (GdkWindowObject *)_gdk_parent_root; for (ltmp = private->children; ltmp; ltmp = ltmp->next) { @@ -457,7 +457,7 @@ gdk_drag_find_window (GdkDragContext *context, dest = get_toplevel_window_at (drag_window, x_root, y_root); if (dest == NULL) - dest = gdk_parent_root; + dest = _gdk_parent_root; if (context->dest_window != dest) { diff --git a/gdk/linux-fb/gdkdrawable-fb2.c b/gdk/linux-fb/gdkdrawable-fb2.c index 471ced65d5..0fa7cc8346 100644 --- a/gdk/linux-fb/gdkdrawable-fb2.c +++ b/gdk/linux-fb/gdkdrawable-fb2.c @@ -338,7 +338,7 @@ gdk_fb_clip_region (GdkDrawable *drawable, if (GDK_IS_WINDOW (private->wrapper)) { parent = GDK_WINDOW_P (private->wrapper); - while (parent != (GdkWindowObject *)gdk_parent_root) + while (parent != (GdkWindowObject *)_gdk_parent_root) { if (full_shapes) { @@ -529,7 +529,7 @@ gdk_fb_fill_spans (GdkDrawable *real_drawable, real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT, TRUE); - if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem && + if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->mem && gdk_fb_cursor_region_need_hide (real_clip_region)) { handle_cursor = TRUE; @@ -622,7 +622,7 @@ gdk_fb_drawing_context_init (GdkFBDrawingContext *dc, } if (do_clipping && - private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem && + private->mem == GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->mem && gdk_fb_cursor_region_need_hide (dc->real_clip_region)) { dc->handle_cursor = TRUE; @@ -965,7 +965,7 @@ gdk_fb_draw_rectangle (GdkDrawable *drawable, real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT, TRUE); - if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem && + if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->mem && gdk_fb_cursor_region_need_hide (real_clip_region)) { handle_cursor = TRUE; diff --git a/gdk/linux-fb/gdkevents-fb.c b/gdk/linux-fb/gdkevents-fb.c index 023d8d4f96..321e47dc64 100644 --- a/gdk/linux-fb/gdkevents-fb.c +++ b/gdk/linux-fb/gdkevents-fb.c @@ -57,7 +57,7 @@ gdk_fb_get_time(void) } void -gdk_events_init (void) +_gdk_events_init (void) { GSource *source; @@ -87,7 +87,7 @@ gdk_events_init (void) gboolean gdk_events_pending (void) { - return gdk_event_queue_find_first () ? TRUE : FALSE; + return _gdk_event_queue_find_first () ? TRUE : FALSE; } GdkEvent* @@ -96,7 +96,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) GList *ltmp; g_return_val_if_fail (window != NULL, NULL); - for (ltmp = gdk_queued_events; ltmp; ltmp = ltmp->next) + for (ltmp = _gdk_queued_events; ltmp; ltmp = ltmp->next) { GdkEvent *event = ltmp->data; if (event->type == GDK_EXPOSE && @@ -108,7 +108,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) { GdkEvent *retval = ltmp->data; - gdk_event_queue_remove_link (ltmp); + _gdk_event_queue_remove_link (ltmp); g_list_free_1 (ltmp); return retval; @@ -118,7 +118,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) } void -gdk_events_queue (void) +_gdk_events_queue (void) { } @@ -138,7 +138,7 @@ fb_events_check (GSource *source) GDK_THREADS_ENTER (); - retval = (gdk_event_queue_find_first () != NULL); + retval = (_gdk_event_queue_find_first () != NULL); GDK_THREADS_LEAVE (); @@ -154,18 +154,18 @@ fb_events_dispatch (GSource *source, GDK_THREADS_ENTER (); - while ((event = gdk_event_unqueue ())) + while ((event = _gdk_event_unqueue ())) { if (event->type == GDK_EXPOSE && - event->expose.window == gdk_parent_root) + event->expose.window == _gdk_parent_root) gdk_window_clear_area (event->expose.window, event->expose.area.x, event->expose.area.y, event->expose.area.width, event->expose.area.height); - else if (gdk_event_func) - (*gdk_event_func) (event, gdk_event_data); + else if (_gdk_event_func) + (*_gdk_event_func) (event, _gdk_event_data); gdk_event_free (event); } diff --git a/gdk/linux-fb/gdkfb.h b/gdk/linux-fb/gdkfb.h index 542d0196df..61305b38d0 100644 --- a/gdk/linux-fb/gdkfb.h +++ b/gdk/linux-fb/gdkfb.h @@ -10,18 +10,13 @@ extern GdkFBWindow *gdk_root_window; extern GdkFBDisplay *gdk_display; #define GDK_ROOT_WINDOW() gdk_root_window -#define GDK_ROOT_PARENT() ((GdkWindow *)gdk_parent_root) #define GDK_DISPLAY() gdk_display -extern const char *gdk_progclass; - #define gdk_window_foreign_new(xid) gdk_window_ref(xid) #define gdk_window_lookup(xid) ((GdkWindow*) (xid)) #define gdk_pixmap_lookup(xid) ((GdkPixmap*) (xid)) #define gdk_font_lookup(xid) ((GdkFont*) (xid)) -extern GdkAtom gdk_selection_property; - typedef enum { GDK_FB_0_DEGREES, GDK_FB_90_DEGREES, diff --git a/gdk/linux-fb/gdkglobals-fb.c b/gdk/linux-fb/gdkglobals-fb.c index a48852f309..2dfbea545f 100644 --- a/gdk/linux-fb/gdkglobals-fb.c +++ b/gdk/linux-fb/gdkglobals-fb.c @@ -30,9 +30,6 @@ #include "gdkprivate-fb.h" #include "config.h" -const gchar *gdk_progclass = "none"; -gboolean gdk_null_window_warnings = TRUE; - GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine = NULL; gboolean _gdk_fb_pointer_grab_owner_events; gboolean _gdk_fb_keyboard_grab_owner_events; @@ -42,5 +39,5 @@ GdkFBWindow *gdk_root_window = NULL; GdkFBDisplay *gdk_display = NULL; GdkCursor *_gdk_fb_pointer_grab_cursor; GdkGC *_gdk_fb_screen_gc = NULL; -GdkAtom gdk_selection_property; +GdkAtom _gdk_selection_property; GdkFBAngle _gdk_fb_screen_angle = GDK_FB_0_DEGREES; diff --git a/gdk/linux-fb/gdkimage-fb.c b/gdk/linux-fb/gdkimage-fb.c index 10609fa001..dff16fbb52 100644 --- a/gdk/linux-fb/gdkimage-fb.c +++ b/gdk/linux-fb/gdkimage-fb.c @@ -210,7 +210,7 @@ _gdk_fb_get_image (GdkDrawable *drawable, fbd.drawable_data.depth = image->depth; fbd.drawable_data.window_type = GDK_DRAWABLE_PIXMAP; - if (GDK_DRAWABLE_FBDATA (drawable)->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem) + if (GDK_DRAWABLE_FBDATA (drawable)->mem == GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->mem) { region = gdk_fb_clip_region (drawable, _gdk_fb_screen_gc, TRUE, FALSE, FALSE); @@ -311,6 +311,6 @@ gdk_image_put_pixel (GdkImage *image, } void -gdk_image_exit(void) +_gdk_image_exit(void) { } diff --git a/gdk/linux-fb/gdkinput-none.c b/gdk/linux-fb/gdkinput-none.c index 02ffc164b0..c92a6a5cd1 100644 --- a/gdk/linux-fb/gdkinput-none.c +++ b/gdk/linux-fb/gdkinput-none.c @@ -36,7 +36,7 @@ static void gdk_input_none_get_pointer (GdkWindow *window, GdkModifierType *mask); void -gdk_input_init (void) +_gdk_input_init (void) { _gdk_init_input_core (); gdk_input_vtable.set_mode = NULL; @@ -53,9 +53,9 @@ gdk_input_init (void) gdk_input_vtable.enable_window = NULL; gdk_input_vtable.disable_window = NULL; - gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info); + _gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info); - gdk_input_ignore_core = FALSE; + _gdk_input_ignore_core = FALSE; } static void diff --git a/gdk/linux-fb/gdkinput.c b/gdk/linux-fb/gdkinput.c index c4308f6ba6..d8015430ab 100644 --- a/gdk/linux-fb/gdkinput.c +++ b/gdk/linux-fb/gdkinput.c @@ -37,29 +37,29 @@ static const GdkDeviceAxis gdk_input_core_axes[] = { { GDK_AXIS_Y, 0, 0 } }; -GdkDevice *gdk_core_pointer = NULL; +GdkDevice *_gdk_core_pointer = NULL; /* Global variables */ -gchar *gdk_input_gxid_host; -gint gdk_input_gxid_port; -gint gdk_input_ignore_core; -GList *gdk_input_windows; -GList *gdk_input_devices; +gchar *_gdk_input_gxid_host; +gint _gdk_input_gxid_port; +gint _gdk_input_ignore_core; +GList *_gdk_input_windows; +GList *_gdk_input_devices; void _gdk_init_input_core (void) { - gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); + _gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - gdk_core_pointer->name = "Core Pointer"; - gdk_core_pointer->source = GDK_SOURCE_MOUSE; - gdk_core_pointer->mode = GDK_MODE_SCREEN; - gdk_core_pointer->has_cursor = TRUE; - gdk_core_pointer->num_axes = 2; - gdk_core_pointer->axes = gdk_input_core_axes; - gdk_core_pointer->num_keys = 0; - gdk_core_pointer->keys = NULL; + _gdk_core_pointer->name = "Core Pointer"; + _gdk_core_pointer->source = GDK_SOURCE_MOUSE; + _gdk_core_pointer->mode = GDK_MODE_SCREEN; + _gdk_core_pointer->has_cursor = TRUE; + _gdk_core_pointer->num_axes = 2; + _gdk_core_pointer->axes = gdk_input_core_axes; + _gdk_core_pointer->num_keys = 0; + _gdk_core_pointer->keys = NULL; } static void @@ -105,7 +105,7 @@ gdk_device_get_type (void) GList * gdk_devices_list (void) { - return gdk_input_devices; + return _gdk_input_devices; } void @@ -166,7 +166,7 @@ gdk_device_get_state (GdkDevice *device, { gint x_int, y_int; - g_assert (device == gdk_core_pointer); + g_assert (device == _gdk_core_pointer); gdk_window_get_pointer (window, &x_int, &y_int, mask); @@ -232,7 +232,7 @@ gdk_input_window_find(GdkWindow *window) { GList *tmp_list; - for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next) + for (tmp_list=_gdk_input_windows; tmp_list; tmp_list=tmp_list->next) if (((GdkInputWindow *)(tmp_list->data))->window == window) return (GdkInputWindow *)(tmp_list->data); @@ -272,7 +272,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw->num_obscuring = 0; iw->grabbed = FALSE; - gdk_input_windows = g_list_append (gdk_input_windows,iw); + _gdk_input_windows = g_list_append (_gdk_input_windows,iw); window_private->extension_events = mask; /* Add enter window events to the event mask */ @@ -286,18 +286,18 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw = gdk_input_window_find (window); if (iw) { - gdk_input_windows = g_list_remove (gdk_input_windows,iw); + _gdk_input_windows = g_list_remove (_gdk_input_windows,iw); g_free (iw); } window_private->extension_events = 0; } - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev != (GdkDevicePrivate *)gdk_core_pointer) + if (gdkdev != (GdkDevicePrivate *)_gdk_core_pointer) { if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED && (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL)) @@ -316,27 +316,27 @@ gdk_input_window_destroy (GdkWindow *window) input_window = gdk_input_window_find (window); g_return_if_fail (input_window != NULL); - gdk_input_windows = g_list_remove (gdk_input_windows,input_window); + _gdk_input_windows = g_list_remove (_gdk_input_windows,input_window); g_free (input_window); } void -gdk_input_init (void) +_gdk_input_init (void) { - gdk_input_devices = g_list_append (NULL, gdk_core_pointer); - gdk_input_ignore_core = FALSE; + _gdk_input_devices = g_list_append (NULL, _gdk_core_pointer); + _gdk_input_ignore_core = FALSE; } void -gdk_input_exit (void) +_gdk_input_exit (void) { GList *tmp_list; GdkDevicePrivate *gdkdev; - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev != (GdkDevicePrivate *)gdk_core_pointer) + if (gdkdev != (GdkDevicePrivate *)_gdk_core_pointer) { gdk_device_set_mode ((GdkDevice *)gdkdev, GDK_MODE_DISABLED); @@ -347,13 +347,13 @@ gdk_input_exit (void) } } - g_list_free (gdk_input_devices); + g_list_free (_gdk_input_devices); - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { g_free (tmp_list->data); } - g_list_free (gdk_input_windows); + g_list_free (_gdk_input_windows); } /** diff --git a/gdk/linux-fb/gdkinputprivate.h b/gdk/linux-fb/gdkinputprivate.h index 76004cd5ca..e0d137d416 100644 --- a/gdk/linux-fb/gdkinputprivate.h +++ b/gdk/linux-fb/gdkinputprivate.h @@ -126,22 +126,22 @@ struct _GdkInputWindow /* Global data */ extern const GdkDevice gdk_input_core_info; -extern GList *gdk_input_devices; -extern GList *gdk_input_windows; +extern GList *_gdk_input_devices; +extern GList *_gdk_input_windows; extern GdkInputVTable gdk_input_vtable; /* information about network port and host for gxid daemon */ -extern gchar *gdk_input_gxid_host; -extern gint gdk_input_gxid_port; -extern gint gdk_input_ignore_core; +extern gchar *_gdk_input_gxid_host; +extern gint _gdk_input_gxid_port; +extern gint _gdk_input_ignore_core; /* Function declarations */ GdkDevicePrivate * gdk_input_find_device (guint32 id); GdkInputWindow * gdk_input_window_find (GdkWindow *window); void gdk_input_window_destroy (GdkWindow *window); -void gdk_input_init (void); -void gdk_input_exit (void); +void _gdk_input_init (void); +void _gdk_input_exit (void); gint gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev); gint gdk_input_disable_window (GdkWindow *window, @@ -151,6 +151,6 @@ void _gdk_init_input_core (void); GdkDevicePrivate *gdk_input_find_device (guint32 id); GdkInputWindow *gdk_input_window_find (GdkWindow *window); void gdk_input_window_destroy (GdkWindow *window); -void gdk_input_exit (void); +void _gdk_input_exit (void); #endif /* __GDK_INPUTPRIVATE_H__ */ diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c index 6f0357e406..cffdd6d69c 100644 --- a/gdk/linux-fb/gdkmain-fb.c +++ b/gdk/linux-fb/gdkmain-fb.c @@ -836,7 +836,7 @@ _gdk_windowing_init_check (int argc, char **argv) gdk_initialized = TRUE; - gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); + _gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); return TRUE; @@ -1183,21 +1183,11 @@ gdk_set_sm_client_id (const gchar* sm_client_id) { } -void -gdk_key_repeat_disable (void) -{ -} - -void -gdk_key_repeat_restore (void) -{ -} - extern void keyboard_shutdown(void); void -gdk_windowing_exit (void) +_gdk_windowing_exit (void) { gdk_fb_mouse_close (); @@ -1293,7 +1283,7 @@ gdk_fb_other_event_window (GdkWindow *window, GdkWindow *w; w = window; - while (w != gdk_parent_root) + while (w != _gdk_parent_root) { /* Huge hack, so that we don't propagate events to GtkWindow->frame */ if ((w != window) && @@ -1342,7 +1332,7 @@ gdk_fb_pointer_event_window (GdkWindow *window, } w = window; - while (w != gdk_parent_root) + while (w != _gdk_parent_root) { /* Huge hack, so that we don't propagate events to GtkWindow->frame */ if ((w != window) && @@ -1400,7 +1390,7 @@ gdk_fb_keyboard_event_window (GdkWindow *window, } w = window; - while (w != gdk_parent_root) + while (w != _gdk_parent_root) { /* Huge hack, so that we don't propagate events to GtkWindow->frame */ if ((w != window) && @@ -1430,7 +1420,7 @@ gdk_event_make (GdkWindow *window, GdkEventType type, gboolean append_to_queue) { - GdkEvent *event = gdk_event_new (); + GdkEvent *event = _gdk_event_new (); guint32 the_time; the_time = gdk_fb_get_time (); @@ -1498,7 +1488,7 @@ gdk_event_make (GdkWindow *window, } if (append_to_queue) - gdk_event_queue_append (event); + _gdk_event_queue_append (event); return event; } diff --git a/gdk/linux-fb/gdkmouse-fb.c b/gdk/linux-fb/gdkmouse-fb.c index e89ab67b5d..95023a81f5 100644 --- a/gdk/linux-fb/gdkmouse-fb.c +++ b/gdk/linux-fb/gdkmouse-fb.c @@ -84,7 +84,7 @@ handle_mouse_movement(GdkFBMouse *mouse) if (_gdk_fb_pointer_grab_confine) mousewin = _gdk_fb_pointer_grab_confine; else - mousewin = gdk_parent_root; + mousewin = _gdk_parent_root; mousewin_private = GDK_DRAWABLE_IMPL_FBDATA (mousewin); @@ -107,7 +107,7 @@ handle_mouse_movement(GdkFBMouse *mouse) cursor_win = _gdk_fb_pointer_grab_window; w = win; - while (w != gdk_parent_root) + while (w != _gdk_parent_root) { if (w == _gdk_fb_pointer_grab_window) { @@ -139,7 +139,7 @@ handle_mouse_movement(GdkFBMouse *mouse) event->motion.y = y; event->motion.state = state; event->motion.is_hint = FALSE; - event->motion.device = gdk_core_pointer; + event->motion.device = _gdk_core_pointer; event->motion.x_root = mouse->x; event->motion.y_root = mouse->y; } @@ -179,15 +179,15 @@ send_button_event (GdkFBMouse *mouse, (mouse->button_pressed[2] ? GDK_BUTTON3_MASK : 0) | (1 << (button + 8)) /* badhack */ | gdk_fb_keyboard_modifiers (); - event->button.device = gdk_core_pointer; + event->button.device = _gdk_core_pointer; event->button.x_root = mouse->x; event->button.y_root = mouse->y; - gdk_event_queue_append (event); + _gdk_event_queue_append (event); /* For double-clicks */ if (press_event) - gdk_event_button_generate (event); + _gdk_event_button_generate (event); } nbuttons = 0; diff --git a/gdk/linux-fb/gdkpixmap-fb.c b/gdk/linux-fb/gdkpixmap-fb.c index a0dbcdb2f3..f18d7005c1 100644 --- a/gdk/linux-fb/gdkpixmap-fb.c +++ b/gdk/linux-fb/gdkpixmap-fb.c @@ -125,7 +125,7 @@ gdk_pixmap_new (GdkWindow *window, g_return_val_if_fail ((width != 0) && (height != 0), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (depth == -1) depth = gdk_drawable_get_visual (window)->depth; @@ -160,7 +160,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; pixmap = gdk_pixmap_new (window, width, height, 1); @@ -188,7 +188,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, g_return_val_if_fail ((width != 0) && (height != 0), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (depth == -1) depth = gdk_drawable_get_visual (window)->depth; diff --git a/gdk/linux-fb/gdkprivate-fb.h b/gdk/linux-fb/gdkprivate-fb.h index 5e8d32f40b..40cfabc8a3 100644 --- a/gdk/linux-fb/gdkprivate-fb.h +++ b/gdk/linux-fb/gdkprivate-fb.h @@ -407,6 +407,8 @@ void gdk_shadow_fb_init (void); void gdk_shadow_fb_stop_updates (void); void gdk_fb_recompute_all (void); +extern GdkAtom _gdk_selection_property; + extern GdkFBAngle _gdk_fb_screen_angle; /* Pointer grab info */ diff --git a/gdk/linux-fb/gdkselection-fb.c b/gdk/linux-fb/gdkselection-fb.c index 29fd655981..22956c788b 100644 --- a/gdk/linux-fb/gdkselection-fb.c +++ b/gdk/linux-fb/gdkselection-fb.c @@ -138,7 +138,7 @@ gdk_selection_convert (GdkWindow *requestor, event->selection.requestor = requestor; event->selection.selection = selection; event->selection.target = target; - event->selection.property = gdk_selection_property; + event->selection.property = _gdk_selection_property; } } else @@ -169,7 +169,7 @@ gdk_selection_property_get (GdkWindow *requestor, g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0); if (!gdk_property_get (requestor, - gdk_selection_property, + _gdk_selection_property, 0/*AnyPropertyType?*/, 0, 0, FALSE, @@ -186,7 +186,7 @@ gdk_selection_property_get (GdkWindow *requestor, *ret_format = prop_format; if (!gdk_property_get (requestor, - gdk_selection_property, + _gdk_selection_property, 0/*AnyPropertyType?*/, 0, prop_len + 1, FALSE, diff --git a/gdk/linux-fb/gdkvisual-fb.c b/gdk/linux-fb/gdkvisual-fb.c index 6a33541274..ac707b779e 100644 --- a/gdk/linux-fb/gdkvisual-fb.c +++ b/gdk/linux-fb/gdkvisual-fb.c @@ -73,7 +73,7 @@ gdk_visual_get_type (void) } void -gdk_visual_init (void) +_gdk_visual_init (void) { system_visual = g_object_new (GDK_TYPE_VISUAL, NULL); diff --git a/gdk/linux-fb/gdkwindow-fb.c b/gdk/linux-fb/gdkwindow-fb.c index 62054129b1..3557bee26c 100644 --- a/gdk/linux-fb/gdkwindow-fb.c +++ b/gdk/linux-fb/gdkwindow-fb.c @@ -143,23 +143,23 @@ _gdk_windowing_window_init (void) attr.cursor = NULL; attr.event_mask = GDK_EXPOSURE_MASK; attr.wclass = GDK_INPUT_OUTPUT; - gdk_parent_root = gdk_window_new (NULL, &attr, GDK_WA_CURSOR); - private = (GdkWindowObject *)gdk_parent_root; + _gdk_parent_root = gdk_window_new (NULL, &attr, GDK_WA_CURSOR); + private = (GdkWindowObject *)_gdk_parent_root; private->state = 0; - GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->lim_x = attr.width; - GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->lim_y = attr.height; + GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->lim_x = attr.width; + GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->lim_y = attr.height; - _gdk_fb_screen_gc = gdk_gc_new (gdk_parent_root); + _gdk_fb_screen_gc = gdk_gc_new (_gdk_parent_root); - gdk_fb_drawable_clear (gdk_parent_root); + gdk_fb_drawable_clear (_gdk_parent_root); /* Must be done after root is created, since gdk_cursor_new() - * references gdk_parent_root. + * references _gdk_parent_root. */ cursor = gdk_cursor_new (GDK_LEFT_PTR); - gdk_window_set_cursor (gdk_parent_root, cursor); + gdk_window_set_cursor (_gdk_parent_root, cursor); } GdkWindow* @@ -180,7 +180,7 @@ gdk_window_new (GdkWindow *parent, if (!parent || (attributes->window_type != GDK_WINDOW_CHILD && attributes->window_type != GDK_WINDOW_TEMP)) - parent = gdk_parent_root; + parent = _gdk_parent_root; parent_private = (GdkWindowObject*) parent; @@ -241,7 +241,7 @@ gdk_window_new (GdkWindow *parent, break; case GDK_WINDOW_ROOT: - if (gdk_parent_root) + if (_gdk_parent_root) g_error ("cannot make windows of type GDK_WINDOW_ROOT"); break; case GDK_DRAWABLE_PIXMAP: @@ -288,7 +288,7 @@ _gdk_windowing_window_destroy (GdkWindow *window, r.height = GDK_DRAWABLE_IMPL_FBDATA (window)->height; /* Clear the root window, as it might be visible under the destroyed window */ - gdk_window_clear_area (gdk_parent_root, + gdk_window_clear_area (_gdk_parent_root, r.x, r.y, r.width, @@ -459,9 +459,9 @@ gdk_fb_redraw_all (void) { GdkRectangle r; r.x = r.y = 0; - r.width = GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->width; - r.height = GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->height; - gdk_window_invalidate_rect_clear (gdk_parent_root, &r); + r.width = GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->width; + r.height = GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->height; + gdk_window_invalidate_rect_clear (_gdk_parent_root, &r); gdk_window_process_all_updates (); } @@ -471,14 +471,14 @@ static GdkWindow * gdk_fb_window_find_toplevel (GdkWindow *window) { GdkWindowObject *priv = (GdkWindowObject *)window; - while (priv != (GdkWindowObject *)gdk_parent_root) + while (priv != (GdkWindowObject *)_gdk_parent_root) { - if ((priv->parent == (GdkWindowObject *)gdk_parent_root) && GDK_WINDOW_IS_MAPPED (priv)) + if ((priv->parent == (GdkWindowObject *)_gdk_parent_root) && GDK_WINDOW_IS_MAPPED (priv)) return (GdkWindow *)priv; priv = priv->parent; } - return gdk_parent_root; + return _gdk_parent_root; } GdkWindow * @@ -488,7 +488,7 @@ gdk_fb_window_find_focus (void) return _gdk_fb_keyboard_grab_window; if (!gdk_fb_focused_window) - gdk_fb_focused_window = gdk_window_ref (gdk_parent_root); + gdk_fb_focused_window = gdk_window_ref (_gdk_parent_root); return gdk_fb_focused_window; } @@ -589,7 +589,7 @@ gdk_fb_window_send_crossing_events (GdkWindow *src, return; if (gdk_fb_window_containing_pointer == NULL) - gdk_fb_window_containing_pointer = gdk_window_ref (gdk_parent_root); + gdk_fb_window_containing_pointer = gdk_window_ref (_gdk_parent_root); if (src) a = src; @@ -605,7 +605,7 @@ gdk_fb_window_send_crossing_events (GdkWindow *src, * might have died. */ if (GDK_WINDOW_DESTROYED (a)) - a = gdk_parent_root; + a = _gdk_parent_root; gdk_fb_mouse_get_info (&x, &y, &my_mask); @@ -774,7 +774,7 @@ gdk_window_show (GdkWindow *window) rect.y = GDK_DRAWABLE_IMPL_FBDATA (window)->llim_y; rect.width = GDK_DRAWABLE_IMPL_FBDATA (window)->lim_x - rect.x; rect.height = GDK_DRAWABLE_IMPL_FBDATA (window)->lim_y - rect.y; - gdk_window_invalidate_rect (gdk_parent_root, &rect, TRUE); + gdk_window_invalidate_rect (_gdk_parent_root, &rect, TRUE); } } } @@ -823,13 +823,13 @@ gdk_window_hide (GdkWindow *window) /* Clear the root window, as it might be visible under the hidden window*/ - gdk_window_clear_area (gdk_parent_root, + gdk_window_clear_area (_gdk_parent_root, r.x, r.y, r.width, r.height); /* Invalidate the rect */ - gdk_window_invalidate_rect (gdk_parent_root, &r, TRUE); + gdk_window_invalidate_rect (_gdk_parent_root, &r, TRUE); if (do_hide) gdk_fb_cursor_unhide (); @@ -966,13 +966,13 @@ recompute_rowstride(GdkDrawable *drawable) void gdk_fb_recompute_all (void) { - GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->width = gdk_display->fb_width; - GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->height = gdk_display->fb_height; + GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->width = gdk_display->fb_width; + GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->height = gdk_display->fb_height; - recompute_abs_positions (gdk_parent_root, + recompute_abs_positions (_gdk_parent_root, 0, 0, 0, 0, gdk_display->fb_width, gdk_display->fb_height); - recompute_rowstride (gdk_parent_root); + recompute_rowstride (_gdk_parent_root); } static void @@ -985,7 +985,7 @@ recompute_drawable (GdkDrawable *drawable) parent = (GdkWindow *)private->parent; if (!parent) - parent = gdk_parent_root; + parent = _gdk_parent_root; recompute_abs_positions (drawable, GDK_DRAWABLE_IMPL_FBDATA (parent)->abs_x, @@ -1081,7 +1081,7 @@ gdk_fb_window_move_resize (GdkWindow *window, handle_cursor = TRUE; } - gdk_fb_drawing_context_init (&fbdc, GDK_DRAWABLE_IMPL (gdk_parent_root), NULL, FALSE, FALSE); + gdk_fb_drawing_context_init (&fbdc, GDK_DRAWABLE_IMPL (_gdk_parent_root), NULL, FALSE, FALSE); draw_dir = 1; if ((dy>0) || ((dy==0) && (dx>0))) @@ -1091,9 +1091,9 @@ gdk_fb_window_move_resize (GdkWindow *window, { GdkRegionBox *reg = ®ion->rects[i]; - gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(gdk_parent_root), + gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(_gdk_parent_root), _gdk_fb_screen_gc, - GDK_DRAWABLE_IMPL(gdk_parent_root), + GDK_DRAWABLE_IMPL(_gdk_parent_root), &fbdc, (reg->x1 - dx), (reg->y1 - dy), @@ -1119,13 +1119,13 @@ gdk_fb_window_move_resize (GdkWindow *window, root_rect.height = gdk_screen_height(); gdk_region_get_clipbox (new_region, &update_rect); if (gdk_rectangle_intersect (&update_rect, &root_rect, &update_rect)) - gdk_window_clear_area (gdk_parent_root, + gdk_window_clear_area (_gdk_parent_root, update_rect.x, update_rect.y, update_rect.width, update_rect.height); /* Invalidate regions in new_region */ - gdk_window_invalidate_region (gdk_parent_root, new_region, TRUE); + gdk_window_invalidate_region (_gdk_parent_root, new_region, TRUE); if (handle_cursor) gdk_fb_cursor_unhide (); @@ -1183,7 +1183,7 @@ gdk_window_reparent (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (new_parent)); if (!new_parent) - new_parent = gdk_parent_root; + new_parent = _gdk_parent_root; window_private = (GdkWindowObject*) window; old_parent_private = (GdkWindowObject*)window_private->parent; @@ -1216,7 +1216,7 @@ gdk_window_reparent (GdkWindow *window, r.height = GDK_DRAWABLE_IMPL_FBDATA (window)->lim_y - r.y; gdk_region_union_with_rect (region, &r); - gdk_window_invalidate_region (gdk_parent_root, region, TRUE); + gdk_window_invalidate_region (_gdk_parent_root, region, TRUE); gdk_region_destroy (region); } } @@ -1398,7 +1398,7 @@ gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent) { GdkWindowObject *private = GDK_WINDOW_OBJECT (window); - GdkWindowObject *root = GDK_WINDOW_OBJECT (gdk_parent_root); + GdkWindowObject *root = GDK_WINDOW_OBJECT (_gdk_parent_root); int i; g_return_if_fail (window != NULL); @@ -1407,8 +1407,8 @@ gdk_window_set_transient_for (GdkWindow *window, g_return_if_fail (parent != NULL); g_return_if_fail (GDK_IS_WINDOW (parent)); - g_return_if_fail ((GdkWindow *)private->parent == gdk_parent_root); - g_return_if_fail ((GdkWindow *)GDK_WINDOW_OBJECT (parent)->parent == gdk_parent_root); + g_return_if_fail ((GdkWindow *)private->parent == _gdk_parent_root); + g_return_if_fail ((GdkWindow *)GDK_WINDOW_OBJECT (parent)->parent == _gdk_parent_root); root->children = g_list_remove (root->children, window); @@ -1509,7 +1509,7 @@ gdk_window_get_geometry (GdkWindow *window, g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (!private->destroyed) { @@ -1618,7 +1618,7 @@ _gdk_windowing_window_get_pointer (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; gdk_window_get_root_origin (window, &x_int, &y_int); gdk_fb_mouse_get_info (&winx, &winy, &my_mask); @@ -1680,7 +1680,7 @@ _gdk_windowing_window_get_pointer (GdkWindow *window, } if (!return_val) - return_val = gdk_parent_root; + return_val = _gdk_parent_root; return return_val; } @@ -1926,7 +1926,7 @@ _gdk_window_shape_combine_region (GdkWindow *window, gdk_region_subtract (old_region, new_region); gdk_region_destroy (new_region); - gdk_window_invalidate_region (gdk_parent_root, old_region, TRUE); + gdk_window_invalidate_region (_gdk_parent_root, old_region, TRUE); gdk_region_destroy (old_region); } } diff --git a/gdk/nanox/Makefile.am b/gdk/nanox/Makefile.am deleted file mode 100644 index d906549139..0000000000 --- a/gdk/nanox/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## Process this file with automake to produce Makefile.in - -INCLUDES = @STRIP_BEGIN@ \ - -DG_LOG_DOMAIN=\"Gdk\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gdk \ - @GTK_DEBUG_FLAGS@ \ - @GDK_DEP_CFLAGS@ \ -@STRIP_END@ - -LDADDS = @STRIP_BEGIN@ \ - @GDK_DEP_LIBS@ \ -@STRIP_END@ - -noinst_LTLIBRARIES = libgdk-nanox.la - -xinput_sources = \ - gdkinput-none.c - -libgdk_nanox_la_SOURCES = \ - gdkcc-nanox.c \ - gdkcolor-nanox.c \ - gdkcursor-nanox.c \ - gdkdnd-nanox.c \ - gdkdrawable-nanox.c \ - gdkevents-nanox.c \ - gdkfont-nanox.c \ - gdkgc-nanox.c \ - gdkglobals-nanox.c \ - gdkim-nanox.c \ - gdkimage-nanox.c \ - gdkinput.c \ - gdkinputprivate.h \ - gdkmain-nanox.c \ - gdkpixmap-nanox.c \ - gdkproperty-nanox.c \ - gdkselection-nanox.c \ - gdkvisual-nanox.c \ - gdkwindow-nanox.c \ - gdkprivate-nanox.h \ - gdkinput-none.c diff --git a/gdk/nanox/gdkcc-nanox.c b/gdk/nanox/gdkcc-nanox.c deleted file mode 100644 index 3589924346..0000000000 --- a/gdk/nanox/gdkcc-nanox.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkColorContext * -gdk_color_context_new (GdkVisual *visual, - GdkColormap *colormap) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkColorContext * -gdk_color_context_new_mono (GdkVisual *visual, - GdkColormap *colormap) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_color_context_free (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gulong -gdk_color_context_get_pixel (GdkColorContext *cc, - gushort red, - gushort green, - gushort blue, - gint *failed) -{ - return RGB2PIXEL(red, green, blue); -} - -void -gdk_color_context_get_pixels (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gulong *colors, - gint *nallocated) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_color_context_get_pixels_incremental (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gint *used, - gulong *colors, - gint *nallocated) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_color_context_query_color (GdkColorContext *cc, - GdkColor *color) -{ - return gdk_color_context_query_colors (cc, color, 1); -} - -gint -gdk_color_context_query_colors (GdkColorContext *cc, - GdkColor *colors, - gint num_colors) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gint -gdk_color_context_add_palette (GdkColorContext *cc, - GdkColor *palette, - gint num_palette) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_color_context_init_dither (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_color_context_free_dither (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gulong -gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, - gushort *red, - gushort *green, - gushort *blue, - gint *failed) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -guchar -gdk_color_context_get_index_from_palette (GdkColorContext *cc, - gint *red, - gint *green, - gint *blue, - gint *failed) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} diff --git a/gdk/nanox/gdkcolor-nanox.c b/gdk/nanox/gdkcolor-nanox.c deleted file mode 100644 index e0fb65be85..0000000000 --- a/gdk/nanox/gdkcolor-nanox.c +++ /dev/null @@ -1,238 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" -#include <stdlib.h> -#include <string.h> - -GdkColormap* -gdk_colormap_new (GdkVisual *visual, - gboolean private_cmap) -{ - GdkColormap *colormap; - GdkColormapPrivateX *private; - int size; - int i; - - g_return_val_if_fail (visual != NULL, NULL); - - private = g_new (GdkColormapPrivateX, 1); - colormap = (GdkColormap*) private; - - private->base.visual = visual; - private->base.ref_count = 1; - - colormap->size = visual->colormap_size; - colormap->colors = NULL; - - return colormap; -} - -void -_gdk_colormap_real_destroy (GdkColormap *colormap) -{ -} - - -void -gdk_colormap_sync (GdkColormap *colormap, - gboolean force) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -GdkColormap* -gdk_colormap_get_system (void) -{ - return gdk_colormap_new(gdk_visual_get_system(), 0); -} - - -gint -gdk_colormap_get_system_size (void) -{ - GR_PALETTE palette; - - GrGetSystemPalette(&palette); - return palette.count; -} - -void -gdk_colormap_change (GdkColormap *colormap, - gint ncolors) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - g_message("unimplemented %s", __FUNCTION__); - return 1; -} - -static struct cspec { - char *name; - int red, green, blue; -} cnames [] = { - {"white", 0xffff, 0xffff, 0xffff}, - {"black", 0, 0, 0}, - {"red", 0xffff, 0, 0}, - {"green", 0, 0xffff, 0}, - {"blue", 0, 0, 0xffff}, - {NULL} -}; - -gboolean -gdk_color_parse (const gchar *spec, - GdkColor *color) -{ - int size, csize, i, j, shift; - double dval; - gchar *end; - int scale[] = {0, 4096, 256, 16, 1}; - int add[] = {0, 4095, 255, 15, 1}; - - g_return_val_if_fail(spec != NULL, 0); - g_return_val_if_fail(color != NULL, 0); - - g_message("color parsing %s", spec); - - if (*spec == '#') { - spec++; - size = strlen(spec); - csize = size/3; - shift = 16-csize*4; - if (size > 12 || size % 3) - return 0; - j = spec[csize]; - spec[csize] = 0; - color->red = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - spec[csize] = j; - spec += csize; - /* green */ - j = spec[csize]; - spec[csize] = 0; - color->green = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - spec[csize] = j; - spec += csize; - /* blue */ - color->blue = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - return 1; - } else if (!strncmp(spec, "rgb:", 4)) { - spec += 4; - color->red = strtol(spec, &end, 16); - if (end == spec || *end != '/') - return 0; - csize = end-spec; - color->red *= scale[csize]; - color->red += add[csize]; - spec += csize + 1; - /* green */ - color->green = strtol(spec, &end, 16); - if (end == spec || *end != '/') - return 0; - csize = end-spec; - color->green *= scale[csize]; - color->green += add[csize]; - spec += csize + 1; - /* blue */ - color->blue = strtol(spec, &end, 16); - if (end == spec || *end != '\0') - return 0; - csize = end-spec; - color->blue *= scale[csize]; - color->blue += add[csize]; - return 1; - } else if (!strncmp(spec, "rgbi:", 5)) { - spec += 5; - dval = strtod(spec, &end); - if (end == spec || *end != '/' || dval > 1.0 || dval < 0) - return 0; - color->red = dval*0xffff; - spec += end-spec + 1; - /* green */ - dval = strtod(spec, &end); - if (end == spec || *end != '/' || dval > 1.0 || dval < 0) - return 0; - color->green = dval*0xffff; - spec += end-spec + 1; - /* blue */ - dval = strtod(spec, &end); - if (end == spec || *end != '0' || dval > 1.0 || dval < 0) - return 0; - color->blue = dval*0xffff; - return 1; - } else { - /* use a cdb database, instead, later */ - for (i=0; cnames[i].name; ++i) { - if (strcmp(cnames[i].name, spec)) - continue; - color->red = cnames[i].red; - color->green = cnames[i].green; - color->blue = cnames[i].blue; - return 1; - } - if (spec[0] == 'g' && spec[1] == 'r' && (spec[2] == 'a' || spec[2] == 'e') && spec[3] == 'y') { - dval = strtol(spec+4, NULL, 10)/100; - color->red = color->green = color->blue = 255 * dval; - return 1; - } - } - - return 0; -} - -void -gdk_colors_free (GdkColormap *colormap, - gulong *in_pixels, - gint in_npixels, - gulong planes) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_colormap_free_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gint -gdk_colormap_alloc_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors, - gboolean writeable, - gboolean best_match, - gboolean *success) -{ - int i; - - for (i=0; i < ncolors;++i) - colors[i].pixel = RGB2PIXEL(colors[i].red>>8, colors[i].green>>8, colors[i].blue>>8); - success = 1; - return 1; -} - - -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - g_message("unimplemented %s", __FUNCTION__); - return 1; -} - - diff --git a/gdk/nanox/gdkcursor-nanox.c b/gdk/nanox/gdkcursor-nanox.c deleted file mode 100644 index a3b7fb0ca1..0000000000 --- a/gdk/nanox/gdkcursor-nanox.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkCursor* -gdk_cursor_new (GdkCursorType cursor_type) { - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkCursor* -gdk_cursor_new_from_pixmap (GdkPixmap *source, - GdkPixmap *mask, - GdkColor *fg, - GdkColor *bg, - gint x, - gint y) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -_gdk_cursor_destroy (GdkCursor *cursor) -{ -} - diff --git a/gdk/nanox/gdkdnd-nanox.c b/gdk/nanox/gdkdnd-nanox.c deleted file mode 100644 index d9fc05537b..0000000000 --- a/gdk/nanox/gdkdnd-nanox.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - - -GdkDragContext * -gdk_drag_context_new (void) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_drag_context_ref (GdkDragContext *context) -{ -} - -void -gdk_drag_context_unref (GdkDragContext *context) -{ -} - -void -gdk_dnd_init (void) -{ -} - -GdkDragContext * -gdk_drag_begin (GdkWindow *window, - GList *targets) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -guint32 -gdk_drag_get_protocol (guint32 xid, - GdkDragProtocol *protocol) -{ - *protocol = GDK_DRAG_PROTO_NONE; - return 0; -} - -void -gdk_drag_find_window (GdkDragContext *context, - GdkWindow *drag_window, - gint x_root, - gint y_root, - GdkWindow **dest_window, - GdkDragProtocol *protocol) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, - GdkDragProtocol protocol, - gint x_root, - gint y_root, - GdkDragAction suggested_action, - GdkDragAction possible_actions, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_drag_drop (GdkDragContext *context, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_drag_abort (GdkDragContext *context, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drag_status (GdkDragContext *context, - GdkDragAction action, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drop_reply (GdkDragContext *context, - gboolean ok, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drop_finish (GdkDragContext *context, - gboolean success, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_register_dnd (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -GdkAtom -gdk_drag_get_selection (GdkDragContext *context) -{ - return GDK_NONE; -} - - diff --git a/gdk/nanox/gdkdrawable-nanox.c b/gdk/nanox/gdkdrawable-nanox.c deleted file mode 100644 index 10c67049b3..0000000000 --- a/gdk/nanox/gdkdrawable-nanox.c +++ /dev/null @@ -1,271 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static void gdk_nanox_drawable_destroy (GdkDrawable *drawable); - -static void gdk_nanox_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height); -static void gdk_nanox_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2); -static void gdk_nanox_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - GdkPoint *points, - gint npoints); -static void gdk_nanox_draw_text (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length); -static void gdk_nanox_draw_text_wc (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length); -static void gdk_nanox_draw_drawable (GdkDrawable *drawable, - GdkGC *gc, - GdkPixmap *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -static void gdk_nanox_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); -static void gdk_nanox_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs); -static void gdk_nanox_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); - -GdkDrawableClass _gdk_nanox_drawable_class = { - gdk_nanox_drawable_destroy, - _gdk_nanox_gc_new, - gdk_nanox_draw_rectangle, - gdk_nanox_draw_arc, - gdk_nanox_draw_polygon, - gdk_nanox_draw_text, - gdk_nanox_draw_text_wc, - gdk_nanox_draw_drawable, - gdk_nanox_draw_points, - gdk_nanox_draw_segments, - gdk_nanox_draw_lines -}; - -GdkColormap* -gdk_drawable_get_colormap (GdkDrawable *drawable) -{ - GdkDrawablePrivate *drawable_private; - - g_return_val_if_fail (drawable != NULL, NULL); - drawable_private = (GdkDrawablePrivate*) drawable; - - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (drawable_private->colormap == NULL && - GDK_IS_WINDOW (drawable)) - { - /*XGetWindowAttributes (GDK_DRAWABLE_XDISPLAY (drawable), - GDK_DRAWABLE_XID (drawable), - &window_attributes); - drawable_private->colormap = gdk_colormap_lookup (window_attributes.colormap);*/ - } - - return drawable_private->colormap; - } - - return NULL; -} - -void -gdk_drawable_set_colormap (GdkDrawable *drawable, - GdkColormap *colormap) -{ - GdkDrawablePrivate *drawable_private; - GdkColormapPrivateX *colormap_private; - - g_return_if_fail (drawable != NULL); - g_return_if_fail (colormap != NULL); - - drawable_private = (GdkDrawablePrivate *)drawable; - colormap_private = (GdkColormapPrivateX *)colormap; - - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (GDK_IS_WINDOW (drawable)) - { - g_return_if_fail (colormap_private->base.visual != - ((GdkColormapPrivate *)(drawable_private->colormap))->visual); - - } - - if (drawable_private->colormap) - gdk_colormap_unref (drawable_private->colormap); - drawable_private->colormap = colormap; - gdk_colormap_ref (drawable_private->colormap); - - if (GDK_IS_WINDOW (drawable) && - drawable_private->window_type != GDK_WINDOW_TOPLEVEL) - /*gdk_window_add_colormap_windows (drawable);*/; - } -} - -static void -gdk_nanox_drawable_destroy (GdkDrawable *drawable) -{ - -} - -static void -gdk_nanox_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height) -{ - if (filled) - GrFillRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height); - else - GrRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height); -} - -static void -gdk_nanox_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2) -{ - /* this is not an arc, obviously */ - if (filled) - GrFillEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2); - else - GrEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2); -} - -static void -gdk_nanox_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - GdkPoint *points, - gint npoints) -{ - GR_POINT *new_points = g_new(GR_POINT, npoints); - int i; - for (i=0; i < npoints;++i) { - new_points[i].x = points[i].x; - new_points[i].y = points[i].y; - } - if (filled) - { - GrFillPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points); - } - else - { - GrPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points); - } - g_free(new_points); -} - -static void -gdk_nanox_draw_text (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length) -{ - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font)); - GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UTF8|TF_BASELINE); -} - -static void -gdk_nanox_draw_text_wc (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length) -{ - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font)); - GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UC32|TF_BASELINE); -} - -static void -gdk_nanox_draw_drawable (GdkDrawable *drawable, - GdkGC *gc, - GdkPixmap *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height) -{ - GrCopyArea(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), xdest, ydest, - width, height, GDK_DRAWABLE_XID(src), xsrc, ysrc, 0); -} - -static void -gdk_nanox_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) -{ - int i; - for (i=0; i < npoints; ++i) - GrPoint(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y); -} - -static void -gdk_nanox_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs) -{ - int i; - for (i=0; i < nsegs; ++i) - GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), segs[i].x1, segs[i].y1, segs[i].x2, segs[i].y2); -} - -static void -gdk_nanox_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) -{ - int i; - for (i=0; i < npoints-1; ++i) - GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y, points[i+1].x, points[i+1].y); -} - diff --git a/gdk/nanox/gdkevents-nanox.c b/gdk/nanox/gdkevents-nanox.c deleted file mode 100644 index 81d9cb4bc7..0000000000 --- a/gdk/nanox/gdkevents-nanox.c +++ /dev/null @@ -1,441 +0,0 @@ -#include "gdk.h" -#include "gdkinternals.h" -#include "gdkprivate-nanox.h" - -typedef struct _GdkEventPrivate GdkEventPrivate; - -#define DOUBLE_CLICK_TIME 250 -#define TRIPLE_CLICK_TIME 500 -#define DOUBLE_CLICK_DIST 5 -#define TRIPLE_CLICK_DIST 5 - -#define GR_BUTTON_TO_GDK(b) b&LBUTTON? 1: (b&MBUTTON? 2: (b&RBUTTON? 3: 0)) - -static guint gr_mod_to_gdk(guint mods, guint buttons) { - guint res=0; - if (mods & GR_MODIFIER_SHIFT) - res |= GDK_SHIFT_MASK; - if (mods & GR_MODIFIER_CTRL) - res |= GDK_CONTROL_MASK; - if (mods & GR_MODIFIER_META) - res |= GDK_MOD1_MASK; - if (buttons & LBUTTON) - res |= GDK_BUTTON1_MASK; - if (buttons & MBUTTON) - res |= GDK_BUTTON2_MASK; - if (buttons & RBUTTON) - res |= GDK_BUTTON3_MASK; - return res; -} - -static gboolean gdk_event_prepare (gpointer source_data, - GTimeVal *current_time, - gint *timeout, - gpointer user_data); -static gboolean gdk_event_check (gpointer source_data, - GTimeVal *current_time, - gpointer user_data); -static gboolean gdk_event_dispatch (gpointer source_data, - GTimeVal *current_time, - gpointer user_data); - -typedef enum -{ - /* Following flag is set for events on the event queue during - * translation and cleared afterwards. - */ - GDK_EVENT_PENDING = 1 << 0 -} GdkEventFlags; - -struct _GdkEventPrivate -{ - GdkEvent event; - guint flags; -}; - - -static GSourceFuncs event_funcs = { - gdk_event_prepare, - gdk_event_check, - gdk_event_dispatch, - (GDestroyNotify)g_free -}; - -GPollFD event_poll_fd; -extern int sock; -static guint serial_value = 1; - -static int -events_idle () { - gdk_events_queue(); - return TRUE; -} - -void -gdk_events_init (void) -{ - g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL); - - event_poll_fd.fd = sock; - event_poll_fd.events = G_IO_IN; - - g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS); - - g_idle_add(events_idle, NULL); - -} - -static gboolean -gdk_event_prepare (gpointer source_data, - GTimeVal *current_time, - gint *timeout, - gpointer user_data) -{ - gboolean retval; - - GDK_THREADS_ENTER (); - - *timeout = -1; - - retval = (gdk_event_queue_find_first () != NULL); - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_check (gpointer source_data, - GTimeVal *current_time, - gpointer user_data) -{ - gboolean retval; - - GDK_THREADS_ENTER (); - - if (event_poll_fd.revents & G_IO_IN) - //retval = (gdk_event_queue_find_first () != NULL); - retval = 1; - else - retval = FALSE; - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_dispatch (gpointer source_data, - GTimeVal *current_time, - gpointer user_data) -{ - GdkEvent *event; - - GDK_THREADS_ENTER (); - - gdk_events_queue(); - event = gdk_event_unqueue(); - - if (event) - { - if (gdk_event_func) - (*gdk_event_func) (event, gdk_event_data); - - gdk_event_free (event); - } - - GDK_THREADS_LEAVE (); - - return TRUE; -} - - -gboolean -gdk_events_pending (void) -{ - return gdk_event_queue_find_first(); -} - -GdkEvent* -gdk_event_get_graphics_expose (GdkWindow *window) -{ - return NULL; -} - -static gint gdk_event_translate (GdkEvent *event, GR_EVENT *xevent) { - GdkWindow *window=NULL; - GdkWindowPrivate *window_private=NULL; - gint return_val = FALSE; - static int lastx=0, lasty=0, lastrootx=0, lastrooty=0; - - if (xevent->type == GR_EVENT_TYPE_FDINPUT) - return 0; - window = gdk_window_lookup (xevent->general.wid); - /* FIXME: window might be a GdkPixmap!!! */ - - window_private = (GdkWindowPrivate *) window; - - if (window != NULL) - gdk_window_ref (window); - - event->any.window = window; - event->any.send_event = FALSE; - - if (window_private && GDK_DRAWABLE_DESTROYED (window)) - { - return FALSE; - } - else - { - /* Check for filters for this window - */ - GdkFilterReturn result = GDK_FILTER_CONTINUE; - /*result = gdk_event_apply_filters (xevent, event, - window_private - ?window_private->filters - :gdk_default_filters); - */ - if (result != GDK_FILTER_CONTINUE) - { - return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE; - } - } - - return_val = TRUE; - - //g_message("got event (%p) %d", window, xevent->type); - switch (xevent->type) - { - case GR_EVENT_TYPE_KEY_DOWN: - event->key.keyval = xevent->keystroke.ch; - event->key.type = GDK_KEY_PRESS; - event->key.window = window; - event->key.time = serial_value++; - event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons); - event->key.string = g_strdup_printf ("%c", xevent->keystroke.ch); - event->key.length = 1; - - break; - case GR_EVENT_TYPE_KEY_UP: - event->key.keyval = xevent->keystroke.ch; - event->key.type = GDK_KEY_RELEASE; - event->key.window = window; - event->key.time = serial_value++; - event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons)|GDK_RELEASE_MASK; - event->key.string = NULL; - event->key.length = 0; - - break; - case GR_EVENT_TYPE_BUTTON_DOWN: - event->button.type = GDK_BUTTON_PRESS; - event->button.window = window; - event->button.time = serial_value++; - event->button.x = xevent->button.x; - event->button.y = xevent->button.y; - event->button.x_root = (gfloat)xevent->button.rootx; - event->button.y_root = (gfloat)xevent->button.rooty; - event->button.pressure = 0.5; - event->button.xtilt = 0; - event->button.ytilt = 0; - event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons); - event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons); - event->button.source = GDK_SOURCE_MOUSE; - event->button.deviceid = GDK_CORE_POINTER; - g_message("button down: %d", event->button.button); - gdk_event_button_generate (event); - break; - case GR_EVENT_TYPE_BUTTON_UP: - event->button.type = GDK_BUTTON_RELEASE; - event->button.window = window; - event->button.time = serial_value++; - event->button.x = xevent->button.x; - event->button.y = xevent->button.y; - event->button.x_root = (gfloat)xevent->button.rootx; - event->button.y_root = (gfloat)xevent->button.rooty; - event->button.pressure = 0.5; - event->button.xtilt = 0; - event->button.ytilt = 0; - event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons)|GDK_RELEASE_MASK; - event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons); - event->button.source = GDK_SOURCE_MOUSE; - event->button.deviceid = GDK_CORE_POINTER; - g_message("button up: %d", event->button.button); - gdk_event_button_generate (event); - break; - case GR_EVENT_TYPE_MOUSE_MOTION: - event->motion.type = GDK_MOTION_NOTIFY; - event->motion.window = window; - event->motion.time = serial_value++; - event->motion.x = xevent->mouse.x; - event->motion.y = xevent->mouse.y; - event->motion.x_root = (gfloat)xevent->mouse.rootx; - event->motion.y_root = (gfloat)xevent->mouse.rooty; - event->motion.pressure = 0.5; - event->motion.xtilt = 0; - event->motion.ytilt = 0; - event->motion.state = gr_mod_to_gdk(xevent->mouse.modifiers, xevent->mouse.buttons); - event->motion.is_hint = 0; - event->motion.source = GDK_SOURCE_MOUSE; - event->motion.deviceid = GDK_CORE_POINTER; - - break; - case GR_EVENT_TYPE_MOUSE_POSITION: - return_val = FALSE; - break; - case GR_EVENT_TYPE_MOUSE_ENTER: - event->crossing.type = GDK_ENTER_NOTIFY; - event->crossing.window = window; - event->crossing.subwindow = NULL; - event->crossing.time = serial_value++; - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - //g_message("subwindow 1: %p", event->crossing.subwindow); - /* other stuff here , x, y, x_root, y_root */ - break; - case GR_EVENT_TYPE_MOUSE_EXIT: - event->crossing.type = GDK_LEAVE_NOTIFY; - event->crossing.window = window; - event->crossing.subwindow = NULL; - event->crossing.time = serial_value++; - event->crossing.mode = GDK_CROSSING_NORMAL; - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - //g_message("subwindow 2: %p", event->crossing.subwindow); - /* other stuff here , x, y, x_root, y_root */ - break; - case GR_EVENT_TYPE_FOCUS_IN: - case GR_EVENT_TYPE_FOCUS_OUT: - event->focus_change.type = GDK_FOCUS_CHANGE; - event->focus_change.window = window; - event->focus_change.in = (xevent->general.type == GR_EVENT_TYPE_FOCUS_IN); - - break; - case GR_EVENT_TYPE_UPDATE: - case GR_EVENT_TYPE_CHLD_UPDATE: - if (xevent->update.utype == GR_UPDATE_MAP) { - event->any.type = GDK_MAP; - event->any.window = window; - - } else if (xevent->update.utype == GR_UPDATE_UNMAP) { - event->any.type = GDK_UNMAP; - event->any.window = window; - - if (gdk_xgrab_window == window_private) - gdk_xgrab_window = NULL; - } else { - if (!window || GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_CHILD) - return_val = FALSE; - else - { - event->configure.type = GDK_CONFIGURE; - event->configure.window = window; - event->configure.width = xevent->update.width; - event->configure.height = xevent->update.height; - event->configure.x = xevent->update.x; - event->configure.y = xevent->update.y; - window_private->x = event->configure.x; - window_private->y = event->configure.y; - window_private->drawable.width = event->configure.width; - window_private->drawable.height = event->configure.height; - if (window_private->resize_count > 1) - window_private->resize_count -= 1; - } - } - break; - case GR_EVENT_TYPE_EXPOSURE: - - event->expose.type = GDK_EXPOSE; - event->expose.window = window; - event->expose.area.x = xevent->exposure.x; - event->expose.area.y = xevent->exposure.y; - event->expose.area.width = xevent->exposure.width; - event->expose.area.height = xevent->exposure.height; - event->expose.count = 0; - - break; - case GR_EVENT_TYPE_FDINPUT: - case GR_EVENT_TYPE_NONE: - return_val = FALSE; - break; - default: - return_val = FALSE; - g_message("event %d not handled\n", xevent->type); - } - if (return_val) - { - if (event->any.window) - gdk_window_ref (event->any.window); - if (((event->any.type == GDK_ENTER_NOTIFY) || - (event->any.type == GDK_LEAVE_NOTIFY)) && - (event->crossing.subwindow != NULL)) - gdk_window_ref (event->crossing.subwindow); - } - else - { - /* Mark this event as having no resources to be freed */ - event->any.window = NULL; - event->any.type = GDK_NOTHING; - } - - if (window) - gdk_window_unref (window); - - return return_val; -} - -void -gdk_events_queue (void) -{ - GList *node; - GdkEvent *event; - GR_EVENT xevent; - - while (!gdk_event_queue_find_first()) - { - GrCheckNextEvent (&xevent); - if (!xevent.type) - return; - - event = gdk_event_new (); - - event->any.type = GDK_NOTHING; - event->any.window = NULL; - event->any.send_event = FALSE; - - ((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING; - - gdk_event_queue_append (event); - node = gdk_queued_tail; - - if (gdk_event_translate (event, &xevent)) - { - ((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING; - //g_message("got event: %d", event->type); - } - else - { - gdk_event_queue_remove_link (node); - g_list_free_1 (node); - gdk_event_free (event); - } - } -} - -gboolean -gdk_event_send_client_message (GdkEvent *event, guint32 xid) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_event_send_clientmessage_toall (GdkEvent *event) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_flush (void) -{ - GrFlush(); -} - - diff --git a/gdk/nanox/gdkfont-nanox.c b/gdk/nanox/gdkfont-nanox.c deleted file mode 100644 index 19818b5ebf..0000000000 --- a/gdk/nanox/gdkfont-nanox.c +++ /dev/null @@ -1,146 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static GR_GC_ID gc_for_width = 0; - -#define ENSURE_GC if (!gc_for_width) gc_for_width = GrNewGC(); - -GdkFont* -gdk_font_load (const gchar *font_name) -{ - GdkFont *font; - GdkFontPrivateX *private; - GR_FONTID xfont; - - g_return_val_if_fail (font_name != NULL, NULL); - - xfont = GrCreateFont("System", 0, 0); - if (xfont == 0) - return NULL; - - { - private = g_new (GdkFontPrivateX, 1); - private->xfont = xfont; - private->base.ref_count = 1; - - font = (GdkFont*) private; - font->type = GDK_FONT_FONT; - font->ascent = 8; - font->descent = 4; - - } - - return font; -} - -GdkFont* -gdk_fontset_load (const gchar *fontset_name) -{ - return gdk_font_load(fontset_name); -} - -void -_gdk_font_destroy (GdkFont *font) -{ - GrUnloadFont(GDK_FONT_XFONT(font)); -} - -gint -_gdk_font_strlen (GdkFont *font, - const gchar *str) -{ - return strlen(str); -} - -gint -gdk_font_id (const GdkFont *font) -{ - return GDK_FONT_XFONT(font); -} - -gboolean -gdk_font_equal (const GdkFont *fonta, - const GdkFont *fontb) -{ - return GDK_FONT_XFONT(fonta) == GDK_FONT_XFONT(fontb); -} - -gint -gdk_text_width (GdkFont *font, - const gchar *text, - gint text_length) -{ - gint width, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &width, &height, &base); - return width; -} - -gint -gdk_text_width_wc (GdkFont *font, - const GdkWChar *text, - gint text_length) -{ - gint width, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &width, &height, &base); - return width; -} - - -void -gdk_text_extents (GdkFont *font, - const gchar *text, - gint text_length, - gint *lbearing, - gint *rbearing, - gint *width, - gint *ascent, - gint *descent) -{ - gint mwidth, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &mwidth, &height, &base); - if (width) - *width = mwidth; - if (lbearing) - *lbearing = 0; - if (rbearing) - *rbearing = 0; - if (ascent) - *ascent = base; - if (descent) - *descent = height - base; - -} - -void -gdk_text_extents_wc (GdkFont *font, - const GdkWChar *text, - gint text_length, - gint *lbearing, - gint *rbearing, - gint *width, - gint *ascent, - gint *descent) -{ - gint mwidth, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &mwidth, &height, &base); - if (width) - *width = mwidth; - if (lbearing) - *lbearing = 0; - if (rbearing) - *rbearing = 0; - if (ascent) - *ascent = base; - if (descent) - *descent = height - base; -} - - diff --git a/gdk/nanox/gdkgc-nanox.c b/gdk/nanox/gdkgc-nanox.c deleted file mode 100644 index 78246a3dc0..0000000000 --- a/gdk/nanox/gdkgc-nanox.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "gdkprivate-nanox.h" - -static void gdk_nanox_gc_destroy (GdkGC *gc); -static void gdk_nanox_gc_get_values (GdkGC *gc, - GdkGCValues *values); -static void gdk_nanox_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask); -static void gdk_nanox_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gchar dash_list[], - gint n); - -static GdkGCClass gdk_nanox_gc_class = { - gdk_nanox_gc_destroy, - gdk_nanox_gc_get_values, - gdk_nanox_gc_set_values, - gdk_nanox_gc_set_dashes -}; - -GdkGC * -_gdk_nanox_gc_new (GdkDrawable *drawable, - GdkGCValues *values, - GdkGCValuesMask values_mask) -{ - - GdkGC *gc; - GdkGCPrivate *private; - - gc = gdk_gc_alloc (); - private = (GdkGCPrivate *)gc; - - private->klass = &gdk_nanox_gc_class; - private->klass_data = g_new (GdkGCXData, 1); - - GDK_GC_XDATA(gc)->xgc = GrNewGC(); - GrSetGCUseBackground(GDK_GC_XDATA(gc)->xgc, 0); - GrSetGCForeground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0)); - GrSetGCBackground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0)); - g_message("created GC: %d", GDK_GC_XDATA(gc)->xgc); - return gc; -} - - -static void -gdk_nanox_gc_destroy (GdkGC *gc) -{ - GrDestroyGC (GDK_GC_XGC (gc)); - g_free (GDK_GC_XDATA (gc)); -} - -static void -gdk_nanox_gc_get_values (GdkGC *gc, - GdkGCValues *values) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -static void -gdk_nanox_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask) -{ - if (values_mask & GDK_GC_FOREGROUND) - GrSetGCForeground(GDK_GC_XGC(gc), values->foreground.pixel); - else if (values_mask & GDK_GC_BACKGROUND) - GrSetGCBackground(GDK_GC_XGC(gc), values->background.pixel); - else if (values_mask & GDK_GC_FONT) - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(values->font)); -} - -static void -gdk_nanox_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gchar dash_list[], - gint n) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle) -{ - //g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_gc_set_clip_region (GdkGC *gc, - GdkRegion *region) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc) -{ - GDK_GC_XDATA(dst_gc)->xgc = GrCopyGC(GDK_GC_XGC(src_gc)); -} - - diff --git a/gdk/nanox/gdkglobals-nanox.c b/gdk/nanox/gdkglobals-nanox.c deleted file mode 100644 index e69de29bb2..0000000000 --- a/gdk/nanox/gdkglobals-nanox.c +++ /dev/null diff --git a/gdk/nanox/gdkim-nanox.c b/gdk/nanox/gdkim-nanox.c deleted file mode 100644 index e69de29bb2..0000000000 --- a/gdk/nanox/gdkim-nanox.c +++ /dev/null diff --git a/gdk/nanox/gdkimage-nanox.c b/gdk/nanox/gdkimage-nanox.c deleted file mode 100644 index e0b580ac42..0000000000 --- a/gdk/nanox/gdkimage-nanox.c +++ /dev/null @@ -1,118 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static void -gdk_nanox_image_destroy (GdkImage *image); - -static void -gdk_image_put_normal (GdkImage *image, - GdkDrawable *drawable, - GdkGC *gc, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); - -static GdkImageClass image_class_normal = { - gdk_nanox_image_destroy, - gdk_image_put_normal -}; - -void -gdk_image_exit (void) -{ -} - - -GdkImage * -gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_image_init (void) -{ -} - - -GdkImage* -gdk_image_new (GdkImageType type, - GdkVisual *visual, - gint width, - gint height) -{ - GdkImage *image; - GdkImagePrivateX *private; - - private = g_new (GdkImagePrivateX, 1); - image = (GdkImage*) private; - - private->base.ref_count = 1; - image->type = type; - image->visual = visual; - image->width = width; - image->height = height; - image->depth = visual->depth; - - private->base.klass = &image_class_normal; - //private->ximage = NULL; - /* more: implement as a pixmap? */ - return image; -} - - -GdkImage* -gdk_image_get (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -guint32 -gdk_image_get_pixel (GdkImage *image, - gint x, - gint y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_image_put_pixel (GdkImage *image, - gint x, - gint y, - guint32 pixel) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -static void -gdk_nanox_image_destroy (GdkImage *image) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -static void -gdk_image_put_normal (GdkImage *image, - GdkDrawable *drawable, - GdkGC *gc, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); -} - diff --git a/gdk/nanox/gdkinput-none.c b/gdk/nanox/gdkinput-none.c deleted file mode 100644 index 4c0575bc4f..0000000000 --- a/gdk/nanox/gdkinput-none.c +++ /dev/null @@ -1,79 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "gdkinputprivate.h" - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -static void gdk_input_none_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask); - -void -gdk_input_init (void) -{ - gdk_input_vtable.set_mode = NULL; - gdk_input_vtable.set_axes = NULL; - gdk_input_vtable.set_key = NULL; - gdk_input_vtable.motion_events = NULL; - gdk_input_vtable.get_pointer = gdk_input_none_get_pointer; - gdk_input_vtable.grab_pointer = NULL; - gdk_input_vtable.ungrab_pointer = NULL; - gdk_input_vtable.configure_event = NULL; - gdk_input_vtable.enter_event = NULL; - gdk_input_vtable.other_event = NULL; - gdk_input_vtable.window_none_event = NULL; - gdk_input_vtable.enable_window = NULL; - gdk_input_vtable.disable_window = NULL; - - gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info); - - gdk_input_ignore_core = FALSE; -} - -static void -gdk_input_none_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask) -{ - gint x_int, y_int; - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (x) *x = x_int; - if (y) *y = y_int; - if (pressure) *pressure = 0.5; - if (xtilt) *xtilt = 0; - if (ytilt) *ytilt = 0; -} diff --git a/gdk/nanox/gdkinput.c b/gdk/nanox/gdkinput.c deleted file mode 100644 index 6dd0195746..0000000000 --- a/gdk/nanox/gdkinput.c +++ /dev/null @@ -1,282 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" -#include "gdkinputprivate.h" - -static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y }; - -const GdkDeviceInfo gdk_input_core_info = -{ - GDK_CORE_POINTER, - "Core Pointer", - GDK_SOURCE_MOUSE, - GDK_MODE_SCREEN, - TRUE, - 2, - gdk_input_core_axes -}; - -/* Global variables */ - -GdkInputVTable gdk_input_vtable; -/* information about network port and host for gxid daemon */ -gchar *gdk_input_gxid_host; -gint gdk_input_gxid_port; -gint gdk_input_ignore_core; - -GList *gdk_input_devices; -GList *gdk_input_windows; - -GList * -gdk_input_list_devices (void) -{ - return gdk_input_devices; -} - -void -gdk_input_set_source (guint32 deviceid, GdkInputSource source) -{ - GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid); - g_return_if_fail (gdkdev != NULL); - - gdkdev->info.source = source; -} - -gboolean -gdk_input_set_mode (guint32 deviceid, GdkInputMode mode) -{ - if (deviceid == GDK_CORE_POINTER) - return FALSE; - - if (gdk_input_vtable.set_mode) - return gdk_input_vtable.set_mode(deviceid,mode); - else - return FALSE; -} - -void -gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes) -{ - if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_axes) - gdk_input_vtable.set_axes (deviceid, axes); -} - -void gdk_input_set_key (guint32 deviceid, - guint index, - guint keyval, - GdkModifierType modifiers) -{ - if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_key) - gdk_input_vtable.set_key (deviceid, index, keyval, modifiers); -} - -GdkTimeCoord * -gdk_input_motion_events (GdkWindow *window, - guint32 deviceid, - guint32 start, - guint32 stop, - gint *nevents_return) -{ - GdkTimeCoord *coords; - int i; - - g_return_val_if_fail (window != NULL, NULL); - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); - - if (GDK_DRAWABLE_DESTROYED (window)) - return NULL; - - if (deviceid == GDK_CORE_POINTER) - { - return NULL; - } - else - { - if (gdk_input_vtable.motion_events) - { - return gdk_input_vtable.motion_events(window, - deviceid, start, stop, - nevents_return); - } - else - { - *nevents_return = 0; - return NULL; - } - } -} - -gint -gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) -{ - if (gdk_input_vtable.enable_window) - return gdk_input_vtable.enable_window (window, gdkdev); - else - return TRUE; -} - -gint -gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) -{ - if (gdk_input_vtable.disable_window) - return gdk_input_vtable.disable_window(window,gdkdev); - else - return TRUE; -} - - -GdkInputWindow * -gdk_input_window_find(GdkWindow *window) -{ - GList *tmp_list; - - for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next) - if (((GdkInputWindow *)(tmp_list->data))->window == window) - return (GdkInputWindow *)(tmp_list->data); - - return NULL; /* Not found */ -} - -/* FIXME: this routine currently needs to be called between creation - and the corresponding configure event (because it doesn't get the - root_relative_geometry). This should work with - gtk_window_set_extension_events, but will likely fail in other - cases */ - -void -gdk_input_set_extension_events (GdkWindow *window, gint mask, - GdkExtensionMode mode) -{ - GdkWindowPrivate *window_private; - GList *tmp_list; - GdkInputWindow *iw; - - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - window_private = (GdkWindowPrivate*) window; - if (GDK_DRAWABLE_DESTROYED (window)) - return; - - if (mode == GDK_EXTENSION_EVENTS_NONE) - mask = 0; - - if (mask != 0) - { - iw = g_new(GdkInputWindow,1); - - iw->window = window; - iw->mode = mode; - - iw->obscuring = NULL; - iw->num_obscuring = 0; - iw->grabbed = FALSE; - - gdk_input_windows = g_list_append(gdk_input_windows,iw); - window_private->extension_events = mask; - - /* Add enter window events to the event mask */ - /* FIXME, this is not needed for XINPUT_NONE */ - gdk_window_set_events (window, - gdk_window_get_events (window) | - GDK_ENTER_NOTIFY_MASK); - } - else - { - iw = gdk_input_window_find (window); - if (iw) - { - gdk_input_windows = g_list_remove(gdk_input_windows,iw); - g_free(iw); - } - - window_private->extension_events = 0; - } - - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data); - - if (gdkdev->info.deviceid != GDK_CORE_POINTER) - { - if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED - && (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL)) - gdk_input_enable_window(window,gdkdev); - else - gdk_input_disable_window(window,gdkdev); - } - } -} - -void -gdk_input_window_destroy (GdkWindow *window) -{ - GdkInputWindow *input_window; - - input_window = gdk_input_window_find (window); - g_return_if_fail (input_window != NULL); - - gdk_input_windows = g_list_remove (gdk_input_windows,input_window); - g_free(input_window); -} - -void -gdk_input_exit (void) -{ - GList *tmp_list; - GdkDevicePrivate *gdkdev; - - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev->info.deviceid != GDK_CORE_POINTER) - { - gdk_input_set_mode(gdkdev->info.deviceid,GDK_MODE_DISABLED); - - g_free(gdkdev->info.name); -#ifndef XINPUT_NONE - g_free(gdkdev->axes); -#endif - g_free(gdkdev->info.axes); - g_free(gdkdev->info.keys); - g_free(gdkdev); - } - } - - g_list_free(gdk_input_devices); - - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - { - g_free(tmp_list->data); - } - g_list_free(gdk_input_windows); -} - -GdkDevicePrivate * -gdk_input_find_device(guint32 id) -{ - GList *tmp_list = gdk_input_devices; - GdkDevicePrivate *gdkdev; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev->info.deviceid == id) - return gdkdev; - tmp_list = tmp_list->next; - } - return NULL; -} - -void -gdk_input_window_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask) -{ - if (gdk_input_vtable.get_pointer) - gdk_input_vtable.get_pointer (window, deviceid, x, y, pressure, - xtilt, ytilt, mask); -} diff --git a/gdk/nanox/gdkinputprivate.h b/gdk/nanox/gdkinputprivate.h deleted file mode 100644 index 03df0dfd54..0000000000 --- a/gdk/nanox/gdkinputprivate.h +++ /dev/null @@ -1,230 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_INPUTPRIVATE_H__ -#define __GDK_INPUTPRIVATE_H__ - -#include "config.h" -#include "gdkinput.h" -#include "gdkevents.h" - -typedef struct _GdkAxisInfo GdkAxisInfo; -typedef struct _GdkInputVTable GdkInputVTable; -typedef struct _GdkDevicePrivate GdkDevicePrivate; -typedef struct _GdkInputWindow GdkInputWindow; - -/* ugly stuff to get compilation going... */ -typedef void * XEvent; -typedef void * XConfigureEvent; -typedef void * XCrossingEvent; -typedef void * XDevice; -typedef void * XEventClass; -typedef void * Display; -typedef guint Window; - -struct _GdkInputVTable { - gint (*set_mode) (guint32 deviceid, GdkInputMode mode); - void (*set_axes) (guint32 deviceid, GdkAxisUse *axes); - void (*set_key) (guint32 deviceid, - guint index, - guint keyval, - GdkModifierType modifiers); - - GdkTimeCoord* (*motion_events) (GdkWindow *window, - guint32 deviceid, - guint32 start, - guint32 stop, - gint *nevents_return); - void (*get_pointer) (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask); - gint (*grab_pointer) (GdkWindow * window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - guint32 time); - void (*ungrab_pointer) (guint32 time); - - void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window); - void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window); - gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window); - /* Handle an unidentified event. Returns TRUE if handled, FALSE - otherwise */ - gint (*window_none_event) (GdkEvent *event, XEvent *xevent); - gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev); - gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev); -}; - -/* information about a device axis */ -struct _GdkAxisInfo -{ - /* reported x resolution */ - gint xresolution; - - /* reported x minimum/maximum values */ - gint xmin_value, xmax_value; - - /* calibrated resolution (for aspect ration) - only relative values - between axes used */ - gint resolution; - - /* calibrated minimum/maximum values */ - gint min_value, max_value; -}; - -#define GDK_INPUT_NUM_EVENTC 6 - -struct _GdkDevicePrivate { - GdkDeviceInfo info; - -#ifndef XINPUT_NONE - /* information about the axes */ - GdkAxisInfo *axes; - - /* reverse lookup on axis use type */ - gint axis_for_use[GDK_AXIS_LAST]; - - /* Information about XInput device */ - XDevice *xdevice; - - /* minimum key code for device */ - gint min_keycode; - - int buttonpress_type, buttonrelease_type, keypress_type, - keyrelease_type, motionnotify_type, proximityin_type, - proximityout_type, changenotify_type; - - /* true if we need to select a different set of events, but - can't because this is the core pointer */ - gint needs_update; - - /* Mask of buttons (used for button grabs) */ - gint button_state; - - /* true if we've claimed the device as active. (used only for XINPUT_GXI) */ - gint claimed; -#endif /* !XINPUT_NONE */ -}; - -struct _GdkInputWindow -{ - /* gdk window */ - GdkWindow *window; - - /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */ - GdkExtensionMode mode; - - /* position relative to root window */ - gint16 root_x; - gint16 root_y; - - /* rectangles relative to window of windows obscuring this one */ - GdkRectangle *obscuring; - gint num_obscuring; - - /* Is there a pointer grab for this window ? */ - gint grabbed; -}; - -/* Global data */ - -extern const GdkDeviceInfo gdk_input_core_info; -extern GList *gdk_input_devices; -extern GList *gdk_input_windows; - -extern GdkInputVTable gdk_input_vtable; -/* information about network port and host for gxid daemon */ -extern gchar *gdk_input_gxid_host; -extern gint gdk_input_gxid_port; -extern gint gdk_input_ignore_core; - -/* Function declarations */ - -GdkDevicePrivate * gdk_input_find_device (guint32 id); -GdkInputWindow * gdk_input_window_find (GdkWindow *window); -void gdk_input_window_destroy (GdkWindow *window); -void gdk_input_init (void); -void gdk_input_exit (void); -gint gdk_input_enable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev); -gint gdk_input_disable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev); - -#ifndef XINPUT_NONE - -#define GDK_MAX_DEVICE_CLASSES 13 - -gint gdk_input_common_init (gint include_core); -void gdk_input_get_root_relative_geometry (Display *dpy, - Window w, - int *x_ret, - int *y_ret, - int *width_ret, - int *height_ret); -void gdk_input_common_find_events (GdkWindow *window, - GdkDevicePrivate *gdkdev, - gint mask, - XEventClass *classes, - int *num_classes); -void gdk_input_common_select_events (GdkWindow *window, - GdkDevicePrivate *gdkdev); -gint gdk_input_common_other_event (GdkEvent *event, - XEvent *xevent, - GdkInputWindow *input_window, - GdkDevicePrivate *gdkdev); -void gdk_input_common_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask); -void gdk_input_common_set_key (guint32 deviceid, - guint index, - guint keyval, - GdkModifierType modifiers); -void gdk_input_common_set_axes (guint32 deviceid, - GdkAxisUse *axes); -GdkTimeCoord * gdk_input_common_motion_events (GdkWindow *window, - guint32 deviceid, - guint32 start, - guint32 stop, - gint *nevents_return); - -#endif /* !XINPUT_NONE */ - -GdkDevicePrivate *gdk_input_find_device (guint32 id); -GdkInputWindow *gdk_input_window_find (GdkWindow *window); -void gdk_input_window_destroy (GdkWindow *window); -void gdk_input_exit (void); - -#endif /* __GDK_INPUTPRIVATE_H__ */ diff --git a/gdk/nanox/gdkmain-nanox.c b/gdk/nanox/gdkmain-nanox.c deleted file mode 100644 index 38983228b8..0000000000 --- a/gdk/nanox/gdkmain-nanox.c +++ /dev/null @@ -1,250 +0,0 @@ -#include "gdk.h" -#include "gdkinternals.h" -#include "gdkprivate-nanox.h" - -static GR_SCREEN_INFO screen_info; -static int gdk_use_xshm = 0; /* shm not supported */ -guint gdk_selection_property = 0; -gchar* gdk_progclass = NULL; -GdkWindowPrivate* gdk_xgrab_window = NULL; - -GdkArgDesc _gdk_windowing_args[] = { - {NULL} -}; - -gboolean -_gdk_windowing_init_check (int argc, char **argv) -{ - int result = GrOpen(); - if (result < 0) - return 0; - GrGetScreenInfo(&screen_info); - - return 1; -} - - -gchar* -gdk_set_locale (void) -{ - return ""; -} - -void -gdk_set_use_xshm (gboolean use_xshm) -{ - gdk_use_xshm = 0; /* shm not supported */ -} - -gboolean -gdk_get_use_xshm (void) -{ - return gdk_use_xshm; -} - -GdkGrabStatus -gdk_pointer_grab (GdkWindow * window, - gboolean owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - GdkCursor * cursor, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_pointer_ungrab (guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_pointer_is_grabbed (void) -{ - return gdk_xgrab_window != NULL; -} - -GdkGrabStatus -gdk_keyboard_grab (GdkWindow * window, - gboolean owner_events, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_keyboard_ungrab (guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_screen_width (void) -{ - return screen_info.cols; -} - -gint -gdk_screen_height (void) -{ - return screen_info.rows; -} - -gint -gdk_screen_width_mm (void) -{ - return screen_info.cols*10/screen_info.xdpcm; -} - -gint -gdk_screen_height_mm (void) -{ - return screen_info.rows*10/screen_info.ydpcm; -} - -void -gdk_set_sm_client_id (const gchar* sm_client_id) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_key_repeat_disable (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_key_repeat_restore (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_beep (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_windowing_exit (void) -{ - GrClose(); -} - -gchar * -gdk_get_display (void) -{ - return "nano-X"; -} - -gchar* -gdk_keyval_name (guint keyval) -{ - static gchar buf[64]; - g_snprintf(buf, 64, "%c", keyval); - return buf; -} - -guint -gdk_keyval_from_name (const gchar *keyval_name) -{ - return *keyval_name; -} - -/* -void -gdk_keyval_convert_case (guint symbol, - guint *lower, - guint *upper) -{ -} -*/ - -static guint gdk_xid_hash (guint *xid); -static gboolean gdk_xid_equal (guint *a, - guint *b); - - -static GHashTable *xid_ht = NULL; - - -void -gdk_xid_table_insert (guint *xid, - gpointer data) -{ - g_return_if_fail (xid != NULL); - - if (!xid_ht) - xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash, - (GEqualFunc) gdk_xid_equal); - - g_hash_table_insert (xid_ht, xid, data); -} - -void -gdk_xid_table_remove (guint xid) -{ - if (!xid_ht) - xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash, - (GEqualFunc) gdk_xid_equal); - - g_hash_table_remove (xid_ht, &xid); -} - -gpointer -gdk_xid_table_lookup (guint xid) -{ - gpointer data = NULL; - - if (xid_ht) - data = g_hash_table_lookup (xid_ht, &xid); - - return data; -} - - -static guint -gdk_xid_hash (guint *xid) -{ - return *xid; -} - -static gboolean -gdk_xid_equal (guint *a, - guint *b) -{ - return (*a == *b); -} - -gchar * -gdk_wcstombs (const GdkWChar *src) -{ - gchar *mbstr; - gint i, length = 0; - - while (src[length] != 0) - length++; - mbstr = g_new (gchar, length + 1); - for (i=0; i <length+1;++i) - mbstr[i] = src[i]; - return mbstr; -} - -gint -gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max) -{ - gint i; - - for (i=0; i < dest_max && src[i]; i++) - dest[i] = src[i]; - return i; -} - diff --git a/gdk/nanox/gdkpixmap-nanox.c b/gdk/nanox/gdkpixmap-nanox.c deleted file mode 100644 index 3235acf233..0000000000 --- a/gdk/nanox/gdkpixmap-nanox.c +++ /dev/null @@ -1,149 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkDrawableClass _gdk_nanox_pixmap_class; - -static void -gdk_nanox_pixmap_destroy (GdkPixmap *pixmap) -{ - GrDestroyWindow (GDK_DRAWABLE_XID (pixmap)); - gdk_xid_table_remove (GDK_DRAWABLE_XID (pixmap)); - - g_free (GDK_DRAWABLE_XDATA (pixmap)); -} - -static GdkDrawable * -gdk_nanox_pixmap_alloc (void) -{ - GdkDrawable *drawable; - GdkDrawablePrivate *private; - - static GdkDrawableClass klass; - static gboolean initialized = FALSE; - - if (!initialized) - { - initialized = TRUE; - - klass = _gdk_nanox_drawable_class; - klass.destroy = gdk_nanox_pixmap_destroy; - } - - drawable = gdk_drawable_alloc (); - private = (GdkDrawablePrivate *)drawable; - - private->klass = &klass; - private->klass_data = g_new (GdkDrawableXData, 1); - private->window_type = GDK_DRAWABLE_PIXMAP; - - return drawable; -} - -GdkPixmap* -gdk_pixmap_new (GdkWindow *window, - gint width, - gint height, - gint depth) -{ - GdkPixmap *pixmap; - GdkDrawablePrivate *private; - - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); - g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); - g_return_val_if_fail ((width != 0) && (height != 0), NULL); - - if (!window) - window = gdk_parent_root; - - if (GDK_DRAWABLE_DESTROYED (window)) - return NULL; - - if (depth == -1) - depth = gdk_drawable_get_visual (window)->depth; - - pixmap = gdk_nanox_pixmap_alloc (); - private = (GdkDrawablePrivate *)pixmap; - - GDK_DRAWABLE_XDATA (private)->xid = GrNewPixmap (width, height, NULL); - private->width = width; - private->height = height; - - gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap); - - return pixmap; -} - -GdkPixmap * -gdk_bitmap_create_from_data (GdkWindow *window, - const gchar *data, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_create_from_data (GdkWindow *window, - const gchar *data, - gint width, - gint height, - gint depth, - GdkColor *fg, - GdkColor *bg) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GdkPixmap* -gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GdkPixmap* -gdk_pixmap_create_from_xpm (GdkWindow *window, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - gchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_create_from_xpm_d (GdkWindow *window, - GdkBitmap **mask, - GdkColor *transparent_color, - gchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_foreign_new (guint32 anid) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - diff --git a/gdk/nanox/gdkprivate-nanox.h b/gdk/nanox/gdkprivate-nanox.h deleted file mode 100644 index aed8c3de55..0000000000 --- a/gdk/nanox/gdkprivate-nanox.h +++ /dev/null @@ -1,178 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_NANOX_H__ -#define __GDK_NANOX_H__ - -#include <microwin/nano-X.h> - -#include <gdk/gdkfont.h> -#include <gdk/gdkprivate.h> -#include <gdk/gdkcursor.h> - -typedef struct _GdkGCXData GdkGCXData; -typedef struct _GdkDrawableXData GdkDrawableXData; -typedef struct _GdkColormapPrivateX GdkColormapPrivateX; -typedef struct _GdkCursorPrivate GdkCursorPrivate; -typedef struct _GdkFontPrivateX GdkFontPrivateX; -typedef struct _GdkImagePrivateX GdkImagePrivateX; -typedef struct _GdkVisualPrivate GdkVisualPrivate; -typedef struct _GdkRegionPrivate GdkRegionPrivate; - -#define GDK_DRAWABLE_XDATA(win) ((GdkDrawableXData *)(((GdkDrawablePrivate*)(win))->klass_data)) -#define GDK_GC_XDATA(gc) ((GdkGCXData *)(((GdkGCPrivate*)(gc))->klass_data)) - -struct _GdkGCXData -{ - GR_GC_ID xgc; -}; - -struct _GdkDrawableXData -{ - GR_WINDOW_ID xid; -}; - -struct _GdkCursorPrivate -{ - GdkCursor cursor; - int width, height; - int hotx, hoty; - GR_COLOR fg, bg; - GR_BITMAP *fgb; - GR_BITMAP *bgb; -}; - -struct _GdkFontPrivateX -{ - GdkFontPrivate base; - GR_FONTID xfont; -}; - -struct _GdkVisualPrivate -{ - GdkVisual visual; -}; - -struct _GdkColormapPrivateX -{ - GdkColormapPrivate base; - -}; - -struct _GdkImagePrivateX -{ - GdkImagePrivate base; - - gpointer x_shm_info; -}; - -struct _GdkRegionPrivate -{ - /*GdkRegion region;*/ - MWCLIPREGION* xregion; -}; - -GdkGC * _gdk_nanox_gc_new (GdkDrawable *drawable, - GdkGCValues *values, - GdkGCValuesMask values_mask); -void gdk_xid_table_insert (guint *xid, - gpointer data); -void gdk_xid_table_remove (guint xid); -gpointer gdk_xid_table_lookup (guint xid); -/* -gint gdk_send_xevent (Window window, - gboolean propagate, - glong event_mask, - XEvent *event_send); -GdkColormap * gdk_colormap_lookup (Colormap xcolormap); -GdkVisual * gdk_visual_lookup (Visual *xvisual); -*/ -/* Please see gdkwindow.c for comments on how to use */ -/*Window gdk_window_xid_at (Window base, - gint bx, - gint by, - gint x, - gint y, - GList *excludes, - gboolean excl_child); -Window gdk_window_xid_at_coords (gint x, - gint y, - GList *excludes, - gboolean excl_child); -*/ - -extern GdkDrawableClass _gdk_nanox_drawable_class; -extern gboolean gdk_use_xshm; -extern gchar *gdk_display_name; -extern GR_WINDOW_ID gdk_root_window; -extern GR_WINDOW_ID gdk_leader_window; -/*extern Atom gdk_wm_delete_window; -extern Atom gdk_wm_take_focus; -extern Atom gdk_wm_protocols; -extern Atom gdk_wm_window_protocols[];*/ -extern guint gdk_selection_property; -extern GdkWindow *selection_owner[]; -extern gchar *gdk_progclass; -extern gboolean gdk_null_window_warnings; -extern const int gdk_nevent_masks; -extern const int gdk_event_mask_table[]; - -extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the - * x pointer grab - */ - -#define GDK_ROOT_WINDOW() gdk_root_window -#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_parent_root) -#define GDK_DISPLAY() NULL -#define GDK_DRAWABLE_XDISPLAY(win) NULL -#define GDK_DRAWABLE_XID(win) (GDK_DRAWABLE_XDATA(win)->xid) -#define GDK_IMAGE_XDISPLAY(image) NULL -#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage) -#define GDK_GC_XDISPLAY(gc) NULL -#define GDK_GC_XGC(gc) (GDK_GC_XDATA(gc)->xgc) -#define GDK_COLORMAP_XDISPLAY(cmap) NULL -#define GDK_COLORMAP_XCOLORMAP(cmap) (((GdkColormapPrivateX *)cmap)->xcolormap) -#define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate*) vis)->xvisual) -#define GDK_FONT_XDISPLAY(font) NULL -#define GDK_FONT_XFONT(font) (((GdkFontPrivateX *)font)->xfont) - -#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID -#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY - -/*GdkVisual* gdkx_visual_get (VisualID xvisualid);*/ -/* XXX: Do not use this function until it is fixed. An X Colormap - * is useless unless we also have the visual. */ -/*GdkColormap* gdkx_colormap_get (Colormap xcolormap);*/ -/* Utility function in gdk.c - not sure where it belongs, but it's - needed in more than one place, so make it public */ -/*Window gdk_get_client_window (Display *dpy, - Window win);*/ - -/* Functions to create pixmaps and windows from their X equivalents */ -/*GdkPixmap *gdk_pixmap_foreign_new (guint32 anid); -GdkWindow *gdk_window_foreign_new (guint32 anid);*/ - -#endif /* __GDK_NANOX_H__ */ diff --git a/gdk/nanox/gdkproperty-nanox.c b/gdk/nanox/gdkproperty-nanox.c deleted file mode 100644 index 2c88c70485..0000000000 --- a/gdk/nanox/gdkproperty-nanox.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkAtom -gdk_atom_intern (const gchar *atom_name, - gboolean only_if_exists) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gchar* -gdk_atom_name (GdkAtom atom) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -gboolean -gdk_property_get (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gulong offset, - gulong length, - gint pdelete, - GdkAtom *actual_property_type, - gint *actual_format_type, - gint *actual_length, - guchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_property_change (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gint format, - GdkPropMode mode, - const guchar *data, - gint nelements) -{ - g_message("unimplemented %s", __FUNCTION__); - return; -} - -void -gdk_property_delete (GdkWindow *window, - GdkAtom property) -{ - g_message("unimplemented %s", __FUNCTION__); - return; -} - diff --git a/gdk/nanox/gdkregion-nanox.c b/gdk/nanox/gdkregion-nanox.c deleted file mode 100644 index b0bcc33d81..0000000000 --- a/gdk/nanox/gdkregion-nanox.c +++ /dev/null @@ -1,107 +0,0 @@ -#include "gdkprivate-nanox.h" - -GdkRegion* -gdk_region_new (void) -{ - return NULL; -} - - -void -gdk_region_destroy (GdkRegion *region) -{ -} - - -gboolean -gdk_region_empty (GdkRegion *region) -{ - return 1; -} - -gboolean -gdk_region_equal (GdkRegion *region1, - GdkRegion *region2) -{ - return 1; -} - - -void -gdk_region_get_clipbox(GdkRegion *region, - GdkRectangle *rectangle) -{ -} - -gboolean -gdk_region_point_in (GdkRegion *region, - gint x, - gint y) -{ - return 0; -} - -GdkOverlapType -gdk_region_rect_in (GdkRegion *region, - GdkRectangle *rect) -{ - return 0; -} - -GdkRegion * -gdk_region_polygon (GdkPoint *points, - gint npoints, - GdkFillRule fill_rule) -{ - return NULL; -} - -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) -{ - return NULL; -} - -GdkRegion* -gdk_regions_intersect (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_union (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_subtract (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_xor (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - diff --git a/gdk/nanox/gdkselection-nanox.c b/gdk/nanox/gdkselection-nanox.c deleted file mode 100644 index 60d7fcaa2c..0000000000 --- a/gdk/nanox/gdkselection-nanox.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -gboolean -gdk_selection_owner_set (GdkWindow *owner, - GdkAtom selection, - guint32 time, - gboolean send_event) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -GdkWindow* -gdk_selection_owner_get (GdkAtom selection) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -void -gdk_selection_convert (GdkWindow *requestor, - GdkAtom selection, - GdkAtom target, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gint -gdk_selection_property_get (GdkWindow *requestor, - guchar **data, - GdkAtom *ret_type, - gint *ret_format) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_selection_send_notify (guint32 requestor, - GdkAtom selection, - GdkAtom target, - GdkAtom property, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_text_property_to_text_list (GdkAtom encoding, - gint format, - const guchar *text, - gint length, - gchar ***list) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_free_text_list (gchar **list) -{ - g_return_if_fail (list != NULL); - -} - -gint -gdk_string_to_compound_text (const gchar *str, - GdkAtom *encoding, - gint *format, - guchar **ctext, - gint *length) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void gdk_free_compound_text (guchar *ctext) -{ -/* if (ctext) - g_free (ctext);*/ -} - diff --git a/gdk/nanox/gdkvisual-nanox.c b/gdk/nanox/gdkvisual-nanox.c deleted file mode 100644 index 616410d03b..0000000000 --- a/gdk/nanox/gdkvisual-nanox.c +++ /dev/null @@ -1,95 +0,0 @@ - -#include "gdkvisual.h" -#include "gdkprivate-nanox.h" -#include <glib.h> - -static GdkVisual system_visual; - -void -gdk_visual_init (void) -{ - system_visual.type = GDK_VISUAL_TRUE_COLOR; - system_visual.depth = 24; - system_visual.bits_per_rgb = 8; -} - -GdkVisual* -gdk_visual_ref (GdkVisual *visual) -{ - return visual; -} - -void -gdk_visual_unref (GdkVisual *visual) -{ - return; -} - -gint -gdk_visual_get_best_depth (void) -{ - return 24; -} - -GdkVisualType -gdk_visual_get_best_type (void) -{ - return GDK_VISUAL_TRUE_COLOR; -} - -GdkVisual* -gdk_visual_get_system (void) -{ - return ((GdkVisual*) &system_visual); -} - -GdkVisual* -gdk_visual_get_best (void) -{ - return ((GdkVisual*) &system_visual); -} - -GdkVisual* -gdk_visual_get_best_with_type (GdkVisualType visual_type) -{ - if (visual_type == GDK_VISUAL_TRUE_COLOR) - return &system_visual; - return NULL; -} - -GdkVisual* -gdk_visual_get_best_with_both (gint depth, - GdkVisualType visual_type) -{ - if (visual_type == GDK_VISUAL_TRUE_COLOR && depth == 24) - return &system_visual; - return NULL; -} - -void -gdk_query_depths (gint **depths, - gint *count) -{ - if (count) - *count = 1; - if (depths) - *depths[0] = 24; -} - -void -gdk_query_visual_types (GdkVisualType **visual_types, - gint *count) -{ - if (count) - *count = 1; - if (visual_types) - *visual_types[0] = GDK_VISUAL_TRUE_COLOR; -} - -GList* -gdk_list_visuals (void) -{ - return g_list_append(NULL, &system_visual); -} - - diff --git a/gdk/nanox/gdkwindow-nanox.c b/gdk/nanox/gdkwindow-nanox.c deleted file mode 100644 index c537c8fe95..0000000000 --- a/gdk/nanox/gdkwindow-nanox.c +++ /dev/null @@ -1,600 +0,0 @@ - -#include "gdk.h" -#include "config.h" - -#include "gdkwindow.h" -#include "gdkprivate-nanox.h" -#include "gdkprivate.h" - -static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height); -static int manage_event (GR_EVENT *event); -static void set_title (GR_WINDOW_ID win, char* title); - -typedef struct { - char * name; - void (*create_toplevel) (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height); - int (*manage_event) (GR_EVENT *event); - void (*set_title) (GR_WINDOW_ID win, char* title); -} GdkWindowManager; - -typedef struct { - GR_WINDOW_ID pwin; - GR_WINDOW_ID win; - char *title; - GdkWMFunction functions; - GdkWMDecoration decors; -} WMInfo; - -static GdkWindowManager test_wm = { - "test", - create_toplevel, - manage_event, - set_title -}; - -static GdkWindowManager *default_wm = &test_wm; -static GHashTable * wm_hash = NULL; -GdkDrawableClass _gdk_windowing_window_class; - -static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height) -{ - WMInfo *winfo; - - winfo = g_new0(WMInfo, 1); - winfo->pwin = GrNewWindow(parent, x, y-20, width, height+20, 0, RGB(150, 50,150), WHITE); - winfo->win = win; - GrReparentWindow(winfo->pwin, win, 20, 0); - if (!wm_hash) - wm_hash = g_hash_table_new(g_int_hash, g_int_equal); - g_hash_table_insert(wm_hash, winfo->pwin, winfo); -} - -static int manage_event (GR_EVENT *event) { - return 0; -} - -static void set_title (GR_WINDOW_ID win, char* title) { -} - - -static void -gdk_nanox_window_destroy (GdkDrawable *drawable) -{ - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (GDK_DRAWABLE_TYPE (drawable) == GDK_WINDOW_FOREIGN) - gdk_xid_table_remove (GDK_DRAWABLE_XID (drawable)); - else - g_warning ("losing last reference to undestroyed window\n"); - } - - g_free (GDK_DRAWABLE_XDATA (drawable)); -} - -static GdkWindowPrivate* -gdk_window_nanox_alloc() { - GdkWindow *window; - GdkWindowPrivate *private; - - static GdkDrawableClass klass; - static gboolean initialized = FALSE; - - if (!initialized) - { - initialized = TRUE; - - klass = _gdk_nanox_drawable_class; - klass.destroy = gdk_nanox_window_destroy; - } - - window = _gdk_window_alloc (); - private = (GdkWindowPrivate *)window; - - private->drawable.klass = &klass; - private->drawable.klass_data = g_new (GdkDrawableXData, 1); - - return window; -} - -static void -gdk_window_internal_destroy (GdkWindow *window, - gboolean xdestroy, - gboolean our_destroy) -{ -} - -GR_WINDOW_ID gdk_root_window = GR_ROOT_WINDOW_ID; - -void -gdk_window_init (void) -{ - GdkWindowPrivate *private; - - gdk_parent_root = gdk_window_nanox_alloc (); - private = (GdkWindowPrivate *)gdk_parent_root; - - GDK_DRAWABLE_XDATA (gdk_parent_root)->xid = gdk_root_window; - - private->drawable.window_type = GDK_WINDOW_ROOT; - private->drawable.width = gdk_screen_width(); - private->drawable.height = gdk_screen_height(); - - gdk_window_set_events(private, -1); - gdk_xid_table_insert (&gdk_root_window, gdk_parent_root); -} - - -GdkWindow* -gdk_window_new (GdkWindow *parent, - GdkWindowAttr *attributes, - gint attributes_mask) -{ - GR_WINDOW_ID new_win; - GdkWindowPrivate *private, *parent_private; - int x, y, width, height; - int border = 1; - - if (!parent) - parent = gdk_parent_root; - - if (GDK_DRAWABLE_DESTROYED (parent)) - return NULL; - - private->parent = parent; - - parent_private = (GdkWindowPrivate*)parent; - - if (attributes_mask & GDK_WA_X) - x = attributes->x; - else - x = 0; - - if (attributes_mask & GDK_WA_Y) - y = attributes->y; - else - y = 0; - - width = attributes->width; - height = attributes->height; - - private = gdk_window_nanox_alloc(); - private->x = x; - private->y = y; - private->drawable.width = (attributes->width > 1) ? (attributes->width) : (1); - private->drawable.height = (attributes->height > 1) ? (attributes->height) : (1); - private->drawable.window_type = attributes->window_type; - - if (attributes->window_type == GDK_WINDOW_TOPLEVEL || attributes->window_type == GDK_WINDOW_DIALOG) - border = 2; - /* if toplevel reparent to our own window managed window... (check override_redirect) */ - if (attributes->wclass == GDK_INPUT_OUTPUT) - new_win = GrNewWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height, border, RGB(150,150,150), WHITE); - else - new_win = GrNewInputWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height); - - GDK_DRAWABLE_XDATA(private)->xid = new_win; - gdk_drawable_ref(private); - - private->drawable.colormap = gdk_colormap_get_system (); - - gdk_xid_table_insert (&GDK_DRAWABLE_XID(private), private); - g_message("created window %d %d %d %d %d", new_win, x, y, width, height); - GrSelectEvents(GDK_DRAWABLE_XID(private), -1); - return (GdkWindow*)private;; -} - - -GdkWindow * -gdk_window_foreign_new (guint32 anid) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_window_destroy (GdkWindow *window) -{ - gdk_window_internal_destroy (window, TRUE, TRUE); - gdk_drawable_unref (window); -} - -void -gdk_window_destroy_notify (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_show (GdkWindow *window) -{ - GdkWindowPrivate *private; - - g_return_if_fail (window != NULL); - - private = (GdkWindowPrivate*) window; - if (!private->drawable.destroyed) - { - private->mapped = TRUE; - GrRaiseWindow (GDK_DRAWABLE_XID (window)); - GrMapWindow (GDK_DRAWABLE_XID (window)); - } -} - -void -gdk_window_hide (GdkWindow *window) -{ - GdkWindowPrivate *private; - - g_return_if_fail (window != NULL); - - private = (GdkWindowPrivate*) window; - if (!private->drawable.destroyed) - { - private->mapped = FALSE; - GrUnmapWindow (GDK_DRAWABLE_XID (window)); - } -} - -void -gdk_window_raise (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrRaiseWindow (GDK_DRAWABLE_XID (window)); -} - -void -gdk_window_lower (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrLowerWindow (GDK_DRAWABLE_XID (window)); -} - -void -gdk_window_withdraw (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_move (GdkWindow *window, - gint x, - gint y) -{ - GrMoveWindow(GDK_DRAWABLE_XID(window), x, y); -} - -void -gdk_window_resize (GdkWindow *window, - gint width, - gint height) -{ - GrResizeWindow(GDK_DRAWABLE_XID(window), width, height); -} - -void -gdk_window_move_resize (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - GrMoveWindow(GDK_DRAWABLE_XID(window), x, y); - GrResizeWindow(GDK_DRAWABLE_XID(window), width, height); -} - -void -gdk_window_reparent (GdkWindow *window, - GdkWindow *new_parent, - gint x, - gint y) -{ - GrReparentWindow(GDK_DRAWABLE_XID(window), GDK_DRAWABLE_XID(new_parent), x, y); -} - -void -gdk_window_clear (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 0); -} - -void -_gdk_windowing_window_clear_area (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 0); -} - -void -_gdk_windowing_window_clear_area_e (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 1); -} - -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) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_title (GdkWindow *window, - const gchar *title) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_role (GdkWindow *window, - const gchar *role) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_background (GdkWindow *window, - GdkColor *color) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - g_message("unimplemented %s", __FUNCTION__); - if (GDK_DRAWABLE_DESTROYED (window)) - return; -} - - -void -gdk_window_set_back_pixmap (GdkWindow *window, - GdkPixmap *pixmap, - gboolean parent_relative) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_cursor (GdkWindow *window, - GdkCursor *cursor) -{ -} - -void -gdk_window_get_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *depth) -{ - GR_WINDOW_INFO winfo; - g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); - - if (!window) - window = gdk_parent_root; - - if (!GDK_DRAWABLE_DESTROYED (window)) - { - GrGetWindowInfo(GDK_DRAWABLE_XID(window), &winfo); - if (x) - *x = winfo.x; - if (y) - *y = winfo.y; - if (width) - *width = winfo.width; - if (height) - *height = winfo.height; - if (depth) - *depth = 24; - } -} - - -gint -gdk_window_get_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gboolean -gdk_window_get_deskrelative_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_window_get_root_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -GdkWindow* -gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkWindow* -gdk_window_at_pointer (gint *win_x, - gint *win_y) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GList* -gdk_window_get_children (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkEventMask -gdk_window_get_events (GdkWindow *window) -{ - return -1; -} - - -void -gdk_window_set_events (GdkWindow *window, - GdkEventMask event_mask) -{ - GrSelectEvents(GDK_DRAWABLE_XID(window), -1); -} - - -void -gdk_window_shape_combine_mask (GdkWindow *window, - GdkBitmap *mask, - gint x, gint y) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_override_redirect (GdkWindow *window, - gboolean override_redirect) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_icon (GdkWindow *window, - GdkWindow *icon_window, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_icon_name (GdkWindow *window, - const gchar *name) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_group (GdkWindow *window, - GdkWindow *leader) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_decorations (GdkWindow *window, - GdkWMDecoration decorations) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_functions (GdkWindow *window, - GdkWMFunction functions) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_child_shapes (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_merge_child_shapes (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_window_set_static_gravities (GdkWindow *window, - gboolean use_static) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -_gdk_windowing_window_get_offsets (GdkWindow *window, gint *x_offset, gint *y_offset) { - *x_offset = *y_offset = 0; -} - -gboolean -_gdk_windowing_window_queue_antiexpose (GdkWindow *window, GdkRegion *area) { - return FALSE; -} diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index a5ed72b802..d9767f336f 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -964,7 +964,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, private = GDK_DRAG_CONTEXT_PRIVATE_DATA (context); context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES; context->is_source = FALSE; - context->source_window = gdk_parent_root; + context->source_window = _gdk_parent_root; gdk_drawable_ref (context->source_window); context->dest_window = event->any.window; gdk_drawable_ref (context->dest_window); @@ -1007,7 +1007,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, } g_string_append (result, "\015\012"); } - gdk_sel_prop_store (gdk_parent_root, text_uri_list_atom, 8, + gdk_sel_prop_store (_gdk_parent_root, text_uri_list_atom, 8, result->str, result->len + 1); DragFinish (hdrop); @@ -1023,7 +1023,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, *************************************************************/ void -gdk_dnd_init (void) +_gdk_dnd_init (void) { #ifdef OLE2_DND HRESULT hres; diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 6b95b0a1fb..ccce2174a5 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -180,7 +180,7 @@ real_window_procedure (HWND hwnd, if (event.event.any.type == GDK_CONFIGURE) { /* Compress configure events */ - GList *list = gdk_queued_events; + GList *list = _gdk_queued_events; while (list != NULL && (((GdkEvent *)list->data)->any.type != GDK_CONFIGURE @@ -200,7 +200,7 @@ real_window_procedure (HWND hwnd, else if (event.event.any.type == GDK_EXPOSE) { /* Compress expose events */ - GList *list = gdk_queued_events; + GList *list = _gdk_queued_events; while (list != NULL && (((GdkEvent *)list->data)->any.type != GDK_EXPOSE @@ -224,7 +224,7 @@ real_window_procedure (HWND hwnd, } } #endif - eventp = gdk_event_new (); + eventp = _gdk_event_new (); *((GdkEventPrivate *) eventp) = event; /* Philippe Colantoni <colanton@aris.ss.uci.edu> suggests this @@ -237,14 +237,14 @@ real_window_procedure (HWND hwnd, { GDK_THREADS_ENTER (); - (*gdk_event_func) (eventp, gdk_event_data); + (*_gdk_event_func) (eventp, _gdk_event_data); gdk_event_free (eventp); GDK_THREADS_LEAVE (); } else { - gdk_event_queue_append (eventp); + _gdk_event_queue_append (eventp); #if 1 /* Wake up WaitMessage */ PostMessage (NULL, gdk_ping_msg, 0, 0); @@ -289,7 +289,7 @@ gdk_window_procedure (HWND hwnd, } void -gdk_events_init (void) +_gdk_events_init (void) { GSource *source; HRESULT hres; @@ -380,7 +380,7 @@ gdk_events_pending (void) { MSG msg; - return (gdk_event_queue_find_first() || + return (_gdk_event_queue_find_first() || PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)); } @@ -416,7 +416,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) #else if (PeekMessage (&msg, GDK_WINDOW_HWND (window), WM_PAINT, WM_PAINT, PM_REMOVE)) { - event = gdk_event_new (); + event = _gdk_event_new (); if (gdk_event_translate (event, &msg, NULL, NULL, TRUE)) return event; @@ -1156,7 +1156,7 @@ synthesize_enter_or_leave_event (GdkWindow *window, { GdkEvent *event; - event = gdk_event_new (); + event = _gdk_event_new (); event->crossing.type = type; event->crossing.window = window; event->crossing.send_event = FALSE; @@ -1172,7 +1172,7 @@ synthesize_enter_or_leave_event (GdkWindow *window, event->crossing.focus = TRUE; /* ??? */ event->crossing.state = 0; /* ??? */ - gdk_event_queue_append (event); + _gdk_event_queue_append (event); if (type == GDK_ENTER_NOTIFY && GDK_WINDOW_OBJECT (window)->extension_events != 0) @@ -1380,7 +1380,7 @@ propagate (GdkWindow **window, if ((*doesnt_want_it) (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (*window)->impl)->event_mask, msg)) { /* Owner doesn't want it, propagate to parent. */ - if (GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent) == gdk_parent_root) + if (GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent) == _gdk_parent_root) { /* No parent; check if grabbed */ if (grab_window != NULL) @@ -1648,7 +1648,7 @@ gdk_event_translate (GdkEvent *event, event->selection.window = window; event->selection.selection = msg->wParam; event->selection.target = msg->lParam; - event->selection.property = gdk_selection_property; + event->selection.property = _gdk_selection_property; event->selection.time = msg->time; return_val = !GDK_WINDOW_DESTROYED (window); @@ -1664,7 +1664,7 @@ gdk_event_translate (GdkEvent *event, event->selection.window = window; event->selection.selection = gdk_clipboard_atom; event->selection.target = GDK_TARGET_STRING; - event->selection.property = gdk_selection_property; + event->selection.property = _gdk_selection_property; event->selection.requestor = (guint32) msg->hwnd; event->selection.time = msg->time; @@ -1715,7 +1715,7 @@ gdk_event_translate (GdkEvent *event, } if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) + && _gdk_input_ignore_core) { GDK_NOTE (EVENTS, g_print ("...ignored\n")); goto done; @@ -1739,7 +1739,7 @@ gdk_event_translate (GdkEvent *event, event->scroll.x_root = (gint16) LOWORD (msg->lParam); event->scroll.y_root = (gint16) HIWORD (msg->lParam); event->scroll.state = 0; /* No state information with MSH_MOUSEWHEEL */ - event->scroll.device = gdk_core_pointer; + event->scroll.device = _gdk_core_pointer; return_val = !GDK_WINDOW_DESTROYED (window); goto done; @@ -2163,11 +2163,11 @@ gdk_event_translate (GdkEvent *event, * (from which it will be fetched before the release * event). */ - GdkEvent *event2 = gdk_event_new (); + GdkEvent *event2 = _gdk_event_new (); build_keypress_event (window_impl, event2, msg); event2->key.window = window; gdk_drawable_ref (window); - gdk_event_queue_append (event2); + _gdk_event_queue_append (event2); GDK_NOTE (EVENTS, print_event (event2)); } /* Return the key release event. */ @@ -2207,7 +2207,7 @@ gdk_event_translate (GdkEvent *event, LOWORD (msg->lParam), HIWORD (msg->lParam))); if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) + && _gdk_input_ignore_core) { GDK_NOTE (EVENTS, g_print ("...ignored\n")); break; @@ -2254,9 +2254,9 @@ gdk_event_translate (GdkEvent *event, event->button.axes = NULL; event->button.state = build_pointer_event_state (msg); event->button.button = button; - event->button.device = gdk_core_pointer; + event->button.device = _gdk_core_pointer; - gdk_event_button_generate (event); + _gdk_event_button_generate (event); return_val = !GDK_WINDOW_DESTROYED (window); break; @@ -2280,7 +2280,7 @@ gdk_event_translate (GdkEvent *event, ASSIGN_WINDOW (find_window_for_pointer_event (window, msg)); if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) + && _gdk_input_ignore_core) { GDK_NOTE (EVENTS, g_print ("...ignored\n")); break; @@ -2310,7 +2310,7 @@ gdk_event_translate (GdkEvent *event, event->button.axes = NULL; event->button.state = build_pointer_event_state (msg); event->button.button = button; - event->button.device = gdk_core_pointer; + event->button.device = _gdk_core_pointer; return_val = !GDK_WINDOW_DESTROYED (window); } @@ -2348,7 +2348,7 @@ gdk_event_translate (GdkEvent *event, synthesize_crossing_events (window, msg); if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) + && _gdk_input_ignore_core) { GDK_NOTE (EVENTS, g_print ("...ignored\n")); break; @@ -2374,7 +2374,7 @@ gdk_event_translate (GdkEvent *event, event->motion.axes = NULL; event->motion.state = build_pointer_event_state (msg); event->motion.is_hint = FALSE; - event->motion.device = gdk_core_pointer; + event->motion.device = _gdk_core_pointer; return_val = !GDK_WINDOW_DESTROYED (window); break; @@ -2442,7 +2442,7 @@ gdk_event_translate (GdkEvent *event, } if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) + && _gdk_input_ignore_core) { GDK_NOTE (EVENTS, g_print ("...ignored\n")); break; @@ -2466,7 +2466,7 @@ gdk_event_translate (GdkEvent *event, event->scroll.x_root = (gint16) LOWORD (msg->lParam); event->scroll.y_root = (gint16) HIWORD (msg->lParam); event->scroll.state = build_pointer_event_state (msg); - event->scroll.device = gdk_core_pointer; + event->scroll.device = _gdk_core_pointer; return_val = !GDK_WINDOW_DESTROYED (window); break; @@ -2731,7 +2731,7 @@ gdk_event_translate (GdkEvent *event, return_val = !GDK_WINDOW_DESTROYED (window); if (return_val) { - GList *list = gdk_queued_events; + GList *list = _gdk_queued_events; while (list != NULL ) { if ((((GdkEvent *)list->data)->any.type == GDK_EXPOSE) && @@ -2996,7 +2996,7 @@ gdk_event_translate (GdkEvent *event, GetClipboardFormatName (msg->wParam, buf, sizeof (buf)); event->selection.target = gdk_atom_intern (buf, FALSE); } - event->selection.property = gdk_selection_property; + event->selection.property = _gdk_selection_property; event->selection.requestor = (guint32) msg->hwnd; event->selection.time = msg->time; return_val = !GDK_WINDOW_DESTROYED (window); @@ -3106,13 +3106,13 @@ done: } void -gdk_events_queue (void) +_gdk_events_queue (void) { MSG msg; GdkEvent *event; GList *node; - while (!gdk_event_queue_find_first () + while (!_gdk_event_queue_find_first () && PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { GDK_NOTE (EVENTS, g_print ("PeekMessage: %#lx %s\n", @@ -3125,7 +3125,7 @@ gdk_events_queue (void) #if 1 /* It was like this all the time */ DispatchMessage (&msg); #else /* but this one is more similar to the X implementation. Any effect ? */ - event = gdk_event_new (); + event = _gdk_event_new (); event->any.type = GDK_NOTHING; event->any.window = NULL; @@ -3133,8 +3133,8 @@ gdk_events_queue (void) ((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING; - gdk_event_queue_append (event); - node = gdk_queued_tail; + _gdk_event_queue_append (event); + node = _gdk_queued_tail; if (gdk_event_translate (event, &msg, NULL, NULL, FALSE)) { @@ -3142,7 +3142,7 @@ gdk_events_queue (void) } else { - gdk_event_queue_remove_link (node); + _gdk_event_queue_remove_link (node); g_list_free_1 (node); gdk_event_free (event); DispatchMessage (&msg); @@ -3163,7 +3163,7 @@ gdk_event_prepare (GSource *source, *timeout = -1; - retval = (gdk_event_queue_find_first () != NULL) + retval = (_gdk_event_queue_find_first () != NULL) || PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); GDK_THREADS_LEAVE (); @@ -3180,7 +3180,7 @@ gdk_event_check (GSource *source) GDK_THREADS_ENTER (); if (event_poll_fd.revents & G_IO_IN) - retval = (gdk_event_queue_find_first () != NULL) + retval = (_gdk_event_queue_find_first () != NULL) || PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); else retval = FALSE; @@ -3199,13 +3199,13 @@ gdk_event_dispatch (GSource *source, GDK_THREADS_ENTER (); - gdk_events_queue(); - event = gdk_event_unqueue(); + _gdk_events_queue(); + event = _gdk_event_unqueue(); if (event) { - if (gdk_event_func) - (*gdk_event_func) (event, gdk_event_data); + if (_gdk_event_func) + (*_gdk_event_func) (event, _gdk_event_data); gdk_event_free (event); } diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c index 312809a556..6f7ce1dd7d 100644 --- a/gdk/win32/gdkgc-win32.c +++ b/gdk/win32/gdkgc-win32.c @@ -1128,7 +1128,7 @@ gdk_win32_hdc_get (GdkDrawable *drawable, WIN32_API_FAILED ("OffsetClipRgn"), ok = FALSE; } - if (gdk_debug_flags & GDK_DEBUG_MISC) + if (_gdk_debug_flags & GDK_DEBUG_MISC) { HGDIOBJ obj; LOGBRUSH logbrush; diff --git a/gdk/win32/gdkglobals-win32.c b/gdk/win32/gdkglobals-win32.c index f38a237886..de5ea06c7b 100644 --- a/gdk/win32/gdkglobals-win32.c +++ b/gdk/win32/gdkglobals-win32.c @@ -38,7 +38,6 @@ UINT gdk_selection_clear_msg; GdkAtom gdk_clipboard_atom; GdkAtom gdk_win32_dropfiles_atom; GdkAtom gdk_ole2_dnd_atom; -ATOM gdk_selection_property; -gint gdk_null_window_warnings = TRUE; +ATOM _gdk_selection_property; DWORD windows_version = 0; gint gdk_input_ignore_wintab = FALSE; diff --git a/gdk/win32/gdkimage-win32.c b/gdk/win32/gdkimage-win32.c index b204f850d0..845071ff9e 100644 --- a/gdk/win32/gdkimage-win32.c +++ b/gdk/win32/gdkimage-win32.c @@ -97,7 +97,7 @@ gdk_image_finalize (GObject *object) } void -gdk_image_exit (void) +_gdk_image_exit (void) { GdkImage *image; @@ -655,7 +655,7 @@ gdk_win32_image_destroy (GdkImage *image) private = IMAGE_PRIVATE_DATA (image); - if (private == NULL) /* This means that gdk_image_exit() destroyed the + if (private == NULL) /* This means that _gdk_image_exit() destroyed the * image already, and now we're called a second * time from _finalize() */ diff --git a/gdk/win32/gdkinput-win32.c b/gdk/win32/gdkinput-win32.c index 554365811d..a6eb0fbaf2 100644 --- a/gdk/win32/gdkinput-win32.c +++ b/gdk/win32/gdkinput-win32.c @@ -83,7 +83,7 @@ static GdkDevicePrivate * gdk_input_find_dev_from_ctx (HCTX hctx, UINT cursor) { - GList *tmp_list = gdk_input_devices; + GList *tmp_list = _gdk_input_devices; GdkDevicePrivate *gdkdev; while (tmp_list) @@ -210,7 +210,7 @@ gdk_input_wintab_init (void) int devix, cursorix; char devname[100], csrname[100]; - gdk_input_devices = NULL; + _gdk_input_devices = NULL; wintab_contexts = NULL; if (!gdk_input_ignore_wintab && @@ -246,7 +246,7 @@ gdk_input_wintab_init (void) wa.window_type = GDK_WINDOW_TOPLEVEL; if ((wintab_window = gdk_window_new (NULL, &wa, GDK_WA_X|GDK_WA_Y)) == NULL) { - g_warning ("gdk_input_init: gdk_window_new failed"); + g_warning ("_gdk_input_init: gdk_window_new failed"); return; } gdk_drawable_ref (wintab_window); @@ -330,7 +330,7 @@ gdk_input_wintab_init (void) hctx = g_new (HCTX, 1); if ((*hctx = WTOpen (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) { - g_warning ("gdk_input_init: WTOpen failed"); + g_warning ("_gdk_input_init: WTOpen failed"); return; } GDK_NOTE (MISC, g_print ("opened Wintab device %d %p\n", @@ -468,7 +468,7 @@ gdk_input_wintab_init (void) gdkdev->axes[i].min_value, gdkdev->axes[i].max_value, gdkdev->axes[i].resolution)); - gdk_input_devices = g_list_append (gdk_input_devices, + _gdk_input_devices = g_list_append (_gdk_input_devices, gdkdev); } } @@ -506,7 +506,7 @@ gdk_input_window_find_within (GdkWindow *window) GdkWindow *tmpw; GdkInputWindow *candidate = NULL; - for (list = gdk_input_windows; list != NULL; list = list->next) + for (list = _gdk_input_windows; list != NULL; list = list->next) { tmpw = ((GdkInputWindow *) (tmp_list->data))->window; if (tmpw == window @@ -716,7 +716,7 @@ _gdk_input_other_event (GdkEvent *event, #if USE_SYSCONTEXT window = gdk_window_at_pointer (&x, &y); if (window == NULL) - window = gdk_parent_root; + window = _gdk_parent_root; gdk_drawable_ref (window); @@ -747,7 +747,7 @@ _gdk_input_other_event (GdkEvent *event, switch (msg->message) { case WT_PACKET: - if (window == gdk_parent_root) + if (window == _gdk_parent_root) { GDK_NOTE (EVENTS, g_print ("...is root\n")); return FALSE; @@ -815,7 +815,7 @@ _gdk_input_other_event (GdkEvent *event, { GDK_NOTE (EVENTS, g_print ("...not selected\n")); - if (obj->parent == GDK_WINDOW_OBJECT (gdk_parent_root)) + if (obj->parent == GDK_WINDOW_OBJECT (_gdk_parent_root)) return FALSE; pt.x = x; @@ -925,7 +925,7 @@ _gdk_input_other_event (GdkEvent *event, event2->button.button, event2->button.x, event2->button.y)); - gdk_event_queue_append (event2); + _gdk_event_queue_append (event2); } } return TRUE; @@ -934,12 +934,12 @@ _gdk_input_other_event (GdkEvent *event, if (LOWORD (msg->lParam) == 0) { event->proximity.type = GDK_PROXIMITY_OUT; - gdk_input_ignore_core = FALSE; + _gdk_input_ignore_core = FALSE; } else { event->proximity.type = GDK_PROXIMITY_IN; - gdk_input_ignore_core = TRUE; + _gdk_input_ignore_core = TRUE; } event->proximity.time = msg->time; event->proximity.device = &gdkdev->info; @@ -992,7 +992,7 @@ _gdk_input_grab_pointer (GdkWindow *window, GdkDevicePrivate *gdkdev; GList *tmp_list; - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; new_window = NULL; need_ungrab = FALSE; @@ -1020,7 +1020,7 @@ _gdk_input_grab_pointer (GdkWindow *window, { new_window->grabbed = TRUE; - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -1048,7 +1048,7 @@ _gdk_input_grab_pointer (GdkWindow *window, } else { - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -1080,7 +1080,7 @@ _gdk_input_ungrab_pointer (guint32 time) GDK_NOTE (MISC, g_print ("gdk_input_win32_ungrab_pointer\n")); - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; while (tmp_list) { input_window = (GdkInputWindow *)tmp_list->data; @@ -1093,7 +1093,7 @@ _gdk_input_ungrab_pointer (guint32 time) { input_window->grabbed = FALSE; - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -1192,16 +1192,16 @@ gdk_device_get_state (GdkDevice *device, } void -gdk_input_init (void) +_gdk_input_init (void) { - gdk_input_ignore_core = FALSE; - gdk_input_devices = NULL; + _gdk_input_ignore_core = FALSE; + _gdk_input_devices = NULL; _gdk_init_input_core (); #ifdef HAVE_WINTAB gdk_input_wintab_init (); #endif /* HAVE_WINTAB */ - gdk_input_devices = g_list_append (gdk_input_devices, gdk_core_pointer); + _gdk_input_devices = g_list_append (_gdk_input_devices, _gdk_core_pointer); } diff --git a/gdk/win32/gdkinput-win32.h b/gdk/win32/gdkinput-win32.h index b42273d31a..cea2f1a5b8 100644 --- a/gdk/win32/gdkinput-win32.h +++ b/gdk/win32/gdkinput-win32.h @@ -121,12 +121,12 @@ struct _GdkInputWindow /* Global data */ -#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == gdk_core_pointer) +#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == _gdk_core_pointer) -extern GList *gdk_input_devices; -extern GList *gdk_input_windows; +extern GList *_gdk_input_devices; +extern GList *_gdk_input_windows; -extern gint gdk_input_ignore_core; +extern gint _gdk_input_ignore_core; /* Function declarations */ void _gdk_init_input_core (void); diff --git a/gdk/win32/gdkinput.c b/gdk/win32/gdkinput.c index 7d9567e4b0..110ef5c5f2 100644 --- a/gdk/win32/gdkinput.c +++ b/gdk/win32/gdkinput.c @@ -54,26 +54,26 @@ static GdkDeviceAxis gdk_input_core_axes[] = { /* Global variables */ -GDKVAR GdkDevice *gdk_core_pointer = NULL; +GDKVAR GdkDevice *_gdk_core_pointer = NULL; -gint gdk_input_ignore_core; +gint _gdk_input_ignore_core; -GList *gdk_input_devices; -GList *gdk_input_windows; +GList *_gdk_input_devices; +GList *_gdk_input_windows; void _gdk_init_input_core (void) { - gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); + _gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - gdk_core_pointer->name = "Core Pointer"; - gdk_core_pointer->source = GDK_SOURCE_MOUSE; - gdk_core_pointer->mode = GDK_MODE_SCREEN; - gdk_core_pointer->has_cursor = TRUE; - gdk_core_pointer->num_axes = 2; - gdk_core_pointer->axes = gdk_input_core_axes; - gdk_core_pointer->num_keys = 0; - gdk_core_pointer->keys = NULL; + _gdk_core_pointer->name = "Core Pointer"; + _gdk_core_pointer->source = GDK_SOURCE_MOUSE; + _gdk_core_pointer->mode = GDK_MODE_SCREEN; + _gdk_core_pointer->has_cursor = TRUE; + _gdk_core_pointer->num_axes = 2; + _gdk_core_pointer->axes = gdk_input_core_axes; + _gdk_core_pointer->num_keys = 0; + _gdk_core_pointer->keys = NULL; } static void @@ -119,7 +119,7 @@ gdk_device_get_type (void) GList * gdk_devices_list (void) { - return gdk_input_devices; + return _gdk_input_devices; } void @@ -229,7 +229,7 @@ gdk_input_window_find(GdkWindow *window) { GList *tmp_list; - for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next) + for (tmp_list=_gdk_input_windows; tmp_list; tmp_list=tmp_list->next) if (((GdkInputWindow *)(tmp_list->data))->window == window) return (GdkInputWindow *)(tmp_list->data); @@ -271,11 +271,11 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw->num_obscuring = 0; iw->grabbed = FALSE; - gdk_input_windows = g_list_append(gdk_input_windows,iw); + _gdk_input_windows = g_list_append(_gdk_input_windows,iw); window_private->extension_events = mask; /* Add enter window events to the event mask */ - if (g_list_length (gdk_input_devices) > 1) + if (g_list_length (_gdk_input_devices) > 1) gdk_window_set_events (window, gdk_window_get_events (window) | GDK_ENTER_NOTIFY_MASK); @@ -285,14 +285,14 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw = gdk_input_window_find (window); if (iw) { - gdk_input_windows = g_list_remove(gdk_input_windows,iw); + _gdk_input_windows = g_list_remove(_gdk_input_windows,iw); g_free(iw); } window_private->extension_events = 0; } - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { GdkDevicePrivate *gdkdev = tmp_list->data; @@ -315,17 +315,17 @@ gdk_input_window_destroy (GdkWindow *window) input_window = gdk_input_window_find (window); g_return_if_fail (input_window != NULL); - gdk_input_windows = g_list_remove (gdk_input_windows,input_window); + _gdk_input_windows = g_list_remove (_gdk_input_windows,input_window); g_free(input_window); } void -gdk_input_exit (void) +_gdk_input_exit (void) { GList *tmp_list; GdkDevicePrivate *gdkdev; - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { gdkdev = (GdkDevicePrivate *)(tmp_list->data); if (!GDK_IS_CORE (gdkdev)) @@ -340,12 +340,12 @@ gdk_input_exit (void) } } - g_list_free(gdk_input_devices); + g_list_free(_gdk_input_devices); - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) g_free(tmp_list->data); - g_list_free(gdk_input_windows); + g_list_free(_gdk_input_windows); } gboolean @@ -395,7 +395,7 @@ gdk_device_set_mode (GdkDevice *device, if (mode == GDK_MODE_WINDOW) { device->has_cursor = FALSE; - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) @@ -408,13 +408,13 @@ gdk_device_set_mode (GdkDevice *device, else if (mode == GDK_MODE_SCREEN) { device->has_cursor = TRUE; - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) _gdk_input_enable_window (((GdkInputWindow *)tmp_list->data)->window, gdkdev); } else /* mode == GDK_MODE_DISABLED */ { - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (old_mode != GDK_MODE_WINDOW || diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index 5565719b5c..dcb585686e 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -90,7 +90,7 @@ _gdk_windowing_init_check (int argc, gdk_selection_notify_msg = RegisterWindowMessage ("gdk-selection-notify"); gdk_selection_clear_msg = RegisterWindowMessage ("gdk-selection-clear"); - gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); + _gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); gdk_clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); gdk_win32_dropfiles_atom = gdk_atom_intern ("DROPFILES_DND", FALSE); gdk_ole2_dnd_atom = gdk_atom_intern ("OLE2_DND", FALSE); @@ -162,7 +162,7 @@ gdk_get_use_xshm (void) gint gdk_screen_width (void) { - return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (gdk_parent_root)->impl)->width; + return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_parent_root)->impl)->width; } /* @@ -183,7 +183,7 @@ gdk_screen_width (void) gint gdk_screen_height (void) { - return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (gdk_parent_root)->impl)->height; + return GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_parent_root)->impl)->height; } /* @@ -235,25 +235,13 @@ gdk_set_sm_client_id (const gchar* sm_client_id) } void -gdk_key_repeat_disable (void) -{ - /* XXX */ -} - -void -gdk_key_repeat_restore (void) -{ - /* XXX */ -} - -void gdk_beep (void) { Beep(1000, 50); } void -gdk_windowing_exit (void) +_gdk_windowing_exit (void) { gdk_win32_dnd_exit (); CoUninitialize (); diff --git a/gdk/win32/gdkpixmap-win32.c b/gdk/win32/gdkpixmap-win32.c index 5ea1488940..c6b203b2ec 100644 --- a/gdk/win32/gdkpixmap-win32.c +++ b/gdk/win32/gdkpixmap-win32.c @@ -170,7 +170,7 @@ gdk_pixmap_new (GdkWindow *window, #endif if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (GDK_WINDOW_DESTROYED (window)) return NULL; @@ -330,7 +330,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (GDK_WINDOW_DESTROYED (window)) return NULL; diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 6669d264bd..04e5d57018 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -152,6 +152,8 @@ extern DWORD windows_version; extern gint gdk_input_ignore_wintab; +extern ATOM _gdk_selection_property; + #define IMAGE_PRIVATE_DATA(image) ((GdkImagePrivateWin32 *) GDK_IMAGE (image)->windowing_data) #endif /* __GDK_PRIVATE_WIN32_H__ */ diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index ec1e4090f3..ef912e95d3 100644 --- a/gdk/win32/gdkproperty-win32.c +++ b/gdk/win32/gdkproperty-win32.c @@ -167,7 +167,7 @@ gdk_property_change (GdkWindow *window, g_free (prop_name), g_free (type_name))); - if (property == gdk_selection_property + if (property == _gdk_selection_property && type == GDK_TARGET_STRING && format == 8 && mode == GDK_PROP_MODE_REPLACE) @@ -228,7 +228,7 @@ gdk_property_delete (GdkWindow *window, (guint) property, prop_name), g_free (prop_name))); - if (property == gdk_selection_property) + if (property == _gdk_selection_property) gdk_selection_property_delete (window); else g_warning ("gdk_property_delete: General case not implemented"); @@ -254,4 +254,4 @@ gdk_setting_get (const gchar *name, } else return FALSE; -}
\ No newline at end of file +} diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c index fd85b80322..ad5766c2fd 100644 --- a/gdk/win32/gdkselection-win32.c +++ b/gdk/win32/gdkselection-win32.c @@ -302,12 +302,12 @@ gdk_selection_convert (GdkWindow *requestor, GdkSelProp *prop; prop = g_hash_table_lookup (sel_prop_table, - &GDK_WINDOW_HWND (gdk_parent_root)); + &GDK_WINDOW_HWND (_gdk_parent_root)); if (prop != NULL) { g_hash_table_remove (sel_prop_table, - &GDK_WINDOW_HWND (gdk_parent_root)); + &GDK_WINDOW_HWND (_gdk_parent_root)); gdk_sel_prop_store (requestor, prop->type, prop->format, prop->data, prop->length); g_free (prop); diff --git a/gdk/win32/gdkvisual-win32.c b/gdk/win32/gdkvisual-win32.c index 1e2b82a287..00c816eebe 100644 --- a/gdk/win32/gdkvisual-win32.c +++ b/gdk/win32/gdkvisual-win32.c @@ -84,7 +84,7 @@ gdk_visual_get_type (void) } void -gdk_visual_init (void) +_gdk_visual_init (void) { struct { @@ -207,7 +207,7 @@ gdk_visual_init (void) system_visual->visual.blue_mask = 0x000000FF; } else - g_error ("gdk_visual_init: unsupported BITSPIXEL: %d\n", bitspixel); + g_error ("_gdk_visual_init: unsupported BITSPIXEL: %d\n", bitspixel); system_visual->visual.depth = bitspixel; system_visual->visual.byte_order = GDK_LSB_FIRST; diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h index 2e3f1a0d87..4e1d898f98 100644 --- a/gdk/win32/gdkwin32.h +++ b/gdk/win32/gdkwin32.h @@ -340,7 +340,7 @@ struct _GdkGCWin32Class GType gdk_gc_win32_get_type (void); #define GDK_ROOT_WINDOW() ((guint32) HWND_DESKTOP) -#define GDK_ROOT_PARENT() ((GdkWindow *) gdk_parent_root) +#define GDK_ROOT_PARENT() ((GdkWindow *) _gdk_parent_root) #define GDK_DISPLAY() NULL #define GDK_WINDOW_HWND(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle) #define GDK_PIXMAP_HBITMAP(pixmap) (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)pixmap)->impl)->handle) @@ -350,9 +350,6 @@ GType gdk_gc_win32_get_type (void); #define GDK_COLORMAP_WIN32COLORMAP(cmap) (((GdkColormapPrivateWin32 *)GDK_COLORMAP (cmap)->windowing_data)->xcolormap) #define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate *) vis)->xvisual) -GDKVAR gchar *gdk_progclass; -GDKVAR ATOM gdk_selection_property; - /* Functions to create GDK pixmaps and windows from their native equivalents */ GdkPixmap *gdk_pixmap_foreign_new (GdkNativeWindow anid); GdkWindow *gdk_window_foreign_new (GdkNativeWindow anid); diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 75ce99dc9e..630fa598c5 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -228,14 +228,14 @@ _gdk_windowing_window_init (void) guint width; guint height; - g_assert (gdk_parent_root == NULL); + g_assert (_gdk_parent_root == NULL); SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); width = rect.right - rect.left; height = rect.bottom - rect.top; - gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL); - private = (GdkWindowObject *)gdk_parent_root; + _gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL); + private = (GdkWindowObject *)_gdk_parent_root; impl = GDK_WINDOW_IMPL_WIN32 (private->impl); draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl); @@ -247,7 +247,7 @@ _gdk_windowing_window_init (void) impl->width = width; impl->height = height; - gdk_win32_handle_table_insert (&gdk_root_window, gdk_parent_root); + gdk_win32_handle_table_insert (&gdk_root_window, _gdk_parent_root); } /* The Win API function AdjustWindowRect may return negative values @@ -427,7 +427,7 @@ gdk_window_new (GdkWindow *parent, g_return_val_if_fail (attributes != NULL, NULL); if (!parent) - parent = gdk_parent_root; + parent = _gdk_parent_root; g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL); @@ -560,7 +560,7 @@ gdk_window_new (GdkWindow *parent, case GDK_WINDOW_TEMP: dwStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS; /* a temp window is not necessarily a top level window */ - dwStyle |= (gdk_parent_root == parent ? WS_POPUP : WS_CHILDWINDOW); + dwStyle |= (_gdk_parent_root == parent ? WS_POPUP : WS_CHILDWINDOW); dwExStyle |= WS_EX_TOOLWINDOW; break; @@ -850,7 +850,7 @@ show_window_internal (GdkWindow *window, ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL); ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE); } - if (parent == gdk_parent_root) + if (parent == _gdk_parent_root) SetForegroundWindow (GDK_WINDOW_HWND (window)); if (raise) BringWindowToTop (GDK_WINDOW_HWND (window)); @@ -1080,7 +1080,7 @@ gdk_window_reparent (GdkWindow *window, g_return_if_fail (window != NULL); if (!new_parent) - new_parent = gdk_parent_root; + new_parent = _gdk_parent_root; window_private = (GdkWindowObject*) window; old_parent_private = (GdkWindowObject *) window_private->parent; @@ -1663,7 +1663,7 @@ gdk_window_get_geometry (GdkWindow *window, g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (!GDK_WINDOW_DESTROYED (window)) { @@ -1822,7 +1822,7 @@ _gdk_windowing_window_get_pointer (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; return_val = NULL; GetCursorPos (&pointc); @@ -1886,7 +1886,7 @@ _gdk_windowing_window_at_pointer (gint *win_x, if (hwnd == NULL) { - window = gdk_parent_root; + window = _gdk_parent_root; if (win_x) *win_x = pointc.x; if (win_y) diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am index 703ebee435..1d8d57dd86 100644 --- a/gdk/x11/Makefile.am +++ b/gdk/x11/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in libgdkincludedir = $(includedir)/gtk-2.0/gdk -libgdkx11includedir = $(includedir)/gtk-2.0/gdk/x11 INCLUDES = @STRIP_BEGIN@ \ -DG_LOG_DOMAIN=\"Gdk\" \ + -DINSIDE_GDK_X11 \ -I$(top_srcdir) \ -I$(top_srcdir)/gdk \ -I$(top_builddir)/gdk \ @@ -39,6 +39,7 @@ libgdk_x11_la_SOURCES = \ gdkcursor-x11.c \ gdkdnd-x11.c \ gdkdrawable-x11.c \ + gdkdrawable-x11.h \ gdkevents-x11.c \ gdkfont-x11.c \ gdkgc-x11.c \ @@ -51,10 +52,12 @@ libgdk_x11_la_SOURCES = \ gdkmain-x11.c \ gdkpango-x11.c \ gdkpixmap-x11.c \ + gdkpixmap-x11.h \ gdkproperty-x11.c \ gdkselection-x11.c \ gdkvisual-x11.c \ gdkwindow-x11.c \ + gdkwindow-x11.h \ gdkxid.c \ gxid_lib.c \ gxid_lib.h \ @@ -71,11 +74,6 @@ libgdk_x11_la_SOURCES = \ libgdkinclude_HEADERS = \ gdkx.h -libgdkx11include_HEADERS = \ - gdkdrawable-x11.h \ - gdkwindow-x11.h \ - gdkpixmap-x11.h - EXTRA_PROGRAMS = gxid bin_PROGRAMS = @xinput_progs@ diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c index af6a1172dc..13b99e0ba0 100644 --- a/gdk/x11/gdkcolor-x11.c +++ b/gdk/x11/gdkcolor-x11.c @@ -27,8 +27,22 @@ #include <time.h> #include "gdkcolor.h" +#include "gdkinternals.h" #include "gdkprivate-x11.h" +typedef struct _GdkColormapPrivateX11 GdkColormapPrivateX11; + +struct _GdkColormapPrivateX11 +{ + Colormap xcolormap; + Display *xdisplay; + gint private_val; + + GHashTable *hash; + GdkColorInfo *info; + time_t last_sync_time; +}; + #define GDK_COLORMAP_PRIVATE_DATA(cmap) ((GdkColormapPrivateX11 *) GDK_COLORMAP (cmap)->windowing_data) static gint gdk_colormap_match_color (GdkColormap *cmap, @@ -161,7 +175,7 @@ gdk_colormap_new (GdkVisual *visual, (GEqualFunc) gdk_color_equal); private->private_val = private_cmap; - private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window, + private->xcolormap = XCreateColormap (private->xdisplay, _gdk_root_window, xvisual, (private_cmap) ? (AllocAll) : (AllocNone)); if (private_cmap) @@ -174,7 +188,7 @@ gdk_colormap_new (GdkVisual *visual, default_colors[i].pixel = i; XQueryColors (private->xdisplay, - DefaultColormap (private->xdisplay, gdk_screen), + DefaultColormap (private->xdisplay, _gdk_screen), default_colors, colormap->size); for (i = 0; i < colormap->size; i++) @@ -193,7 +207,7 @@ gdk_colormap_new (GdkVisual *visual, case GDK_VISUAL_DIRECT_COLOR: private->private_val = TRUE; - private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window, + private->xcolormap = XCreateColormap (private->xdisplay, _gdk_root_window, xvisual, AllocAll); colormap->colors = g_new (GdkColor, colormap->size); @@ -215,7 +229,7 @@ gdk_colormap_new (GdkVisual *visual, case GDK_VISUAL_STATIC_GRAY: case GDK_VISUAL_STATIC_COLOR: private->private_val = FALSE; - private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window, + private->xcolormap = XCreateColormap (private->xdisplay, _gdk_root_window, xvisual, AllocNone); colormap->colors = g_new (GdkColor, colormap->size); @@ -224,7 +238,7 @@ gdk_colormap_new (GdkVisual *visual, case GDK_VISUAL_TRUE_COLOR: private->private_val = FALSE; - private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window, + private->xcolormap = XCreateColormap (private->xdisplay, _gdk_root_window, xvisual, AllocNone); break; } @@ -296,7 +310,7 @@ gdk_colormap_get_system (void) private = GDK_COLORMAP_PRIVATE_DATA (colormap); private->xdisplay = gdk_display; - private->xcolormap = DefaultColormap (gdk_display, gdk_screen); + private->xcolormap = DefaultColormap (gdk_display, _gdk_screen); colormap->visual = gdk_visual_get_system (); private->private_val = FALSE; @@ -334,7 +348,7 @@ gdk_colormap_get_system (void) gint gdk_colormap_get_system_size (void) { - return DisplayCells (gdk_display, gdk_screen); + return DisplayCells (gdk_display, _gdk_screen); } void @@ -462,7 +476,7 @@ gdk_color_parse (const gchar *spec, g_return_val_if_fail (spec != NULL, FALSE); g_return_val_if_fail (color != NULL, FALSE); - xcolormap = DefaultColormap (gdk_display, gdk_screen); + xcolormap = DefaultColormap (gdk_display, _gdk_screen); if (XParseColor (gdk_display, xcolormap, spec, &xcolor)) { @@ -986,9 +1000,12 @@ gdk_colormap_query_color (GdkColormap *colormap, { XColor xcolor; GdkVisual *visual; - + GdkColormapPrivateX11 *private; + g_return_if_fail (GDK_IS_COLORMAP (colormap)); + private = GDK_COLORMAP_PRIVATE_DATA (colormap); + visual = gdk_colormap_get_visual (colormap); switch (visual->type) { @@ -1004,7 +1021,7 @@ gdk_colormap_query_color (GdkColormap *colormap, break; case GDK_VISUAL_STATIC_COLOR: xcolor.pixel = pixel; - XQueryColor (GDK_DISPLAY (), GDK_COLORMAP_XCOLORMAP (colormap), &xcolor); + XQueryColor (private->xdisplay, private->xcolormap, &xcolor); result->red = xcolor.red; result->green = xcolor.green; result->blue = xcolor.blue; @@ -1055,7 +1072,7 @@ gdkx_colormap_get (Colormap xcolormap) if (colormap) return colormap; - if (xcolormap == DefaultColormap (gdk_display, gdk_screen)) + if (xcolormap == DefaultColormap (gdk_display, _gdk_screen)) return gdk_colormap_get_system (); colormap = g_object_new (gdk_colormap_get_type (), NULL); @@ -1191,3 +1208,27 @@ gdk_colormap_equal (Colormap *a, { return (*a == *b); } + +Display * +gdk_x11_colormap_get_xdisplay (GdkColormap *colormap) +{ + GdkColormapPrivateX11 *private; + + g_return_val_if_fail (GDK_IS_COLORMAP (colormap), NULL); + + private = GDK_COLORMAP_PRIVATE_DATA (colormap); + + return private->xdisplay; +} + +Colormap +gdk_x11_colormap_get_xcolormap (GdkColormap *colormap) +{ + GdkColormapPrivateX11 *private; + + g_return_val_if_fail (GDK_IS_COLORMAP (colormap), None); + + private = GDK_COLORMAP_PRIVATE_DATA (colormap); + + return private->xcolormap; +} diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 6cd32fb739..82e6dbb46a 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -27,7 +27,7 @@ #include <X11/Xlib.h> #include <X11/cursorfont.h> -#include "gdkx.h" +#include "gdkprivate-x11.h" #include "gdkcursor.h" #include "gdkpixmap-x11.h" #include <gdk/gdkpixmap.h> @@ -105,3 +105,19 @@ _gdk_cursor_destroy (GdkCursor *cursor) g_free (private); } + +Display * +gdk_x11_cursor_get_xdisplay (GdkCursor *cursor) +{ + g_return_val_if_fail (cursor != NULL, NULL); + + return ((GdkCursorPrivate *)cursor)->xdisplay; +} + +Cursor +gdk_x11_cursor_get_xcursor (GdkCursor *cursor) +{ + g_return_val_if_fail (cursor != NULL, None); + + return ((GdkCursorPrivate *)cursor)->xcursor; +} diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index c143ceae10..024651576f 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -84,7 +84,7 @@ struct _GdkDragContextPrivateX11 { #define PRIVATE_DATA(context) ((GdkDragContextPrivateX11 *) GDK_DRAG_CONTEXT (context)->windowing_data) -GdkDragContext *current_dest_drag = NULL; +static GdkDragContext *current_dest_drag = NULL; /* Forward declarations */ @@ -412,24 +412,24 @@ gdk_window_cache_new (void) unsigned int nchildren; int i; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; GdkWindowCache *result = g_new (GdkWindowCache, 1); result->children = NULL; result->child_hash = g_hash_table_new (g_direct_hash, NULL); - XGetWindowAttributes (gdk_display, gdk_root_window, &xwa); + XGetWindowAttributes (gdk_display, _gdk_root_window, &xwa); result->old_event_mask = xwa.your_event_mask; - XSelectInput (gdk_display, gdk_root_window, + XSelectInput (gdk_display, _gdk_root_window, result->old_event_mask | SubstructureNotifyMask); - gdk_window_add_filter (gdk_parent_root, + gdk_window_add_filter (_gdk_parent_root, gdk_window_cache_filter, result); - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; - if (XQueryTree(gdk_display, gdk_root_window, + if (XQueryTree(gdk_display, _gdk_root_window, &root, &parent, &children, &nchildren) == 0) return result; @@ -441,8 +441,8 @@ gdk_window_cache_new (void) xwa.x, xwa.y, xwa.width, xwa.height, xwa.map_state != IsUnmapped); - if (gdk_error_code) - gdk_error_code = 0; + if (_gdk_error_code) + _gdk_error_code = 0; else { gdk_window_cache_add (result, children[i], @@ -453,7 +453,7 @@ gdk_window_cache_new (void) XFree (children); - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; return result; } @@ -461,8 +461,8 @@ gdk_window_cache_new (void) static void gdk_window_cache_destroy (GdkWindowCache *cache) { - XSelectInput (gdk_display, gdk_root_window, cache->old_event_mask); - gdk_window_remove_filter (gdk_parent_root, + XSelectInput (gdk_display, _gdk_root_window, cache->old_event_mask); + gdk_window_remove_filter (_gdk_parent_root, gdk_window_cache_filter, cache); g_list_foreach (cache->children, (GFunc)g_free, NULL); @@ -495,9 +495,9 @@ get_client_window_at_coords_recurse (Window win, wm_state_atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); - if (gdk_error_code) + if (_gdk_error_code) { - gdk_error_code = 0; + _gdk_error_code = 0; return None; } @@ -510,12 +510,12 @@ get_client_window_at_coords_recurse (Window win, #if 0 /* This is beautiful! Damn Enlightenment and click-to-focus */ - XTranslateCoordinates (gdk_display, gdk_root_window, win, + XTranslateCoordinates (gdk_display, _gdk_root_window, win, x_root, y_root, &dest_x, &dest_y, &child); - if (gdk_error_code) + if (_gdk_error_code) { - gdk_error_code = 0; + _gdk_error_code = 0; return None; } @@ -525,7 +525,7 @@ get_client_window_at_coords_recurse (Window win, &root, &tmp_parent, &children, &nchildren) == 0) return 0; - if (!gdk_error_code) + if (!_gdk_error_code) { for (i = nchildren - 1; (i >= 0) && (child == None); i--) { @@ -533,8 +533,8 @@ get_client_window_at_coords_recurse (Window win, XGetWindowAttributes (gdk_display, children[i], &xwa); - if (gdk_error_code) - gdk_error_code = 0; + if (_gdk_error_code) + _gdk_error_code = 0; else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) && (x >= xwa.x) && (x < xwa.x + (gint)xwa.width) && (y >= xwa.y) && (y < xwa.y + (gint)xwa.height)) @@ -548,7 +548,7 @@ get_client_window_at_coords_recurse (Window win, XFree (children); } else - gdk_error_code = 0; + _gdk_error_code = 0; #endif if (child) @@ -566,10 +566,10 @@ get_client_window_at_coords (GdkWindowCache *cache, GList *tmp_list; Window retval = None; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; tmp_list = cache->children; @@ -593,11 +593,11 @@ get_client_window_at_coords (GdkWindowCache *cache, tmp_list = tmp_list->next; } - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; if (retval) return retval; else - return gdk_root_window; + return _gdk_root_window; } #if 0 @@ -622,9 +622,9 @@ get_client_window_at_coords_recurse (Window win, wm_state_atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); - if (gdk_error_code) + if (_gdk_error_code) { - gdk_error_code = 0; + _gdk_error_code = 0; return None; } @@ -635,12 +635,12 @@ get_client_window_at_coords_recurse (Window win, return win; } - XTranslateCoordinates (gdk_display, gdk_root_window, win, + XTranslateCoordinates (gdk_display, _gdk_root_window, win, x_root, y_root, &dest_x, &dest_y, &child); - if (gdk_error_code) + if (_gdk_error_code) { - gdk_error_code = 0; + _gdk_error_code = 0; return None; } @@ -661,12 +661,12 @@ get_client_window_at_coords (Window ignore, int i; Window retval = None; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; - if (XQueryTree(gdk_display, gdk_root_window, + if (XQueryTree(gdk_display, _gdk_root_window, &root, &parent, &children, &nchildren) == 0) return 0; @@ -678,8 +678,8 @@ get_client_window_at_coords (Window ignore, XGetWindowAttributes (gdk_display, children[i], &xwa); - if (gdk_error_code) - gdk_error_code = 0; + if (_gdk_error_code) + _gdk_error_code = 0; else if ((xwa.map_state == IsViewable) && (x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) && (y_root >= xwa.y) && (y_root < xwa.y + (gint)xwa.height)) @@ -694,11 +694,11 @@ get_client_window_at_coords (Window ignore, XFree (children); - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; if (retval) return retval; else - return gdk_root_window; + return _gdk_root_window; } #endif @@ -890,7 +890,7 @@ motif_lookup_drag_window (Display *display) gint format; guchar *data; - XGetWindowProperty (gdk_display, gdk_root_window, motif_drag_window_atom, + XGetWindowProperty (gdk_display, _gdk_root_window, motif_drag_window_atom, 0, 1, FALSE, XA_WINDOW, &type, &format, &nitems, &bytes_after, &data); @@ -927,7 +927,7 @@ motif_find_drag_window (gboolean create) Display *display; XSetWindowAttributes attr; - display = XOpenDisplay (gdk_display_name); + display = XOpenDisplay (_gdk_display_name); XSetCloseDownMode (display, RetainPermanent); XGrabServer (display); @@ -948,7 +948,7 @@ motif_find_drag_window (gboolean create) GDK_NOTE (DND, g_message ("Created drag window %#lx\n", motif_drag_window)); - XChangeProperty (display, gdk_root_window, + XChangeProperty (display, _gdk_root_window, motif_drag_window_atom, XA_WINDOW, 32, PropModeReplace, (guchar *)&motif_drag_window_atom, 1); @@ -1570,7 +1570,7 @@ motif_read_initiator_info (Window source_window, } #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_DND) + if (_gdk_debug_flags & GDK_DEBUG_DND) print_target_list (*targets); #endif /* G_ENABLE_DEBUG */ @@ -2160,7 +2160,7 @@ static gint xdnd_send_xevent (Window window, gboolean propagate, XEvent *event_send) { - if (window == gdk_root_window) + if (window == _gdk_root_window) return gdk_send_xevent (window, propagate, ButtonPressMask, event_send); else return gdk_send_xevent (window, propagate, 0, event_send); @@ -2322,7 +2322,7 @@ xdnd_check_dest (Window win) Window proxy; static GdkAtom xdnd_proxy_atom = GDK_NONE; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; if (!xdnd_proxy_atom) xdnd_proxy_atom = gdk_atom_intern ("XdndProxy", FALSE); @@ -2332,8 +2332,8 @@ xdnd_check_dest (Window win) proxy = GDK_NONE; - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; XGetWindowProperty (gdk_display, win, xdnd_proxy_atom, 0, @@ -2341,7 +2341,7 @@ xdnd_check_dest (Window win) &type, &format, &nitems, &after, (guchar **)&proxy_data); - if (!gdk_error_code) + if (!_gdk_error_code) { if (type != None) { @@ -2362,7 +2362,7 @@ xdnd_check_dest (Window win) &type, &format, &nitems, &after, (guchar **)&version); - if (!gdk_error_code && type != None) + if (!_gdk_error_code && type != None) { if ((format == 32) && (nitems == 1)) { @@ -2378,8 +2378,8 @@ xdnd_check_dest (Window win) } - gdk_error_warnings = old_warnings; - gdk_error_code = 0; + _gdk_error_warnings = old_warnings; + _gdk_error_code = 0; return retval ? (proxy ? proxy : win) : GDK_NONE; } @@ -2396,10 +2396,10 @@ xdnd_read_actions (GdkDragContext *context) gint i; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; - gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_code = 0; + _gdk_error_warnings = 0; /* Get the XdndActionList, if set */ @@ -2409,7 +2409,7 @@ xdnd_read_actions (GdkDragContext *context) False, XA_ATOM, &type, &format, &nitems, &after, (guchar **)&data); - if (!gdk_error_code && (format == 32) && (type == XA_ATOM)) + if (!_gdk_error_code && (format == 32) && (type == XA_ATOM)) { context->actions = 0; @@ -2419,7 +2419,7 @@ xdnd_read_actions (GdkDragContext *context) (PRIVATE_DATA (context))->xdnd_have_actions = TRUE; #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_DND) + if (_gdk_debug_flags & GDK_DEBUG_DND) { GString *action_str = g_string_new (NULL); if (context->actions & GDK_ACTION_MOVE) @@ -2439,8 +2439,8 @@ xdnd_read_actions (GdkDragContext *context) XFree(data); } - gdk_error_warnings = old_warnings; - gdk_error_code = 0; + _gdk_error_warnings = old_warnings; + _gdk_error_code = 0; } /* We have to make sure that the XdndActionList we keep internally @@ -2586,7 +2586,7 @@ xdnd_enter_filter (GdkXEvent *xev, } #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_DND) + if (_gdk_debug_flags & GDK_DEBUG_DND) print_target_list (new_context->targets); #endif /* G_ENABLE_DEBUG */ @@ -2715,7 +2715,7 @@ xdnd_drop_filter (GdkXEvent *xev, *************************************************************/ void -gdk_dnd_init (void) +_gdk_dnd_init (void) { init_byte_order(); @@ -2819,26 +2819,26 @@ gdk_drag_get_protocol (guint32 xid, /* Check if this is a root window */ gboolean rootwin = FALSE; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; Atom type = None; int format; unsigned long nitems, after; unsigned char *data; - if (xid == gdk_root_window) + if (xid == _gdk_root_window) rootwin = TRUE; - gdk_error_warnings = 0; + _gdk_error_warnings = 0; if (!rootwin) { - gdk_error_code = 0; + _gdk_error_code = 0; XGetWindowProperty (gdk_display, xid, gdk_atom_intern ("ENLIGHTENMENT_DESKTOP", FALSE), 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); - if ((gdk_error_code == 0) && type != None) + if ((_gdk_error_code == 0) && type != None) { XFree (data); rootwin = TRUE; @@ -2852,18 +2852,18 @@ gdk_drag_get_protocol (guint32 xid, #if 0 if (!rootwin) { - gdk_error_code = 0; + _gdk_error_code = 0; XGetWindowProperty (gdk_display, win, gdk_atom_intern ("__SWM_VROOT", FALSE), 0, 0, False, AnyPropertyType, &type, &format, &nitems, &data); - if ((gdk_error_code == 0) && type != None) + if ((_gdk_error_code == 0) && type != None) rootwin = TRUE; } #endif - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; if (rootwin) { diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c index 7d563e86e4..f5589dcb0a 100644 --- a/gdk/x11/gdkdrawable-x11.c +++ b/gdk/x11/gdkdrawable-x11.c @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#include "gdkprivate-x11.h" +#include "gdkx.h" #include "gdkregion-generic.h" #include <pango/pangox.h> @@ -136,7 +136,7 @@ static void gdk_drawable_impl_x11_finalize (GObject *object); static gpointer parent_class = NULL; GType -gdk_drawable_impl_x11_get_type (void) +_gdk_drawable_impl_x11_get_type (void) { static GType object_type = 0; @@ -710,3 +710,39 @@ gdk_x11_get_visual (GdkDrawable *drawable) { return gdk_drawable_get_visual (GDK_DRAWABLE_IMPL_X11 (drawable)->wrapper); } + +Display * +gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable) +{ + GdkDrawable *impl; + + if (GDK_IS_WINDOW (drawable)) + impl = ((GdkPixmapObject *)drawable)->impl; + else if (GDK_IS_PIXMAP (drawable)) + impl = ((GdkPixmapObject *)drawable)->impl; + else + { + g_warning (G_STRLOC " drawable is not a pixmap or window"); + return NULL; + } + + return ((GdkDrawableImplX11 *)impl)->xdisplay; +} + +XID +gdk_x11_drawable_get_xid (GdkDrawable *drawable) +{ + GdkDrawable *impl; + + if (GDK_IS_WINDOW (drawable)) + impl = ((GdkPixmapObject *)drawable)->impl; + else if (GDK_IS_PIXMAP (drawable)) + impl = ((GdkPixmapObject *)drawable)->impl; + else + { + g_warning (G_STRLOC " drawable is not a pixmap or window"); + return None; + } + + return ((GdkDrawableImplX11 *)impl)->xid; +} diff --git a/gdk/x11/gdkdrawable-x11.h b/gdk/x11/gdkdrawable-x11.h index 0164654b3b..7d20d50d52 100644 --- a/gdk/x11/gdkdrawable-x11.h +++ b/gdk/x11/gdkdrawable-x11.h @@ -28,6 +28,7 @@ #define __GDK_DRAWABLE_X11_H__ #include <gdk/gdkdrawable.h> +#include <gdk/x11/gdkx.h> #ifdef __cplusplus extern "C" { @@ -39,7 +40,7 @@ extern "C" { typedef struct _GdkDrawableImplX11 GdkDrawableImplX11; typedef struct _GdkDrawableImplX11Class GdkDrawableImplX11Class; -#define GDK_TYPE_DRAWABLE_IMPL_X11 (gdk_drawable_impl_x11_get_type ()) +#define GDK_TYPE_DRAWABLE_IMPL_X11 (_gdk_drawable_impl_x11_get_type ()) #define GDK_DRAWABLE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE_IMPL_X11, GdkDrawableImplX11)) #define GDK_DRAWABLE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE_IMPL_X11, GdkDrawableImplX11Class)) #define GDK_IS_DRAWABLE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE_IMPL_X11)) @@ -64,7 +65,7 @@ struct _GdkDrawableImplX11Class }; -GType gdk_drawable_impl_x11_get_type (void); +GType _gdk_drawable_impl_x11_get_type (void); #ifdef __cplusplus } diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index a757e6bbfc..ca05f1ba96 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -101,9 +101,9 @@ static gboolean gdk_event_dispatch (GSource *source, GSourceFunc callback, gpointer user_data); -GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, - GdkEvent *event, - gpointer data); +static GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, + GdkEvent *event, + gpointer data); static void gdk_xsettings_watch_cb (Window window, Bool is_start, @@ -143,7 +143,7 @@ static XSettingsClient *xsettings_client; *********************************************/ void -gdk_events_init (void) +_gdk_events_init (void) { GSource *source; @@ -162,7 +162,11 @@ gdk_events_init (void) g_source_set_can_recurse (source, TRUE); g_source_attach (source, NULL); - gdk_add_client_message_filter (gdk_wm_protocols, + _gdk_wm_window_protocols[0] = gdk_atom_intern ("WM_DELETE_WINDOW", FALSE); + _gdk_wm_window_protocols[1] = gdk_atom_intern ("WM_TAKE_FOCUS", FALSE); + _gdk_wm_window_protocols[2] = gdk_atom_intern ("_NET_WM_PING", FALSE); + + gdk_add_client_message_filter (gdk_atom_intern ("WM_PROTOCOLS", FALSE), gdk_wm_protocols_filter, NULL); xsettings_client = xsettings_client_new (gdk_display, DefaultScreen (gdk_display), @@ -190,7 +194,7 @@ gdk_events_init (void) gboolean gdk_events_pending (void) { - return (gdk_event_queue_find_first() || XPending (gdk_display)); + return (_gdk_event_queue_find_first() || XPending (gdk_display)); } /* @@ -214,7 +218,7 @@ graphics_expose_predicate (Display *display, XEvent *xevent, XPointer arg) { - if (xevent->xany.window == GDK_DRAWABLE_XID (arg) && + if (xevent->xany.window == GDK_DRAWABLE_XID ((GdkDrawable *)arg) && (xevent->xany.type == GraphicsExpose || xevent->xany.type == NoExpose)) return True; @@ -234,7 +238,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) if (xevent.xany.type == GraphicsExpose) { - event = gdk_event_new (); + event = _gdk_event_new (); if (gdk_event_translate (event, &xevent, TRUE)) return event; @@ -444,12 +448,12 @@ gdk_event_translate (GdkEvent *event, window_private = NULL; event->any.window = NULL; - if (gdk_default_filters) + if (_gdk_default_filters) { /* Apply global filters */ GdkFilterReturn result; result = gdk_event_apply_filters (xevent, event, - gdk_default_filters); + _gdk_default_filters); if (result != GDK_FILTER_CONTINUE) { @@ -600,7 +604,7 @@ gdk_event_translate (GdkEvent *event, buf[charcount] = '\0'; #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_EVENTS) + if (_gdk_debug_flags & GDK_DEBUG_EVENTS) { g_message ("key press:\twindow: %ld key: %12s %d", xevent->xkey.window, @@ -683,7 +687,7 @@ gdk_event_translate (GdkEvent *event, if (window_private == NULL || ((window_private->extension_events != 0) && - gdk_input_ignore_core)) + _gdk_input_ignore_core)) { return_val = FALSE; break; @@ -715,7 +719,7 @@ gdk_event_translate (GdkEvent *event, event->scroll.x_root = (gfloat)xevent->xbutton.x_root; event->scroll.y_root = (gfloat)xevent->xbutton.y_root; event->scroll.state = (GdkModifierType) xevent->xbutton.state; - event->scroll.device = gdk_core_pointer; + event->scroll.device = _gdk_core_pointer; break; default: @@ -729,9 +733,9 @@ gdk_event_translate (GdkEvent *event, event->button.axes = NULL; event->button.state = (GdkModifierType) xevent->xbutton.state; event->button.button = xevent->xbutton.button; - event->button.device = gdk_core_pointer; + event->button.device = _gdk_core_pointer; - gdk_event_button_generate (event); + _gdk_event_button_generate (event); break; } @@ -746,7 +750,7 @@ gdk_event_translate (GdkEvent *event, if (window_private == NULL || ((window_private->extension_events != 0) && - gdk_input_ignore_core)) + _gdk_input_ignore_core)) { return_val = FALSE; break; @@ -770,7 +774,7 @@ gdk_event_translate (GdkEvent *event, event->button.axes = NULL; event->button.state = (GdkModifierType) xevent->xbutton.state; event->button.button = xevent->xbutton.button; - event->button.device = gdk_core_pointer; + event->button.device = _gdk_core_pointer; break; @@ -783,7 +787,7 @@ gdk_event_translate (GdkEvent *event, if (window_private == NULL || ((window_private->extension_events != 0) && - gdk_input_ignore_core)) + _gdk_input_ignore_core)) { return_val = FALSE; break; @@ -799,7 +803,7 @@ gdk_event_translate (GdkEvent *event, event->motion.axes = NULL; event->motion.state = (GdkModifierType) xevent->xmotion.state; event->motion.is_hint = xevent->xmotion.is_hint; - event->motion.device = gdk_core_pointer; + event->motion.device = _gdk_core_pointer; break; @@ -1158,7 +1162,7 @@ gdk_event_translate (GdkEvent *event, case VisibilityNotify: #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_EVENTS) + if (_gdk_debug_flags & GDK_DEBUG_EVENTS) switch (xevent->xvisibility.state) { case VisibilityFullyObscured: @@ -1254,8 +1258,8 @@ gdk_event_translate (GdkEvent *event, 0, GDK_WINDOW_STATE_ICONIFIED); - if (gdk_xgrab_window == window_private) - gdk_xgrab_window = NULL; + if (_gdk_xgrab_window == window_private) + _gdk_xgrab_window = NULL; break; @@ -1330,7 +1334,7 @@ gdk_event_translate (GdkEvent *event, gdk_error_trap_push (); if (XTranslateCoordinates (GDK_DRAWABLE_XDISPLAY (window), GDK_DRAWABLE_XID (window), - gdk_root_window, + _gdk_root_window, 0, 0, &tx, &ty, &child_window)) @@ -1578,14 +1582,14 @@ gdk_event_translate (GdkEvent *event, return return_val; } -GdkFilterReturn +static GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) { XEvent *xevent = (XEvent *)xev; - if ((Atom) xevent->xclient.data.l[0] == gdk_wm_delete_window) + if ((Atom) xevent->xclient.data.l[0] == gdk_atom_intern ("WM_DELETE_WINDOW", FALSE)) { /* The delete window request specifies a window * to delete. We don't actually destroy the @@ -1603,7 +1607,7 @@ gdk_wm_protocols_filter (GdkXEvent *xev, return GDK_FILTER_TRANSLATE; } - else if ((Atom) xevent->xclient.data.l[0] == gdk_wm_take_focus) + else if ((Atom) xevent->xclient.data.l[0] == gdk_atom_intern ("WM_TAKE_FOCUS", FALSE)) { GdkWindow *win = event->any.window; Window focus_win = GDK_WINDOW_IMPL_X11(((GdkWindowObject *)win)->impl)->focus_window; @@ -1623,8 +1627,8 @@ gdk_wm_protocols_filter (GdkXEvent *xev, { XEvent xev = *xevent; - xev.xclient.window = gdk_root_window; - XSendEvent (gdk_display, gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); + xev.xclient.window = _gdk_root_window; + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } return GDK_FILTER_REMOVE; @@ -1650,13 +1654,13 @@ gdk_event_get_type (Display *display, #endif void -gdk_events_queue (void) +_gdk_events_queue (void) { GList *node; GdkEvent *event; XEvent xevent; - while (!gdk_event_queue_find_first() && XPending (gdk_display)) + while (!_gdk_event_queue_find_first() && XPending (gdk_display)) { XNextEvent (gdk_display, &xevent); @@ -1670,7 +1674,7 @@ gdk_events_queue (void) continue; } - event = gdk_event_new (); + event = _gdk_event_new (); event->any.type = GDK_NOTHING; event->any.window = NULL; @@ -1678,8 +1682,8 @@ gdk_events_queue (void) ((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING; - gdk_event_queue_append (event); - node = gdk_queued_tail; + _gdk_event_queue_append (event); + node = _gdk_queued_tail; if (gdk_event_translate (event, &xevent, FALSE)) { @@ -1687,7 +1691,7 @@ gdk_events_queue (void) } else { - gdk_event_queue_remove_link (node); + _gdk_event_queue_remove_link (node); g_list_free_1 (node); gdk_event_free (event); } @@ -1704,7 +1708,7 @@ gdk_event_prepare (GSource *source, *timeout = -1; - retval = (gdk_event_queue_find_first () != NULL) || XPending (gdk_display); + retval = (_gdk_event_queue_find_first () != NULL) || XPending (gdk_display); GDK_THREADS_LEAVE (); @@ -1719,7 +1723,7 @@ gdk_event_check (GSource *source) GDK_THREADS_ENTER (); if (event_poll_fd.revents & G_IO_IN) - retval = (gdk_event_queue_find_first () != NULL) || XPending (gdk_display); + retval = (_gdk_event_queue_find_first () != NULL) || XPending (gdk_display); else retval = FALSE; @@ -1737,13 +1741,13 @@ gdk_event_dispatch (GSource *source, GDK_THREADS_ENTER (); - gdk_events_queue(); - event = gdk_event_unqueue(); + _gdk_events_queue(); + event = _gdk_event_unqueue(); if (event) { - if (gdk_event_func) - (*gdk_event_func) (event, gdk_event_data); + if (_gdk_event_func) + (*_gdk_event_func) (event, _gdk_event_data); gdk_event_free (event); } @@ -1785,7 +1789,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev, unsigned char *data; Window *ret_children, ret_root, ret_parent; unsigned int ret_nchildren; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; gboolean send = FALSE; gboolean found = FALSE; int i; @@ -1793,14 +1797,14 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev, if (!wm_state_atom) wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE); - gdk_error_warnings = FALSE; - gdk_error_code = 0; + _gdk_error_warnings = FALSE; + _gdk_error_code = 0; XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); - if (gdk_error_code) + if (_gdk_error_code) { - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; return FALSE; } @@ -1815,9 +1819,9 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev, /* OK, we're all set, now let's find some windows to send this to */ if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent, &ret_children, &ret_nchildren) != True || - gdk_error_code) + _gdk_error_code) { - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; return FALSE; } @@ -1835,7 +1839,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev, gdk_send_xevent (xid, False, NoEventMask, xev); } - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; return (send || found); } @@ -1844,7 +1848,7 @@ void gdk_event_send_clientmessage_toall (GdkEvent *event) { XEvent sev; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; g_return_if_fail(event != NULL); @@ -1855,9 +1859,9 @@ gdk_event_send_clientmessage_toall (GdkEvent *event) memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data)); sev.xclient.message_type = event->client.message_type; - gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0); + gdk_event_send_client_message_to_all_recurse(&sev, _gdk_root_window, 0); - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; } /* @@ -1990,7 +1994,7 @@ gdk_net_wm_supports (GdkAtom property) if (wmspec_supported_atom == 0) wmspec_supported_atom = gdk_atom_intern ("_NET_SUPPORTED", FALSE); - XGetWindowProperty (gdk_display, gdk_root_window, + XGetWindowProperty (gdk_display, _gdk_root_window, wmspec_check_atom, 0, G_MAXLONG, False, XA_WINDOW, &type, &format, &nitems, &bytes_after, (guchar **)&xwindow); @@ -2012,7 +2016,7 @@ gdk_net_wm_supports (GdkAtom property) return FALSE; } - XGetWindowProperty (gdk_display, gdk_root_window, + XGetWindowProperty (gdk_display, _gdk_root_window, wmspec_supported_atom, 0, G_MAXLONG, False, XA_ATOM, &type, &format, &n_atoms, &bytes_after, (guchar **)&atoms); @@ -2175,7 +2179,7 @@ gdk_setting_get (const gchar *name, return success; } -GdkFilterReturn +static GdkFilterReturn gdk_xsettings_client_event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data) diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c index 1f4b76c1c7..efec6f2c43 100644 --- a/gdk/x11/gdkfont-x11.c +++ b/gdk/x11/gdkfont-x11.c @@ -32,6 +32,19 @@ #include "gdkfont.h" #include "gdkprivate-x11.h" +typedef struct _GdkFontPrivateX GdkFontPrivateX; + +struct _GdkFontPrivateX +{ + GdkFontPrivate base; + /* XFontStruct *xfont; */ + /* generic pointer point to XFontStruct or XFontSet */ + gpointer xfont; + Display *xdisplay; + + GSList *names; +}; + static GHashTable *font_name_hash = NULL; static GHashTable *fontset_name_hash = NULL; @@ -648,3 +661,20 @@ gdk_text_extents_wc (GdkFont *font, } } + +Display * +gdk_x11_font_get_xdisplay (GdkFont *font) +{ + g_return_val_if_fail (font != NULL, NULL); + + return ((GdkFontPrivateX *)font)->xdisplay; +} + +gpointer +gdk_x11_font_get_xfont (GdkFont *font) +{ + g_return_val_if_fail (font != NULL, NULL); + + return ((GdkFontPrivateX *)font)->xfont; +} + diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c index 34f90a0d28..ce3c60490e 100644 --- a/gdk/x11/gdkgc-x11.c +++ b/gdk/x11/gdkgc-x11.c @@ -62,7 +62,7 @@ static void gdk_gc_x11_finalize (GObject *object); static gpointer parent_class = NULL; GType -gdk_gc_x11_get_type (void) +_gdk_gc_x11_get_type (void) { static GType object_type = 0; @@ -139,7 +139,7 @@ _gdk_x11_gc_new (GdkDrawable *drawable, */ g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_X11 (drawable), NULL); - gc = g_object_new (gdk_gc_x11_get_type (), NULL); + gc = g_object_new (_gdk_gc_x11_get_type (), NULL); private = GDK_GC_X11 (gc); private->dirty_mask = 0; @@ -734,3 +734,26 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc) x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask; x11_dst_gc->fg_pixel = x11_src_gc->fg_pixel; } + +Display * +gdk_x11_gc_get_xdisplay (GdkGC *gc) +{ + g_return_val_if_fail (GDK_IS_GC_X11 (gc), NULL); + + return GDK_GC_X11(gc)->xdisplay; +} + +GC +gdk_x11_gc_get_xgc (GdkGC *gc) +{ + GdkGCX11 *gc_x11; + + g_return_val_if_fail (GDK_IS_GC_X11 (gc), NULL); + + gc_x11 = GDK_GC_X11 (gc); + + if (gc_x11->dirty_mask) + _gdk_x11_gc_flush (gc); + + return gc_x11->xgc; +} diff --git a/gdk/x11/gdkglobals-x11.c b/gdk/x11/gdkglobals-x11.c index 104b79f9ef..ffa30896c3 100644 --- a/gdk/x11/gdkglobals-x11.c +++ b/gdk/x11/gdkglobals-x11.c @@ -30,23 +30,15 @@ #include "gdkprivate-x11.h" #include "config.h" -gboolean gdk_use_xshm = TRUE; -gchar *gdk_display_name = NULL; +gboolean _gdk_use_xshm = TRUE; +gchar *_gdk_display_name = NULL; Display *gdk_display = NULL; -gint gdk_screen; -Window gdk_root_window; -Window gdk_leader_window; -Atom gdk_wm_delete_window; -Atom gdk_wm_take_focus; -Atom gdk_wm_protocols; -Atom gdk_wm_window_protocols[3]; -Atom gdk_selection_property; -gchar *gdk_progclass = NULL; -gboolean gdk_null_window_warnings = TRUE; +gint _gdk_screen; +Window _gdk_root_window; +Window _gdk_leader_window; +Atom _gdk_wm_window_protocols[3]; +Atom _gdk_selection_property; -gboolean gdk_xim_using; /* using XIM Protocol if TRUE */ -GdkWindow *gdk_xim_window; /* currently using Widow */ - -GdkWindowObject *gdk_xgrab_window = NULL; /* Window that currently holds the +GdkWindowObject *_gdk_xgrab_window = NULL; /* Window that currently holds the * x pointer grab */ diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c index d957595ce3..21302d7e6f 100644 --- a/gdk/x11/gdkimage-x11.c +++ b/gdk/x11/gdkimage-x11.c @@ -52,6 +52,15 @@ #include "gdkprivate.h" #include "gdkprivate-x11.h" +typedef struct _GdkImagePrivateX11 GdkImagePrivateX11; + +struct _GdkImagePrivateX11 +{ + XImage *ximage; + Display *xdisplay; + gpointer x_shm_info; +}; + static GList *image_list = NULL; static gpointer parent_class = NULL; @@ -118,7 +127,7 @@ gdk_image_finalize (GObject *object) void -gdk_image_exit (void) +_gdk_image_exit (void) { GdkImage *image; @@ -187,11 +196,11 @@ gdk_image_check_xshm(Display *display) void _gdk_windowing_image_init (void) { - if (gdk_use_xshm) + if (_gdk_use_xshm) { if (!gdk_image_check_xshm (gdk_display)) { - gdk_use_xshm = False; + _gdk_use_xshm = False; } } } @@ -237,7 +246,7 @@ gdk_image_new (GdkImageType type, { case GDK_IMAGE_SHARED: #ifdef USE_SHM - if (gdk_use_xshm) + if (_gdk_use_xshm) { private->x_shm_info = g_new (XShmSegmentInfo, 1); x_shm_info = private->x_shm_info; @@ -249,7 +258,7 @@ gdk_image_new (GdkImageType type, if (private->ximage == NULL) { g_warning ("XShmCreateImage failed"); - gdk_use_xshm = FALSE; + _gdk_use_xshm = FALSE; goto error; } @@ -268,7 +277,7 @@ gdk_image_new (GdkImageType type, if (errno != EINVAL) { g_warning ("shmget failed: error %d (%s)", errno, g_strerror (errno)); - gdk_use_xshm = FALSE; + _gdk_use_xshm = FALSE; } goto error; @@ -285,7 +294,7 @@ gdk_image_new (GdkImageType type, * EMFILE, which would mean that we've exceeded the per-process * Shm segment limit. */ - gdk_use_xshm = FALSE; + _gdk_use_xshm = FALSE; goto error; } @@ -297,7 +306,7 @@ gdk_image_new (GdkImageType type, if (gdk_error_trap_pop ()) { /* this is the common failure case so omit warning */ - gdk_use_xshm = FALSE; + _gdk_use_xshm = FALSE; goto error; } @@ -408,7 +417,7 @@ _gdk_x11_get_image (GdkDrawable *drawable, /* Translate screen area into window coordinates */ XTranslateCoordinates (gdk_display, - gdk_root_window, + _gdk_root_window, impl->xid, 0, 0, &screen_rect.x, &screen_rect.y, @@ -599,7 +608,7 @@ gdk_x11_image_destroy (GdkImage *image) private = PRIVATE_DATA (image); - if (private == NULL) /* This means that gdk_image_exit() destroyed the + if (private == NULL) /* This means that _gdk_image_exit() destroyed the * image already, and now we're called a second * time from _finalize() */ @@ -640,3 +649,27 @@ gdk_x11_image_destroy (GdkImage *image) g_free (private); image->windowing_data = NULL; } + +Display * +gdk_x11_image_get_xdisplay (GdkImage *image) +{ + GdkImagePrivateX11 *private; + + g_return_val_if_fail (GDK_IS_IMAGE (image), NULL); + + private = PRIVATE_DATA (image); + + return private->xdisplay; +} + +XImage * +gdk_x11_image_get_ximage (GdkImage *image) +{ + GdkImagePrivateX11 *private; + + g_return_val_if_fail (GDK_IS_IMAGE (image), NULL); + + private = PRIVATE_DATA (image); + + return private->ximage; +} diff --git a/gdk/x11/gdkinput-gxi.c b/gdk/x11/gdkinput-gxi.c index b7469cea01..aecb850bed 100644 --- a/gdk/x11/gdkinput-gxi.c +++ b/gdk/x11/gdkinput-gxi.c @@ -49,30 +49,30 @@ static GdkDevicePrivate *gdk_input_current_device; static GdkDevicePrivate *gdk_input_core_pointer; void -gdk_input_init(void) +_gdk_input_init(void) { GList *tmp_list; _gdk_init_input_core (); - gdk_input_ignore_core = FALSE; + _gdk_input_ignore_core = FALSE; gdk_input_core_pointer = NULL; - if (!gdk_input_gxid_host) + if (!_gdk_input_gxid_host) { - gdk_input_gxid_host = getenv("GXID_HOST"); + _gdk_input_gxid_host = getenv("GXID_HOST"); } - if (!gdk_input_gxid_port) + if (!_gdk_input_gxid_port) { char *t = getenv("GXID_PORT"); if (t) - gdk_input_gxid_port = atoi(t); + _gdk_input_gxid_port = atoi(t); } gdk_input_common_init(TRUE); /* find initial core pointer */ - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)tmp_list->data; if (gdk_input_is_extension_device (gdkdev)) @@ -94,7 +94,7 @@ gdk_input_gxi_select_notify (GdkDevicePrivate *gdkdev) ChangeDeviceNotify (gdkdev->xdevice, gdkdev->changenotify_type, class); - XSelectExtensionEvent (gdk_display, gdk_root_window, &class, 1); + XSelectExtensionEvent (gdk_display, _gdk_root_window, &class, 1); } /* Set the core pointer. Device should already be enabled. */ @@ -167,7 +167,7 @@ gdk_device_set_mode (GdkDevice *device, if (old_mode != GDK_MODE_DISABLED) { - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) @@ -177,7 +177,7 @@ gdk_device_set_mode (GdkDevice *device, if (mode != GDK_MODE_DISABLED) { - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) @@ -320,7 +320,7 @@ gdk_input_gxi_update_device (GdkDevicePrivate *gdkdev) } if (gdkdev->needs_update && gdkdev->xdevice) { - for (t = gdk_input_windows; t; t = t->next) + for (t = _gdk_input_windows; t; t = t->next) gdk_input_common_select_events (((GdkInputWindow *)t->data)->window, gdkdev); gdkdev->needs_update = 0; @@ -365,7 +365,7 @@ _gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) if (!gdkdev->claimed) { - if (gxid_claim_device(gdk_input_gxid_host, gdk_input_gxid_port, + if (gxid_claim_device(_gdk_input_gxid_host, _gdk_input_gxid_port, gdkdev->deviceid, GDK_WINDOW_XWINDOW(window), FALSE) != GXID_RETURN_OK) @@ -394,7 +394,7 @@ _gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) if (gdkdev->claimed) { - gxid_release_device(gdk_input_gxid_host, gdk_input_gxid_port, + gxid_release_device(_gdk_input_gxid_host, _gdk_input_gxid_port, gdkdev->deviceid, GDK_WINDOW_XWINDOW(window)); @@ -529,7 +529,7 @@ _gdk_input_grab_pointer (GdkWindow * window, GdkInputWindow *input_window; GdkDevicePrivate *gdkdev; - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; while (tmp_list) { input_window = (GdkInputWindow *)tmp_list->data; @@ -542,7 +542,7 @@ _gdk_input_grab_pointer (GdkWindow * window, tmp_list = tmp_list->next; } - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -563,7 +563,7 @@ _gdk_input_ungrab_pointer (guint32 time) GdkInputWindow *input_window; GList *tmp_list; - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; while (tmp_list) { input_window = (GdkInputWindow *)tmp_list->data; diff --git a/gdk/x11/gdkinput-none.c b/gdk/x11/gdkinput-none.c index 3295169d5d..616809afc9 100644 --- a/gdk/x11/gdkinput-none.c +++ b/gdk/x11/gdkinput-none.c @@ -27,12 +27,12 @@ */ void -gdk_input_init (void) +_gdk_input_init (void) { _gdk_init_input_core (); - gdk_input_devices = g_list_append (NULL, gdk_core_pointer); + _gdk_input_devices = g_list_append (NULL, _gdk_core_pointer); - gdk_input_ignore_core = FALSE; + _gdk_input_ignore_core = FALSE; } void diff --git a/gdk/x11/gdkinput-x11.c b/gdk/x11/gdkinput-x11.c index dfdae3d949..770c9b874a 100644 --- a/gdk/x11/gdkinput-x11.c +++ b/gdk/x11/gdkinput-x11.c @@ -47,7 +47,7 @@ static guint gdk_input_translate_state(guint state, guint device_state); GdkDevicePrivate * gdk_input_find_device (guint32 id) { - GList *tmp_list = gdk_input_devices; + GList *tmp_list = _gdk_input_devices; GdkDevicePrivate *gdkdev; while (tmp_list) { @@ -386,7 +386,7 @@ gdk_input_common_init(gint include_core) for (loop = 0; loop < num_extensions && (strcmp(extensions[loop], "XInputExtension") != 0); loop++); XFreeExtensionList(extensions); - gdk_input_devices = NULL; + _gdk_input_devices = NULL; if (loop < num_extensions) { /* XInput extension found */ @@ -398,12 +398,12 @@ gdk_input_common_init(gint include_core) GdkDevicePrivate *gdkdev = gdk_input_device_new(&devices[loop], include_core); if (gdkdev) - gdk_input_devices = g_list_append(gdk_input_devices, gdkdev); + _gdk_input_devices = g_list_append(_gdk_input_devices, gdkdev); } XFreeDeviceList(devices); } - gdk_input_devices = g_list_append (gdk_input_devices, gdk_core_pointer); + _gdk_input_devices = g_list_append (_gdk_input_devices, _gdk_core_pointer); return TRUE; } diff --git a/gdk/x11/gdkinput-xfree.c b/gdk/x11/gdkinput-xfree.c index e2260934e9..fe7cafdebc 100644 --- a/gdk/x11/gdkinput-xfree.c +++ b/gdk/x11/gdkinput-xfree.c @@ -31,10 +31,10 @@ static void gdk_input_check_proximity (void); void -gdk_input_init(void) +_gdk_input_init(void) { _gdk_init_input_core (); - gdk_input_ignore_core = FALSE; + _gdk_input_ignore_core = FALSE; gdk_input_common_init(FALSE); } @@ -61,7 +61,7 @@ gdk_device_set_mode (GdkDevice *device, if (mode == GDK_MODE_WINDOW) { device->has_cursor = FALSE; - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) @@ -74,13 +74,13 @@ gdk_device_set_mode (GdkDevice *device, else if (mode == GDK_MODE_SCREEN) { device->has_cursor = TRUE; - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) _gdk_input_enable_window (((GdkInputWindow *)tmp_list->data)->window, gdkdev); } else /* mode == GDK_MODE_DISABLED */ { - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) { input_window = (GdkInputWindow *)tmp_list->data; if (old_mode != GDK_MODE_WINDOW || @@ -97,7 +97,7 @@ static void gdk_input_check_proximity (void) { gint new_proximity = 0; - GList *tmp_list = gdk_input_devices; + GList *tmp_list = _gdk_input_devices; while (tmp_list && !new_proximity) { @@ -132,7 +132,7 @@ gdk_input_check_proximity (void) tmp_list = tmp_list->next; } - gdk_input_ignore_core = new_proximity; + _gdk_input_ignore_core = new_proximity; } void @@ -202,14 +202,14 @@ _gdk_input_other_event (GdkEvent *event, && input_window->mode == GDK_EXTENSION_EVENTS_CURSOR)) return FALSE; - if (!gdk_input_ignore_core) + if (!_gdk_input_ignore_core) gdk_input_check_proximity(); return_val = gdk_input_common_other_event (event, xevent, input_window, gdkdev); if (return_val > 0 && event->type == GDK_PROXIMITY_OUT && - gdk_input_ignore_core) + _gdk_input_ignore_core) gdk_input_check_proximity(); return return_val; @@ -245,7 +245,7 @@ _gdk_input_grab_pointer (GdkWindow * window, gint num_classes; gint result; - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; new_window = NULL; need_ungrab = FALSE; @@ -268,7 +268,7 @@ _gdk_input_grab_pointer (GdkWindow * window, { new_window->grabbed = TRUE; - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -293,7 +293,7 @@ _gdk_input_grab_pointer (GdkWindow * window, } else { - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; @@ -319,7 +319,7 @@ _gdk_input_ungrab_pointer (guint32 time) GdkDevicePrivate *gdkdev; GList *tmp_list; - tmp_list = gdk_input_windows; + tmp_list = _gdk_input_windows; while (tmp_list) { input_window = (GdkInputWindow *)tmp_list->data; @@ -332,7 +332,7 @@ _gdk_input_ungrab_pointer (guint32 time) { input_window->grabbed = FALSE; - tmp_list = gdk_input_devices; + tmp_list = _gdk_input_devices; while (tmp_list) { gdkdev = (GdkDevicePrivate *)tmp_list->data; diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c index 7e952c4492..4f16a4f62a 100644 --- a/gdk/x11/gdkinput.c +++ b/gdk/x11/gdkinput.c @@ -39,31 +39,31 @@ static GdkDeviceAxis gdk_input_core_axes[] = { { GDK_AXIS_Y, 0, 0 } }; -GdkDevice *gdk_core_pointer = NULL; +GdkDevice *_gdk_core_pointer = NULL; /* Global variables */ /* information about network port and host for gxid daemon */ -gchar *gdk_input_gxid_host; -gint gdk_input_gxid_port; -gint gdk_input_ignore_core; +gchar *_gdk_input_gxid_host; +gint _gdk_input_gxid_port; +gint _gdk_input_ignore_core; -GList *gdk_input_devices; -GList *gdk_input_windows; +GList *_gdk_input_devices; +GList *_gdk_input_windows; void _gdk_init_input_core (void) { - gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); + _gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - gdk_core_pointer->name = "Core Pointer"; - gdk_core_pointer->source = GDK_SOURCE_MOUSE; - gdk_core_pointer->mode = GDK_MODE_SCREEN; - gdk_core_pointer->has_cursor = TRUE; - gdk_core_pointer->num_axes = 2; - gdk_core_pointer->axes = gdk_input_core_axes; - gdk_core_pointer->num_keys = 0; - gdk_core_pointer->keys = NULL; + _gdk_core_pointer->name = "Core Pointer"; + _gdk_core_pointer->source = GDK_SOURCE_MOUSE; + _gdk_core_pointer->mode = GDK_MODE_SCREEN; + _gdk_core_pointer->has_cursor = TRUE; + _gdk_core_pointer->num_axes = 2; + _gdk_core_pointer->axes = gdk_input_core_axes; + _gdk_core_pointer->num_keys = 0; + _gdk_core_pointer->keys = NULL; } GType @@ -97,7 +97,7 @@ gdk_device_get_type (void) GList * gdk_devices_list (void) { - return gdk_input_devices; + return _gdk_input_devices; } void @@ -233,7 +233,7 @@ gdk_input_window_find(GdkWindow *window) { GList *tmp_list; - for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next) + for (tmp_list=_gdk_input_windows; tmp_list; tmp_list=tmp_list->next) if (((GdkInputWindow *)(tmp_list->data))->window == window) return (GdkInputWindow *)(tmp_list->data); @@ -275,7 +275,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw->num_obscuring = 0; iw->grabbed = FALSE; - gdk_input_windows = g_list_append(gdk_input_windows,iw); + _gdk_input_windows = g_list_append(_gdk_input_windows,iw); window_private->extension_events = mask; /* Add enter window events to the event mask */ @@ -289,14 +289,14 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw = gdk_input_window_find (window); if (iw) { - gdk_input_windows = g_list_remove(gdk_input_windows,iw); + _gdk_input_windows = g_list_remove(_gdk_input_windows,iw); g_free(iw); } window_private->extension_events = 0; } - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { GdkDevicePrivate *gdkdev = tmp_list->data; @@ -319,17 +319,17 @@ gdk_input_window_destroy (GdkWindow *window) input_window = gdk_input_window_find (window); g_return_if_fail (input_window != NULL); - gdk_input_windows = g_list_remove (gdk_input_windows,input_window); + _gdk_input_windows = g_list_remove (_gdk_input_windows,input_window); g_free(input_window); } void -gdk_input_exit (void) +_gdk_input_exit (void) { GList *tmp_list; GdkDevicePrivate *gdkdev; - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { gdkdev = (GdkDevicePrivate *)(tmp_list->data); if (!GDK_IS_CORE (gdkdev)) @@ -346,12 +346,12 @@ gdk_input_exit (void) } } - g_list_free(gdk_input_devices); + g_list_free(_gdk_input_devices); - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) g_free(tmp_list->data); - g_list_free(gdk_input_windows); + g_list_free(_gdk_input_windows); } /** diff --git a/gdk/x11/gdkinputprivate.h b/gdk/x11/gdkinputprivate.h index acfb26d23d..cb19db41e1 100644 --- a/gdk/x11/gdkinputprivate.h +++ b/gdk/x11/gdkinputprivate.h @@ -124,15 +124,15 @@ struct _GdkInputWindow /* Global data */ -#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == gdk_core_pointer) +#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == _gdk_core_pointer) -extern GList *gdk_input_devices; -extern GList *gdk_input_windows; +extern GList *_gdk_input_devices; +extern GList *_gdk_input_windows; /* information about network port and host for gxid daemon */ -extern gchar *gdk_input_gxid_host; -extern gint gdk_input_gxid_port; -extern gint gdk_input_ignore_core; +extern gchar *_gdk_input_gxid_host; +extern gint _gdk_input_gxid_port; +extern gint _gdk_input_ignore_core; /* Function declarations */ diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c index 63fa3cfb31..620d417525 100644 --- a/gdk/x11/gdkkeys-x11.c +++ b/gdk/x11/gdkkeys-x11.c @@ -194,7 +194,7 @@ get_keymap (void) } #if HAVE_XKB -PangoDirection +static PangoDirection get_direction (void) { XkbDescRec *xkb = get_xkb (); diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 677a0214ac..0f6476fe44 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -103,12 +103,11 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey); #endif /* G_ENABLE_DEBUG */ GdkArgDesc _gdk_windowing_args[] = { - { "display", GDK_ARG_STRING, &gdk_display_name, (GdkArgFunc)NULL }, + { "display", GDK_ARG_STRING, &_gdk_display_name, (GdkArgFunc)NULL }, { "sync", GDK_ARG_BOOL, &gdk_synchronize, (GdkArgFunc)NULL }, - { "no-xshm", GDK_ARG_NOBOOL, &gdk_use_xshm, (GdkArgFunc)NULL }, - { "class", GDK_ARG_STRING, &gdk_progclass, (GdkArgFunc)NULL }, - { "gxid-host", GDK_ARG_STRING, &gdk_input_gxid_host, (GdkArgFunc)NULL }, - { "gxid-port", GDK_ARG_INT, &gdk_input_gxid_port, (GdkArgFunc)NULL }, + { "no-xshm", GDK_ARG_NOBOOL, &_gdk_use_xshm, (GdkArgFunc)NULL }, + { "gxid-host", GDK_ARG_STRING, &_gdk_input_gxid_host, (GdkArgFunc)NULL }, + { "gxid-port", GDK_ARG_INT, &_gdk_input_gxid_port, (GdkArgFunc)NULL }, { NULL } }; @@ -122,46 +121,35 @@ _gdk_windowing_init_check (int argc, char **argv) XSetErrorHandler (gdk_x_error); XSetIOErrorHandler (gdk_x_io_error); - gdk_display = XOpenDisplay (gdk_display_name); + gdk_display = XOpenDisplay (_gdk_display_name); if (!gdk_display) return FALSE; if (gdk_synchronize) XSynchronize (gdk_display, True); - gdk_screen = DefaultScreen (gdk_display); - gdk_root_window = RootWindow (gdk_display, gdk_screen); + _gdk_screen = DefaultScreen (gdk_display); + _gdk_root_window = RootWindow (gdk_display, _gdk_screen); - gdk_leader_window = XCreateSimpleWindow(gdk_display, gdk_root_window, + _gdk_leader_window = XCreateSimpleWindow(gdk_display, _gdk_root_window, 10, 10, 10, 10, 0, 0 , 0); class_hint = XAllocClassHint(); class_hint->res_name = g_get_prgname (); - if (gdk_progclass == NULL) - { - gdk_progclass = g_strdup (g_get_prgname ()); - gdk_progclass[0] = toupper (gdk_progclass[0]); - } - class_hint->res_class = gdk_progclass; - XmbSetWMProperties (gdk_display, gdk_leader_window, + class_hint->res_class = gdk_get_program_class (); + XmbSetWMProperties (gdk_display, _gdk_leader_window, NULL, NULL, argv, argc, NULL, NULL, class_hint); XFree (class_hint); pid = getpid(); - XChangeProperty (gdk_display, gdk_leader_window, + XChangeProperty (gdk_display, _gdk_leader_window, gdk_atom_intern ("_NET_WM_PID", FALSE), XA_CARDINAL, 32, PropModeReplace, (guchar *)&pid, 1); - gdk_wm_delete_window = gdk_atom_intern ("WM_DELETE_WINDOW", FALSE); - gdk_wm_take_focus = gdk_atom_intern ("WM_TAKE_FOCUS", FALSE); - gdk_wm_protocols = gdk_atom_intern ("WM_PROTOCOLS", FALSE); - gdk_wm_window_protocols[0] = gdk_wm_delete_window; - gdk_wm_window_protocols[1] = gdk_wm_take_focus; - gdk_wm_window_protocols[2] = gdk_atom_intern ("_NET_WM_PING", FALSE); - gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); - + _gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE); + XGetKeyboardControl (gdk_display, &keyboard_state); autorepeat = keyboard_state.global_auto_repeat; @@ -205,13 +193,13 @@ _gdk_windowing_init_check (int argc, char **argv) void gdk_set_use_xshm (gboolean use_xshm) { - gdk_use_xshm = use_xshm; + _gdk_use_xshm = use_xshm; } gboolean gdk_get_use_xshm (void) { - return gdk_use_xshm; + return _gdk_use_xshm; } static GdkGrabStatus @@ -295,10 +283,10 @@ gdk_pointer_grab (GdkWindow * window, xevent_mask = 0; - for (i = 0; i < gdk_nevent_masks; i++) + for (i = 0; i < _gdk_nenvent_masks; i++) { if (event_mask & (1 << (i + 1))) - xevent_mask |= gdk_event_mask_table[i]; + xevent_mask |= _gdk_event_mask_table[i]; } return_val = _gdk_input_grab_pointer (window, @@ -323,7 +311,7 @@ gdk_pointer_grab (GdkWindow * window, } if (return_val == GrabSuccess) - gdk_xgrab_window = (GdkWindowObject *)window; + _gdk_xgrab_window = (GdkWindowObject *)window; return gdk_x11_convert_grab_status (return_val); } @@ -349,7 +337,7 @@ gdk_pointer_ungrab (guint32 time) _gdk_input_ungrab_pointer (time); XUngrabPointer (gdk_display, time); - gdk_xgrab_window = NULL; + _gdk_xgrab_window = NULL; } /* @@ -370,7 +358,7 @@ gdk_pointer_ungrab (guint32 time) gboolean gdk_pointer_is_grabbed (void) { - return gdk_xgrab_window != NULL; + return _gdk_xgrab_window != NULL; } /* @@ -456,7 +444,7 @@ gdk_screen_width (void) { gint return_val; - return_val = DisplayWidth (gdk_display, gdk_screen); + return_val = DisplayWidth (gdk_display, _gdk_screen); return return_val; } @@ -481,7 +469,7 @@ gdk_screen_height (void) { gint return_val; - return_val = DisplayHeight (gdk_display, gdk_screen); + return_val = DisplayHeight (gdk_display, _gdk_screen); return return_val; } @@ -506,7 +494,7 @@ gdk_screen_width_mm (void) { gint return_val; - return_val = DisplayWidthMM (gdk_display, gdk_screen); + return_val = DisplayWidthMM (gdk_display, _gdk_screen); return return_val; } @@ -531,7 +519,7 @@ gdk_screen_height_mm (void) { gint return_val; - return_val = DisplayHeightMM (gdk_display, gdk_screen); + return_val = DisplayHeightMM (gdk_display, _gdk_screen); return return_val; } @@ -563,13 +551,13 @@ gdk_set_sm_client_id (const gchar* sm_client_id) { if (sm_client_id && strcmp (sm_client_id, "")) { - XChangeProperty (gdk_display, gdk_leader_window, + XChangeProperty (gdk_display, _gdk_leader_window, gdk_atom_intern ("SM_CLIENT_ID", FALSE), XA_STRING, 8, PropModeReplace, sm_client_id, strlen(sm_client_id)); } else - XDeleteProperty (gdk_display, gdk_leader_window, + XDeleteProperty (gdk_display, _gdk_leader_window, gdk_atom_intern ("SM_CLIENT_ID", FALSE)); } @@ -580,7 +568,7 @@ gdk_beep (void) } void -gdk_windowing_exit (void) +_gdk_windowing_exit (void) { pango_x_shutdown_display (gdk_display); @@ -599,7 +587,7 @@ gdk_windowing_exit (void) * * Results: * Either we were expecting some sort of error to occur, - * in which case we set the "gdk_error_code" flag, or this + * in which case we set the "_gdk_error_code" flag, or this * error was unexpected, in which case we will print an * error message and exit. (Since trying to continue will * most likely simply lead to more errors). @@ -615,7 +603,7 @@ gdk_x_error (Display *display, { if (error->error_code) { - if (gdk_error_warnings) + if (_gdk_error_warnings) { gchar buf[64]; gchar *msg; @@ -647,7 +635,7 @@ gdk_x_error (Display *display, exit(1); #endif /* G_ENABLE_DEBUG */ } - gdk_error_code = error->error_code; + _gdk_error_code = error->error_code; } return 0; @@ -707,7 +695,7 @@ gdk_x_io_error (Display *display) gchar * gdk_get_display (void) { - return (gchar *)XDisplayName (gdk_display_name); + return (gchar *)XDisplayName (_gdk_display_name); } gint @@ -715,16 +703,16 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask, XEvent *event_send) { Status result; - gint old_warnings = gdk_error_warnings; + gint old_warnings = _gdk_error_warnings; - gdk_error_code = 0; + _gdk_error_code = 0; - gdk_error_warnings = 0; + _gdk_error_warnings = 0; result = XSendEvent (gdk_display, window, propagate, event_mask, event_send); XSync (gdk_display, False); - gdk_error_warnings = old_warnings; + _gdk_error_warnings = old_warnings; - return result && !gdk_error_code; + return result && !_gdk_error_code; } void @@ -769,3 +757,30 @@ gdk_x11_ungrab_server (void) if (grab_count == 0) XUngrabServer (gdk_display); } + +/** + * gdk_x11_get_default_screen: + * + * Gets the default GTK+ screen number. + * + * Return value: returns the screen number specified by + * the --display command line option on the DISPLAY environment + * variable gdk_init() calls XOpenDisplay(). + **/ +gint +gdk_x11_get_default_screen (void) +{ + return _gdk_screen; +} + +Window +gdk_x11_get_default_root_xwindow (void) +{ + return _gdk_root_window; +} + +Display * +gdk_x11_get_default_xdisplay (void) +{ + return gdk_display; +} diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index fe0b421a0c..3c69ed7aa2 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -32,7 +32,8 @@ #include <unistd.h> #include <X11/Xlib.h> -#include <gdk/gdkpixmap.h> +#include "gdkx.h" + #include "gdkpixmap-x11.h" #include "gdkprivate-x11.h" @@ -60,7 +61,7 @@ static void gdk_pixmap_impl_x11_finalize (GObject *object); static gpointer parent_class = NULL; -GType +static GType gdk_pixmap_impl_x11_get_type (void) { static GType object_type = 0; @@ -157,7 +158,7 @@ gdk_pixmap_new (GdkWindow *window, g_return_val_if_fail ((width != 0) && (height != 0), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (GDK_WINDOW_DESTROYED (window)) return NULL; @@ -188,7 +189,7 @@ gdk_pixmap_new (GdkWindow *window, gdk_drawable_set_colormap (pixmap, cmap); } - gdk_xid_table_insert (&GDK_PIXMAP_XID (pixmap), pixmap); + gdk_xid_table_insert (&draw_impl->xid, pixmap); return pixmap; } @@ -208,7 +209,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (GDK_WINDOW_DESTROYED (window)) return NULL; @@ -228,7 +229,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, GDK_WINDOW_XID (window), (char *)data, width, height); - gdk_xid_table_insert (&GDK_PIXMAP_XID (pixmap), pixmap); + gdk_xid_table_insert (&draw_impl->xid, pixmap); return pixmap; } @@ -254,7 +255,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, g_return_val_if_fail ((width != 0) && (height != 0), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (GDK_WINDOW_DESTROYED (window)) return NULL; @@ -278,7 +279,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, (char *)data, width, height, fg->pixel, bg->pixel, depth); - gdk_xid_table_insert (&GDK_PIXMAP_XID (pixmap), pixmap); + gdk_xid_table_insert (&draw_impl->xid, pixmap); return pixmap; } @@ -321,7 +322,7 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid) pix_impl->height = h_ret; GDK_PIXMAP_OBJECT (pixmap)->depth = depth_ret; - gdk_xid_table_insert(&GDK_PIXMAP_XID (pixmap), pixmap); + gdk_xid_table_insert(&draw_impl->xid, pixmap); return pixmap; } diff --git a/gdk/x11/gdkpixmap-x11.h b/gdk/x11/gdkpixmap-x11.h index 7fc626ab90..9dc6727ffb 100644 --- a/gdk/x11/gdkpixmap-x11.h +++ b/gdk/x11/gdkpixmap-x11.h @@ -63,8 +63,6 @@ struct _GdkPixmapImplX11Class }; -GType gdk_pixmap_impl_x11_get_type (void); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index 3dad11d434..bc8564825c 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -32,10 +32,59 @@ #define __GDK_PRIVATE_X11_H__ #include <gdk/gdkprivate.h> -#include "gdkx.h" +#include <gdk/x11/gdkwindow-x11.h> +#include <gdk/x11/gdkpixmap-x11.h> + +#include "gdkinternals.h" #include <config.h> +#define GDK_TYPE_GC_X11 (_gdk_gc_x11_get_type ()) +#define GDK_GC_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_X11, GdkGCX11)) +#define GDK_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_X11, GdkGCX11Class)) +#define GDK_IS_GC_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_X11)) +#define GDK_IS_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_X11)) +#define GDK_GC_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_X11, GdkGCX11Class)) + +typedef struct _GdkCursorPrivate GdkCursorPrivate; +typedef struct _GdkVisualPrivate GdkVisualPrivate; +typedef struct _GdkGCX11 GdkGCX11; +typedef struct _GdkGCX11Class GdkGCX11Class; + +struct _GdkGCX11 +{ + GdkGC parent_instance; + + GC xgc; + Display *xdisplay; + GdkRegion *clip_region; + guint dirty_mask; + + /* We can't conditionalize on HAVE_XFT here, so we simply always + * have this here as a gpointer. + */ + gpointer xft_draw; + gulong fg_pixel; +}; + +struct _GdkGCX11Class +{ + GdkGCClass parent_class; +}; + +struct _GdkCursorPrivate +{ + GdkCursor cursor; + Cursor xcursor; + Display *xdisplay; +}; + +struct _GdkVisualPrivate +{ + GdkVisual visual; + Visual *xvisual; +}; + void gdk_xid_table_insert (XID *xid, gpointer data); void gdk_xid_table_remove (XID xid); @@ -44,6 +93,8 @@ gint gdk_send_xevent (Window window, glong event_mask, XEvent *event_send); +GType _gdk_gc_x11_get_type (void); + GdkGC *_gdk_x11_gc_new (GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask); @@ -97,17 +148,21 @@ void _gdk_moveresize_configure_done (void); void _gdk_keymap_state_changed (void); +GC _gdk_x11_gc_flush (GdkGC *gc); + extern GdkDrawableClass _gdk_x11_drawable_class; -extern gboolean gdk_use_xshm; -extern Atom gdk_wm_delete_window; -extern Atom gdk_wm_take_focus; -extern Atom gdk_wm_protocols; -extern Atom gdk_wm_window_protocols[]; -extern gboolean gdk_null_window_warnings; -extern const int gdk_nevent_masks; -extern const int gdk_event_mask_table[]; - -extern GdkWindowObject *gdk_xgrab_window; /* Window that currently holds the +extern Window _gdk_root_window; +extern gboolean _gdk_use_xshm; +extern Atom _gdk_wm_window_protocols[]; +extern const int _gdk_nenvent_masks; +extern const int _gdk_event_mask_table[]; +extern gint _gdk_screen; +extern Atom _gdk_selection_property; +extern gchar *_gdk_display_name; + +extern Window _gdk_leader_window; + +extern GdkWindowObject *_gdk_xgrab_window; /* Window that currently holds the * x pointer grab */ diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index 3929729892..08c055dd29 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -68,13 +68,13 @@ gdk_atom_name (GdkAtom atom) /* If this atom doesn't exist, we'll die with an X error unless we take precautions */ - old_error_warnings = gdk_error_warnings; - gdk_error_warnings = 0; - gdk_error_code = 0; + old_error_warnings = _gdk_error_warnings; + _gdk_error_warnings = 0; + _gdk_error_code = 0; t = XGetAtomName (gdk_display, atom); - gdk_error_warnings = old_error_warnings; + _gdk_error_warnings = old_error_warnings; - if (gdk_error_code) + if (_gdk_error_code) { if (t) XFree (t); @@ -125,7 +125,7 @@ gdk_property_get (GdkWindow *window, else { xdisplay = gdk_display; - xwindow = gdk_root_window; + xwindow = _gdk_root_window; } ret_data = NULL; @@ -213,7 +213,7 @@ gdk_property_change (GdkWindow *window, else { xdisplay = gdk_display; - xwindow = gdk_root_window; + xwindow = _gdk_root_window; } XChangeProperty (xdisplay, xwindow, property, type, @@ -240,7 +240,7 @@ gdk_property_delete (GdkWindow *window, else { xdisplay = gdk_display; - xwindow = gdk_root_window; + xwindow = _gdk_root_window; } XDeleteProperty (xdisplay, xwindow, property); diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c index 1b1e73553b..eae9020133 100644 --- a/gdk/x11/gdkselection-x11.c +++ b/gdk/x11/gdkselection-x11.c @@ -42,7 +42,7 @@ struct _OwnerInfo gulong serial; }; -GSList *owner_list; +static GSList *owner_list; /* When a window is destroyed we check if it is the owner * of any selections. This is somewhat inefficient, but @@ -170,7 +170,7 @@ gdk_selection_convert (GdkWindow *requestor, return; XConvertSelection (GDK_WINDOW_XDISPLAY (requestor), selection, target, - gdk_selection_property, GDK_WINDOW_XID (requestor), time); + _gdk_selection_property, GDK_WINDOW_XID (requestor), time); } gint @@ -199,7 +199,7 @@ gdk_selection_property_get (GdkWindow *requestor, t = NULL; XGetWindowProperty (GDK_WINDOW_XDISPLAY (requestor), GDK_WINDOW_XID (requestor), - gdk_selection_property, 0, 0, False, + _gdk_selection_property, 0, 0, False, AnyPropertyType, &prop_type, &prop_format, &nitems, &nbytes, &t); @@ -230,7 +230,7 @@ gdk_selection_property_get (GdkWindow *requestor, Otherwise there's no guarantee we'll win the race ... */ XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (requestor), GDK_DRAWABLE_XID (requestor), - gdk_selection_property, 0, (nbytes + 3) / 4, False, + _gdk_selection_property, 0, (nbytes + 3) / 4, False, AnyPropertyType, &prop_type, &prop_format, &nitems, &nbytes, &t); diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index 617b15dd94..66c42ff769 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -31,6 +31,11 @@ #include "gdkprivate-x11.h" #include "gdkinternals.h" +struct _GdkVisualClass +{ + GObjectClass parent_class; +}; + static void gdk_visual_add (GdkVisual *visual); static void gdk_visual_decompose_mask (gulong mask, gint *shift, @@ -109,7 +114,7 @@ gdk_visual_get_type (void) void -gdk_visual_init (void) +_gdk_visual_init (void) { static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 }; static const GdkVisualType possible_types[6] = @@ -132,14 +137,14 @@ gdk_visual_init (void) int nxvisuals; int i, j; - visual_template.screen = gdk_screen; + visual_template.screen = _gdk_screen; visual_list = XGetVisualInfo (gdk_display, VisualScreenMask, &visual_template, &nxvisuals); visuals = g_new (GdkVisualPrivate *, nxvisuals); for (i = 0; i < nxvisuals; i++) visuals[i] = g_object_new (GDK_TYPE_VISUAL, NULL); - default_xvisual = DefaultVisual (gdk_display, gdk_screen); + default_xvisual = DefaultVisual (gdk_display, _gdk_screen); nvisuals = 0; for (i = 0; i < nxvisuals; i++) @@ -262,7 +267,7 @@ gdk_visual_init (void) } #ifdef G_ENABLE_DEBUG - if (gdk_debug_flags & GDK_DEBUG_MISC) + if (_gdk_debug_flags & GDK_DEBUG_MISC) for (i = 0; i < nvisuals; i++) g_message ("visual: %s: %d", visual_names[visuals[i]->visual.type], @@ -484,3 +489,11 @@ gdk_visual_equal (Visual *a, { return (a->visualid == b->visualid); } + +Visual * +gdk_x11_visual_get_xvisual (GdkVisual *visual) +{ + g_return_val_if_fail (visual != NULL, NULL); + + return ((GdkVisualPrivate*) visual)->xvisual; +} diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 60e936241d..f5a65e6acd 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -48,7 +48,7 @@ #include <X11/extensions/shape.h> #endif -const int gdk_event_mask_table[21] = +const int _gdk_event_mask_table[21] = { ExposureMask, PointerMotionMask, @@ -72,7 +72,7 @@ const int gdk_event_mask_table[21] = SubstructureNotifyMask, ButtonPressMask /* SCROLL; on X mouse wheel events is treated as mouse button 4/5 */ }; -const int gdk_nevent_masks = sizeof (gdk_event_mask_table) / sizeof (int); +const int _gdk_nenvent_masks = sizeof (_gdk_event_mask_table) / sizeof (int); /* Forward declarations */ static gboolean gdk_window_gravity_works (void); @@ -274,19 +274,19 @@ _gdk_windowing_window_init (void) unsigned int depth; int x, y; - g_assert (gdk_parent_root == NULL); + g_assert (_gdk_parent_root == NULL); - XGetGeometry (gdk_display, gdk_root_window, &gdk_root_window, + XGetGeometry (gdk_display, _gdk_root_window, &_gdk_root_window, &x, &y, &width, &height, &border_width, &depth); - XGetWindowAttributes (gdk_display, gdk_root_window, &xattributes); + XGetWindowAttributes (gdk_display, _gdk_root_window, &xattributes); - gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL); - private = (GdkWindowObject *)gdk_parent_root; + _gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL); + private = (GdkWindowObject *)_gdk_parent_root; impl = GDK_WINDOW_IMPL_X11 (private->impl); draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl); draw_impl->xdisplay = gdk_display; - draw_impl->xid = gdk_root_window; + draw_impl->xid = _gdk_root_window; draw_impl->wrapper = GDK_DRAWABLE (private); private->window_type = GDK_WINDOW_ROOT; @@ -294,7 +294,7 @@ _gdk_windowing_window_init (void) impl->width = width; impl->height = height; - gdk_xid_table_insert (&gdk_root_window, gdk_parent_root); + gdk_xid_table_insert (&_gdk_root_window, _gdk_parent_root); } static GdkAtom wm_client_leader_atom = GDK_NONE; @@ -330,7 +330,7 @@ gdk_window_new (GdkWindow *parent, g_return_val_if_fail (attributes != NULL, NULL); if (!parent) - parent = gdk_parent_root; + parent = _gdk_parent_root; g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL); @@ -393,10 +393,10 @@ gdk_window_new (GdkWindow *parent, xvisual = ((GdkVisualPrivate*) visual)->xvisual; xattributes.event_mask = StructureNotifyMask; - for (i = 0; i < gdk_nevent_masks; i++) + for (i = 0; i < _gdk_nenvent_masks; i++) { if (attributes->event_mask & (1 << (i + 1))) - xattributes.event_mask |= gdk_event_mask_table[i]; + xattributes.event_mask |= _gdk_event_mask_table[i]; } if (xattributes.event_mask) @@ -428,7 +428,7 @@ gdk_window_new (GdkWindow *parent, { g_warning (G_STRLOC "Toplevel windows must be created as children of\n" "of a window of type GDK_WINDOW_ROOT or GDK_WINDOW_FOREIGN"); - xparent = gdk_root_window; + xparent = _gdk_root_window; } case GDK_WINDOW_CHILD: break; @@ -465,12 +465,12 @@ gdk_window_new (GdkWindow *parent, } } - private->bg_color.pixel = BlackPixel (gdk_display, gdk_screen); + private->bg_color.pixel = BlackPixel (gdk_display, _gdk_screen); xattributes.background_pixel = private->bg_color.pixel; private->bg_pixmap = NULL; - xattributes.border_pixel = BlackPixel (gdk_display, gdk_screen); + xattributes.border_pixel = BlackPixel (gdk_display, _gdk_screen); xattributes_mask |= CWBorderPixel | CWBackPixel; if (private->guffaw_gravity) @@ -524,7 +524,7 @@ gdk_window_new (GdkWindow *parent, case GDK_WINDOW_TOPLEVEL: case GDK_WINDOW_TEMP: XSetWMProtocols (xdisplay, xid, - gdk_wm_window_protocols, 3); + _gdk_wm_window_protocols, 3); break; case GDK_WINDOW_CHILD: if ((attributes->wclass == GDK_INPUT_OUTPUT) && @@ -564,7 +564,7 @@ gdk_window_new (GdkWindow *parent, size_hints.height = impl->height; wm_hints.flags = StateHint | WindowGroupHint; - wm_hints.window_group = gdk_leader_window; + wm_hints.window_group = _gdk_leader_window; wm_hints.input = True; wm_hints.initial_state = NormalState; @@ -582,7 +582,7 @@ gdk_window_new (GdkWindow *parent, XChangeProperty (xdisplay, xid, wm_client_leader_atom, XA_WINDOW, 32, PropModeReplace, - (guchar*) &gdk_leader_window, 1); + (guchar*) &_gdk_leader_window, 1); if (attributes_mask & GDK_WA_TITLE) title = attributes->title; @@ -700,9 +700,9 @@ _gdk_windowing_window_destroy (GdkWindow *window, xevent.type = ClientMessage; xevent.window = GDK_WINDOW_XID (window); - xevent.message_type = gdk_wm_protocols; + xevent.message_type = gdk_atom_intern ("WM_PROTOCOLS", FALSE); xevent.format = 32; - xevent.data.l[0] = gdk_wm_delete_window; + xevent.data.l[0] = gdk_atom_intern ("WM_DELETE_WINDOW", FALSE); xevent.data.l[1] = CurrentTime; XSendEvent (GDK_WINDOW_XDISPLAY (window), @@ -1051,7 +1051,7 @@ gdk_window_reparent (GdkWindow *window, g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT); if (!new_parent) - new_parent = gdk_parent_root; + new_parent = _gdk_parent_root; window_private = (GdkWindowObject*) window; old_parent_private = (GdkWindowObject*)window_private->parent; @@ -1077,7 +1077,7 @@ gdk_window_reparent (GdkWindow *window, GDK_WINDOW_TYPE (window) = GDK_WINDOW_TOPLEVEL; XSetWMProtocols (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), - gdk_wm_window_protocols, 3); + _gdk_wm_window_protocols, 3); } case GDK_WINDOW_TOPLEVEL: case GDK_WINDOW_CHILD: @@ -1179,7 +1179,7 @@ gdk_window_focus (GdkWindow *window, xev.xclient.format = 32; xev.xclient.data.l[0] = 0; - XSendEvent (gdk_display, gdk_root_window, False, + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } @@ -1323,7 +1323,7 @@ gdk_wmspec_change_state (gboolean add, xev.xclient.data.l[1] = state1; xev.xclient.data.l[2] = state2; - XSendEvent (gdk_display, gdk_root_window, False, + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } @@ -1757,7 +1757,7 @@ gdk_window_get_geometry (GdkWindow *window, g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; if (!GDK_WINDOW_DESTROYED (window)) { @@ -1807,7 +1807,7 @@ gdk_window_get_origin (GdkWindow *window, { return_val = XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), - gdk_root_window, + _gdk_root_window, 0, 0, &tx, &ty, &child); @@ -2017,7 +2017,7 @@ _gdk_windowing_window_get_pointer (GdkWindow *window, g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); if (!window) - window = gdk_parent_root; + window = _gdk_parent_root; _gdk_windowing_window_get_offsets (window, &xoffset, &yoffset); @@ -2098,9 +2098,9 @@ gdk_window_get_events (GdkWindow *window) &attrs); event_mask = 0; - for (i = 0; i < gdk_nevent_masks; i++) + for (i = 0; i < _gdk_nenvent_masks; i++) { - if (attrs.your_event_mask & gdk_event_mask_table[i]) + if (attrs.your_event_mask & _gdk_event_mask_table[i]) event_mask |= 1 << (i + 1); } @@ -2121,10 +2121,10 @@ gdk_window_set_events (GdkWindow *window, if (!GDK_WINDOW_DESTROYED (window)) { xevent_mask = StructureNotifyMask; - for (i = 0; i < gdk_nevent_masks; i++) + for (i = 0; i < _gdk_nenvent_masks; i++) { if (event_mask & (1 << (i + 1))) - xevent_mask |= gdk_event_mask_table[i]; + xevent_mask |= _gdk_event_mask_table[i]; } XSelectInput (GDK_WINDOW_XDISPLAY (window), @@ -2360,7 +2360,7 @@ gdk_window_set_icon_list (GdkWindow *window, while (l) { pixbuf = l->data; - g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), FALSE); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -2588,7 +2588,7 @@ gdk_window_stick (GdkWindow *window) xev.xclient.data.l[0] = 0xFFFFFFFF; - XSendEvent (gdk_display, gdk_root_window, False, + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } @@ -2626,7 +2626,7 @@ gdk_window_unstick (GdkWindow *window) /* Get current desktop, then set it; this is a race, but not * one that matters much in practice. */ - XGetWindowProperty (gdk_display, gdk_root_window, + XGetWindowProperty (gdk_display, _gdk_root_window, gdk_atom_intern ("_NET_CURRENT_DESKTOP", FALSE), 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, @@ -2644,7 +2644,7 @@ gdk_window_unstick (GdkWindow *window) xev.xclient.data.l[0] = *current_desktop; - XSendEvent (gdk_display, gdk_root_window, False, + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); @@ -3419,7 +3419,7 @@ gdk_window_xid_at_coords (gint x, unsigned int num; int i; - window = gdk_parent_root; + window = _gdk_parent_root; xdisplay = GDK_WINDOW_XDISPLAY (window); root = GDK_WINDOW_XID (window); num = g_list_length (excludes); @@ -3495,7 +3495,7 @@ wmspec_moveresize (GdkWindow *window, xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; - XSendEvent (gdk_display, gdk_root_window, False, + XSendEvent (gdk_display, _gdk_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h index fdb3848fd5..09385de300 100644 --- a/gdk/x11/gdkx.h +++ b/gdk/x11/gdkx.h @@ -33,116 +33,66 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> -#include <gdk/x11/gdkwindow-x11.h> -#include <gdk/x11/gdkpixmap-x11.h> - G_BEGIN_DECLS -typedef struct _GdkColormapPrivateX11 GdkColormapPrivateX11; -typedef struct _GdkCursorPrivate GdkCursorPrivate; -typedef struct _GdkImagePrivateX11 GdkImagePrivateX11; -typedef struct _GdkVisualPrivate GdkVisualPrivate; - -struct _GdkCursorPrivate -{ - GdkCursor cursor; - Cursor xcursor; - Display *xdisplay; -}; - -struct _GdkVisualPrivate -{ - GdkVisual visual; - Visual *xvisual; -}; - -struct _GdkVisualClass -{ - GObjectClass parent_class; -}; - -struct _GdkColormapPrivateX11 -{ - Colormap xcolormap; - Display *xdisplay; - gint private_val; - - GHashTable *hash; - GdkColorInfo *info; - time_t last_sync_time; -}; - -struct _GdkImagePrivateX11 -{ - XImage *ximage; - Display *xdisplay; - gpointer x_shm_info; -}; - - -typedef struct _GdkGCX11 GdkGCX11; -typedef struct _GdkGCX11Class GdkGCX11Class; - -#define GDK_TYPE_GC_X11 (gdk_gc_x11_get_type ()) -#define GDK_GC_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_X11, GdkGCX11)) -#define GDK_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_X11, GdkGCX11Class)) -#define GDK_IS_GC_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_X11)) -#define GDK_IS_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_X11)) -#define GDK_GC_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_X11, GdkGCX11Class)) - -struct _GdkGCX11 -{ - GdkGC parent_instance; - - GC xgc; - Display *xdisplay; - GdkRegion *clip_region; - guint dirty_mask; - - /* We can't conditionalize on HAVE_XFT here, so we simply always - * have this here as a gpointer. - */ - gpointer xft_draw; - gulong fg_pixel; -}; - -struct _GdkGCX11Class -{ - GdkGCClass parent_class; - -}; - -GType gdk_gc_x11_get_type (void); - -#define GDK_ROOT_WINDOW() gdk_root_window -#define GDK_ROOT_PARENT() ((GdkWindow *)gdk_parent_root) +extern Display *gdk_display; + +Display *gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable); +XID gdk_x11_drawable_get_xid (GdkDrawable *drawable); +Display *gdk_x11_image_get_xdisplay (GdkImage *image); +XImage *gdk_x11_image_get_ximage (GdkImage *image); +Display *gdk_x11_colormap_get_xdisplay (GdkColormap *colormap); +Colormap gdk_x11_colormap_get_xcolormap (GdkColormap *colormap); +Display *gdk_x11_cursor_get_xdisplay (GdkCursor *cursor); +Cursor gdk_x11_cursor_get_xcursor (GdkCursor *cursor); +Visual * gdk_x11_visual_get_xvisual (GdkVisual *visual); +Display *gdk_x11_gc_get_xdisplay (GdkGC *gc); +GC gdk_x11_gc_get_xgc (GdkGC *gc); +Window gdk_x11_get_default_root_xwindow (void); +Display *gdk_x11_get_default_xdisplay (void); +gint gdk_x11_get_default_screen (void); + +#define GDK_COLORMAP_XDISPLAY(cmap) (gdk_x11_colormap_get_xdisplay (cmap)) +#define GDK_COLORMAP_XCOLORMAP(cmap) (gdk_x11_colormap_get_xcolormap (cmap)) +#define GDK_CURSOR_XDISPLAY(win) (gdk_x11_cursor_get_xdisplay (win)) +#define GDK_CURSOR_XCURSOR(win) (gdk_x11_cursor_get_xid (win)) #define GDK_DISPLAY() gdk_display +#define GDK_IMAGE_XDISPLAY(image) (gdk_x11_image_get_xdisplay (image)) +#define GDK_IMAGE_XIMAGE(image) (gdk_x11_image_get_ximage (image)) + +#ifdef INSIDE_GDK_X11 + +#include "gdkprivate-x11.h" + +#define GDK_ROOT_WINDOW() _gdk_root_window +#define GDK_ROOT_PARENT() ((GdkWindow *)_gdk_parent_root) #define GDK_WINDOW_XDISPLAY(win) (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xdisplay) #define GDK_WINDOW_XID(win) (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xid) #define GDK_PIXMAP_XDISPLAY(win) (GDK_DRAWABLE_IMPL_X11(((GdkPixmapObject *)win)->impl)->xdisplay) #define GDK_PIXMAP_XID(win) (GDK_DRAWABLE_IMPL_X11(((GdkPixmapObject *)win)->impl)->xid) #define GDK_DRAWABLE_XDISPLAY(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XDISPLAY (win) : GDK_PIXMAP_XDISPLAY (win)) #define GDK_DRAWABLE_XID(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XID (win) : GDK_PIXMAP_XID (win)) -#define GDK_IMAGE_XDISPLAY(image) (((GdkImagePrivateX11 *) GDK_IMAGE (image)->windowing_data)->xdisplay) -#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivateX11 *) GDK_IMAGE (image)->windowing_data)->ximage) #define GDK_GC_XDISPLAY(gc) (GDK_GC_X11(gc)->xdisplay) -#define GDK_COLORMAP_XDISPLAY(cmap) (((GdkColormapPrivateX11 *)GDK_COLORMAP (cmap)->windowing_data)->xdisplay) -#define GDK_COLORMAP_XCOLORMAP(cmap) (((GdkColormapPrivateX11 *)GDK_COLORMAP (cmap)->windowing_data)->xcolormap) #define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate *) vis)->xvisual) - #define GDK_GC_XGC(gc) (GDK_GC_X11(gc)->xgc) -#define GDK_GC_GET_XGC(gc) (GDK_GC_X11(gc)->dirty_mask ? _gdk_x11_gc_flush (gc) : GDK_GC_XGC (gc)) +#define GDK_GC_GET_XGC(gc) (GDK_GC_X11(gc)->dirty_mask ? _gdk_x11_gc_flush (gc) : ((GdkGCX11 *)(gc))->xgc) #define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID -extern Display *gdk_display; -extern Window gdk_root_window; -extern gint gdk_screen; -extern gchar *gdk_display_name; -extern Window gdk_leader_window; +#else /* INSIDE_GDK_X11 */ -extern Atom gdk_selection_property; +#define GDK_ROOT_WINDOW() (gdk_x11_get_default_root_xwindow ()) +#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win)) +#define GDK_WINDOW_XID(win) (gdk_x11_drawable_get_xid (win)) +#define GDK_WINDOW_XWINDOW(win) (gdk_x11_drawable_get_xid (win)) +#define GDK_PIXMAP_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win)) +#define GDK_PIXMAP_XID(win) (gdk_x11_drawable_get_xid (win)) +#define GDK_DRAWABLE_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win)) +#define GDK_DRAWABLE_XID(win) (gdk_x11_drawable_get_xid (win)) +#define GDK_VISUAL_XVISUAL(visual) (gdk_x11_visual_get_xvisual (visual)) +#define GDK_GC_XDISPLAY(gc) (gdk_x11_gc_get_xdisplay (gc)) +#define GDK_GC_XGC(gc) (gdk_x11_gc_get_xgc (gc)) -extern gchar *gdk_progclass; +#endif /* INSIDE_GDK_X11 */ GdkVisual* gdkx_visual_get (VisualID xvisualid); /* XXX: Do not use this function until it is fixed. An X Colormap @@ -169,31 +119,16 @@ void gdk_x11_ungrab_server (void); /* returns TRUE if we support the given WM spec feature */ gboolean gdk_net_wm_supports (GdkAtom property); -void gdk_x11_grab_server (void); -void gdk_x11_ungrab_server (void); - #define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid)) #define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid)) -GC _gdk_x11_gc_flush (GdkGC *gc); - #ifndef GDK_DISABLE_DEPRECATED -typedef struct _GdkFontPrivateX GdkFontPrivateX; - -struct _GdkFontPrivateX -{ - GdkFontPrivate base; - /* XFontStruct *xfont; */ - /* generic pointer point to XFontStruct or XFontSet */ - gpointer xfont; - Display *xdisplay; - - GSList *names; -}; +Display *gdk_x11_font_get_xdisplay (GdkFont *font); +gpointer gdk_x11_font_get_xfont (GdkFont *font); -#define GDK_FONT_XDISPLAY(font) (((GdkFontPrivate *) font)->xdisplay) -#define GDK_FONT_XFONT(font) (((GdkFontPrivateX *)font)->xfont) +#define GDK_FONT_XDISPLAY(font) (gdk_x11_font_get_xdisplay (font)) +#define GDK_FONT_XFONT(font) (gdk_x11_font_get_xfont (font)) #define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid)) diff --git a/gdk/x11/xsettings-common.h b/gdk/x11/xsettings-common.h index e3af4a662e..1e93f84d4d 100644 --- a/gdk/x11/xsettings-common.h +++ b/gdk/x11/xsettings-common.h @@ -27,6 +27,23 @@ extern "C" { #endif /* __cplusplus */ +/* Renames for GDK inclusion */ + +#define xsettings_byte_order _gdk_xsettings_byte_order +#define xsettings_client_destroy _gdk_xsettings_client_destroy +#define xsettings_client_get_setting _gdk_xsettings_client_get_setting +#define xsettings_client_new _gdk_xsettings_client_new +#define xsettings_client_process_event _gdk_xsettings_client_process_event +#define xsettings_list_copy _gdk_xsettings_list_copy +#define xsettings_list_delete _gdk_xsettings_list_delete +#define xsettings_list_free _gdk_xsettings_list_free +#define xsettings_list_insert _gdk_xsettings_list_insert +#define xsettings_list_lookup _gdk_xsettings_list_lookup +#define xsettings_setting_copy _gdk_xsettings_setting_copy +#define xsettings_setting_equal _gdk_xsettings_setting_equal +#define xsettings_setting_free _gdk_xsettings_setting_free + + typedef struct _XSettingsBuffer XSettingsBuffer; typedef struct _XSettingsColor XSettingsColor; typedef struct _XSettingsList XSettingsList; diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index d78688cc07..f61ae769f2 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -26,16 +26,6 @@ #include "gdkconfig.h" -#if defined (GDK_WINDOWING_X11) -#include "x11/gdkx.h" -#elif defined (GDK_WINDOWING_WIN32) -#include "win32/gdkwin32.h" -#elif defined(GDK_WINDOWING_FB) -#include "linux-fb/gdkfb.h" -#elif defined (GDK_WINDOWING_NANOX) -#include "nanox/gdkprivate-nanox.h" -#endif - #include "gdk/gdkkeysyms.h" #include "gtkdnd.h" @@ -2398,19 +2388,12 @@ _gtk_drag_source_handle_event (GtkWidget *widget, cursor = gtk_drag_get_cursor (event->dnd.context->action); if (info->cursor != cursor) { -#ifdef GDK_WINDOWING_X11 - XChangeActivePointerGrab (GDK_WINDOW_XDISPLAY (widget->window), - PointerMotionMask | PointerMotionHintMask | ButtonReleaseMask, - ((GdkCursorPrivate *)cursor)->xcursor, - event->dnd.time); -#elif defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_FB) gdk_pointer_grab (widget->window, FALSE, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, cursor, event->dnd.time); -#endif info->cursor = cursor; } @@ -2986,7 +2969,7 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) send_event.button.axes = NULL; send_event.button.state = 0; send_event.button.button = info->button; - send_event.button.device = gdk_core_pointer; + send_event.button.device = gdk_device_get_core_pointer (); send_event.button.x_root = 0; send_event.button.y_root = 0; diff --git a/gtk/gtkinputdialog.c b/gtk/gtkinputdialog.c index 70a79ae5de..b35999a986 100644 --- a/gtk/gtkinputdialog.c +++ b/gtk/gtkinputdialog.c @@ -199,7 +199,7 @@ gtk_input_dialog_init (GtkInputDialog *inputd) for (tmp_list = device_info; tmp_list; tmp_list = tmp_list->next) { GdkDevice *info = (GdkDevice *)(tmp_list->data); - if (info != gdk_core_pointer) + if (info != gdk_device_get_core_pointer ()) { menuitem = gtk_menu_item_new_with_label(info->name); diff --git a/gtk/gtkinvisible.h b/gtk/gtkinvisible.h index 4ab0335239..27516e493d 100644 --- a/gtk/gtkinvisible.h +++ b/gtk/gtkinvisible.h @@ -49,6 +49,7 @@ struct _GtkInvisible { GtkWidget widget; gboolean has_user_ref_count; + gpointer gtk_reserved1; /* For future GdkScreen * */ }; struct _GtkInvisibleClass diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index bb81a3acf9..2ebbb784ce 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -580,7 +580,7 @@ gtk_plug_forward_key_press (GtkPlug *plug, GdkEventKey *event) xevent.xkey.same_screen = TRUE; /* FIXME ? */ gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (plug->socket_window), False, NoEventMask, &xevent); gdk_flush (); @@ -610,7 +610,7 @@ gtk_plug_set_focus (GtkWindow *window, xevent.xfocus.detail = FALSE; /* Don't force */ gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (plug->socket_window), False, NoEventMask, &xevent); gdk_flush (); @@ -857,7 +857,7 @@ send_xembed_message (GtkPlug *plug, xevent.xclient.data.l[4] = data2; gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (plug->socket_window), False, NoEventMask, &xevent); gdk_flush (); diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 4f93f6b65d..0e670919a4 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1439,7 +1439,7 @@ gtk_selection_property_notify (GtkWidget *widget, #if defined(GDK_WINDOWING_WIN32) || defined(GDK_WINDOWING_X11) if ((event->state != GDK_PROPERTY_NEW_VALUE) || /* property was deleted */ - (event->atom != gdk_selection_property)) /* not the right property */ + (event->atom != gdk_atom_intern ("GDK_SELECTION", FALSE))) /* not the right property */ #endif return FALSE; diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index d5ca43e892..a1ff7226b4 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -705,7 +705,7 @@ gtk_socket_key_press_event (GtkWidget *widget, xevent.xkey.same_screen = TRUE; /* FIXME ? */ gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (socket->plug_window), False, NoEventMask, &xevent); gdk_flush (); @@ -880,7 +880,7 @@ gtk_socket_focus (GtkWidget *widget, GtkDirectionType direction) gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (socket->plug_window), False, NoEventMask, &xevent); gdk_flush(); @@ -926,7 +926,7 @@ gtk_socket_send_configure_event (GtkSocket *socket) g_return_if_fail (socket->plug_window != NULL); event.xconfigure.type = ConfigureNotify; - event.xconfigure.display = gdk_display; + event.xconfigure.display = GDK_DISPLAY (); event.xconfigure.event = GDK_WINDOW_XWINDOW (socket->plug_window); event.xconfigure.window = GDK_WINDOW_XWINDOW (socket->plug_window); @@ -941,7 +941,7 @@ gtk_socket_send_configure_event (GtkSocket *socket) event.xconfigure.override_redirect = False; gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (socket->plug_window), False, NoEventMask, &event); gdk_flush (); @@ -1087,7 +1087,7 @@ send_xembed_message (GtkSocket *socket, xevent.xclient.data.l[4] = data2; gdk_error_trap_push (); - XSendEvent (gdk_display, + XSendEvent (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (socket->plug_window), False, NoEventMask, &xevent); gdk_flush (); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 81ed3aa897..2ed597fe57 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -5468,7 +5468,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, send_event.button.axes = NULL; send_event.button.state = 0; send_event.button.button = 1; - send_event.button.device = gdk_core_pointer; + send_event.button.device = gdk_device_get_core_pointer (); send_event.button.x_root = 0; send_event.button.y_root = 0; diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 46f8d2491b..eab6decbac 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -585,7 +585,7 @@ gtk_window_init (GtkWindow *window) window->title = NULL; window->wmclass_name = g_strdup (g_get_prgname ()); - window->wmclass_class = g_strdup (gdk_progclass); + window->wmclass_class = g_strdup (gdk_get_program_class ()); window->wm_role = NULL; window->geometry_info = NULL; window->type = GTK_WINDOW_TOPLEVEL; diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 2f74744251..32ce21d337 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -106,6 +106,7 @@ struct _GtkWindow guint frame_bottom; GdkModifierType mnemonic_modifier; + gpointer gtk_reserved1; /* For future GdkScreen * */ }; struct _GtkWindowClass diff --git a/tests/testinput.c b/tests/testinput.c index eb256bddfb..667ff3ee1f 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -313,7 +313,7 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); - current_device = gdk_core_pointer; + current_device = gdk_device_get_core_pointer (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Test Input"); |