1997-11-24 22:37:52 +00:00
|
|
|
/* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2005-06-15 18:37:18 +00:00
|
|
|
|
|
|
|
#define GDK_PIXBUF_ENABLE_BACKEND
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/cursorfont.h>
|
2003-06-30 22:30:54 +00:00
|
|
|
#ifdef HAVE_XCURSOR
|
|
|
|
#include <X11/Xcursor/Xcursor.h>
|
|
|
|
#endif
|
2005-06-14 15:10:13 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
#include <X11/extensions/Xfixes.h>
|
|
|
|
#endif
|
|
|
|
#include <string.h>
|
2010-10-15 18:34:44 +00:00
|
|
|
#include <errno.h>
|
1999-10-01 23:18:30 +00:00
|
|
|
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
#include "gdkprivate-x11.h"
|
1999-10-01 23:18:30 +00:00
|
|
|
#include "gdkcursor.h"
|
2008-07-24 03:38:08 +00:00
|
|
|
#include "gdkdisplay-x11.h"
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
#include "gdkpixmap-x11.h"
|
2002-04-25 22:29:14 +00:00
|
|
|
#include "gdkx.h"
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
#include <gdk/gdkpixmap.h>
|
2003-06-30 22:30:54 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2005-03-16 03:17:27 +00:00
|
|
|
#include "gdkalias.h"
|
2003-06-30 22:30:54 +00:00
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
static guint theme_serial = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2009-01-20 02:15:59 +00:00
|
|
|
/* cursor_cache holds a cache of non-pixmap cursors to avoid expensive
|
2009-01-24 21:29:36 +00:00
|
|
|
* libXcursor searches, cursors are added to it but only removed when
|
|
|
|
* their display is closed. We make the assumption that since there are
|
|
|
|
* a small number of display's and a small number of cursor's that this
|
|
|
|
* list will stay small enough not to be a problem.
|
2009-01-20 02:15:59 +00:00
|
|
|
*/
|
|
|
|
static GSList* cursor_cache = NULL;
|
|
|
|
|
|
|
|
struct cursor_cache_key
|
|
|
|
{
|
|
|
|
GdkDisplay* display;
|
|
|
|
GdkCursorType type;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Caller should check if there is already a match first.
|
|
|
|
* Cursor MUST be either a typed cursor or a pixmap with
|
|
|
|
* a non-NULL name.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
add_to_cache (GdkCursorPrivate* cursor)
|
|
|
|
{
|
|
|
|
cursor_cache = g_slist_prepend (cursor_cache, cursor);
|
|
|
|
|
|
|
|
/* Take a ref so that if the caller frees it we still have it */
|
|
|
|
gdk_cursor_ref ((GdkCursor*) cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns 0 on a match
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
cache_compare_func (gconstpointer listelem,
|
|
|
|
gconstpointer target)
|
|
|
|
{
|
|
|
|
GdkCursorPrivate* cursor = (GdkCursorPrivate*)listelem;
|
|
|
|
struct cursor_cache_key* key = (struct cursor_cache_key*)target;
|
|
|
|
|
|
|
|
if ((cursor->cursor.type != key->type) ||
|
|
|
|
(cursor->display != key->display))
|
|
|
|
return 1; /* No match */
|
|
|
|
|
|
|
|
/* Elements marked as pixmap must be named cursors
|
|
|
|
* (since we don't store normal pixmap cursors
|
|
|
|
*/
|
|
|
|
if (key->type == GDK_CURSOR_IS_PIXMAP)
|
|
|
|
return strcmp (key->name, cursor->name);
|
|
|
|
|
|
|
|
return 0; /* Match */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns the cursor if there is a match, NULL if not
|
|
|
|
* For named cursors type shall be GDK_CURSOR_IS_PIXMAP
|
|
|
|
* For unnamed, typed cursors, name shall be NULL
|
|
|
|
*/
|
|
|
|
static GdkCursorPrivate*
|
|
|
|
find_in_cache (GdkDisplay *display,
|
|
|
|
GdkCursorType type,
|
|
|
|
const char *name)
|
|
|
|
{
|
|
|
|
GSList* res;
|
|
|
|
struct cursor_cache_key key;
|
|
|
|
|
|
|
|
key.display = display;
|
|
|
|
key.type = type;
|
|
|
|
key.name = name;
|
|
|
|
|
|
|
|
res = g_slist_find_custom (cursor_cache, &key, cache_compare_func);
|
|
|
|
|
|
|
|
if (res)
|
|
|
|
return (GdkCursorPrivate *) res->data;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Called by gdk_display_x11_finalize to flush any cached cursors
|
|
|
|
* for a dead display.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
_gdk_x11_cursor_display_finalize (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
GSList* item;
|
|
|
|
GSList** itemp; /* Pointer to the thing to fix when we delete an item */
|
|
|
|
item = cursor_cache;
|
|
|
|
itemp = &cursor_cache;
|
|
|
|
while (item)
|
|
|
|
{
|
|
|
|
GdkCursorPrivate* cursor = (GdkCursorPrivate*)(item->data);
|
|
|
|
if (cursor->display == display)
|
|
|
|
{
|
|
|
|
GSList* olditem;
|
|
|
|
gdk_cursor_unref ((GdkCursor*) cursor);
|
|
|
|
/* Remove this item from the list */
|
|
|
|
*(itemp) = item->next;
|
|
|
|
olditem = item;
|
|
|
|
item = g_slist_next (item);
|
|
|
|
g_slist_free_1 (olditem);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
itemp = &(item->next);
|
|
|
|
item = g_slist_next (item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Cursor
|
|
|
|
get_blank_cursor (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
GdkScreen *screen;
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
Pixmap source_pixmap;
|
|
|
|
XColor color;
|
|
|
|
Cursor cursor;
|
|
|
|
|
|
|
|
screen = gdk_display_get_default_screen (display);
|
|
|
|
pixmap = gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen),
|
|
|
|
"\0\0\0\0\0\0\0\0", 1, 1);
|
|
|
|
|
|
|
|
source_pixmap = GDK_PIXMAP_XID (pixmap);
|
|
|
|
|
|
|
|
color.pixel = 0;
|
|
|
|
color.red = color.blue = color.green = 0;
|
|
|
|
|
|
|
|
if (display->closed)
|
|
|
|
cursor = None;
|
|
|
|
else
|
|
|
|
cursor = XCreatePixmapCursor (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
source_pixmap, source_pixmap,
|
|
|
|
&color, &color, 1, 1);
|
|
|
|
g_object_unref (pixmap);
|
|
|
|
|
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
/**
|
2002-06-18 20:59:44 +00:00
|
|
|
* gdk_cursor_new_for_display:
|
|
|
|
* @display: the #GdkDisplay for which the cursor will be created
|
2001-10-03 18:19:48 +00:00
|
|
|
* @cursor_type: cursor to create
|
|
|
|
*
|
|
|
|
* Creates a new cursor from the set of builtin cursors.
|
2001-12-07 05:27:17 +00:00
|
|
|
* Some useful ones are:
|
|
|
|
* <itemizedlist>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="right_ptr.png"></inlinegraphic> #GDK_RIGHT_PTR (right-facing arrow)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="crosshair.png"></inlinegraphic> #GDK_CROSSHAIR (crosshair)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="xterm.png"></inlinegraphic> #GDK_XTERM (I-beam)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="watch.png"></inlinegraphic> #GDK_WATCH (busy)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="fleur.png"></inlinegraphic> #GDK_FLEUR (for moving objects)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="hand1.png"></inlinegraphic> #GDK_HAND1 (a right-pointing hand)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="hand2.png"></inlinegraphic> #GDK_HAND2 (a left-pointing hand)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="left_side.png"></inlinegraphic> #GDK_LEFT_SIDE (resize left side)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="right_side.png"></inlinegraphic> #GDK_RIGHT_SIDE (resize right side)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="top_left_corner.png"></inlinegraphic> #GDK_TOP_LEFT_CORNER (resize northwest corner)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="top_right_corner.png"></inlinegraphic> #GDK_TOP_RIGHT_CORNER (resize northeast corner)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="bottom_left_corner.png"></inlinegraphic> #GDK_BOTTOM_LEFT_CORNER (resize southwest corner)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="bottom_right_corner.png"></inlinegraphic> #GDK_BOTTOM_RIGHT_CORNER (resize southeast corner)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="top_side.png"></inlinegraphic> #GDK_TOP_SIDE (resize top side)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="bottom_side.png"></inlinegraphic> #GDK_BOTTOM_SIDE (resize bottom side)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="sb_h_double_arrow.png"></inlinegraphic> #GDK_SB_H_DOUBLE_ARROW (move vertical splitter)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
|
|
|
* <listitem><para>
|
2002-05-28 22:23:55 +00:00
|
|
|
* <inlinegraphic format="PNG" fileref="sb_v_double_arrow.png"></inlinegraphic> #GDK_SB_V_DOUBLE_ARROW (move horizontal splitter)
|
2001-12-07 05:27:17 +00:00
|
|
|
* </para></listitem>
|
2009-01-20 02:15:59 +00:00
|
|
|
* <listitem><para>
|
|
|
|
* #GDK_BLANK_CURSOR (Blank cursor). Since 2.16
|
|
|
|
* </para></listitem>
|
2001-12-07 05:27:17 +00:00
|
|
|
* </itemizedlist>
|
2001-10-03 18:19:48 +00:00
|
|
|
*
|
|
|
|
* Return value: a new #GdkCursor
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2001-10-03 18:19:48 +00:00
|
|
|
**/
|
1997-11-24 22:37:52 +00:00
|
|
|
GdkCursor*
|
2002-06-18 20:59:44 +00:00
|
|
|
gdk_cursor_new_for_display (GdkDisplay *display,
|
|
|
|
GdkCursorType cursor_type)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
GdkCursor *cursor;
|
|
|
|
Cursor xcursor;
|
|
|
|
|
2002-06-18 20:59:44 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
if (display->closed)
|
2009-01-20 02:15:59 +00:00
|
|
|
{
|
|
|
|
xcursor = None;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
private = find_in_cache (display, cursor_type, NULL);
|
|
|
|
|
|
|
|
if (private)
|
|
|
|
{
|
|
|
|
/* Cache had it, add a ref for this user */
|
|
|
|
gdk_cursor_ref ((GdkCursor*) private);
|
|
|
|
|
|
|
|
return (GdkCursor*) private;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cursor_type != GDK_BLANK_CURSOR)
|
|
|
|
xcursor = XCreateFontCursor (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
cursor_type);
|
|
|
|
else
|
|
|
|
xcursor = get_blank_cursor (display);
|
|
|
|
}
|
|
|
|
}
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
private = g_new (GdkCursorPrivate, 1);
|
2002-06-18 20:59:44 +00:00
|
|
|
private->display = display;
|
1997-11-24 22:37:52 +00:00
|
|
|
private->xcursor = xcursor;
|
2005-06-14 15:10:13 +00:00
|
|
|
private->name = NULL;
|
2005-06-17 17:26:24 +00:00
|
|
|
private->serial = theme_serial;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
cursor = (GdkCursor *) private;
|
1997-11-24 22:37:52 +00:00
|
|
|
cursor->type = cursor_type;
|
2000-02-13 20:22:20 +00:00
|
|
|
cursor->ref_count = 1;
|
|
|
|
|
2009-01-20 02:15:59 +00:00
|
|
|
if (xcursor != None)
|
|
|
|
add_to_cache (private);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
2002-10-24 21:24:20 +00:00
|
|
|
/**
|
|
|
|
* gdk_cursor_new_from_pixmap:
|
|
|
|
* @source: the pixmap specifying the cursor.
|
|
|
|
* @mask: the pixmap specifying the mask, which must be the same size as
|
|
|
|
* @source.
|
|
|
|
* @fg: the foreground color, used for the bits in the source which are 1.
|
|
|
|
* The color does not have to be allocated first.
|
|
|
|
* @bg: the background color, used for the bits in the source which are 0.
|
|
|
|
* The color does not have to be allocated first.
|
|
|
|
* @x: the horizontal offset of the 'hotspot' of the cursor.
|
|
|
|
* @y: the vertical offset of the 'hotspot' of the cursor.
|
|
|
|
*
|
|
|
|
* Creates a new cursor from a given pixmap and mask. Both the pixmap and mask
|
|
|
|
* must have a depth of 1 (i.e. each pixel has only 2 values - on or off).
|
|
|
|
* The standard cursor size is 16 by 16 pixels. You can create a bitmap
|
|
|
|
* from inline data as in the below example.
|
|
|
|
*
|
2002-11-23 23:02:10 +00:00
|
|
|
* <example><title>Creating a custom cursor</title>
|
2002-10-24 21:24:20 +00:00
|
|
|
* <programlisting>
|
2002-10-25 00:01:15 +00:00
|
|
|
* /<!-- -->* This data is in X bitmap format, and can be created with the 'bitmap'
|
2002-10-24 21:24:20 +00:00
|
|
|
* utility. *<!-- -->/
|
|
|
|
* #define cursor1_width 16
|
|
|
|
* #define cursor1_height 16
|
|
|
|
* static unsigned char cursor1_bits[] = {
|
|
|
|
* 0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20,
|
|
|
|
* 0x82, 0x41, 0x41, 0x82, 0x41, 0x82, 0x82, 0x41, 0x04, 0x20, 0x08, 0x10,
|
|
|
|
* 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01};
|
2002-10-29 21:27:17 +00:00
|
|
|
*
|
2002-10-24 21:24:20 +00:00
|
|
|
* static unsigned char cursor1mask_bits[] = {
|
|
|
|
* 0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x8c, 0x31,
|
|
|
|
* 0xc6, 0x63, 0x63, 0xc6, 0x63, 0xc6, 0xc6, 0x63, 0x8c, 0x31, 0x18, 0x18,
|
|
|
|
* 0x30, 0x0c, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01};
|
2002-10-29 21:27:17 +00:00
|
|
|
*
|
|
|
|
*
|
2002-10-24 21:24:20 +00:00
|
|
|
* GdkCursor *cursor;
|
|
|
|
* GdkPixmap *source, *mask;
|
2002-10-25 00:01:15 +00:00
|
|
|
* GdkColor fg = { 0, 65535, 0, 0 }; /<!-- -->* Red. *<!-- -->/
|
|
|
|
* GdkColor bg = { 0, 0, 0, 65535 }; /<!-- -->* Blue. *<!-- -->/
|
2002-10-29 21:27:17 +00:00
|
|
|
*
|
|
|
|
*
|
2002-10-24 21:24:20 +00:00
|
|
|
* source = gdk_bitmap_create_from_data (NULL, cursor1_bits,
|
|
|
|
* cursor1_width, cursor1_height);
|
|
|
|
* mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
|
|
|
|
* cursor1_width, cursor1_height);
|
|
|
|
* cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8);
|
2009-10-14 01:02:14 +00:00
|
|
|
* g_object_unref (source);
|
|
|
|
* g_object_unref (mask);
|
2002-10-29 21:27:17 +00:00
|
|
|
*
|
|
|
|
*
|
2002-10-24 21:24:20 +00:00
|
|
|
* gdk_window_set_cursor (widget->window, cursor);
|
|
|
|
* </programlisting>
|
|
|
|
* </example>
|
|
|
|
*
|
|
|
|
* Return value: a new #GdkCursor.
|
|
|
|
**/
|
1997-12-06 20:53:46 +00:00
|
|
|
GdkCursor*
|
2004-01-26 20:21:09 +00:00
|
|
|
gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
|
|
|
GdkPixmap *mask,
|
|
|
|
const GdkColor *fg,
|
|
|
|
const GdkColor *bg,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
1997-12-06 20:53:46 +00:00
|
|
|
{
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
GdkCursor *cursor;
|
|
|
|
Pixmap source_pixmap, mask_pixmap;
|
|
|
|
Cursor xcursor;
|
|
|
|
XColor xfg, xbg;
|
2002-06-18 20:59:44 +00:00
|
|
|
GdkDisplay *display;
|
2000-02-13 08:16:48 +00:00
|
|
|
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_PIXMAP (source), NULL);
|
|
|
|
g_return_val_if_fail (GDK_IS_PIXMAP (mask), NULL);
|
2000-02-13 08:16:48 +00:00
|
|
|
g_return_val_if_fail (fg != NULL, NULL);
|
|
|
|
g_return_val_if_fail (bg != NULL, NULL);
|
|
|
|
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
source_pixmap = GDK_PIXMAP_XID (source);
|
|
|
|
mask_pixmap = GDK_PIXMAP_XID (mask);
|
2002-06-18 20:59:44 +00:00
|
|
|
display = GDK_PIXMAP_DISPLAY (source);
|
1997-12-06 20:53:46 +00:00
|
|
|
|
|
|
|
xfg.pixel = fg->pixel;
|
|
|
|
xfg.red = fg->red;
|
|
|
|
xfg.blue = fg->blue;
|
|
|
|
xfg.green = fg->green;
|
|
|
|
xbg.pixel = bg->pixel;
|
|
|
|
xbg.red = bg->red;
|
|
|
|
xbg.blue = bg->blue;
|
|
|
|
xbg.green = bg->green;
|
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
if (display->closed)
|
|
|
|
xcursor = None;
|
|
|
|
else
|
|
|
|
xcursor = XCreatePixmapCursor (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
source_pixmap, mask_pixmap, &xfg, &xbg, x, y);
|
1997-12-06 20:53:46 +00:00
|
|
|
private = g_new (GdkCursorPrivate, 1);
|
2002-06-18 20:59:44 +00:00
|
|
|
private->display = display;
|
1997-12-06 20:53:46 +00:00
|
|
|
private->xcursor = xcursor;
|
2005-06-14 15:10:13 +00:00
|
|
|
private->name = NULL;
|
2005-06-17 17:26:24 +00:00
|
|
|
private->serial = theme_serial;
|
|
|
|
|
1997-12-06 20:53:46 +00:00
|
|
|
cursor = (GdkCursor *) private;
|
|
|
|
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
2000-02-13 20:22:20 +00:00
|
|
|
cursor->ref_count = 1;
|
|
|
|
|
1997-12-06 20:53:46 +00:00
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
2000-01-29 22:26:41 +00:00
|
|
|
_gdk_cursor_destroy (GdkCursor *cursor)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_if_fail (cursor != NULL);
|
2000-02-13 08:16:48 +00:00
|
|
|
g_return_if_fail (cursor->ref_count == 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
private = (GdkCursorPrivate *) cursor;
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
if (!private->display->closed && private->xcursor)
|
|
|
|
XFreeCursor (GDK_DISPLAY_XDISPLAY (private->display), private->xcursor);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
g_free (private->name);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_free (private);
|
|
|
|
}
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
|
2002-10-22 22:11:22 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_cursor_get_xdisplay:
|
|
|
|
* @cursor: a #GdkCursor.
|
|
|
|
*
|
|
|
|
* Returns the display of a #GdkCursor.
|
|
|
|
*
|
|
|
|
* Return value: an Xlib <type>Display*</type>.
|
|
|
|
**/
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
Display *
|
|
|
|
gdk_x11_cursor_get_xdisplay (GdkCursor *cursor)
|
|
|
|
{
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
|
2002-06-18 20:59:44 +00:00
|
|
|
return GDK_DISPLAY_XDISPLAY(((GdkCursorPrivate *)cursor)->display);
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
}
|
|
|
|
|
2002-10-22 22:11:22 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_cursor_get_xcursor:
|
|
|
|
* @cursor: a #GdkCursor.
|
|
|
|
*
|
|
|
|
* Returns the X cursor belonging to a #GdkCursor.
|
|
|
|
*
|
|
|
|
* Return value: an Xlib <type>Cursor</type>.
|
|
|
|
**/
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
Cursor
|
|
|
|
gdk_x11_cursor_get_xcursor (GdkCursor *cursor)
|
|
|
|
{
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_val_if_fail (cursor != NULL, None);
|
Make gdkx.h the only installed header from gdk/x11. All structures in
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 21:50:20 +00:00
|
|
|
|
|
|
|
return ((GdkCursorPrivate *)cursor)->xcursor;
|
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
/**
|
2002-06-18 20:59:44 +00:00
|
|
|
* gdk_cursor_get_display:
|
2002-11-28 00:33:17 +00:00
|
|
|
* @cursor: a #GdkCursor.
|
|
|
|
*
|
|
|
|
* Returns the display on which the #GdkCursor is defined.
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
2002-11-28 00:33:17 +00:00
|
|
|
* Returns: the #GdkDisplay associated to @cursor
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
2002-11-28 00:33:17 +00:00
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
|
2002-06-18 20:59:44 +00:00
|
|
|
GdkDisplay *
|
|
|
|
gdk_cursor_get_display (GdkCursor *cursor)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-06-18 20:59:44 +00:00
|
|
|
return ((GdkCursorPrivate *)cursor)->display;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
2003-06-30 22:30:54 +00:00
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
#if defined(HAVE_XCURSOR) && defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_cursor_get_image:
|
|
|
|
* @cursor: a #GdkCursor
|
|
|
|
*
|
|
|
|
* Returns a #GdkPixbuf with the image used to display the cursor.
|
|
|
|
*
|
|
|
|
* Note that depending on the capabilities of the windowing system and
|
|
|
|
* on the cursor, GDK may not be able to obtain the image data. In this
|
|
|
|
* case, %NULL is returned.
|
|
|
|
*
|
|
|
|
* Returns: a #GdkPixbuf representing @cursor, or %NULL
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
GdkPixbuf*
|
|
|
|
gdk_cursor_get_image (GdkCursor *cursor)
|
|
|
|
{
|
|
|
|
Display *xdisplay;
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
XcursorImages *images = NULL;
|
|
|
|
XcursorImage *image;
|
|
|
|
gint size;
|
|
|
|
gchar buf[32];
|
2005-06-15 21:22:54 +00:00
|
|
|
guchar *data, *p, tmp;
|
2005-06-14 15:10:13 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
gchar *theme;
|
2005-06-14 20:43:20 +00:00
|
|
|
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
2005-06-14 15:10:13 +00:00
|
|
|
|
|
|
|
private = (GdkCursorPrivate *) cursor;
|
|
|
|
|
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (private->display);
|
|
|
|
|
|
|
|
size = XcursorGetDefaultSize (xdisplay);
|
|
|
|
theme = XcursorGetTheme (xdisplay);
|
|
|
|
|
|
|
|
if (cursor->type == GDK_CURSOR_IS_PIXMAP)
|
|
|
|
{
|
|
|
|
if (private->name)
|
|
|
|
images = XcursorLibraryLoadImages (private->name, theme, size);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
images = XcursorShapeLoadImages (cursor->type, theme, size);
|
|
|
|
|
|
|
|
if (!images)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
image = images->images[0];
|
|
|
|
|
|
|
|
data = g_malloc (4 * image->width * image->height);
|
|
|
|
memcpy (data, image->pixels, 4 * image->width * image->height);
|
|
|
|
|
2005-06-15 21:22:54 +00:00
|
|
|
for (p = data; p < data + (4 * image->width * image->height); p += 4)
|
|
|
|
{
|
|
|
|
tmp = p[0];
|
|
|
|
p[0] = p[2];
|
|
|
|
p[2] = tmp;
|
|
|
|
}
|
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
pixbuf = gdk_pixbuf_new_from_data (data, GDK_COLORSPACE_RGB, TRUE,
|
|
|
|
8, image->width, image->height,
|
|
|
|
4 * image->width,
|
|
|
|
(GdkPixbufDestroyNotify)g_free, NULL);
|
|
|
|
|
|
|
|
if (private->name)
|
|
|
|
gdk_pixbuf_set_option (pixbuf, "name", private->name);
|
|
|
|
g_snprintf (buf, 32, "%d", image->xhot);
|
|
|
|
gdk_pixbuf_set_option (pixbuf, "x_hot", buf);
|
|
|
|
g_snprintf (buf, 32, "%d", image->yhot);
|
|
|
|
gdk_pixbuf_set_option (pixbuf, "y_hot", buf);
|
2005-06-14 20:43:20 +00:00
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
XcursorImagesDestroy (images);
|
|
|
|
|
|
|
|
return pixbuf;
|
|
|
|
}
|
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
void
|
|
|
|
_gdk_x11_cursor_update_theme (GdkCursor *cursor)
|
2005-06-15 18:37:18 +00:00
|
|
|
{
|
|
|
|
Display *xdisplay;
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
Cursor new_cursor = None;
|
2008-07-24 03:38:08 +00:00
|
|
|
GdkDisplayX11 *display_x11;
|
2005-06-14 20:43:20 +00:00
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
private = (GdkCursorPrivate *) cursor;
|
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (private->display);
|
2008-07-24 03:38:08 +00:00
|
|
|
display_x11 = GDK_DISPLAY_X11 (private->display);
|
|
|
|
|
|
|
|
if (!display_x11->have_xfixes)
|
|
|
|
return;
|
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
if (private->serial == theme_serial)
|
2005-06-15 18:37:18 +00:00
|
|
|
return;
|
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
private->serial = theme_serial;
|
2005-06-15 18:37:18 +00:00
|
|
|
|
|
|
|
if (private->xcursor != None)
|
2005-06-14 20:43:20 +00:00
|
|
|
{
|
2009-01-24 21:29:36 +00:00
|
|
|
if (cursor->type == GDK_BLANK_CURSOR)
|
|
|
|
return;
|
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
if (cursor->type == GDK_CURSOR_IS_PIXMAP)
|
2005-06-14 20:43:20 +00:00
|
|
|
{
|
2005-06-15 18:37:18 +00:00
|
|
|
if (private->name)
|
|
|
|
new_cursor = XcursorLibraryLoadCursor (xdisplay, private->name);
|
2005-06-14 20:43:20 +00:00
|
|
|
}
|
2005-06-15 18:37:18 +00:00
|
|
|
else
|
|
|
|
new_cursor = XcursorShapeLoadCursor (xdisplay, cursor->type);
|
|
|
|
|
|
|
|
if (new_cursor != None)
|
2009-01-20 02:15:59 +00:00
|
|
|
{
|
|
|
|
XFixesChangeCursor (xdisplay, new_cursor, private->xcursor);
|
|
|
|
private->xcursor = new_cursor;
|
|
|
|
}
|
2005-06-14 20:43:20 +00:00
|
|
|
}
|
2005-06-15 18:37:18 +00:00
|
|
|
}
|
2005-06-14 20:43:20 +00:00
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
static void
|
2009-01-20 02:15:59 +00:00
|
|
|
update_cursor (gpointer data,
|
|
|
|
gpointer user_data)
|
2005-06-17 17:26:24 +00:00
|
|
|
{
|
|
|
|
GdkCursor *cursor;
|
|
|
|
|
2009-01-20 02:15:59 +00:00
|
|
|
cursor = (GdkCursor*)(data);
|
2005-06-17 17:26:24 +00:00
|
|
|
|
|
|
|
if (!cursor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
_gdk_x11_cursor_update_theme (cursor);
|
|
|
|
}
|
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_display_set_cursor_theme:
|
|
|
|
* @display: a #GdkDisplay
|
2005-08-25 19:22:29 +00:00
|
|
|
* @theme: the name of the cursor theme to use, or %NULL to unset
|
2006-01-25 15:41:40 +00:00
|
|
|
* a previously set value
|
|
|
|
* @size: the cursor size to use, or 0 to keep the previous size
|
2005-06-15 18:37:18 +00:00
|
|
|
*
|
|
|
|
* Sets the cursor theme from which the images for cursor
|
|
|
|
* should be taken.
|
|
|
|
*
|
|
|
|
* If the windowing system supports it, existing cursors created
|
|
|
|
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
|
|
|
|
* gdk_cursor_new_for_name() are updated to reflect the theme
|
|
|
|
* change. Custom cursors constructed with gdk_cursor_new_from_pixmap()
|
|
|
|
* or gdk_cursor_new_from_pixbuf() will have to be handled
|
|
|
|
* by the application (GTK+ applications can learn about
|
|
|
|
* cursor theme changes by listening for change notification
|
|
|
|
* for the corresponding #GtkSetting).
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_x11_display_set_cursor_theme (GdkDisplay *display,
|
|
|
|
const gchar *theme,
|
|
|
|
const gint size)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
Display *xdisplay;
|
|
|
|
gchar *old_theme;
|
|
|
|
gint old_size;
|
2005-06-14 15:10:13 +00:00
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
|
|
|
|
old_theme = XcursorGetTheme (xdisplay);
|
|
|
|
old_size = XcursorGetDefaultSize (xdisplay);
|
|
|
|
|
2005-08-25 19:22:29 +00:00
|
|
|
if (old_size == size &&
|
|
|
|
(old_theme == theme ||
|
|
|
|
(old_theme && theme && strcmp (old_theme, theme) == 0)))
|
2005-06-15 18:37:18 +00:00
|
|
|
return;
|
|
|
|
|
2005-06-17 17:26:24 +00:00
|
|
|
theme_serial++;
|
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
XcursorSetTheme (xdisplay, theme);
|
2006-01-25 15:41:40 +00:00
|
|
|
if (size > 0)
|
|
|
|
XcursorSetDefaultSize (xdisplay, size);
|
2005-06-15 18:37:18 +00:00
|
|
|
|
2009-01-20 02:15:59 +00:00
|
|
|
g_slist_foreach (cursor_cache, update_cursor, NULL);
|
2005-06-14 15:10:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
GdkPixbuf*
|
|
|
|
gdk_cursor_get_image (GdkCursor *cursor)
|
|
|
|
{
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
2005-06-14 15:10:13 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-06-15 18:37:18 +00:00
|
|
|
void
|
|
|
|
gdk_x11_display_set_cursor_theme (GdkDisplay *display,
|
|
|
|
const gchar *theme,
|
|
|
|
const gint size)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
2005-06-17 19:27:04 +00:00
|
|
|
}
|
2005-06-15 18:37:18 +00:00
|
|
|
|
2005-06-17 19:27:04 +00:00
|
|
|
void
|
|
|
|
_gdk_x11_cursor_update_theme (GdkCursor *cursor)
|
|
|
|
{
|
2005-06-18 11:25:14 +00:00
|
|
|
g_return_if_fail (cursor != NULL);
|
2005-06-15 18:37:18 +00:00
|
|
|
}
|
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
#endif
|
2003-06-30 22:30:54 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XCURSOR
|
|
|
|
|
|
|
|
static XcursorImage*
|
2004-06-21 16:13:55 +00:00
|
|
|
create_cursor_image (GdkPixbuf *pixbuf,
|
|
|
|
gint x,
|
2003-06-30 22:30:54 +00:00
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
guint width, height, rowstride, n_channels;
|
|
|
|
guchar *pixels, *src;
|
|
|
|
XcursorImage *xcimage;
|
|
|
|
XcursorPixel *dest;
|
|
|
|
|
|
|
|
width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
height = gdk_pixbuf_get_height (pixbuf);
|
|
|
|
|
|
|
|
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
|
|
|
|
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
|
|
|
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
|
|
|
|
|
|
|
xcimage = XcursorImageCreate (width, height);
|
2004-06-21 16:13:55 +00:00
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
xcimage->xhot = x;
|
|
|
|
xcimage->yhot = y;
|
|
|
|
|
|
|
|
dest = xcimage->pixels;
|
|
|
|
|
2004-06-21 16:13:55 +00:00
|
|
|
if (n_channels == 3)
|
2003-06-30 22:30:54 +00:00
|
|
|
{
|
2004-06-21 16:13:55 +00:00
|
|
|
gint i, j;
|
|
|
|
|
|
|
|
for (j = 0; j < height; j++)
|
|
|
|
{
|
|
|
|
src = pixels + j * rowstride;
|
|
|
|
for (i = 0; i < width; i++)
|
|
|
|
{
|
|
|
|
*dest = (0xff << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
|
|
|
}
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
src += n_channels;
|
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
}
|
2004-06-21 16:13:55 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
_gdk_x11_convert_to_format (pixels, rowstride,
|
|
|
|
(guchar *) dest, 4 * width,
|
|
|
|
GDK_X11_FORMAT_ARGB,
|
|
|
|
(G_BYTE_ORDER == G_BIG_ENDIAN) ?
|
|
|
|
GDK_MSB_FIRST : GDK_LSB_FIRST,
|
|
|
|
width, height);
|
|
|
|
}
|
2003-06-30 22:30:54 +00:00
|
|
|
|
|
|
|
return xcimage;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_cursor_new_from_pixbuf:
|
|
|
|
* @display: the #GdkDisplay for which the cursor will be created
|
|
|
|
* @pixbuf: the #GdkPixbuf containing the cursor image
|
|
|
|
* @x: the horizontal offset of the 'hotspot' of the cursor.
|
|
|
|
* @y: the vertical offset of the 'hotspot' of the cursor.
|
|
|
|
*
|
|
|
|
* Creates a new cursor from a pixbuf.
|
|
|
|
*
|
|
|
|
* Not all GDK backends support RGBA cursors. If they are not
|
|
|
|
* supported, a monochrome approximation will be displayed.
|
|
|
|
* The functions gdk_display_supports_cursor_alpha() and
|
|
|
|
* gdk_display_supports_cursor_color() can be used to determine
|
|
|
|
* whether RGBA cursors are supported;
|
|
|
|
* gdk_display_get_default_cursor_size() and
|
|
|
|
* gdk_display_get_maximal_cursor_size() give information about
|
|
|
|
* cursor sizes.
|
|
|
|
*
|
2010-10-15 18:34:44 +00:00
|
|
|
* If @x or @y are <literal>-1</literal>, the pixbuf must have
|
|
|
|
* options named "x_hot" and "y_hot", resp., containing
|
|
|
|
* integer values between %0 and the width resp. height of
|
|
|
|
* the pixbuf. (Since: 3.0)
|
|
|
|
*
|
2003-06-30 22:30:54 +00:00
|
|
|
* On the X backend, support for RGBA cursors requires a
|
|
|
|
* sufficently new version of the X Render extension.
|
|
|
|
*
|
|
|
|
* Returns: a new #GdkCursor.
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
GdkCursor *
|
|
|
|
gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
|
|
|
GdkPixbuf *pixbuf,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
XcursorImage *xcimage;
|
|
|
|
Cursor xcursor;
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
GdkCursor *cursor;
|
2010-10-15 18:34:44 +00:00
|
|
|
const char *option;
|
|
|
|
char *end;
|
|
|
|
gint64 value;
|
2003-06-30 22:30:54 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
2010-10-15 18:34:44 +00:00
|
|
|
|
|
|
|
if (x == -1 && (option = gdk_pixbuf_get_option (pixbuf, "x_hot")))
|
|
|
|
{
|
|
|
|
errno = 0;
|
|
|
|
end = NULL;
|
|
|
|
value = g_ascii_strtoll (option, &end, 10);
|
|
|
|
if (errno == 0 &&
|
|
|
|
end != option &&
|
|
|
|
value >= 0 && value < G_MAXINT)
|
|
|
|
x = (gint) value;
|
|
|
|
}
|
|
|
|
if (y == -1 && (option = gdk_pixbuf_get_option (pixbuf, "y_hot")))
|
|
|
|
{
|
|
|
|
errno = 0;
|
|
|
|
end = NULL;
|
|
|
|
value = g_ascii_strtoll (option, &end, 10);
|
|
|
|
if (errno == 0 &&
|
|
|
|
end != option &&
|
|
|
|
value >= 0 && value < G_MAXINT)
|
|
|
|
y = (gint) value;
|
|
|
|
}
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
g_return_val_if_fail (0 <= x && x < gdk_pixbuf_get_width (pixbuf), NULL);
|
|
|
|
g_return_val_if_fail (0 <= y && y < gdk_pixbuf_get_height (pixbuf), NULL);
|
|
|
|
|
|
|
|
if (display->closed)
|
|
|
|
xcursor = None;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xcimage = create_cursor_image (pixbuf, x, y);
|
|
|
|
xcursor = XcursorImageLoadCursor (GDK_DISPLAY_XDISPLAY (display), xcimage);
|
|
|
|
XcursorImageDestroy (xcimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
private = g_new (GdkCursorPrivate, 1);
|
|
|
|
private->display = display;
|
|
|
|
private->xcursor = xcursor;
|
2005-06-14 15:10:13 +00:00
|
|
|
private->name = NULL;
|
2005-06-17 17:26:24 +00:00
|
|
|
private->serial = theme_serial;
|
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
cursor = (GdkCursor *) private;
|
|
|
|
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
|
|
|
cursor->ref_count = 1;
|
|
|
|
|
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_cursor_new_from_name:
|
|
|
|
* @display: the #GdkDisplay for which the cursor will be created
|
|
|
|
* @name: the name of the cursor
|
|
|
|
*
|
|
|
|
* Creates a new cursor by looking up @name in the current cursor
|
|
|
|
* theme.
|
|
|
|
*
|
|
|
|
* Returns: a new #GdkCursor, or %NULL if there is no cursor with
|
|
|
|
* the given name
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
GdkCursor*
|
|
|
|
gdk_cursor_new_from_name (GdkDisplay *display,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
Cursor xcursor;
|
|
|
|
Display *xdisplay;
|
|
|
|
GdkCursorPrivate *private;
|
|
|
|
GdkCursor *cursor;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
if (display->closed)
|
|
|
|
xcursor = None;
|
|
|
|
else
|
|
|
|
{
|
2009-01-20 02:15:59 +00:00
|
|
|
private = find_in_cache (display, GDK_CURSOR_IS_PIXMAP, name);
|
|
|
|
|
|
|
|
if (private)
|
|
|
|
{
|
|
|
|
/* Cache had it, add a ref for this user */
|
|
|
|
gdk_cursor_ref ((GdkCursor*) private);
|
|
|
|
|
|
|
|
return (GdkCursor*) private;
|
|
|
|
}
|
|
|
|
|
2005-06-14 15:10:13 +00:00
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
xcursor = XcursorLibraryLoadCursor (xdisplay, name);
|
|
|
|
if (xcursor == None)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
private = g_new (GdkCursorPrivate, 1);
|
|
|
|
private->display = display;
|
|
|
|
private->xcursor = xcursor;
|
|
|
|
private->name = g_strdup (name);
|
2005-06-17 17:26:24 +00:00
|
|
|
private->serial = theme_serial;
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
cursor = (GdkCursor *) private;
|
|
|
|
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
|
|
|
cursor->ref_count = 1;
|
2009-01-20 02:15:59 +00:00
|
|
|
add_to_cache (private);
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_supports_cursor_alpha:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns %TRUE if cursors can use an 8bit alpha channel
|
|
|
|
* on @display. Otherwise, cursors are restricted to bilevel
|
|
|
|
* alpha (i.e. a mask).
|
|
|
|
*
|
|
|
|
* Returns: whether cursors can have alpha channels.
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return XcursorSupportsARGB (GDK_DISPLAY_XDISPLAY (display));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_supports_cursor_color:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns %TRUE if multicolored cursors are supported
|
|
|
|
* on @display. Otherwise, cursors have only a forground
|
|
|
|
* and a background color.
|
|
|
|
*
|
|
|
|
* Returns: whether cursors can have multiple colors.
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gdk_display_supports_cursor_color (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return XcursorSupportsARGB (GDK_DISPLAY_XDISPLAY (display));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_get_default_cursor_size:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns the default size to use for cursors on @display.
|
|
|
|
*
|
|
|
|
* Returns: the default cursor size.
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
guint
|
|
|
|
gdk_display_get_default_cursor_size (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return XcursorGetDefaultSize (GDK_DISPLAY_XDISPLAY (display));
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
GdkCursor *
|
|
|
|
gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
|
|
|
GdkPixbuf *pixbuf,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GdkCursor *cursor;
|
|
|
|
GdkPixmap *pixmap, *mask;
|
|
|
|
guint width, height, n_channels, rowstride, i, j;
|
|
|
|
guint8 *data, *mask_data, *pixels;
|
|
|
|
GdkColor fg = { 0, 0, 0, 0 };
|
|
|
|
GdkColor bg = { 0, 0xffff, 0xffff, 0xffff };
|
|
|
|
GdkScreen *screen;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
|
|
|
|
|
|
|
width = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
height = gdk_pixbuf_get_height (pixbuf);
|
|
|
|
|
|
|
|
g_return_val_if_fail (0 <= x && x < width, NULL);
|
|
|
|
g_return_val_if_fail (0 <= y && y < height, NULL);
|
|
|
|
|
|
|
|
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
|
|
|
|
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
|
|
|
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
|
|
|
|
|
|
|
data = g_new0 (guint8, (width + 7) / 8 * height);
|
|
|
|
mask_data = g_new0 (guint8, (width + 7) / 8 * height);
|
|
|
|
|
|
|
|
for (j = 0; j < height; j++)
|
|
|
|
{
|
|
|
|
guint8 *src = pixels + j * rowstride;
|
|
|
|
guint8 *d = data + (width + 7) / 8 * j;
|
|
|
|
guint8 *md = mask_data + (width + 7) / 8 * j;
|
|
|
|
|
|
|
|
for (i = 0; i < width; i++)
|
|
|
|
{
|
|
|
|
if (src[1] < 0x80)
|
|
|
|
*d |= 1 << (i % 8);
|
|
|
|
|
|
|
|
if (n_channels == 3 || src[3] >= 0x80)
|
|
|
|
*md |= 1 << (i % 8);
|
|
|
|
|
|
|
|
src += n_channels;
|
2003-07-11 17:32:49 +00:00
|
|
|
if (i % 8 == 7)
|
2003-06-30 22:30:54 +00:00
|
|
|
{
|
|
|
|
d++;
|
|
|
|
md++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
screen = gdk_display_get_default_screen (display);
|
|
|
|
pixmap = gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen),
|
|
|
|
data, width, height);
|
|
|
|
|
|
|
|
mask = gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen),
|
|
|
|
mask_data, width, height);
|
|
|
|
|
|
|
|
cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg, x, y);
|
|
|
|
|
|
|
|
g_object_unref (pixmap);
|
|
|
|
g_object_unref (mask);
|
|
|
|
|
|
|
|
g_free (data);
|
|
|
|
g_free (mask_data);
|
|
|
|
|
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
2005-06-14 20:43:20 +00:00
|
|
|
GdkCursor*
|
|
|
|
gdk_cursor_new_from_name (GdkDisplay *display,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
gboolean
|
|
|
|
gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gdk_display_supports_cursor_color (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
2003-12-24 23:28:14 +00:00
|
|
|
gdk_display_get_default_cursor_size (GdkDisplay *display)
|
2003-06-30 22:30:54 +00:00
|
|
|
{
|
2004-01-30 19:49:40 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
2003-06-30 22:30:54 +00:00
|
|
|
|
|
|
|
/* no idea, really */
|
|
|
|
return 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_get_maximal_cursor_size:
|
|
|
|
* @display: a #GdkDisplay
|
2009-08-18 18:35:10 +00:00
|
|
|
* @width: (out): the return location for the maximal cursor width
|
|
|
|
* @height: (out): the return location for the maximal cursor height
|
2003-06-30 22:30:54 +00:00
|
|
|
*
|
2003-07-14 22:13:33 +00:00
|
|
|
* Gets the maximal size to use for cursors on @display.
|
2003-06-30 22:30:54 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
|
|
|
guint *width,
|
|
|
|
guint *height)
|
|
|
|
{
|
|
|
|
GdkScreen *screen;
|
|
|
|
GdkWindow *window;
|
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
2003-06-30 22:30:54 +00:00
|
|
|
|
|
|
|
screen = gdk_display_get_default_screen (display);
|
|
|
|
window = gdk_screen_get_root_window (screen);
|
|
|
|
XQueryBestCursor (GDK_DISPLAY_XDISPLAY (display),
|
|
|
|
GDK_WINDOW_XWINDOW (window),
|
|
|
|
128, 128, width, height);
|
|
|
|
}
|
|
|
|
|
2005-03-16 03:17:27 +00:00
|
|
|
#define __GDK_CURSOR_X11_C__
|
|
|
|
#include "gdkaliasdef.c"
|