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/.
|
|
|
|
*/
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
#include "config.h"
|
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
|
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"
|
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>
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
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>
|
|
|
|
* </itemizedlist>
|
2001-10-03 18:19:48 +00:00
|
|
|
*
|
|
|
|
* To make the cursor invisible, use gdk_cursor_new_from_pixmap() to create
|
|
|
|
* a cursor with no pixels in it.
|
|
|
|
*
|
|
|
|
* 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)
|
|
|
|
xcursor = None;
|
|
|
|
else
|
|
|
|
xcursor = XCreateFontCursor (GDK_DISPLAY_XDISPLAY (display), cursor_type);
|
|
|
|
|
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;
|
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;
|
|
|
|
|
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);
|
|
|
|
* gdk_pixmap_unref (source);
|
|
|
|
* gdk_pixmap_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*
|
2000-02-13 08:16:48 +00:00
|
|
|
gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
|
|
|
GdkPixmap *mask,
|
|
|
|
GdkColor *fg,
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (cursor != NULL, None);
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
g_return_val_if_fail (cursor != NULL, NULL);
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_XCURSOR
|
|
|
|
|
|
|
|
static XcursorImage*
|
|
|
|
create_cursor_image (GdkPixbuf *pixbuf,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
guint width, height, rowstride, n_channels;
|
|
|
|
guchar *pixels, *src;
|
|
|
|
XcursorImage *xcimage;
|
|
|
|
XcursorPixel *dest;
|
|
|
|
guchar a;
|
|
|
|
gint i, j;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
xcimage->xhot = x;
|
|
|
|
xcimage->yhot = y;
|
|
|
|
|
|
|
|
dest = xcimage->pixels;
|
|
|
|
|
|
|
|
for (j = 0; j < height; j++)
|
|
|
|
{
|
|
|
|
src = pixels + j * rowstride;
|
|
|
|
for (i = 0; i < width; i++)
|
|
|
|
{
|
|
|
|
if (n_channels == 3)
|
|
|
|
a = 0xff;
|
|
|
|
else
|
|
|
|
a = src[3];
|
|
|
|
|
|
|
|
*dest = (a << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
|
|
|
|
src += n_channels;
|
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* 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;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
|
|
|
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;
|
|
|
|
cursor = (GdkCursor *) private;
|
|
|
|
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
|
|
|
cursor->ref_count = 1;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
gdk_display_default_cursor_size (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
/* no idea, really */
|
|
|
|
return 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_get_maximal_cursor_size:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
* @width: the return location for the maximal cursor width
|
|
|
|
* @height: the return location for the maximal cursor height
|
|
|
|
*
|
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);
|
|
|
|
}
|
|
|
|
|