gtk/gdk/gdkgc.c

1518 lines
37 KiB
C
Raw Normal View History

/* GDK - The GIMP Drawing Kit
1997-11-24 22:37:52 +00:00
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
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
* Lesser General Public License for more details.
1997-11-24 22:37:52 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
1997-11-24 22:37:52 +00:00
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
1997-11-24 22:37:52 +00:00
#include <string.h>
Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to 2005-05-11 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to avoid having an extraneous window. * gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe color when !has_opacity. 2005-05-10 Owen Taylor <otaylor@redhat.com> * gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source files for Cairo convenience functionality. * gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a convenience functions to add GdkRectangle, GdkRegion to a cairo path. * gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c gtk/gtkstyle.c: Use gdk_cairo_rectangle/region(). * gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename gdk_drawable_create_cairo_context() to gdk_cairo_create(). * gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c: Rename gdk_pixbuf_set_as_cairo_source() to gdk_cairo_set_source_pixbuf(). * gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c: Adjust for renames. * gdk/gdk.symbols: Update. * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix coordinate system problem that was causing the wrong portions to be invalidated. * gtk/gtkcellrenderer.c (gtk_cell_renderer_render) gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render) gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render) gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render) gtk/gtkcellview.c (gtk_cell_view_expose) gtk/gtkdnd.c (gtk_drag_highlight_expose) gtk/gtkentry.c (gtk_entry_draw_text) gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization. * gtk/gtkcalendar.[ch]: Beat into something roughly resembling GTK+ style ... use instance-private data and standard names for private structure, etc. Move function docs inline. * gtk/gtkcalendar.[ch]: Switch to drawing everything in expose. Switch drawing to Cairo. * gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
#include "gdkcairo.h"
#include "gdkgc.h"
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
#include "gdkinternals.h"
#include "gdkpixmap.h"
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
#include "gdkrgb.h"
1997-11-24 22:37:52 +00:00
#include "gdkprivate.h"
#include "gdkalias.h"
1997-11-24 22:37:52 +00:00
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
static void gdk_gc_finalize (GObject *object);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
typedef struct _GdkGCPrivate GdkGCPrivate;
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
struct _GdkGCPrivate
1997-11-24 22:37:52 +00:00
{
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
GdkRegion *clip_region;
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
2008-12-04 19:18:02 +00:00
guint32 region_tag_applied;
int region_tag_offset_x;
int region_tag_offset_y;
2009-05-27 15:06:46 +00:00
2008-12-04 19:18:02 +00:00
GdkRegion *old_clip_region;
GdkPixmap *old_clip_mask;
2009-05-27 15:06:46 +00:00
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
GdkBitmap *stipple;
GdkPixmap *tile;
GdkPixmap *clip_mask;
2009-05-27 15:06:46 +00:00
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
guint32 fg_pixel;
guint32 bg_pixel;
2009-05-27 15:06:46 +00:00
guint subwindow_mode : 1;
guint fill : 2;
guint exposures : 2;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
};
#define GDK_GC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_GC, GdkGCPrivate))
2006-05-14 03:58:06 +00:00
G_DEFINE_TYPE (GdkGC, gdk_gc, G_TYPE_OBJECT)
1997-11-24 22:37:52 +00:00
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
static void
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
gdk_gc_class_init (GdkGCClass *class)
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
{
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
GObjectClass *object_class = G_OBJECT_CLASS (class);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
object_class->finalize = gdk_gc_finalize;
g_type_class_add_private (object_class, sizeof (GdkGCPrivate));
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
static void
gdk_gc_init (GdkGC *gc)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
priv->fill = GDK_SOLID;
/* These are the default X11 value, which we match. They are clearly
* wrong for TrueColor displays, so apps have to change them.
*/
priv->fg_pixel = 0;
priv->bg_pixel = 1;
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_new:
* @drawable: a #GdkDrawable. The created GC must always be used
* with drawables of the same depth as this one.
*
* Create a new graphics context with default values.
*
* Returns: the new graphics context.
**/
1997-11-24 22:37:52 +00:00
GdkGC*
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
gdk_gc_new (GdkDrawable *drawable)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
g_return_val_if_fail (drawable != NULL, NULL);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
return gdk_gc_new_with_values (drawable, NULL, 0);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_new_with_values:
* @drawable: a #GdkDrawable. The created GC must always be used
* with drawables of the same depth as this one.
* @values: a structure containing initial values for the GC.
* @values_mask: a bit mask indicating which fields in @values
* are set.
*
* Create a new GC with the given initial values.
*
* Return value: the new graphics context.
**/
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGC*
gdk_gc_new_with_values (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
g_return_val_if_fail (drawable != NULL, NULL);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
return GDK_DRAWABLE_GET_CLASS (drawable)->create_gc (drawable,
values,
values_mask);
}
/**
* _gdk_gc_init:
* @gc: a #GdkGC
* @drawable: a #GdkDrawable.
* @values: a structure containing initial values for the GC.
* @values_mask: a bit mask indicating which fields in @values
* are set.
*
* Does initialization of the generic portions of a #GdkGC
* created with the specified values and values_mask. This
* should be called out of the implementation of
* GdkDrawable.create_gc() immediately after creating the
* #GdkGC object.
**/
void
_gdk_gc_init (GdkGC *gc,
GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
GdkGCPrivate *priv;
g_return_if_fail (GDK_IS_GC (gc));
priv = GDK_GC_GET_PRIVATE (gc);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
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
gc->clip_x_origin = values->clip_x_origin;
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
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
gc->clip_y_origin = values->clip_y_origin;
if ((values_mask & GDK_GC_CLIP_MASK) && values->clip_mask)
priv->clip_mask = g_object_ref (values->clip_mask);
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_TS_X_ORIGIN)
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
gc->ts_x_origin = values->ts_x_origin;
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_TS_Y_ORIGIN)
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
gc->ts_y_origin = values->ts_y_origin;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (values_mask & GDK_GC_FILL)
priv->fill = values->fill;
if (values_mask & GDK_GC_STIPPLE)
{
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
priv->stipple = values->stipple;
if (priv->stipple)
g_object_ref (priv->stipple);
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (values_mask & GDK_GC_TILE)
{
priv->tile = values->tile;
if (priv->tile)
g_object_ref (priv->tile);
}
if (values_mask & GDK_GC_FOREGROUND)
priv->fg_pixel = values->foreground.pixel;
if (values_mask & GDK_GC_BACKGROUND)
priv->bg_pixel = values->background.pixel;
if (values_mask & GDK_GC_SUBWINDOW)
priv->subwindow_mode = values->subwindow_mode;
2009-05-27 15:06:46 +00:00
if (values_mask & GDK_GC_EXPOSURES)
priv->exposures = values->graphics_exposures;
else
priv->exposures = TRUE;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
gc->colormap = gdk_drawable_get_colormap (drawable);
if (gc->colormap)
g_object_ref (gc->colormap);
}
1997-11-24 22:37:52 +00:00
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
static void
gdk_gc_finalize (GObject *object)
{
GdkGC *gc = GDK_GC (object);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (priv->clip_region)
gdk_region_destroy (priv->clip_region);
2008-12-04 19:18:02 +00:00
if (priv->old_clip_region)
gdk_region_destroy (priv->old_clip_region);
if (priv->clip_mask)
g_object_unref (priv->clip_mask);
if (priv->old_clip_mask)
g_object_unref (priv->old_clip_mask);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
if (gc->colormap)
g_object_unref (gc->colormap);
if (priv->tile)
g_object_unref (priv->tile);
if (priv->stipple)
g_object_unref (priv->stipple);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
G_OBJECT_CLASS (gdk_gc_parent_class)->finalize (object);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
}
/**
* gdk_gc_ref:
* @gc: a #GdkGC
*
* Deprecated function; use g_object_ref() instead.
*
* Return value: the gc.
*
* Deprecated: 2.0: Use g_object_ref() instead.
**/
GdkGC *
gdk_gc_ref (GdkGC *gc)
{
return (GdkGC *) g_object_ref (gc);
}
1997-11-24 22:37:52 +00:00
/**
* gdk_gc_unref:
* @gc: a #GdkGC
*
2004-06-22 15:29:29 +00:00
* Decrement the reference count of @gc.
*
* Deprecated: 2.0: Use g_object_unref() instead.
**/
void
gdk_gc_unref (GdkGC *gc)
{
g_object_unref (gc);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_get_values:
* @gc: a #GdkGC.
* @values: the #GdkGCValues structure in which to store the results.
*
* Retrieves the current values from a graphics context. Note that
* only the pixel values of the @values->foreground and @values->background
* are filled, use gdk_colormap_query_color() to obtain the rgb values
* if you need them.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values)
{
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_if_fail (GDK_IS_GC (gc));
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
g_return_if_fail (values != NULL);
1997-11-24 22:37:52 +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
GDK_GC_GET_CLASS (gc)->get_values (gc, values);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
}
/**
* gdk_gc_set_values:
* @gc: a #GdkGC
* @values: struct containing the new values
* @values_mask: mask indicating which struct fields are to be used
*
* Sets attributes of a graphics context in bulk. For each flag set in
* @values_mask, the corresponding field will be read from @values and
* set as the new value for @gc. If you're only setting a few values
* on @gc, calling individual "setter" functions is likely more
* convenient.
*
**/
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
void
gdk_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
GdkGCPrivate *priv;
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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
g_return_if_fail (values != NULL);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
priv = GDK_GC_GET_PRIVATE (gc);
2008-12-04 19:18:02 +00:00
if ((values_mask & GDK_GC_CLIP_X_ORIGIN) ||
(values_mask & GDK_GC_CLIP_Y_ORIGIN) ||
(values_mask & GDK_GC_CLIP_MASK) ||
(values_mask & GDK_GC_SUBWINDOW))
_gdk_gc_remove_drawable_clip (gc);
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
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
gc->clip_x_origin = values->clip_x_origin;
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
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
gc->clip_y_origin = values->clip_y_origin;
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_TS_X_ORIGIN)
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
gc->ts_x_origin = values->ts_x_origin;
2000-03-28 01:24:44 +00:00
if (values_mask & GDK_GC_TS_Y_ORIGIN)
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
gc->ts_y_origin = values->ts_y_origin;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (values_mask & GDK_GC_CLIP_MASK)
{
if (priv->clip_mask)
{
g_object_unref (priv->clip_mask);
priv->clip_mask = NULL;
}
if (values->clip_mask)
priv->clip_mask = g_object_ref (values->clip_mask);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (priv->clip_region)
{
gdk_region_destroy (priv->clip_region);
priv->clip_region = NULL;
}
}
if (values_mask & GDK_GC_FILL)
priv->fill = values->fill;
if (values_mask & GDK_GC_STIPPLE)
{
if (priv->stipple != values->stipple)
{
if (priv->stipple)
g_object_unref (priv->stipple);
priv->stipple = values->stipple;
if (priv->stipple)
g_object_ref (priv->stipple);
}
}
if (values_mask & GDK_GC_TILE)
{
if (priv->tile != values->tile)
{
if (priv->tile)
g_object_unref (priv->tile);
priv->tile = values->tile;
if (priv->tile)
g_object_ref (priv->tile);
}
}
if (values_mask & GDK_GC_FOREGROUND)
priv->fg_pixel = values->foreground.pixel;
if (values_mask & GDK_GC_BACKGROUND)
priv->bg_pixel = values->background.pixel;
if (values_mask & GDK_GC_SUBWINDOW)
priv->subwindow_mode = values->subwindow_mode;
2009-05-27 15:06:46 +00:00
if (values_mask & GDK_GC_EXPOSURES)
priv->exposures = values->graphics_exposures;
2000-03-28 01:24:44 +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
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_foreground:
* @gc: a #GdkGC.
* @color: the new foreground color.
*
* Sets the foreground color for a graphics context.
* Note that this function uses @color->pixel, use
* gdk_gc_set_rgb_fg_color() to specify the foreground
* color as red, green, blue components.
**/
1997-11-24 22:37:52 +00:00
void
Fix #105497; constify uses of GdkColor. 2004-01-26 Federico Mena Quintero <federico@ximian.com> Fix #105497; constify uses of GdkColor. * gdk/gdkgc.c (gdk_gc_set_rgb_fg_color): Constify. (gdk_gc_set_rgb_bg_color): Constify. (gdk_gc_set_foreground): Constify. * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixmap): Constify. * gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Constify. * gdk/linux-fb/gdkcursor-fb.c (gdk_cursor_new_from_pixmap): Constify. * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_create_from_data): Constify. * gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Constify. * gdk/linux-fb/gdkpixmap-fb.c (gdk_pixmap_create_from_data): Constify. * gdk/x11/gdkwindow-x11.c (gdk_window_set_background): Constify. * gdk/win32/gdkwindow-win32.c (gdk_window_set_background): Constify. * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Constify. * gdk/gdkpango.c (gdk_draw_layout_line_with_colors): Constify. (gdk_draw_layout_with_colors): Constify. * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): Constify. (gdk_pixmap_colormap_create_from_xpm): Constify. (gdk_pixmap_create_from_xpm): Constify. (gdk_pixmap_colormap_create_from_xpm_d): Constify. (gdk_pixmap_create_from_xpm_d): Constify. * gtk/gtkcellview.c (gtk_cell_view_set_background_color): Constify. * gtk/gtkclist.c (gtk_clist_set_foreground): Constify. (gtk_clist_set_background): Constify. * gtk/gtkcolorbutton.c (gtk_color_button_new_with_color): Constify. (gtk_color_button_set_color): Constify. * gtk/gtkcolorsel.c (gtk_color_selection_set_current_color): Constify and add a check for color != NULL. (gtk_color_selection_get_current_color): Add a check for color != NULL. (gtk_color_selection_set_previous_color): Constify and add a check for color != NULL. (gtk_color_selection_get_previous_color): Add a check for color != NULL. * gtk/gtkctree.c (gtk_ctree_node_set_foreground): Constify. (gtk_ctree_node_set_background): Constify. * gtk/gtktext.c (gtk_text_insert): Constify. (insert_text_property): Constify. (text_properties_equal): Constify. (new_text_property): Constify. * gtk/gtkwidget.c (gtk_widget_modify_color_component): Constify. (gtk_widget_modify_fg): Constify. (gtk_widget_modify_bg): Constify. (gtk_widget_modify_text): Constify. (gtk_widget_modify_base): Constify.
2004-01-26 20:21:09 +00:00
gdk_gc_set_foreground (GdkGC *gc,
const GdkColor *color)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
g_return_if_fail (color != NULL);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.foreground = *color;
gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_background:
* @gc: a #GdkGC.
* @color: the new background color.
*
* Sets the background color for a graphics context.
* Note that this function uses @color->pixel, use
* gdk_gc_set_rgb_bg_color() to specify the background
* color as red, green, blue components.
**/
1997-11-24 22:37:52 +00:00
void
Fix #105497; constify uses of GdkColor. 2004-01-26 Federico Mena Quintero <federico@ximian.com> Fix #105497; constify uses of GdkColor. * gdk/gdkgc.c (gdk_gc_set_rgb_fg_color): Constify. (gdk_gc_set_rgb_bg_color): Constify. (gdk_gc_set_foreground): Constify. * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixmap): Constify. * gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Constify. * gdk/linux-fb/gdkcursor-fb.c (gdk_cursor_new_from_pixmap): Constify. * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_create_from_data): Constify. * gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Constify. * gdk/linux-fb/gdkpixmap-fb.c (gdk_pixmap_create_from_data): Constify. * gdk/x11/gdkwindow-x11.c (gdk_window_set_background): Constify. * gdk/win32/gdkwindow-win32.c (gdk_window_set_background): Constify. * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Constify. * gdk/gdkpango.c (gdk_draw_layout_line_with_colors): Constify. (gdk_draw_layout_with_colors): Constify. * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): Constify. (gdk_pixmap_colormap_create_from_xpm): Constify. (gdk_pixmap_create_from_xpm): Constify. (gdk_pixmap_colormap_create_from_xpm_d): Constify. (gdk_pixmap_create_from_xpm_d): Constify. * gtk/gtkcellview.c (gtk_cell_view_set_background_color): Constify. * gtk/gtkclist.c (gtk_clist_set_foreground): Constify. (gtk_clist_set_background): Constify. * gtk/gtkcolorbutton.c (gtk_color_button_new_with_color): Constify. (gtk_color_button_set_color): Constify. * gtk/gtkcolorsel.c (gtk_color_selection_set_current_color): Constify and add a check for color != NULL. (gtk_color_selection_get_current_color): Add a check for color != NULL. (gtk_color_selection_set_previous_color): Constify and add a check for color != NULL. (gtk_color_selection_get_previous_color): Add a check for color != NULL. * gtk/gtkctree.c (gtk_ctree_node_set_foreground): Constify. (gtk_ctree_node_set_background): Constify. * gtk/gtktext.c (gtk_text_insert): Constify. (insert_text_property): Constify. (text_properties_equal): Constify. (new_text_property): Constify. * gtk/gtkwidget.c (gtk_widget_modify_color_component): Constify. (gtk_widget_modify_fg): Constify. (gtk_widget_modify_bg): Constify. (gtk_widget_modify_text): Constify. (gtk_widget_modify_base): Constify.
2004-01-26 20:21:09 +00:00
gdk_gc_set_background (GdkGC *gc,
const GdkColor *color)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
g_return_if_fail (color != NULL);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.background = *color;
gdk_gc_set_values (gc, &values, GDK_GC_BACKGROUND);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_font:
* @gc: a #GdkGC.
* @font: the new font.
*
* Sets the font for a graphics context. (Note that
* all text-drawing functions in GDK take a @font
* argument; the value set here is used when that
* argument is %NULL.)
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_font (GdkGC *gc,
1997-11-24 22:37:52 +00:00
GdkFont *font)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
g_return_if_fail (font != NULL);
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.font = font;
gdk_gc_set_values (gc, &values, GDK_GC_FONT);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_function:
* @gc: a #GdkGC.
* @function: the #GdkFunction to use
*
* Determines how the current pixel values and the
* pixel values being drawn are combined to produce
* the final pixel values.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_function (GdkGC *gc,
1997-11-24 22:37:52 +00:00
GdkFunction function)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.function = function;
gdk_gc_set_values (gc, &values, GDK_GC_FUNCTION);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_fill:
* @gc: a #GdkGC.
* @fill: the new fill mode.
*
* Set the fill mode for a graphics context.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_fill (GdkGC *gc,
1997-11-24 22:37:52 +00:00
GdkFill fill)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.fill = fill;
gdk_gc_set_values (gc, &values, GDK_GC_FILL);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_tile:
* @gc: a #GdkGC.
* @tile: the new tile pixmap.
*
* Set a tile pixmap for a graphics context.
* This will only be used if the fill mode
* is %GDK_TILED.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_tile (GdkGC *gc,
1997-11-24 22:37:52 +00:00
GdkPixmap *tile)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.tile = tile;
gdk_gc_set_values (gc, &values, GDK_GC_TILE);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_stipple:
* @gc: a #GdkGC.
* @stipple: the new stipple bitmap.
*
* Set the stipple bitmap for a graphics context. The
* stipple will only be used if the fill mode is
* %GDK_STIPPLED or %GDK_OPAQUE_STIPPLED.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.stipple = stipple;
gdk_gc_set_values (gc, &values, GDK_GC_STIPPLE);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_ts_origin:
* @gc: a #GdkGC.
* @x: the x-coordinate of the origin.
* @y: the y-coordinate of the origin.
*
* Set the origin when using tiles or stipples with
* the GC. The tile or stipple will be aligned such
* that the upper left corner of the tile or stipple
* will coincide with this point.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_ts_origin (GdkGC *gc,
gint x,
gint y)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.ts_x_origin = x;
values.ts_y_origin = y;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
gdk_gc_set_values (gc, &values,
GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_clip_origin:
* @gc: a #GdkGC.
* @x: the x-coordinate of the origin.
* @y: the y-coordinate of the origin.
*
* Sets the origin of the clip mask. The coordinates are
* interpreted relative to the upper-left corner of
* the destination drawable of the current operation.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_clip_origin (GdkGC *gc,
gint x,
gint y)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.clip_x_origin = x;
values.clip_y_origin = y;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
gdk_gc_set_values (gc, &values,
GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_clip_mask:
* @gc: the #GdkGC.
* @mask: a bitmap.
*
* Sets the clip mask for a graphics context from a bitmap.
* The clip mask is interpreted relative to the clip
* origin. (See gdk_gc_set_clip_origin()).
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_clip_mask (GdkGC *gc,
1997-11-24 22:37:52 +00:00
GdkBitmap *mask)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
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_if_fail (GDK_IS_GC (gc));
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.clip_mask = mask;
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
1997-11-24 22:37:52 +00:00
}
/* Takes ownership of passed in region */
2008-12-04 19:18:02 +00:00
static void
_gdk_gc_set_clip_region_real (GdkGC *gc,
GdkRegion *region,
gboolean reset_origin)
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->clip_mask)
{
g_object_unref (priv->clip_mask);
priv->clip_mask = NULL;
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (priv->clip_region)
gdk_region_destroy (priv->clip_region);
priv->clip_region = region;
_gdk_windowing_gc_set_clip_region (gc, region, reset_origin);
}
2008-12-04 19:18:02 +00:00
/* Doesn't copy region, allows not to reset origin */
void
_gdk_gc_set_clip_region_internal (GdkGC *gc,
GdkRegion *region,
gboolean reset_origin)
{
_gdk_gc_remove_drawable_clip (gc);
_gdk_gc_set_clip_region_real (gc, region, reset_origin);
}
void
2008-12-04 19:18:02 +00:00
_gdk_gc_add_drawable_clip (GdkGC *gc,
guint32 region_tag,
GdkRegion *region,
int offset_x,
int offset_y)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->region_tag_applied == region_tag &&
offset_x == priv->region_tag_offset_x &&
offset_y == priv->region_tag_offset_y)
return; /* Already appied this drawable region */
2008-12-04 19:18:02 +00:00
if (priv->region_tag_applied)
_gdk_gc_remove_drawable_clip (gc);
region = gdk_region_copy (region);
if (offset_x != 0 || offset_y != 0)
gdk_region_offset (region, offset_x, offset_y);
if (priv->clip_mask)
{
int w, h;
GdkPixmap *new_mask;
GdkGC *tmp_gc;
GdkColor black = {0, 0, 0, 0};
GdkRectangle r;
GdkOverlapType overlap;
gdk_drawable_get_size (priv->clip_mask, &w, &h);
r.x = 0;
r.y = 0;
r.width = w;
r.height = h;
/* Its quite common to expose areas that are completely in or outside
* the region, so we try to avoid allocating bitmaps that are just fully
* set or completely unset.
*/
overlap = gdk_region_rect_in (region, &r);
if (overlap == GDK_OVERLAP_RECTANGLE_PART)
{
/* The region and the mask intersect, create a new clip mask that
includes both areas */
priv->old_clip_mask = g_object_ref (priv->clip_mask);
new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)new_mask, FALSE);
gdk_gc_set_foreground (tmp_gc, &black);
gdk_draw_rectangle (new_mask, tmp_gc, TRUE, 0, 0, -1, -1);
_gdk_gc_set_clip_region_internal (tmp_gc, region, TRUE); /* Takes ownership of region */
gdk_draw_drawable (new_mask,
tmp_gc,
priv->old_clip_mask,
0, 0,
0, 0,
-1, -1);
gdk_gc_set_clip_region (tmp_gc, NULL);
gdk_gc_set_clip_mask (gc, new_mask);
g_object_unref (new_mask);
}
else if (overlap == GDK_OVERLAP_RECTANGLE_OUT)
{
/* No intersection, set empty clip region */
GdkRegion *empty = gdk_region_new ();
gdk_region_destroy (region);
priv->old_clip_mask = g_object_ref (priv->clip_mask);
priv->clip_region = empty;
_gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
}
else
{
/* Completely inside region, don't set unnecessary clip */
gdk_region_destroy (region);
return;
}
}
else
{
priv->old_clip_region = priv->clip_region;
priv->clip_region = region;
if (priv->old_clip_region)
gdk_region_intersect (region, priv->old_clip_region);
_gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
}
priv->region_tag_applied = region_tag;
priv->region_tag_offset_x = offset_x;
priv->region_tag_offset_y = offset_y;
2008-12-04 19:18:02 +00:00
}
void
_gdk_gc_remove_drawable_clip (GdkGC *gc)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->region_tag_applied)
{
priv->region_tag_applied = 0;
if (priv->old_clip_mask)
{
gdk_gc_set_clip_mask (gc, priv->old_clip_mask);
g_object_unref (priv->old_clip_mask);
priv->old_clip_mask = NULL;
if (priv->clip_region)
{
g_object_unref (priv->clip_region);
priv->clip_region = NULL;
}
}
else
{
_gdk_gc_set_clip_region_real (gc, priv->old_clip_region, FALSE);
priv->old_clip_region = NULL;
}
2008-12-04 19:18:02 +00:00
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
/**
* gdk_gc_set_clip_rectangle:
* @gc: a #GdkGC.
* @rectangle: the rectangle to clip to.
*
* Sets the clip mask for a graphics context from a
* rectangle. The clip mask is interpreted relative to the clip
* origin. (See gdk_gc_set_clip_origin()).
**/
void
gdk_gc_set_clip_rectangle (GdkGC *gc,
const GdkRectangle *rectangle)
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
{
GdkRegion *region;
g_return_if_fail (GDK_IS_GC (gc));
2008-12-04 19:18:02 +00:00
_gdk_gc_remove_drawable_clip (gc);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (rectangle)
region = gdk_region_rectangle (rectangle);
else
region = NULL;
2008-12-04 19:18:02 +00:00
_gdk_gc_set_clip_region_real (gc, region, TRUE);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
/**
* gdk_gc_set_clip_region:
* @gc: a #GdkGC.
* @region: the #GdkRegion.
*
* Sets the clip mask for a graphics context from a region structure.
* The clip mask is interpreted relative to the clip origin. (See
* gdk_gc_set_clip_origin()).
**/
void
gdk_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region)
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
{
GdkRegion *copy;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
g_return_if_fail (GDK_IS_GC (gc));
2008-12-04 19:18:02 +00:00
_gdk_gc_remove_drawable_clip (gc);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (region)
copy = gdk_region_copy (region);
else
copy = NULL;
2008-12-04 19:18:02 +00:00
_gdk_gc_set_clip_region_real (gc, copy, TRUE);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
/**
* _gdk_gc_get_clip_region:
* @gc: a #GdkGC
*
* Gets the current clip region for @gc, if any.
*
* Return value: the clip region for the GC, or %NULL.
* (if a clip mask is set, the return will be %NULL)
* This value is owned by the GC and must not be freed.
**/
GdkRegion *
_gdk_gc_get_clip_region (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return GDK_GC_GET_PRIVATE (gc)->clip_region;
}
/**
* _gdk_gc_get_clip_mask:
* @gc: a #GdkGC
*
* Gets the current clip mask for @gc, if any.
*
* Return value: the clip mask for the GC, or %NULL.
* (if a clip region is set, the return will be %NULL)
* This value is owned by the GC and must not be freed.
**/
GdkBitmap *
_gdk_gc_get_clip_mask (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return GDK_GC_GET_PRIVATE (gc)->clip_mask;
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
/**
* _gdk_gc_get_fill:
* @gc: a #GdkGC
*
* Gets the current file style for the GC
*
* Return value: the file style for the GC
**/
GdkFill
_gdk_gc_get_fill (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), GDK_SOLID);
return GDK_GC_GET_PRIVATE (gc)->fill;
}
2009-05-27 15:06:46 +00:00
gboolean
_gdk_gc_get_exposures (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), FALSE);
return GDK_GC_GET_PRIVATE (gc)->exposures;
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
/**
* _gdk_gc_get_tile:
* @gc: a #GdkGC
*
* Gets the tile pixmap for @gc, if any
*
* Return value: the tile set on the GC, or %NULL. The
* value is owned by the GC and must not be freed.
**/
GdkPixmap *
_gdk_gc_get_tile (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return GDK_GC_GET_PRIVATE (gc)->tile;
}
/**
* _gdk_gc_get_stipple:
* @gc: a #GdkGC
*
* Gets the stipple pixmap for @gc, if any
*
* Return value: the stipple set on the GC, or %NULL. The
* value is owned by the GC and must not be freed.
**/
GdkBitmap *
_gdk_gc_get_stipple (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return GDK_GC_GET_PRIVATE (gc)->stipple;
}
/**
* _gdk_gc_get_fg_pixel:
* @gc: a #GdkGC
*
* Gets the foreground pixel value for @gc. If the
* foreground pixel has never been set, returns the
* default value 0.
*
* Return value: the foreground pixel value of the GC
**/
guint32
_gdk_gc_get_fg_pixel (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), 0);
return GDK_GC_GET_PRIVATE (gc)->fg_pixel;
}
/**
* _gdk_gc_get_bg_pixel:
* @gc: a #GdkGC
*
* Gets the background pixel value for @gc.If the
* foreground pixel has never been set, returns the
* default value 1.
*
* Return value: the foreground pixel value of the GC
**/
guint32
_gdk_gc_get_bg_pixel (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), 0);
return GDK_GC_GET_PRIVATE (gc)->bg_pixel;
}
1997-11-24 22:37:52 +00:00
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_subwindow:
* @gc: a #GdkGC.
* @mode: the subwindow mode.
*
* Sets how drawing with this GC on a window will affect child
* windows of that window.
**/
void
gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
/* This could get called a lot to reset the subwindow mode in
the client side clipping, so bail out early */
if (priv->subwindow_mode == mode)
return;
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.subwindow_mode = mode;
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
1997-11-24 22:37:52 +00:00
}
GdkSubwindowMode
_gdk_gc_get_subwindow (GdkGC *gc)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
return priv->subwindow_mode;
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_exposures:
* @gc: a #GdkGC.
* @exposures: if %TRUE, exposure events will be generated.
*
* Sets whether copying non-visible portions of a drawable
* using this graphics context generate exposure events
* for the corresponding regions of the destination
* drawable. (See gdk_draw_drawable()).
**/
1997-11-24 22:37:52 +00:00
void
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
gdk_gc_set_exposures (GdkGC *gc,
gboolean exposures)
1997-11-24 22:37:52 +00:00
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
1997-11-24 22:37:52 +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_if_fail (GDK_IS_GC (gc));
1997-11-24 22:37:52 +00:00
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
values.graphics_exposures = exposures;
gdk_gc_set_values (gc, &values, GDK_GC_EXPOSURES);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_line_attributes:
* @gc: a #GdkGC.
* @line_width: the width of lines.
* @line_style: the dash-style for lines.
* @cap_style: the manner in which the ends of lines are drawn.
* @join_style: the in which lines are joined together.
*
* Sets various attributes of how lines are drawn. See
* the corresponding members of #GdkGCValues for full
* explanations of the arguments.
**/
1997-11-24 22:37:52 +00:00
void
gdk_gc_set_line_attributes (GdkGC *gc,
gint line_width,
1997-11-24 22:37:52 +00:00
GdkLineStyle line_style,
GdkCapStyle cap_style,
1997-11-24 22:37:52 +00:00
GdkJoinStyle join_style)
{
Move all X specific code into the x11/ directory. Aside from shuffling Mon Nov 8 14:47:04 1999 Owen Taylor <otaylor@redhat.com> Move all X specific code into the x11/ directory. Aside from shuffling things around, did the following: * gdk/gdkprivate.h gdk/gdk.h gdk/x11/gdkmain-x11.h: Add gdk_arg_context_* - a simple argument parsing system in the style of popt. * gdk/gdkdrawable.[ch] gdk/gdkprivate.h gdk/gdkwindow.[ch] gdk/x11/gdkprivate-x11.h: Remove X specific stuff from GdkDrawable and GdkWindowPrivate - add ->klass and ->klass_data fields. The klass_data field points to an auxilliary structure that is windowing system dependent. * gdk/gdkfont.c: Make most of the measurement functions simply wrappers around gdk_text_extents(). * gdk/gdkfont.c gdk/gdkprivate.h gdk/x11/gdkfont-x11.c: Add a _gdk_font_strlen() function that hides the weird behavior in gtk+-1.[02] where a string is interpreted differently for 8-bit and 16-bit fonts. * gdk/gdkevents.c: Add a new function gdk_event_button_generate() to store common code for synthesizing double/triple press events. * gdk/gdkgc.[ch]: Virtualize in the same way as gdkdrawable.h. Make all the function that modify an existing GC simply wrappers around gdk_gc_set_values(). * gdk/gdkcc.[ch]: Moved into x11/ directory in preparation for throwing out later. * gdk/gdkfont.c gdk/gdkimage.c gdk/gdkcolor.c: Change GdkFontPrivate, GdkImagePrivate and GdkColormapPrivate to have a windowing system dependent part (GdkFontPrivateX etc.) that "derives" from the system-independent part. * configure.in gdk/x11/Makefile.in gdk/x11/gdkinput*.c: Got rid of the included-source-files for XInput in favor of automake conditionals. (Which didn't exist when XInput support was originally added.) * gdk/gdkrgb.c: Remove the visual id from the debugging statements since that is X11 specific; print out type/depth info instead.
1999-11-08 20:14:59 +00:00
GdkGCValues values;
values.line_width = line_width;
values.line_style = line_style;
values.cap_style = cap_style;
values.join_style = join_style;
gdk_gc_set_values (gc, &values,
GDK_GC_LINE_WIDTH |
GDK_GC_LINE_STYLE |
GDK_GC_CAP_STYLE |
GDK_GC_JOIN_STYLE);
1997-11-24 22:37:52 +00:00
}
2004-06-22 15:29:29 +00:00
/**
* gdk_gc_set_dashes:
* @gc: a #GdkGC.
* @dash_offset: the phase of the dash pattern.
* @dash_list: an array of dash lengths.
* @n: the number of elements in @dash_list.
*
* Sets the way dashed-lines are drawn. Lines will be
* drawn with alternating on and off segments of the
* lengths specified in @dash_list. The manner in
* which the on and off segments are drawn is determined
* by the @line_style value of the GC. (This can
* be changed with gdk_gc_set_line_attributes().)
*
* The @dash_offset defines the phase of the pattern,
* specifying how many pixels into the dash-list the pattern
* should actually begin.
**/
void
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
2000-03-14 19:57:25 +00:00
gint8 dash_list[],
gint n)
{
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_if_fail (GDK_IS_GC (gc));
g_return_if_fail (dash_list != 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
GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);
}
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
/**
* gdk_gc_offset:
* @gc: a #GdkGC
* @x_offset: amount by which to offset the GC in the X direction
* @y_offset: amount by which to offset the GC in the Y direction
*
* Offset attributes such as the clip and tile-stipple origins
* of the GC so that drawing at x - x_offset, y - y_offset with
* the offset GC has the same effect as drawing at x, y with the original
* GC.
**/
void
gdk_gc_offset (GdkGC *gc,
gint x_offset,
gint y_offset)
{
if (x_offset != 0 || y_offset != 0)
{
GdkGCValues values;
values.clip_x_origin = gc->clip_x_origin - x_offset;
values.clip_y_origin = gc->clip_y_origin - y_offset;
values.ts_x_origin = gc->ts_x_origin - x_offset;
values.ts_y_origin = gc->ts_y_origin - y_offset;
gdk_gc_set_values (gc, &values,
GDK_GC_CLIP_X_ORIGIN |
GDK_GC_CLIP_Y_ORIGIN |
GDK_GC_TS_X_ORIGIN |
GDK_GC_TS_Y_ORIGIN);
}
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
/**
* gdk_gc_copy:
* @dst_gc: the destination graphics context.
* @src_gc: the source graphics context.
*
* Copy the set of values from one graphics context
* onto another graphics context.
**/
void
gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc)
{
GdkGCPrivate *dst_priv, *src_priv;
g_return_if_fail (GDK_IS_GC (dst_gc));
g_return_if_fail (GDK_IS_GC (src_gc));
dst_priv = GDK_GC_GET_PRIVATE (dst_gc);
src_priv = GDK_GC_GET_PRIVATE (src_gc);
_gdk_windowing_gc_copy (dst_gc, src_gc);
dst_gc->clip_x_origin = src_gc->clip_x_origin;
dst_gc->clip_y_origin = src_gc->clip_y_origin;
dst_gc->ts_x_origin = src_gc->ts_x_origin;
dst_gc->ts_y_origin = src_gc->ts_y_origin;
if (src_gc->colormap)
g_object_ref (src_gc->colormap);
if (dst_gc->colormap)
g_object_unref (dst_gc->colormap);
dst_gc->colormap = src_gc->colormap;
if (dst_priv->clip_region)
gdk_region_destroy (dst_priv->clip_region);
if (src_priv->clip_region)
dst_priv->clip_region = gdk_region_copy (src_priv->clip_region);
else
dst_priv->clip_region = NULL;
2008-12-04 19:18:02 +00:00
dst_priv->region_tag_applied = src_priv->region_tag_applied;
if (dst_priv->old_clip_region)
gdk_region_destroy (dst_priv->old_clip_region);
if (src_priv->old_clip_region)
dst_priv->old_clip_region = gdk_region_copy (src_priv->old_clip_region);
else
dst_priv->old_clip_region = NULL;
if (src_priv->clip_mask)
dst_priv->clip_mask = g_object_ref (src_priv->clip_mask);
else
dst_priv->clip_mask = NULL;
if (src_priv->old_clip_mask)
dst_priv->old_clip_mask = g_object_ref (src_priv->old_clip_mask);
else
dst_priv->old_clip_mask = NULL;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
dst_priv->fill = src_priv->fill;
if (dst_priv->stipple)
g_object_unref (dst_priv->stipple);
dst_priv->stipple = src_priv->stipple;
if (dst_priv->stipple)
g_object_ref (dst_priv->stipple);
if (dst_priv->tile)
g_object_unref (dst_priv->tile);
dst_priv->tile = src_priv->tile;
if (dst_priv->tile)
g_object_ref (dst_priv->tile);
dst_priv->fg_pixel = src_priv->fg_pixel;
dst_priv->bg_pixel = src_priv->bg_pixel;
dst_priv->subwindow_mode = src_priv->subwindow_mode;
2009-05-27 15:06:46 +00:00
dst_priv->exposures = src_priv->exposures;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
/**
* gdk_gc_set_colormap:
* @gc: a #GdkGC
* @colormap: a #GdkColormap
*
* Sets the colormap for the GC to the given colormap. The depth
* of the colormap's visual must match the depth of the drawable
* for which the GC was created.
**/
void
gdk_gc_set_colormap (GdkGC *gc,
GdkColormap *colormap)
{
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (GDK_IS_COLORMAP (colormap));
if (gc->colormap != colormap)
{
if (gc->colormap)
g_object_unref (gc->colormap);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
gc->colormap = colormap;
g_object_ref (gc->colormap);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
}
}
/**
* gdk_gc_get_colormap:
* @gc: a #GdkGC
*
* Retrieves the colormap for a given GC, if it exists.
* A GC will have a colormap if the drawable for which it was created
* has a colormap, or if a colormap was set explicitely with
* gdk_gc_set_colormap.
*
2004-06-22 15:29:29 +00:00
* Return value: the colormap of @gc, or %NULL if @gc doesn't have one.
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
**/
GdkColormap *
gdk_gc_get_colormap (GdkGC *gc)
{
g_return_val_if_fail (GDK_IS_GC (gc), NULL);
return gc->colormap;
}
static GdkColormap *
gdk_gc_get_colormap_warn (GdkGC *gc)
{
GdkColormap *colormap = gdk_gc_get_colormap (gc);
if (!colormap)
{
g_warning ("gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can\n"
"only be used on GC's with a colormap. A GC will have a colormap\n"
"if it is created for a drawable with a colormap, or if a\n"
"colormap has been set explicitly with gdk_gc_set_colormap.\n");
return NULL;
}
return colormap;
}
/**
* gdk_gc_set_rgb_fg_color:
* @gc: a #GdkGC
* @color: an unallocated #GdkColor.
*
* Set the foreground color of a GC using an unallocated color. The
* pixel value for the color will be determined using GdkRGB. If the
* colormap for the GC has not previously been initialized for GdkRGB,
* then for pseudo-color colormaps (colormaps with a small modifiable
* number of colors), a colorcube will be allocated in the colormap.
*
* Calling this function for a GC without a colormap is an error.
**/
void
Fix #105497; constify uses of GdkColor. 2004-01-26 Federico Mena Quintero <federico@ximian.com> Fix #105497; constify uses of GdkColor. * gdk/gdkgc.c (gdk_gc_set_rgb_fg_color): Constify. (gdk_gc_set_rgb_bg_color): Constify. (gdk_gc_set_foreground): Constify. * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixmap): Constify. * gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Constify. * gdk/linux-fb/gdkcursor-fb.c (gdk_cursor_new_from_pixmap): Constify. * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_create_from_data): Constify. * gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Constify. * gdk/linux-fb/gdkpixmap-fb.c (gdk_pixmap_create_from_data): Constify. * gdk/x11/gdkwindow-x11.c (gdk_window_set_background): Constify. * gdk/win32/gdkwindow-win32.c (gdk_window_set_background): Constify. * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Constify. * gdk/gdkpango.c (gdk_draw_layout_line_with_colors): Constify. (gdk_draw_layout_with_colors): Constify. * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): Constify. (gdk_pixmap_colormap_create_from_xpm): Constify. (gdk_pixmap_create_from_xpm): Constify. (gdk_pixmap_colormap_create_from_xpm_d): Constify. (gdk_pixmap_create_from_xpm_d): Constify. * gtk/gtkcellview.c (gtk_cell_view_set_background_color): Constify. * gtk/gtkclist.c (gtk_clist_set_foreground): Constify. (gtk_clist_set_background): Constify. * gtk/gtkcolorbutton.c (gtk_color_button_new_with_color): Constify. (gtk_color_button_set_color): Constify. * gtk/gtkcolorsel.c (gtk_color_selection_set_current_color): Constify and add a check for color != NULL. (gtk_color_selection_get_current_color): Add a check for color != NULL. (gtk_color_selection_set_previous_color): Constify and add a check for color != NULL. (gtk_color_selection_get_previous_color): Add a check for color != NULL. * gtk/gtkctree.c (gtk_ctree_node_set_foreground): Constify. (gtk_ctree_node_set_background): Constify. * gtk/gtktext.c (gtk_text_insert): Constify. (insert_text_property): Constify. (text_properties_equal): Constify. (new_text_property): Constify. * gtk/gtkwidget.c (gtk_widget_modify_color_component): Constify. (gtk_widget_modify_fg): Constify. (gtk_widget_modify_bg): Constify. (gtk_widget_modify_text): Constify. (gtk_widget_modify_base): Constify.
2004-01-26 20:21:09 +00:00
gdk_gc_set_rgb_fg_color (GdkGC *gc,
const GdkColor *color)
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
{
GdkColormap *cmap;
GdkColor tmp_color;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (color != NULL);
cmap = gdk_gc_get_colormap_warn (gc);
if (!cmap)
return;
tmp_color = *color;
gdk_rgb_find_color (cmap, &tmp_color);
gdk_gc_set_foreground (gc, &tmp_color);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
}
/**
* gdk_gc_set_rgb_bg_color:
* @gc: a #GdkGC
* @color: an unallocated #GdkColor.
*
* Set the background color of a GC using an unallocated color. The
* pixel value for the color will be determined using GdkRGB. If the
* colormap for the GC has not previously been initialized for GdkRGB,
* then for pseudo-color colormaps (colormaps with a small modifiable
* number of colors), a colorcube will be allocated in the colormap.
*
* Calling this function for a GC without a colormap is an error.
**/
void
Fix #105497; constify uses of GdkColor. 2004-01-26 Federico Mena Quintero <federico@ximian.com> Fix #105497; constify uses of GdkColor. * gdk/gdkgc.c (gdk_gc_set_rgb_fg_color): Constify. (gdk_gc_set_rgb_bg_color): Constify. (gdk_gc_set_foreground): Constify. * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixmap): Constify. * gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Constify. * gdk/linux-fb/gdkcursor-fb.c (gdk_cursor_new_from_pixmap): Constify. * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_create_from_data): Constify. * gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Constify. * gdk/linux-fb/gdkpixmap-fb.c (gdk_pixmap_create_from_data): Constify. * gdk/x11/gdkwindow-x11.c (gdk_window_set_background): Constify. * gdk/win32/gdkwindow-win32.c (gdk_window_set_background): Constify. * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Constify. * gdk/gdkpango.c (gdk_draw_layout_line_with_colors): Constify. (gdk_draw_layout_with_colors): Constify. * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): Constify. (gdk_pixmap_colormap_create_from_xpm): Constify. (gdk_pixmap_create_from_xpm): Constify. (gdk_pixmap_colormap_create_from_xpm_d): Constify. (gdk_pixmap_create_from_xpm_d): Constify. * gtk/gtkcellview.c (gtk_cell_view_set_background_color): Constify. * gtk/gtkclist.c (gtk_clist_set_foreground): Constify. (gtk_clist_set_background): Constify. * gtk/gtkcolorbutton.c (gtk_color_button_new_with_color): Constify. (gtk_color_button_set_color): Constify. * gtk/gtkcolorsel.c (gtk_color_selection_set_current_color): Constify and add a check for color != NULL. (gtk_color_selection_get_current_color): Add a check for color != NULL. (gtk_color_selection_set_previous_color): Constify and add a check for color != NULL. (gtk_color_selection_get_previous_color): Add a check for color != NULL. * gtk/gtkctree.c (gtk_ctree_node_set_foreground): Constify. (gtk_ctree_node_set_background): Constify. * gtk/gtktext.c (gtk_text_insert): Constify. (insert_text_property): Constify. (text_properties_equal): Constify. (new_text_property): Constify. * gtk/gtkwidget.c (gtk_widget_modify_color_component): Constify. (gtk_widget_modify_fg): Constify. (gtk_widget_modify_bg): Constify. (gtk_widget_modify_text): Constify. (gtk_widget_modify_base): Constify.
2004-01-26 20:21:09 +00:00
gdk_gc_set_rgb_bg_color (GdkGC *gc,
const GdkColor *color)
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
{
GdkColormap *cmap;
GdkColor tmp_color;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (color != NULL);
cmap = gdk_gc_get_colormap_warn (gc);
if (!cmap)
return;
tmp_color = *color;
gdk_rgb_find_color (cmap, &tmp_color);
gdk_gc_set_background (gc, &tmp_color);
Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality Sun Jul 2 12:45:50 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkrgb.[ch]: Add gdk_rgb_find_color() to get a pixel value using GdkRGB functionality given GdkColormap and GdkColor. (name not final, waiting for inspiration.) * gdk/gdkgc.[ch] (gdk_gc_set_rgb_fg/bg_color): New functions to set the foreground/background of a GC using the GC's colormap and GdkRGB. (name not final, waiting for inspiration.) * gdk/gdkcompat.h gdk/gdkrgb.c (gdk_rgb_get_colormap): Rename from gdk_rgb_get_cmap(), put #define in gdkcompat.h. * gtk/gtkwidget.[ch] gtkcompat.h: Make visuals for gtk_widget_get_visual(), gtk_widget_get_default_visual, etc, purely a function of the corresponding colormap. Make gtk_widget_set_visual(), etc, noop macros in gtkcompat.h. * gdk/gdkpixmap.c gdk/x11/gdkpixmap-c11.c: Rewrite gdk_pixbuf_*create_from_xpm_* in terms of gdk_pixbuf_new_from_xpm_data(), move into platform independent code. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Take advantage of the new draw_rgb_32_image_dithalign. * gdk/gdkrgb.c (gdk_draw_rgb_32_image_dithalign): Added. * gtk/gtkgc.c (gtk_gc_new): Set the appropriate colormap on each created GC. * gdk/gdkgc.[ch]: Add gdk_gc_get/set_colormap. * gdk/gdkgc.[ch]: Add a colormap field to the GdkGC structure which we initialize from the drawable when the GC is created, if the drawable has a colormap. * gdk/x11/gdkgc-x11.c: include string.h for memset. * gdk/x11/gdkinput-x11.c: include string.h for strlen, etc. * gtk/gtklayout.[ch]: Remove unsed configure serial member.
2000-07-02 17:03:21 +00:00
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
static cairo_surface_t *
make_stipple_tile_surface (cairo_t *cr,
GdkBitmap *stipple,
GdkColor *foreground,
GdkColor *background)
{
cairo_t *tmp_cr;
cairo_surface_t *surface;
cairo_surface_t *alpha_surface;
gint width, height;
gdk_drawable_get_size (stipple,
&width, &height);
alpha_surface = _gdk_drawable_ref_cairo_surface (stipple);
surface = cairo_surface_create_similar (cairo_get_target (cr),
CAIRO_CONTENT_COLOR_ALPHA,
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
width, height);
tmp_cr = cairo_create (surface);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
cairo_set_operator (tmp_cr, CAIRO_OPERATOR_SOURCE);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (background)
gdk_cairo_set_source_color (tmp_cr, background);
else
cairo_set_source_rgba (tmp_cr, 0, 0, 0 ,0);
cairo_paint (tmp_cr);
cairo_set_operator (tmp_cr, CAIRO_OPERATOR_OVER);
gdk_cairo_set_source_color (tmp_cr, foreground);
cairo_mask_surface (tmp_cr, alpha_surface, 0, 0);
cairo_destroy (tmp_cr);
cairo_surface_destroy (alpha_surface);
return surface;
}
static void
gc_get_foreground (GdkGC *gc,
GdkColor *color)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
color->pixel = priv->bg_pixel;
if (gc->colormap)
gdk_colormap_query_color (gc->colormap, priv->fg_pixel, color);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
else
g_warning ("No colormap in gc_get_foreground");
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
static void
gc_get_background (GdkGC *gc,
GdkColor *color)
{
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
color->pixel = priv->bg_pixel;
if (gc->colormap)
gdk_colormap_query_color (gc->colormap, priv->bg_pixel, color);
else
g_warning ("No colormap in gc_get_background");
}
/**
* _gdk_gc_update_context:
* @gc: a #GdkGC
* @cr: a #cairo_t
* @override_foreground: a foreground color to use to override the
* foreground color of the GC
* @override_stipple: a stipple pattern to use to override the
* stipple from the GC. If this is present and the fill mode
* of the GC isn't %GDK_STIPPLED or %GDK_OPAQUE_STIPPLED
* the fill mode will be forced to %GDK_STIPPLED
* @gc_changed: pass %FALSE if the @gc has not changed since the
* last call to this function
* @target_drawable: The drawable you're drawing in. If passed in
* this is used for client side window clip emulation.
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
*
* Set the attributes of a cairo context to match those of a #GdkGC
* as far as possible. Some aspects of a #GdkGC, such as clip masks
* and functions other than %GDK_COPY are not currently handled.
**/
void
_gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
const GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed,
GdkDrawable *target_drawable)
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
{
GdkGCPrivate *priv;
GdkFill fill;
GdkColor foreground;
GdkColor background;
cairo_surface_t *tile_surface = NULL;
GdkBitmap *stipple = NULL;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (cr != NULL);
g_return_if_fail (override_stipple == NULL || GDK_IS_PIXMAP (override_stipple));
priv = GDK_GC_GET_PRIVATE (gc);
_gdk_gc_remove_drawable_clip (gc);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
fill = priv->fill;
if (override_stipple && fill != GDK_OPAQUE_STIPPLED)
fill = GDK_STIPPLED;
if (fill != GDK_TILED)
{
if (override_foreground)
foreground = *override_foreground;
else
gc_get_foreground (gc, &foreground);
}
if (fill == GDK_OPAQUE_STIPPLED)
gc_get_background (gc, &background);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
switch (fill)
{
case GDK_SOLID:
break;
case GDK_TILED:
if (!priv->tile)
fill = GDK_SOLID;
break;
case GDK_STIPPLED:
case GDK_OPAQUE_STIPPLED:
if (override_stipple)
stipple = override_stipple;
else
stipple = priv->stipple;
if (!stipple)
fill = GDK_SOLID;
break;
}
switch (fill)
{
case GDK_SOLID:
gdk_cairo_set_source_color (cr, &foreground);
break;
case GDK_TILED:
tile_surface = _gdk_drawable_ref_cairo_surface (priv->tile);
break;
case GDK_STIPPLED:
tile_surface = make_stipple_tile_surface (cr, stipple, &foreground, NULL);
break;
case GDK_OPAQUE_STIPPLED:
tile_surface = make_stipple_tile_surface (cr, stipple, &foreground, &background);
break;
}
/* Tiles, stipples, and clip regions are all specified in device space,
* not user space. For the clip region, we can simply change the matrix,
* clip, then clip back, but for the source pattern, we need to
* compute the right matrix.
*
* What we want is:
*
* CTM_inverse * Pattern_matrix = Translate(- ts_x, - ts_y)
*
* (So that ts_x, ts_y in device space is taken to 0,0 in pattern
* space). So, pattern_matrix = CTM * Translate(- ts_x, - tx_y);
*/
if (tile_surface)
{
cairo_pattern_t *pattern = cairo_pattern_create_for_surface (tile_surface);
cairo_matrix_t user_to_device;
cairo_matrix_t user_to_pattern;
cairo_matrix_t device_to_pattern;
cairo_get_matrix (cr, &user_to_device);
cairo_matrix_init_translate (&device_to_pattern,
- gc->ts_x_origin, - gc->ts_y_origin);
cairo_matrix_multiply (&user_to_pattern,
&user_to_device, &device_to_pattern);
cairo_pattern_set_matrix (pattern, &user_to_pattern);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_set_source (cr, pattern);
cairo_surface_destroy (tile_surface);
cairo_pattern_destroy (pattern);
}
if (!gc_changed)
return;
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
cairo_reset_clip (cr);
/* The reset above resets the window clip rect, so we want to re-set that */
if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
if (priv->clip_region)
{
cairo_save (cr);
cairo_identity_matrix (cr);
Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to 2005-05-11 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to avoid having an extraneous window. * gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe color when !has_opacity. 2005-05-10 Owen Taylor <otaylor@redhat.com> * gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source files for Cairo convenience functionality. * gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a convenience functions to add GdkRectangle, GdkRegion to a cairo path. * gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c gtk/gtkstyle.c: Use gdk_cairo_rectangle/region(). * gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename gdk_drawable_create_cairo_context() to gdk_cairo_create(). * gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c: Rename gdk_pixbuf_set_as_cairo_source() to gdk_cairo_set_source_pixbuf(). * gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c: Adjust for renames. * gdk/gdk.symbols: Update. * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix coordinate system problem that was causing the wrong portions to be invalidated. * gtk/gtkcellrenderer.c (gtk_cell_renderer_render) gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render) gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render) gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render) gtk/gtkcellview.c (gtk_cell_view_expose) gtk/gtkdnd.c (gtk_drag_highlight_expose) gtk/gtkentry.c (gtk_entry_draw_text) gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization. * gtk/gtkcalendar.[ch]: Beat into something roughly resembling GTK+ style ... use instance-private data and standard names for private structure, etc. Move function docs inline. * gtk/gtkcalendar.[ch]: Switch to drawing everything in expose. Switch drawing to Cairo. * gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
cairo_translate (cr, gc->clip_x_origin, gc->clip_y_origin);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
cairo_new_path (cr);
Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to 2005-05-11 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to avoid having an extraneous window. * gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe color when !has_opacity. 2005-05-10 Owen Taylor <otaylor@redhat.com> * gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source files for Cairo convenience functionality. * gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a convenience functions to add GdkRectangle, GdkRegion to a cairo path. * gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c gtk/gtkstyle.c: Use gdk_cairo_rectangle/region(). * gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename gdk_drawable_create_cairo_context() to gdk_cairo_create(). * gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c: Rename gdk_pixbuf_set_as_cairo_source() to gdk_cairo_set_source_pixbuf(). * gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c: Adjust for renames. * gdk/gdk.symbols: Update. * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix coordinate system problem that was causing the wrong portions to be invalidated. * gtk/gtkcellrenderer.c (gtk_cell_renderer_render) gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render) gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render) gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render) gtk/gtkcellview.c (gtk_cell_view_expose) gtk/gtkdnd.c (gtk_drag_highlight_expose) gtk/gtkentry.c (gtk_entry_draw_text) gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization. * gtk/gtkcalendar.[ch]: Beat into something roughly resembling GTK+ style ... use instance-private data and standard names for private structure, etc. Move function docs inline. * gtk/gtkcalendar.[ch]: Switch to drawing everything in expose. Switch drawing to Cairo. * gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
gdk_cairo_region (cr, priv->clip_region);
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
cairo_restore (cr);
cairo_clip (cr);
}
Add a draw-border style property to allow themes to draw outside the 2005-04-28 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c: Add a draw-border style property to allow themes to draw outside the widget's allocation. * gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs that were working around the clip-leakage bug in Cairo. * gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than save/fill/restore. * gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context() That updates a Cairo context to match a GC. * gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support for tiles/stipples/clipping to gdk_draw_glyphs(), gdk_draw_trapezoids(). * gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal implementation of stipples. Use one cairo_t across the entire drawing operation. Replace cairo_matrix_create() with stack-allocated matrices. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c: Save various aspects of the GC state (fill, tile, stipple, foreground, background, clip region) in instance-private-data for future use. Add getters. Get rid of _gdk_windowing_gc_get_foreground() function implemented by the backends. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add _gdk_gc_init() to do initial setup of the GC from values; fixes some problems from drawable redirection. * gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into the generic code, add _gdk_windowing_gc_copy(), _gdk_windowing_gc_set_clip_region() to do backend specific stuff. * gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c} gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}: Don't duplicate state that now is stored by the generic code. * gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
}
#define __GDK_GC_C__
#include "gdkaliasdef.c"