2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
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
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2011-11-02 05:21:49 +00:00
|
|
|
|
|
|
|
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <math.h>
|
2001-09-08 17:55:02 +00:00
|
|
|
#include <stdlib.h>
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
#include <string.h>
|
2008-11-01 04:15:14 +00:00
|
|
|
#include <gobject/gvaluecollector.h>
|
2004-02-25 18:03:12 +00:00
|
|
|
#include "gtkmarshalers.h"
|
2010-08-07 00:14:10 +00:00
|
|
|
#include "gtkpango.h"
|
1998-11-06 22:05:02 +00:00
|
|
|
#include "gtkrc.h"
|
2001-05-01 01:36:33 +00:00
|
|
|
#include "gtkspinbutton.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtkstyle.h"
|
2011-01-23 23:29:07 +00:00
|
|
|
#include "gtkstylecontextprivate.h"
|
1997-11-28 06:47:01 +00:00
|
|
|
#include "gtkwidget.h"
|
2011-11-02 10:45:10 +00:00
|
|
|
#include "gtkwidgetprivate.h"
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
#include "gtkiconfactory.h"
|
2005-09-01 05:11:46 +00:00
|
|
|
#include "gtkintl.h"
|
2010-09-18 23:57:32 +00:00
|
|
|
#include "gtkdebug.h"
|
2009-10-16 13:51:13 +00:00
|
|
|
#include "gtkspinner.h"
|
2010-11-26 01:39:53 +00:00
|
|
|
#include "gtkborder.h"
|
2012-03-16 19:01:50 +00:00
|
|
|
#include "gtkwidgetpath.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2010-05-15 22:44:58 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gtkstyle
|
2011-01-30 03:47:33 +00:00
|
|
|
* @Short_description: Deprecated object that holds style information
|
|
|
|
* for widgets
|
2010-05-15 22:44:58 +00:00
|
|
|
* @Title: GtkStyle
|
|
|
|
*
|
|
|
|
* A #GtkStyle object encapsulates the information that provides the look and
|
2011-01-31 04:34:52 +00:00
|
|
|
* feel for a widget.
|
2010-11-25 19:38:02 +00:00
|
|
|
*
|
2010-11-26 01:39:53 +00:00
|
|
|
* <warning>
|
2010-11-25 19:38:02 +00:00
|
|
|
* In GTK+ 3.0, GtkStyle has been deprecated and replaced by #GtkStyleContext.
|
2010-11-26 01:39:53 +00:00
|
|
|
* </warning>
|
2011-01-31 04:34:52 +00:00
|
|
|
*
|
|
|
|
* Each #GtkWidget has an associated #GtkStyle object that is used when
|
|
|
|
* rendering that widget. Also, a #GtkStyle holds information for the five
|
|
|
|
* possible widget states though not every widget supports all five
|
|
|
|
* states; see #GtkStateType.
|
|
|
|
*
|
|
|
|
* Usually the #GtkStyle for a widget is the same as the default style that
|
|
|
|
* is set by GTK+ and modified the theme engine.
|
|
|
|
*
|
|
|
|
* Usually applications should not need to use or modify the #GtkStyle of
|
|
|
|
* their widgets.
|
2010-05-15 22:44:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#define LIGHTNESS_MULT 1.3
|
|
|
|
#define DARKNESS_MULT 0.7
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* --- typedefs & structures --- */
|
|
|
|
typedef struct {
|
|
|
|
GType widget_type;
|
|
|
|
GParamSpec *pspec;
|
|
|
|
GValue value;
|
|
|
|
} PropertyValue;
|
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
#define GTK_STYLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_STYLE, GtkStylePrivate))
|
|
|
|
|
|
|
|
typedef struct _GtkStylePrivate GtkStylePrivate;
|
|
|
|
|
|
|
|
struct _GtkStylePrivate {
|
2010-08-02 14:05:58 +00:00
|
|
|
GtkStyleContext *context;
|
2010-11-03 11:18:48 +00:00
|
|
|
gulong context_changed_id;
|
2010-08-02 14:05:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_CONTEXT
|
2005-11-23 10:33:58 +00:00
|
|
|
};
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* --- prototypes --- */
|
|
|
|
static void gtk_style_finalize (GObject *object);
|
2010-08-02 14:05:58 +00:00
|
|
|
static void gtk_style_constructed (GObject *object);
|
|
|
|
static void gtk_style_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2010-12-03 19:30:13 +00:00
|
|
|
static void gtk_style_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2010-08-02 14:05:58 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
static void gtk_style_real_realize (GtkStyle *style);
|
|
|
|
static void gtk_style_real_unrealize (GtkStyle *style);
|
|
|
|
static void gtk_style_real_copy (GtkStyle *style,
|
|
|
|
GtkStyle *src);
|
|
|
|
static void gtk_style_real_set_background (GtkStyle *style,
|
|
|
|
GdkWindow *window,
|
|
|
|
GtkStateType state_type);
|
|
|
|
static GtkStyle *gtk_style_real_clone (GtkStyle *style);
|
|
|
|
static void gtk_style_real_init_from_rc (GtkStyle *style,
|
|
|
|
GtkRcStyle *rc_style);
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
static GdkPixbuf *gtk_default_render_icon (GtkStyle *style,
|
|
|
|
const GtkIconSource *source,
|
|
|
|
GtkTextDirection direction,
|
|
|
|
GtkStateType state,
|
2001-03-12 18:46:53 +00:00
|
|
|
GtkIconSize size,
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail);
|
2000-01-21 21:53:36 +00:00
|
|
|
static void gtk_default_draw_hline (GtkStyle *style,
|
2010-08-16 13:35:58 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x1,
|
|
|
|
gint x2,
|
|
|
|
gint y);
|
|
|
|
static void gtk_default_draw_vline (GtkStyle *style,
|
2010-08-16 13:40:03 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint y1,
|
|
|
|
gint y2,
|
|
|
|
gint x);
|
|
|
|
static void gtk_default_draw_shadow (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_arrow (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GtkArrowType arrow_type,
|
|
|
|
gboolean fill,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_diamond (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_box (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_flat_box (GtkStyle *style,
|
2010-08-16 19:50:08 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_check (GtkStyle *style,
|
2010-08-16 19:55:02 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_option (GtkStyle *style,
|
2010-08-16 19:58:15 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_tab (GtkStyle *style,
|
2010-08-16 20:10:00 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_shadow_gap (GtkStyle *style,
|
2010-08-16 14:09:11 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width);
|
|
|
|
static void gtk_default_draw_box_gap (GtkStyle *style,
|
2010-08-16 20:15:43 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width);
|
|
|
|
static void gtk_default_draw_extension (GtkStyle *style,
|
2010-08-16 20:19:56 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side);
|
|
|
|
static void gtk_default_draw_focus (GtkStyle *style,
|
2010-08-16 20:24:46 +00:00
|
|
|
cairo_t *cr,
|
2001-12-04 03:27:30 +00:00
|
|
|
GtkStateType state_type,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gtk_default_draw_slider (GtkStyle *style,
|
2010-08-17 00:46:46 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation);
|
|
|
|
static void gtk_default_draw_handle (GtkStyle *style,
|
2010-08-17 01:26:20 +00:00
|
|
|
cairo_t *cr,
|
2000-01-21 21:53:36 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
static void gtk_default_draw_expander (GtkStyle *style,
|
2010-08-16 13:26:19 +00:00
|
|
|
cairo_t *cr,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2001-07-22 20:09:00 +00:00
|
|
|
GtkExpanderStyle expander_style);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
static void gtk_default_draw_layout (GtkStyle *style,
|
2010-08-16 13:21:01 +00:00
|
|
|
cairo_t *cr,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkStateType state_type,
|
2001-04-30 23:23:54 +00:00
|
|
|
gboolean use_text,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoLayout *layout);
|
2001-03-29 21:17:45 +00:00
|
|
|
static void gtk_default_draw_resize_grip (GtkStyle *style,
|
2010-08-16 13:13:26 +00:00
|
|
|
cairo_t *cr,
|
2001-03-29 21:17:45 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GdkWindowEdge edge,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
2009-11-27 06:23:55 +00:00
|
|
|
static void gtk_default_draw_spinner (GtkStyle *style,
|
2010-08-16 13:09:50 +00:00
|
|
|
cairo_t *cr,
|
2009-11-27 06:23:55 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
guint step,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
static void rgb_to_hls (gdouble *r,
|
|
|
|
gdouble *g,
|
|
|
|
gdouble *b);
|
|
|
|
static void hls_to_rgb (gdouble *h,
|
|
|
|
gdouble *l,
|
|
|
|
gdouble *s);
|
|
|
|
|
2010-11-03 20:14:08 +00:00
|
|
|
static void transform_detail_string (const gchar *detail,
|
|
|
|
GtkStyleContext *context);
|
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
/*
|
|
|
|
* Data for default check and radio buttons
|
|
|
|
*/
|
|
|
|
|
2002-12-10 21:39:53 +00:00
|
|
|
static const GtkRequisition default_option_indicator_size = { 7, 13 };
|
|
|
|
static const GtkBorder default_option_indicator_spacing = { 7, 5, 2, 2 };
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2004-06-26 13:09:22 +00:00
|
|
|
#define GTK_GRAY 0xdcdc, 0xdada, 0xd5d5
|
|
|
|
#define GTK_DARK_GRAY 0xc4c4, 0xc2c2, 0xbdbd
|
|
|
|
#define GTK_LIGHT_GRAY 0xeeee, 0xebeb, 0xe7e7
|
|
|
|
#define GTK_WHITE 0xffff, 0xffff, 0xffff
|
|
|
|
#define GTK_BLUE 0x4b4b, 0x6969, 0x8383
|
|
|
|
#define GTK_VERY_DARK_GRAY 0x9c9c, 0x9a9a, 0x9494
|
|
|
|
#define GTK_BLACK 0x0000, 0x0000, 0x0000
|
|
|
|
#define GTK_WEAK_GRAY 0x7530, 0x7530, 0x7530
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* --- variables --- */
|
2004-06-26 13:09:22 +00:00
|
|
|
static const GdkColor gtk_default_normal_fg = { 0, GTK_BLACK };
|
|
|
|
static const GdkColor gtk_default_active_fg = { 0, GTK_BLACK };
|
|
|
|
static const GdkColor gtk_default_prelight_fg = { 0, GTK_BLACK };
|
|
|
|
static const GdkColor gtk_default_selected_fg = { 0, GTK_WHITE };
|
|
|
|
static const GdkColor gtk_default_insensitive_fg = { 0, GTK_WEAK_GRAY };
|
2002-12-10 21:39:53 +00:00
|
|
|
|
2004-06-26 13:09:22 +00:00
|
|
|
static const GdkColor gtk_default_normal_bg = { 0, GTK_GRAY };
|
|
|
|
static const GdkColor gtk_default_active_bg = { 0, GTK_DARK_GRAY };
|
|
|
|
static const GdkColor gtk_default_prelight_bg = { 0, GTK_LIGHT_GRAY };
|
|
|
|
static const GdkColor gtk_default_selected_bg = { 0, GTK_BLUE };
|
|
|
|
static const GdkColor gtk_default_insensitive_bg = { 0, GTK_GRAY };
|
|
|
|
static const GdkColor gtk_default_selected_base = { 0, GTK_BLUE };
|
|
|
|
static const GdkColor gtk_default_active_base = { 0, GTK_VERY_DARK_GRAY };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2004-02-25 18:03:12 +00:00
|
|
|
/* --- signals --- */
|
|
|
|
static guint realize_signal = 0;
|
|
|
|
static guint unrealize_signal = 0;
|
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
|
|
|
|
2006-05-14 04:25:34 +00:00
|
|
|
G_DEFINE_TYPE (GtkStyle, gtk_style, G_TYPE_OBJECT)
|
2006-05-02 23:56:43 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* --- functions --- */
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2002-08-01 23:43:13 +00:00
|
|
|
static void
|
|
|
|
gtk_style_init (GtkStyle *style)
|
|
|
|
{
|
|
|
|
gint i;
|
2010-12-18 10:27:26 +00:00
|
|
|
|
|
|
|
style->font_desc = pango_font_description_from_string ("Sans 10");
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->attach_count = 0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->black.red = 0;
|
|
|
|
style->black.green = 0;
|
|
|
|
style->black.blue = 0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->white.red = 65535;
|
|
|
|
style->white.green = 65535;
|
|
|
|
style->white.blue = 65535;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->fg[GTK_STATE_NORMAL] = gtk_default_normal_fg;
|
|
|
|
style->fg[GTK_STATE_ACTIVE] = gtk_default_active_fg;
|
|
|
|
style->fg[GTK_STATE_PRELIGHT] = gtk_default_prelight_fg;
|
|
|
|
style->fg[GTK_STATE_SELECTED] = gtk_default_selected_fg;
|
|
|
|
style->fg[GTK_STATE_INSENSITIVE] = gtk_default_insensitive_fg;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->bg[GTK_STATE_NORMAL] = gtk_default_normal_bg;
|
|
|
|
style->bg[GTK_STATE_ACTIVE] = gtk_default_active_bg;
|
|
|
|
style->bg[GTK_STATE_PRELIGHT] = gtk_default_prelight_bg;
|
|
|
|
style->bg[GTK_STATE_SELECTED] = gtk_default_selected_bg;
|
|
|
|
style->bg[GTK_STATE_INSENSITIVE] = gtk_default_insensitive_bg;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
new function gtk_container_child_arg_set, similar to
Wed Jun 24 14:14:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: new function gtk_container_child_arg_set, similar
to gtk_container_child_arg_setv, but takes a variable argument list.
new function gtk_container_get_child_arg_type, which is needed by
gtk_object_collect_args.
* gtk/gtkobject.c: changed prototype for gtk_object_collect_args, to
take a function pointer to figure the argument type.
adapted callers to pass gtk_object_get_arg_type.
* gtk/gtkwidget.c: adapted gtk_object_collect_args callers to pass
gtk_object_get_arg_type..
* gtk/gtkpacker.h:
* gtk/gtkpacker.c:
(gtk_packer_reorder_child): new function to change the packing order
of a child.
(gtk_packer_size_request):
(gtk_packer_size_allocate): take container->border_width into acount.
* gtk/gtkpacker.c: implemented widget arguments:
"GtkPacker::spacing", "GtkPacker::border_width", "GtkPacker::pad_x",
"GtkPacker::pad_y", "GtkPacker::ipad_x", "GtkPacker::ipad_y".
implemented child arguments:
"GtkPacker::side", "GtkPacker::anchor", "GtkPacker::expand",
"GtkPacker::fill_x", "GtkPacker::fill_y", "GtkPacker::use_default",
"GtkPacker::border_width", "GtkPacker::pad_x", "GtkPacker::pad_y",
"GtkPacker::ipad_x", "GtkPacker::ipad_y", "GtkPacker::position".
* gtk/gtkmisc.c (gtk_misc_set_arg): for padding args, set the padding,
not the alignment.
* gtk/gtkeventbox.h:
* gtk/gtkeventbox.c: GtkType and macro fixups.
* gtk/testgtk.c (entry_toggle_sensitive): new function to toggle
sensitivity of an entry.
* gtk/gtkstyle.c (gtk_style_new): support normal grey as default color
for insensitive base.
* gtk/gtkentry.c (gtk_entry_realize): set the window backgrounds
widget state dependent.
(gtk_entry_style_set): likewise.
(gtk_entry_state_changed): set background color on state changes.
(gtk_entry_draw_text): for non selected text, use state dependent
colors.
* gtk/gtktogglebutton.c: support for widget arguments
"GtkToggleButton::active" and "GtkToggleButton::draw_indicator".
1998-06-24 12:22:23 +00:00
|
|
|
for (i = 0; i < 4; i++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
style->text[i] = style->fg[i];
|
|
|
|
style->base[i] = style->white;
|
|
|
|
}
|
2001-04-18 20:16:38 +00:00
|
|
|
|
2001-09-17 21:44:20 +00:00
|
|
|
style->base[GTK_STATE_SELECTED] = gtk_default_selected_base;
|
2002-12-10 12:02:43 +00:00
|
|
|
style->text[GTK_STATE_SELECTED] = style->white;
|
2001-09-17 21:44:20 +00:00
|
|
|
style->base[GTK_STATE_ACTIVE] = gtk_default_active_base;
|
2002-12-10 12:02:43 +00:00
|
|
|
style->text[GTK_STATE_ACTIVE] = style->white;
|
2000-03-14 19:57:25 +00:00
|
|
|
style->base[GTK_STATE_INSENSITIVE] = gtk_default_prelight_bg;
|
|
|
|
style->text[GTK_STATE_INSENSITIVE] = gtk_default_insensitive_fg;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
style->rc_style = NULL;
|
1999-01-11 18:49:54 +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
|
|
|
style->xthickness = 2;
|
|
|
|
style->ythickness = 2;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
style->property_cache = 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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_class_init (GtkStyleClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->finalize = gtk_style_finalize;
|
2010-08-02 14:05:58 +00:00
|
|
|
object_class->set_property = gtk_style_set_property;
|
2010-12-03 19:30:13 +00:00
|
|
|
object_class->get_property = gtk_style_get_property;
|
2010-08-02 14:05:58 +00:00
|
|
|
object_class->constructed = gtk_style_constructed;
|
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
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
klass->clone = gtk_style_real_clone;
|
|
|
|
klass->copy = gtk_style_real_copy;
|
|
|
|
klass->init_from_rc = gtk_style_real_init_from_rc;
|
|
|
|
klass->realize = gtk_style_real_realize;
|
|
|
|
klass->unrealize = gtk_style_real_unrealize;
|
|
|
|
klass->set_background = gtk_style_real_set_background;
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
klass->render_icon = gtk_default_render_icon;
|
|
|
|
|
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
|
|
|
klass->draw_hline = gtk_default_draw_hline;
|
|
|
|
klass->draw_vline = gtk_default_draw_vline;
|
|
|
|
klass->draw_shadow = gtk_default_draw_shadow;
|
|
|
|
klass->draw_arrow = gtk_default_draw_arrow;
|
|
|
|
klass->draw_diamond = gtk_default_draw_diamond;
|
|
|
|
klass->draw_box = gtk_default_draw_box;
|
|
|
|
klass->draw_flat_box = gtk_default_draw_flat_box;
|
|
|
|
klass->draw_check = gtk_default_draw_check;
|
|
|
|
klass->draw_option = gtk_default_draw_option;
|
|
|
|
klass->draw_tab = gtk_default_draw_tab;
|
|
|
|
klass->draw_shadow_gap = gtk_default_draw_shadow_gap;
|
|
|
|
klass->draw_box_gap = gtk_default_draw_box_gap;
|
|
|
|
klass->draw_extension = gtk_default_draw_extension;
|
|
|
|
klass->draw_focus = gtk_default_draw_focus;
|
|
|
|
klass->draw_slider = gtk_default_draw_slider;
|
|
|
|
klass->draw_handle = gtk_default_draw_handle;
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
klass->draw_expander = gtk_default_draw_expander;
|
|
|
|
klass->draw_layout = gtk_default_draw_layout;
|
2001-03-29 21:17:45 +00:00
|
|
|
klass->draw_resize_grip = gtk_default_draw_resize_grip;
|
2009-07-21 01:16:56 +00:00
|
|
|
klass->draw_spinner = gtk_default_draw_spinner;
|
2004-02-25 18:03:12 +00:00
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
g_type_class_add_private (object_class, sizeof (GtkStylePrivate));
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CONTEXT,
|
|
|
|
g_param_spec_object ("context",
|
|
|
|
P_("Style context"),
|
|
|
|
P_("GtkStyleContext to get style from"),
|
|
|
|
GTK_TYPE_STYLE_CONTEXT,
|
2010-12-03 19:30:13 +00:00
|
|
|
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
|
2010-08-02 14:05:58 +00:00
|
|
|
|
2004-02-25 18:03:12 +00:00
|
|
|
/**
|
|
|
|
* GtkStyle::realize:
|
|
|
|
* @style: the object which received the signal
|
|
|
|
*
|
|
|
|
* Emitted when the style has been initialized for a particular
|
2010-08-28 21:19:18 +00:00
|
|
|
* visual. Connecting to this signal is probably seldom
|
2004-02-25 18:03:12 +00:00
|
|
|
* useful since most of the time applications and widgets only
|
|
|
|
* deal with styles that have been already realized.
|
2004-02-26 20:59:01 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
2004-02-25 18:03:12 +00:00
|
|
|
*/
|
2005-09-01 05:11:46 +00:00
|
|
|
realize_signal = g_signal_new (I_("realize"),
|
2004-02-25 18:03:12 +00:00
|
|
|
G_TYPE_FROM_CLASS (object_class),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GtkStyleClass, realize),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
/**
|
|
|
|
* GtkStyle::unrealize:
|
|
|
|
* @style: the object which received the signal
|
|
|
|
*
|
2010-08-28 21:19:18 +00:00
|
|
|
* Emitted when the aspects of the style specific to a particular visual
|
2010-08-28 10:08:24 +00:00
|
|
|
* is being cleaned up. A connection to this signal can be useful
|
2010-07-22 00:55:12 +00:00
|
|
|
* if a widget wants to cache objects as object data on #GtkStyle.
|
2004-02-25 18:03:12 +00:00
|
|
|
* This signal provides a convenient place to free such cached objects.
|
2004-02-26 20:59:01 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
2004-02-25 18:03:12 +00:00
|
|
|
*/
|
2005-09-01 05:11:46 +00:00
|
|
|
unrealize_signal = g_signal_new (I_("unrealize"),
|
2004-02-25 18:03:12 +00:00
|
|
|
G_TYPE_FROM_CLASS (object_class),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GtkStyleClass, unrealize),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
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
|
|
|
}
|
|
|
|
|
2001-09-08 17:55:02 +00:00
|
|
|
static void
|
|
|
|
gtk_style_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkStyle *style = GTK_STYLE (object);
|
2005-11-23 10:33:58 +00:00
|
|
|
GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
|
2011-01-16 11:17:52 +00:00
|
|
|
gint i;
|
2001-09-08 17:55:02 +00:00
|
|
|
|
|
|
|
g_return_if_fail (style->attach_count == 0);
|
|
|
|
|
2004-07-16 02:22:48 +00:00
|
|
|
/* All the styles in the list have the same
|
|
|
|
* style->styles pointer. If we delete the
|
|
|
|
* *first* style from the list, we need to update
|
|
|
|
* the style->styles pointers from all the styles.
|
|
|
|
* Otherwise we simply remove the node from
|
|
|
|
* the list.
|
|
|
|
*/
|
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
|
|
|
if (style->styles)
|
|
|
|
{
|
|
|
|
if (style->styles->data != style)
|
2008-06-19 14:08:59 +00:00
|
|
|
style->styles = g_slist_remove (style->styles, style);
|
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
|
|
|
else
|
|
|
|
{
|
|
|
|
GSList *tmp_list = style->styles->next;
|
|
|
|
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
2001-03-18 04:50:34 +00:00
|
|
|
GTK_STYLE (tmp_list->data)->styles = style->styles->next;
|
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
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
g_slist_free_1 (style->styles);
|
|
|
|
}
|
|
|
|
}
|
2001-09-18 20:06:48 +00:00
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
g_slist_foreach (style->icon_factories, (GFunc) g_object_unref, NULL);
|
|
|
|
g_slist_free (style->icon_factories);
|
2004-02-25 15:15:32 +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
|
|
|
pango_font_description_free (style->font_desc);
|
2001-09-18 20:06:48 +00:00
|
|
|
|
|
|
|
if (style->private_font_desc)
|
|
|
|
pango_font_description_free (style->private_font_desc);
|
2008-06-16 16:53:39 +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
|
|
|
if (style->rc_style)
|
2008-06-16 16:53:39 +00:00
|
|
|
g_object_unref (style->rc_style);
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
if (priv->context)
|
2010-11-03 11:18:48 +00:00
|
|
|
{
|
|
|
|
if (priv->context_changed_id)
|
|
|
|
g_signal_handler_disconnect (priv->context, priv->context_changed_id);
|
|
|
|
|
|
|
|
g_object_unref (priv->context);
|
|
|
|
}
|
2010-08-02 14:05:58 +00:00
|
|
|
|
2011-01-16 11:17:52 +00:00
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
if (style->background[i])
|
|
|
|
cairo_pattern_destroy (style->background[i]);
|
|
|
|
}
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_style_parent_class)->finalize (object);
|
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
|
|
|
}
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
static void
|
|
|
|
gtk_style_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_CONTEXT:
|
|
|
|
priv->context = g_value_dup_object (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-03 19:30:13 +00:00
|
|
|
static void
|
|
|
|
gtk_style_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_CONTEXT:
|
|
|
|
g_value_set_object (value, priv->context);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
static void
|
|
|
|
set_color (GtkStyle *style,
|
|
|
|
GtkStyleContext *context,
|
|
|
|
GtkStateType state,
|
|
|
|
GtkRcFlags prop)
|
|
|
|
{
|
2010-11-19 19:54:13 +00:00
|
|
|
GtkStateFlags flags;
|
2010-10-22 10:41:19 +00:00
|
|
|
GdkRGBA *color = NULL;
|
|
|
|
GdkColor *dest = { 0 }; /* Shut up gcc */
|
2010-08-02 14:05:58 +00:00
|
|
|
|
2010-11-19 19:54:13 +00:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags = GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags = GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags = GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags = GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
flags = 0;
|
|
|
|
}
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
switch (prop)
|
|
|
|
{
|
|
|
|
case GTK_RC_BG:
|
2010-11-19 19:54:13 +00:00
|
|
|
gtk_style_context_get (context, flags,
|
2010-08-02 14:05:58 +00:00
|
|
|
"background-color", &color,
|
|
|
|
NULL);
|
2010-10-22 10:41:19 +00:00
|
|
|
dest = &style->bg[state];
|
2010-08-02 14:05:58 +00:00
|
|
|
break;
|
|
|
|
case GTK_RC_FG:
|
2010-11-19 19:54:13 +00:00
|
|
|
gtk_style_context_get (context, flags,
|
2010-10-29 03:33:38 +00:00
|
|
|
"color", &color,
|
2010-08-02 14:05:58 +00:00
|
|
|
NULL);
|
2010-10-22 10:41:19 +00:00
|
|
|
dest = &style->fg[state];
|
2010-08-02 14:05:58 +00:00
|
|
|
break;
|
|
|
|
case GTK_RC_TEXT:
|
2010-11-19 19:54:13 +00:00
|
|
|
gtk_style_context_get (context, flags,
|
2010-10-29 03:33:38 +00:00
|
|
|
"color", &color,
|
2010-08-02 14:05:58 +00:00
|
|
|
NULL);
|
2010-10-22 10:41:19 +00:00
|
|
|
dest = &style->text[state];
|
2010-08-02 14:05:58 +00:00
|
|
|
break;
|
|
|
|
case GTK_RC_BASE:
|
2010-11-19 19:54:13 +00:00
|
|
|
gtk_style_context_get (context, flags,
|
2010-10-29 03:33:38 +00:00
|
|
|
"background-color", &color,
|
2010-08-02 14:05:58 +00:00
|
|
|
NULL);
|
2010-10-22 10:41:19 +00:00
|
|
|
dest = &style->base[state];
|
2010-08-02 14:05:58 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (color)
|
2010-10-22 10:41:19 +00:00
|
|
|
{
|
|
|
|
dest->pixel = 0;
|
|
|
|
dest->red = CLAMP ((guint) (color->red * 65535), 0, 65535);
|
|
|
|
dest->green = CLAMP ((guint) (color->green * 65535), 0, 65535);
|
|
|
|
dest->blue = CLAMP ((guint) (color->blue * 65535), 0, 65535);
|
|
|
|
gdk_rgba_free (color);
|
|
|
|
}
|
2010-08-02 14:05:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_update_from_context (GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateType state;
|
2011-05-17 18:20:31 +00:00
|
|
|
GtkBorder padding;
|
2010-12-18 10:27:26 +00:00
|
|
|
gint i;
|
2010-08-02 14:05:58 +00:00
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
|
|
|
|
for (state = GTK_STATE_NORMAL; state <= GTK_STATE_INSENSITIVE; state++)
|
|
|
|
{
|
2010-10-29 03:33:38 +00:00
|
|
|
if (gtk_style_context_has_class (priv->context, "entry"))
|
|
|
|
{
|
|
|
|
gtk_style_context_save (priv->context);
|
|
|
|
gtk_style_context_remove_class (priv->context, "entry");
|
|
|
|
set_color (style, priv->context, state, GTK_RC_BG);
|
|
|
|
set_color (style, priv->context, state, GTK_RC_FG);
|
|
|
|
gtk_style_context_restore (priv->context);
|
|
|
|
|
|
|
|
set_color (style, priv->context, state, GTK_RC_BASE);
|
|
|
|
set_color (style, priv->context, state, GTK_RC_TEXT);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_style_context_save (priv->context);
|
|
|
|
gtk_style_context_add_class (priv->context, "entry");
|
|
|
|
set_color (style, priv->context, state, GTK_RC_BASE);
|
|
|
|
set_color (style, priv->context, state, GTK_RC_TEXT);
|
|
|
|
gtk_style_context_restore (priv->context);
|
|
|
|
|
|
|
|
set_color (style, priv->context, state, GTK_RC_BG);
|
|
|
|
set_color (style, priv->context, state, GTK_RC_FG);
|
|
|
|
}
|
2010-08-02 14:05:58 +00:00
|
|
|
}
|
|
|
|
|
2010-08-30 20:39:47 +00:00
|
|
|
if (style->font_desc)
|
|
|
|
pango_font_description_free (style->font_desc);
|
|
|
|
|
2010-11-26 00:27:19 +00:00
|
|
|
gtk_style_context_get (priv->context, 0,
|
2010-08-30 20:39:47 +00:00
|
|
|
"font", &style->font_desc,
|
|
|
|
NULL);
|
2011-05-17 18:20:31 +00:00
|
|
|
gtk_style_context_get_padding (priv->context, 0, &padding);
|
2010-08-30 20:39:47 +00:00
|
|
|
|
2011-05-17 18:20:31 +00:00
|
|
|
style->xthickness = padding.left;
|
|
|
|
style->ythickness = padding.top;
|
2010-12-18 10:27:26 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
_gtk_style_shade (&style->bg[i], &style->light[i], LIGHTNESS_MULT);
|
|
|
|
_gtk_style_shade (&style->bg[i], &style->dark[i], DARKNESS_MULT);
|
|
|
|
|
|
|
|
style->mid[i].red = (style->light[i].red + style->dark[i].red) / 2;
|
|
|
|
style->mid[i].green = (style->light[i].green + style->dark[i].green) / 2;
|
|
|
|
style->mid[i].blue = (style->light[i].blue + style->dark[i].blue) / 2;
|
|
|
|
|
|
|
|
style->text_aa[i].red = (style->text[i].red + style->base[i].red) / 2;
|
|
|
|
style->text_aa[i].green = (style->text[i].green + style->base[i].green) / 2;
|
|
|
|
style->text_aa[i].blue = (style->text[i].blue + style->base[i].blue) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
style->black.red = 0x0000;
|
|
|
|
style->black.green = 0x0000;
|
|
|
|
style->black.blue = 0x0000;
|
|
|
|
|
|
|
|
style->white.red = 0xffff;
|
|
|
|
style->white.green = 0xffff;
|
|
|
|
style->white.blue = 0xffff;
|
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
2010-12-25 10:59:56 +00:00
|
|
|
{
|
|
|
|
if (style->background[i])
|
|
|
|
cairo_pattern_destroy (style->background[i]);
|
|
|
|
|
|
|
|
style->background[i] = cairo_pattern_create_rgb (style->bg[i].red / 65535.0,
|
|
|
|
style->bg[i].green / 65535.0,
|
|
|
|
style->bg[i].blue / 65535.0);
|
|
|
|
}
|
2010-08-02 14:05:58 +00:00
|
|
|
}
|
|
|
|
|
2010-11-03 11:18:48 +00:00
|
|
|
static void
|
|
|
|
style_context_changed (GtkStyleContext *context,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gtk_style_update_from_context (GTK_STYLE (user_data));
|
|
|
|
}
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
static void
|
|
|
|
gtk_style_constructed (GObject *object)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
if (priv->context)
|
|
|
|
{
|
|
|
|
gtk_style_update_from_context (GTK_STYLE (object));
|
|
|
|
|
2010-11-03 11:18:48 +00:00
|
|
|
priv->context_changed_id = g_signal_connect (priv->context, "changed",
|
|
|
|
G_CALLBACK (style_context_changed), object);
|
2010-08-02 14:05:58 +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
|
|
|
|
2008-07-06 23:43:15 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_copy:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
*
|
|
|
|
* Creates a copy of the passed in #GtkStyle object.
|
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
* Returns: (transfer full): a copy of @style
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
2008-07-06 23:43:15 +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
|
|
|
GtkStyle*
|
|
|
|
gtk_style_copy (GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkStyle *new_style;
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), 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
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
new_style = GTK_STYLE_GET_CLASS (style)->clone (style);
|
|
|
|
GTK_STYLE_GET_CLASS (style)->copy (new_style, style);
|
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
|
|
|
|
|
|
|
return new_style;
|
|
|
|
}
|
|
|
|
|
2010-12-20 18:48:44 +00:00
|
|
|
GtkStyle*
|
|
|
|
_gtk_style_new_for_path (GdkScreen *screen,
|
2011-02-05 03:01:40 +00:00
|
|
|
GtkWidgetPath *path)
|
2010-12-20 18:48:44 +00:00
|
|
|
{
|
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStyle *style;
|
|
|
|
|
|
|
|
context = gtk_style_context_new ();
|
2011-02-05 03:01:40 +00:00
|
|
|
|
|
|
|
if (screen)
|
|
|
|
gtk_style_context_set_screen (context, screen);
|
2011-02-06 01:40:06 +00:00
|
|
|
|
2010-12-20 18:48:44 +00:00
|
|
|
gtk_style_context_set_path (context, path);
|
|
|
|
|
|
|
|
style = g_object_new (GTK_TYPE_STYLE,
|
|
|
|
"context", context,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_object_unref (context);
|
|
|
|
|
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_new:
|
|
|
|
*
|
|
|
|
* Creates a new #GtkStyle.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2011-09-26 00:58:59 +00:00
|
|
|
* Returns: a new #GtkStyle.
|
|
|
|
*
|
2010-11-25 19:26:39 +00:00
|
|
|
* Deprecated: 3.0: Use #GtkStyleContext
|
2011-09-26 00:58:59 +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
|
|
|
GtkStyle*
|
|
|
|
gtk_style_new (void)
|
|
|
|
{
|
2010-12-20 16:10:27 +00:00
|
|
|
GtkWidgetPath *path;
|
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
|
|
|
GtkStyle *style;
|
2010-12-20 16:10:27 +00:00
|
|
|
|
|
|
|
path = gtk_widget_path_new ();
|
|
|
|
gtk_widget_path_append_type (path, GTK_TYPE_WIDGET);
|
|
|
|
|
2011-02-05 03:01:40 +00:00
|
|
|
style = _gtk_style_new_for_path (gdk_screen_get_default (), path);
|
2010-12-20 16:10:27 +00:00
|
|
|
|
|
|
|
gtk_widget_path_free (path);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
2011-02-09 04:14:46 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_has_context:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
*
|
|
|
|
* Returns whether @style has an associated #GtkStyleContext.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if @style has a #GtkStyleContext
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
*/
|
2010-08-02 14:05:58 +00:00
|
|
|
gboolean
|
|
|
|
gtk_style_has_context (GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
|
|
|
|
return priv->context != NULL;
|
|
|
|
}
|
|
|
|
|
2001-12-06 21:38:12 +00:00
|
|
|
/**
|
2011-01-18 05:37:11 +00:00
|
|
|
* gtk_style_attach: (skip)
|
2001-12-06 21:38:12 +00:00
|
|
|
* @style: a #GtkStyle.
|
2003-11-06 19:42:39 +00:00
|
|
|
* @window: a #GdkWindow.
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
*
|
2001-12-06 21:38:12 +00:00
|
|
|
* Attaches a style to a window; this process allocates the
|
|
|
|
* colors and creates the GC's for the style - it specializes
|
2010-08-28 21:19:18 +00:00
|
|
|
* it to a particular visual. The process may involve the creation
|
|
|
|
* of a new style if the style has already been attached to a
|
|
|
|
* window with a different style and visual.
|
2005-10-05 13:23:21 +00:00
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
* Since this function may return a new object, you have to use it
|
|
|
|
* in the following way:
|
2005-10-05 13:23:21 +00:00
|
|
|
* <literal>style = gtk_style_attach (style, window)</literal>
|
2006-12-29 19:57:03 +00:00
|
|
|
*
|
|
|
|
* Returns: Either @style, or a newly-created #GtkStyle.
|
|
|
|
* If the style is newly created, the style parameter
|
|
|
|
* will be unref'ed, and the new style will have
|
|
|
|
* a reference count belonging to the caller.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_style_attach() instead
|
2006-12-29 19:57:03 +00:00
|
|
|
*/
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStyle*
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_style_attach (GtkStyle *style,
|
1999-01-15 18:41:43 +00:00
|
|
|
GdkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (window != NULL, NULL);
|
2004-07-16 02:22:48 +00:00
|
|
|
|
2010-12-18 10:27:26 +00:00
|
|
|
return style;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2005-10-05 13:23:21 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_detach:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
*
|
|
|
|
* Detaches a style from a window. If the style is not attached
|
|
|
|
* to any windows anymore, it is unrealized. See gtk_style_attach().
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
2005-10-05 13:23:21 +00:00
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_style_detach (GtkStyle *style)
|
|
|
|
{
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2008-12-30 05:56:57 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_lookup_icon_set:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @stock_id: an icon name
|
|
|
|
*
|
|
|
|
* Looks up @stock_id in the icon factories associated with @style
|
|
|
|
* and the default icon factory, returning an icon set if found,
|
|
|
|
* otherwise %NULL.
|
|
|
|
*
|
2011-01-18 09:01:17 +00:00
|
|
|
* Return value: (transfer none): icon set of @stock_id
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_style_context_lookup_icon_set() instead
|
2008-12-30 05:56:57 +00:00
|
|
|
*/
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
GtkIconSet*
|
|
|
|
gtk_style_lookup_icon_set (GtkStyle *style,
|
|
|
|
const char *stock_id)
|
|
|
|
{
|
2010-08-02 14:05:58 +00:00
|
|
|
GtkStylePrivate *priv;
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
|
|
|
g_return_val_if_fail (stock_id != NULL, NULL);
|
|
|
|
|
2010-08-02 14:05:58 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
|
2010-11-24 00:13:27 +00:00
|
|
|
if (priv->context)
|
|
|
|
return gtk_style_context_lookup_icon_set (priv->context, stock_id);
|
|
|
|
|
|
|
|
return gtk_icon_factory_lookup_default (stock_id);
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
}
|
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_lookup_color:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @color_name: the name of the logical color to look up
|
2011-01-18 09:10:30 +00:00
|
|
|
* @color: (out): the #GdkColor to fill in
|
2005-11-23 10:33:58 +00:00
|
|
|
*
|
|
|
|
* Looks up @color_name in the style's logical color mappings,
|
|
|
|
* filling in @color and returning %TRUE if found, otherwise
|
|
|
|
* returning %FALSE. Do not cache the found mapping, because
|
|
|
|
* it depends on the #GtkStyle and might change when a theme
|
|
|
|
* switch occurs.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the mapping was found.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_style_context_lookup_color() instead
|
2005-11-23 10:33:58 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_style_lookup_color (GtkStyle *style,
|
|
|
|
const char *color_name,
|
|
|
|
GdkColor *color)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
2010-10-22 10:41:19 +00:00
|
|
|
gboolean result;
|
|
|
|
GdkRGBA rgba;
|
2005-11-23 10:33:58 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), FALSE);
|
|
|
|
g_return_val_if_fail (color_name != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (color != NULL, FALSE);
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
|
2010-08-03 18:30:26 +00:00
|
|
|
if (!priv->context)
|
|
|
|
return FALSE;
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2010-10-22 10:41:19 +00:00
|
|
|
result = gtk_style_context_lookup_color (priv->context, color_name, &rgba);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
|
|
|
color->red = (guint16) (rgba.red * 65535);
|
|
|
|
color->green = (guint16) (rgba.green * 65535);
|
|
|
|
color->blue = (guint16) (rgba.blue * 65535);
|
|
|
|
color->pixel = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2005-11-23 10:33:58 +00:00
|
|
|
}
|
|
|
|
|
2002-01-14 23:24:02 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_set_background:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @window: a #GdkWindow
|
|
|
|
* @state_type: a state
|
|
|
|
*
|
|
|
|
* Sets the background of @window to the background color or pixmap
|
|
|
|
* specified by @style for the given state.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_style_context_set_background() instead
|
2002-01-14 23:24:02 +00:00
|
|
|
*/
|
1999-01-12 15:12:14 +00:00
|
|
|
void
|
1999-01-15 18:41:43 +00:00
|
|
|
gtk_style_set_background (GtkStyle *style,
|
|
|
|
GdkWindow *window,
|
|
|
|
GtkStateType state_type)
|
1999-01-12 15:12:14 +00:00
|
|
|
{
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
1999-01-15 18:41:43 +00:00
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->set_background (style, window, state_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Default functions */
|
|
|
|
static GtkStyle *
|
|
|
|
gtk_style_real_clone (GtkStyle *style)
|
|
|
|
{
|
2010-08-02 14:05:58 +00:00
|
|
|
GtkStylePrivate *priv;
|
|
|
|
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
|
|
|
|
return g_object_new (G_OBJECT_TYPE (style),
|
|
|
|
"context", priv->context,
|
|
|
|
NULL);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_copy (GtkStyle *style,
|
|
|
|
GtkStyle *src)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
style->fg[i] = src->fg[i];
|
|
|
|
style->bg[i] = src->bg[i];
|
|
|
|
style->text[i] = src->text[i];
|
|
|
|
style->base[i] = src->base[i];
|
2004-07-16 02:22:48 +00:00
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
if (style->background[i])
|
|
|
|
cairo_pattern_destroy (style->background[i]),
|
|
|
|
style->background[i] = src->background[i];
|
|
|
|
if (style->background[i])
|
|
|
|
cairo_pattern_reference (style->background[i]);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (style->font_desc)
|
|
|
|
pango_font_description_free (style->font_desc);
|
|
|
|
if (src->font_desc)
|
|
|
|
style->font_desc = pango_font_description_copy (src->font_desc);
|
|
|
|
else
|
|
|
|
style->font_desc = NULL;
|
|
|
|
|
|
|
|
style->xthickness = src->xthickness;
|
|
|
|
style->ythickness = src->ythickness;
|
|
|
|
|
|
|
|
if (style->rc_style)
|
2006-07-21 14:52:05 +00:00
|
|
|
g_object_unref (style->rc_style);
|
2000-07-17 23:18:29 +00:00
|
|
|
style->rc_style = src->rc_style;
|
|
|
|
if (src->rc_style)
|
2006-07-21 14:52:05 +00:00
|
|
|
g_object_ref (src->rc_style);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2006-09-22 20:47:23 +00:00
|
|
|
g_slist_foreach (style->icon_factories, (GFunc) g_object_unref, NULL);
|
|
|
|
g_slist_free (style->icon_factories);
|
|
|
|
style->icon_factories = g_slist_copy (src->icon_factories);
|
|
|
|
g_slist_foreach (style->icon_factories, (GFunc) g_object_ref, NULL);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_init_from_rc (GtkStyle *style,
|
|
|
|
GtkRcStyle *rc_style)
|
|
|
|
{
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
2008-11-01 04:15:14 +00:00
|
|
|
/**
|
2009-03-10 18:58:23 +00:00
|
|
|
* gtk_style_get_style_property:
|
2008-11-01 04:15:14 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @widget_type: the #GType of a descendant of #GtkWidget
|
|
|
|
* @property_name: the name of the style property to get
|
|
|
|
* @value: a #GValue where the value of the property being
|
|
|
|
* queried will be stored
|
|
|
|
*
|
|
|
|
* Queries the value of a style property corresponding to a
|
|
|
|
* widget class is in the given style.
|
|
|
|
*
|
|
|
|
* Since: 2.16
|
|
|
|
*/
|
|
|
|
void
|
2009-03-10 18:58:23 +00:00
|
|
|
gtk_style_get_style_property (GtkStyle *style,
|
|
|
|
GType widget_type,
|
|
|
|
const gchar *property_name,
|
|
|
|
GValue *value)
|
2008-11-01 04:15:14 +00:00
|
|
|
{
|
2010-12-18 10:27:26 +00:00
|
|
|
GtkStylePrivate *priv;
|
2008-11-01 04:15:14 +00:00
|
|
|
GtkWidgetClass *klass;
|
|
|
|
GParamSpec *pspec;
|
|
|
|
const GValue *peek_value;
|
|
|
|
|
2009-07-21 01:16:56 +00:00
|
|
|
klass = g_type_class_ref (widget_type);
|
2008-11-01 04:15:14 +00:00
|
|
|
pspec = gtk_widget_class_find_style_property (klass, property_name);
|
2009-07-21 01:16:56 +00:00
|
|
|
g_type_class_unref (klass);
|
2008-11-01 04:15:14 +00:00
|
|
|
|
|
|
|
if (!pspec)
|
|
|
|
{
|
|
|
|
g_warning ("%s: widget class `%s' has no property named `%s'",
|
|
|
|
G_STRLOC,
|
|
|
|
g_type_name (widget_type),
|
|
|
|
property_name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-12-18 10:27:26 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
peek_value = _gtk_style_context_peek_style_property (priv->context,
|
|
|
|
widget_type,
|
|
|
|
0, pspec);
|
2008-11-01 04:15:14 +00:00
|
|
|
|
|
|
|
if (G_VALUE_TYPE (value) == G_PARAM_SPEC_VALUE_TYPE (pspec))
|
|
|
|
g_value_copy (peek_value, value);
|
|
|
|
else if (g_value_type_transformable (G_PARAM_SPEC_VALUE_TYPE (pspec), G_VALUE_TYPE (value)))
|
|
|
|
g_value_transform (peek_value, value);
|
|
|
|
else
|
|
|
|
g_warning ("can't retrieve style property `%s' of type `%s' as value of type `%s'",
|
|
|
|
pspec->name,
|
|
|
|
g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)),
|
|
|
|
G_VALUE_TYPE_NAME (value));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_style_get_valist:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @widget_type: the #GType of a descendant of #GtkWidget
|
|
|
|
* @first_property_name: the name of the first style property to get
|
2008-12-29 03:12:35 +00:00
|
|
|
* @var_args: a <type>va_list</type> of pairs of property names and
|
2008-11-01 04:15:14 +00:00
|
|
|
* locations to return the property values, starting with the
|
|
|
|
* location for @first_property_name.
|
|
|
|
*
|
|
|
|
* Non-vararg variant of gtk_style_get().
|
|
|
|
* Used primarily by language bindings.
|
|
|
|
*
|
|
|
|
* Since: 2.16
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_style_get_valist (GtkStyle *style,
|
|
|
|
GType widget_type,
|
|
|
|
const gchar *first_property_name,
|
|
|
|
va_list var_args)
|
|
|
|
{
|
2010-12-18 10:27:26 +00:00
|
|
|
GtkStylePrivate *priv;
|
2008-11-01 04:15:14 +00:00
|
|
|
const char *property_name;
|
|
|
|
GtkWidgetClass *klass;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
|
|
|
|
klass = g_type_class_ref (widget_type);
|
|
|
|
|
2010-12-18 10:27:26 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
2008-11-01 04:15:14 +00:00
|
|
|
property_name = first_property_name;
|
|
|
|
while (property_name)
|
|
|
|
{
|
|
|
|
GParamSpec *pspec;
|
|
|
|
const GValue *peek_value;
|
|
|
|
gchar *error;
|
|
|
|
|
|
|
|
pspec = gtk_widget_class_find_style_property (klass, property_name);
|
|
|
|
|
|
|
|
if (!pspec)
|
|
|
|
{
|
|
|
|
g_warning ("%s: widget class `%s' has no property named `%s'",
|
|
|
|
G_STRLOC,
|
|
|
|
g_type_name (widget_type),
|
|
|
|
property_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-12-18 10:27:26 +00:00
|
|
|
peek_value = _gtk_style_context_peek_style_property (priv->context, widget_type,
|
|
|
|
0, pspec);
|
2008-11-01 04:15:14 +00:00
|
|
|
G_VALUE_LCOPY (peek_value, var_args, 0, &error);
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
g_warning ("%s: %s", G_STRLOC, error);
|
|
|
|
g_free (error);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
property_name = va_arg (var_args, gchar*);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_type_class_unref (klass);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_style_get:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @widget_type: the #GType of a descendant of #GtkWidget
|
|
|
|
* @first_property_name: the name of the first style property to get
|
2011-09-26 00:58:59 +00:00
|
|
|
* @...: pairs of property names and locations to
|
2008-11-01 04:15:14 +00:00
|
|
|
* return the property values, starting with the location for
|
|
|
|
* @first_property_name, terminated by %NULL.
|
|
|
|
*
|
|
|
|
* Gets the values of a multiple style properties for @widget_type
|
|
|
|
* from @style.
|
2009-01-20 19:09:53 +00:00
|
|
|
*
|
|
|
|
* Since: 2.16
|
2008-11-01 04:15:14 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_style_get (GtkStyle *style,
|
|
|
|
GType widget_type,
|
|
|
|
const gchar *first_property_name,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list var_args;
|
|
|
|
|
|
|
|
va_start (var_args, first_property_name);
|
|
|
|
gtk_style_get_valist (style, widget_type, first_property_name, var_args);
|
|
|
|
va_end (var_args);
|
|
|
|
}
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
static void
|
|
|
|
gtk_style_real_realize (GtkStyle *style)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_unrealize (GtkStyle *style)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_set_background (GtkStyle *style,
|
|
|
|
GdkWindow *window,
|
|
|
|
GtkStateType state_type)
|
|
|
|
{
|
2010-08-15 12:36:05 +00:00
|
|
|
gdk_window_set_background_pattern (window, style->background[state_type]);
|
1999-01-12 15:12:14 +00:00
|
|
|
}
|
|
|
|
|
2002-01-14 23:24:02 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_render_icon:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @source: the #GtkIconSource specifying the icon to render
|
|
|
|
* @direction: a text direction
|
|
|
|
* @state: a state
|
2010-09-23 20:56:48 +00:00
|
|
|
* @size: (type int): the size to render the icon at. A size of
|
2009-12-18 10:58:36 +00:00
|
|
|
* (GtkIconSize)-1 means render at the size of the source and
|
|
|
|
* don't scale.
|
2009-12-10 10:23:40 +00:00
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
2002-01-14 23:24:02 +00:00
|
|
|
*
|
2009-12-10 10:23:40 +00:00
|
|
|
* Renders the icon specified by @source at the given @size
|
|
|
|
* according to the given parameters and returns the result in a
|
2002-01-14 23:24:02 +00:00
|
|
|
* pixbuf.
|
2010-09-21 04:18:11 +00:00
|
|
|
*
|
|
|
|
* Return value: (transfer full): a newly-created #GdkPixbuf
|
|
|
|
* containing the rendered icon
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_icon_pixbuf() instead
|
2002-01-14 23:24:02 +00:00
|
|
|
*/
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
GdkPixbuf *
|
|
|
|
gtk_style_render_icon (GtkStyle *style,
|
|
|
|
const GtkIconSource *source,
|
|
|
|
GtkTextDirection direction,
|
|
|
|
GtkStateType state,
|
2001-03-12 18:46:53 +00:00
|
|
|
GtkIconSize size,
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail)
|
|
|
|
{
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
|
|
|
g_return_val_if_fail (GTK_STYLE_GET_CLASS (style)->render_icon != NULL, NULL);
|
|
|
|
|
|
|
|
pixbuf = GTK_STYLE_GET_CLASS (style)->render_icon (style, source, direction, state,
|
|
|
|
size, widget, detail);
|
|
|
|
|
|
|
|
g_return_val_if_fail (pixbuf != NULL, NULL);
|
|
|
|
|
|
|
|
return pixbuf;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Default functions */
|
2009-12-10 10:23:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_style_apply_default_background:
|
|
|
|
* @style:
|
2011-09-26 00:58:59 +00:00
|
|
|
* @cr:
|
2009-12-10 10:23:40 +00:00
|
|
|
* @window:
|
|
|
|
* @state_type:
|
|
|
|
* @x:
|
|
|
|
* @y:
|
|
|
|
* @width:
|
|
|
|
* @height:
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
2009-12-10 10:23:40 +00:00
|
|
|
*/
|
1998-11-06 22:05:02 +00:00
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
gtk_style_apply_default_background (GtkStyle *style,
|
2010-08-16 19:36:49 +00:00
|
|
|
cairo_t *cr,
|
2008-01-25 09:30:40 +00:00
|
|
|
GdkWindow *window,
|
2010-08-16 19:36:49 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-16 19:36:49 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
if (style->background[state_type] == NULL)
|
1999-01-15 15:54:39 +00:00
|
|
|
{
|
2010-08-16 19:36:49 +00:00
|
|
|
GdkWindow *parent = gdk_window_get_parent (window);
|
|
|
|
int x_offset, y_offset;
|
2010-07-15 17:23:27 +00:00
|
|
|
|
2010-08-16 19:36:49 +00:00
|
|
|
if (parent)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-08-16 19:36:49 +00:00
|
|
|
gdk_window_get_position (window, &x_offset, &y_offset);
|
|
|
|
cairo_translate (cr, -x_offset, -y_offset);
|
|
|
|
gtk_style_apply_default_background (style, cr,
|
|
|
|
parent, state_type,
|
|
|
|
x + x_offset, y + y_offset,
|
|
|
|
width, height);
|
|
|
|
goto out;
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
2010-07-15 17:23:27 +00:00
|
|
|
else
|
|
|
|
gdk_cairo_set_source_color (cr, &style->bg[state_type]);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
2010-08-16 19:36:49 +00:00
|
|
|
else
|
2010-08-15 12:36:05 +00:00
|
|
|
cairo_set_source (cr, style->background[state_type]);
|
2010-08-16 19:36:49 +00:00
|
|
|
|
|
|
|
cairo_rectangle (cr, x, y, width, height);
|
|
|
|
cairo_fill (cr);
|
|
|
|
|
|
|
|
out:
|
|
|
|
cairo_restore (cr);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
static GdkPixbuf *
|
|
|
|
gtk_default_render_icon (GtkStyle *style,
|
2001-03-12 18:46:53 +00:00
|
|
|
const GtkIconSource *source,
|
|
|
|
GtkTextDirection direction,
|
|
|
|
GtkStateType state,
|
|
|
|
GtkIconSize size,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail)
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
{
|
2010-11-03 20:14:08 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
2010-12-03 19:31:13 +00:00
|
|
|
GtkStateFlags flags = 0;
|
2010-11-03 20:14:08 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
2002-09-24 21:03:58 +00:00
|
|
|
|
2010-11-03 20:14:08 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
{
|
2010-11-03 20:14:08 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
}
|
|
|
|
|
2010-11-03 20:14:08 +00:00
|
|
|
if (!context)
|
|
|
|
return NULL;
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
2010-11-03 20:14:08 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
2010-12-03 19:31:13 +00:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
2010-11-03 20:14:08 +00:00
|
|
|
pixbuf = gtk_render_icon_pixbuf (context, source, size);
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
|
|
|
return pixbuf;
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
}
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
static void
|
|
|
|
_cairo_draw_line (cairo_t *cr,
|
|
|
|
GdkColor *color,
|
|
|
|
gint x1,
|
|
|
|
gint y1,
|
|
|
|
gint x2,
|
|
|
|
gint y2)
|
|
|
|
{
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, color);
|
|
|
|
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
|
|
|
|
|
|
|
|
cairo_move_to (cr, x1 + 0.5, y1 + 0.5);
|
|
|
|
cairo_line_to (cr, x2 + 0.5, y2 + 0.5);
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
2010-08-02 14:15:06 +00:00
|
|
|
transform_detail_string (const gchar *detail,
|
|
|
|
GtkStyleContext *context)
|
|
|
|
{
|
|
|
|
if (!detail)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (strcmp (detail, "arrow") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "arrow");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "button") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "button");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "buttondefault") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "button");
|
|
|
|
gtk_style_context_add_class (context, "default");
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
|
|
|
else if (strcmp (detail, "calendar") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "calendar");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "cellcheck") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "cell");
|
|
|
|
gtk_style_context_add_class (context, "check");
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
|
|
|
else if (strcmp (detail, "cellradio") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "cell");
|
|
|
|
gtk_style_context_add_class (context, "radio");
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
|
|
|
else if (strcmp (detail, "checkbutton") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "check");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "check") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "check");
|
|
|
|
gtk_style_context_add_class (context, "menu");
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
2010-11-17 02:50:04 +00:00
|
|
|
else if (strcmp (detail, "radiobutton") == 0)
|
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "radio");
|
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "option") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "radio");
|
|
|
|
gtk_style_context_add_class (context, "menu");
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
|
|
|
else if (strcmp (detail, "entry") == 0 ||
|
|
|
|
strcmp (detail, "entry_bg") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "entry");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "expander") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "expander");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "tooltip") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "tooltip");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "frame") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "frame");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "scrolled_window") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "scrolled-window");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "viewport") == 0 ||
|
|
|
|
strcmp (detail, "viewportbin") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "viewport");
|
2010-10-22 21:59:58 +00:00
|
|
|
else if (strncmp (detail, "trough", 6) == 0)
|
2010-11-26 02:47:46 +00:00
|
|
|
gtk_style_context_add_class (context, "trough");
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (detail, "spinbutton") == 0)
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "spinbutton");
|
2010-08-03 18:37:53 +00:00
|
|
|
else if (strcmp (detail, "spinbutton_up") == 0)
|
2010-08-02 14:15:06 +00:00
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "spinbutton");
|
|
|
|
gtk_style_context_add_class (context, "button");
|
2010-08-03 18:37:53 +00:00
|
|
|
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
|
|
|
|
}
|
|
|
|
else if (strcmp (detail, "spinbutton_down") == 0)
|
|
|
|
{
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "spinbutton");
|
|
|
|
gtk_style_context_add_class (context, "button");
|
2010-08-03 18:37:53 +00:00
|
|
|
gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
|
2010-08-02 14:15:06 +00:00
|
|
|
}
|
2010-10-23 16:25:18 +00:00
|
|
|
else if ((detail[0] == 'h' || detail[0] == 'v') &&
|
|
|
|
strncmp (&detail[1], "scrollbar_", 10) == 0)
|
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "button");
|
|
|
|
gtk_style_context_add_class (context, "scrollbar");
|
|
|
|
}
|
2010-10-22 21:59:58 +00:00
|
|
|
else if (strcmp (detail, "slider") == 0)
|
2010-10-23 16:25:18 +00:00
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "slider");
|
|
|
|
gtk_style_context_add_class (context, "scrollbar");
|
|
|
|
}
|
2010-11-22 01:40:05 +00:00
|
|
|
else if (strcmp (detail, "vscale") == 0 ||
|
|
|
|
strcmp (detail, "hscale") == 0)
|
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "slider");
|
|
|
|
gtk_style_context_add_class (context, "scale");
|
|
|
|
}
|
2010-10-29 03:33:38 +00:00
|
|
|
else if (strcmp (detail, "menuitem") == 0)
|
2010-11-17 01:40:21 +00:00
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "menuitem");
|
|
|
|
gtk_style_context_add_class (context, "menu");
|
|
|
|
}
|
2010-11-17 06:38:40 +00:00
|
|
|
else if (strcmp (detail, "menu") == 0)
|
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "popup");
|
|
|
|
gtk_style_context_add_class (context, "menu");
|
|
|
|
}
|
2010-11-08 00:52:25 +00:00
|
|
|
else if (strcmp (detail, "accellabel") == 0)
|
|
|
|
gtk_style_context_add_class (context, "accelerator");
|
2010-11-08 01:15:06 +00:00
|
|
|
else if (strcmp (detail, "menubar") == 0)
|
|
|
|
gtk_style_context_add_class (context, "menubar");
|
2010-11-08 01:30:39 +00:00
|
|
|
else if (strcmp (detail, "base") == 0)
|
|
|
|
gtk_style_context_add_class (context, "background");
|
2010-11-22 01:40:05 +00:00
|
|
|
else if (strcmp (detail, "bar") == 0 ||
|
|
|
|
strcmp (detail, "progressbar") == 0)
|
2010-11-09 17:27:13 +00:00
|
|
|
gtk_style_context_add_class (context, "progressbar");
|
|
|
|
else if (strcmp (detail, "toolbar") == 0)
|
|
|
|
gtk_style_context_add_class (context, "toolbar");
|
|
|
|
else if (strcmp (detail, "handlebox_bin") == 0)
|
|
|
|
gtk_style_context_add_class (context, "dock");
|
|
|
|
else if (strcmp (detail, "notebook") == 0)
|
|
|
|
gtk_style_context_add_class (context, "notebook");
|
2010-11-15 22:27:44 +00:00
|
|
|
else if (strcmp (detail, "tab") == 0)
|
|
|
|
{
|
|
|
|
gtk_style_context_add_class (context, "notebook");
|
|
|
|
gtk_style_context_add_region (context, GTK_STYLE_REGION_TAB, 0);
|
|
|
|
}
|
2010-10-25 11:55:18 +00:00
|
|
|
else if (g_str_has_prefix (detail, "cell"))
|
2010-08-02 14:15:06 +00:00
|
|
|
{
|
2010-08-05 09:08:51 +00:00
|
|
|
GtkRegionFlags row, col;
|
2010-08-02 14:15:06 +00:00
|
|
|
gboolean ruled = FALSE;
|
|
|
|
GStrv tokens;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
tokens = g_strsplit (detail, "_", -1);
|
|
|
|
row = col = 0;
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
while (tokens[i])
|
|
|
|
{
|
|
|
|
if (strcmp (tokens[i], "even") == 0)
|
2010-08-05 09:08:51 +00:00
|
|
|
row |= GTK_REGION_EVEN;
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (tokens[i], "odd") == 0)
|
2010-08-05 09:08:51 +00:00
|
|
|
row |= GTK_REGION_ODD;
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (tokens[i], "start") == 0)
|
2010-08-05 09:08:51 +00:00
|
|
|
col |= GTK_REGION_FIRST;
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (tokens[i], "end") == 0)
|
2010-08-05 09:08:51 +00:00
|
|
|
col |= GTK_REGION_LAST;
|
2010-08-02 14:15:06 +00:00
|
|
|
else if (strcmp (tokens[i], "ruled") == 0)
|
|
|
|
ruled = TRUE;
|
|
|
|
else if (strcmp (tokens[i], "sorted") == 0)
|
2010-08-05 09:08:51 +00:00
|
|
|
col |= GTK_REGION_SORTED;
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ruled)
|
2010-08-05 09:08:51 +00:00
|
|
|
row &= ~(GTK_REGION_EVEN | GTK_REGION_ODD);
|
2010-08-02 14:15:06 +00:00
|
|
|
|
2010-10-20 17:02:41 +00:00
|
|
|
gtk_style_context_add_class (context, "cell");
|
|
|
|
gtk_style_context_add_region (context, "row", row);
|
|
|
|
gtk_style_context_add_region (context, "column", col);
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
g_strfreev (tokens);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_hline (GtkStyle *style,
|
2010-08-16 13:35:58 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x1,
|
|
|
|
gint x2,
|
|
|
|
gint y)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
1999-01-11 18:49:54 +00:00
|
|
|
else
|
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_line (context, cr,
|
|
|
|
x1, y, x2, y);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2010-08-16 13:40:03 +00:00
|
|
|
gtk_default_draw_vline (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint y1,
|
|
|
|
gint y2,
|
|
|
|
gint x)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
1999-01-11 18:49:54 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_line (context, cr,
|
|
|
|
x, y1, x, y2);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_shadow (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
2003-07-06 13:14:28 +00:00
|
|
|
|
2010-12-28 14:15:39 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_NONE)
|
|
|
|
return;
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_render_frame (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cairo_t *cr,
|
2005-03-17 01:54:40 +00:00
|
|
|
GdkColor *color,
|
2002-02-26 23:50:14 +00:00
|
|
|
GtkArrowType arrow_type,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
gdk_cairo_set_source_color (cr, color);
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_save (cr);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
if (arrow_type == GTK_ARROW_DOWN)
|
1999-01-11 18:49:54 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_move_to (cr, x, y);
|
|
|
|
cairo_line_to (cr, x + width, y);
|
|
|
|
cairo_line_to (cr, x + width / 2., y + height);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2002-02-26 23:50:14 +00:00
|
|
|
else if (arrow_type == GTK_ARROW_UP)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_move_to (cr, x, y + height);
|
|
|
|
cairo_line_to (cr, x + width / 2., y);
|
|
|
|
cairo_line_to (cr, x + width, y + height);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2002-02-26 23:50:14 +00:00
|
|
|
else if (arrow_type == GTK_ARROW_LEFT)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_move_to (cr, x + width, y);
|
|
|
|
cairo_line_to (cr, x + width, y + height);
|
|
|
|
cairo_line_to (cr, x, y + height / 2.);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2002-02-26 23:50:14 +00:00
|
|
|
else if (arrow_type == GTK_ARROW_RIGHT)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_move_to (cr, x, y);
|
|
|
|
cairo_line_to (cr, x + width, y + height / 2.);
|
|
|
|
cairo_line_to (cr, x, y + height);
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_close_path (cr);
|
|
|
|
cairo_fill (cr);
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_restore (cr);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_arrow (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
2001-05-01 01:36:33 +00:00
|
|
|
GtkStateType state,
|
|
|
|
GtkShadowType shadow,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GtkArrowType arrow_type,
|
|
|
|
gboolean fill,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
|
|
|
gdouble angle, size;
|
|
|
|
|
2010-08-23 16:00:31 +00:00
|
|
|
if (arrow_type == GTK_ARROW_NONE)
|
|
|
|
return;
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (arrow_type)
|
|
|
|
{
|
|
|
|
case GTK_ARROW_UP:
|
|
|
|
angle = 0;
|
|
|
|
size = width;
|
|
|
|
break;
|
|
|
|
case GTK_ARROW_RIGHT:
|
|
|
|
angle = G_PI / 2;
|
|
|
|
size = height;
|
|
|
|
break;
|
|
|
|
case GTK_ARROW_DOWN:
|
|
|
|
angle = G_PI;
|
|
|
|
size = width;
|
|
|
|
break;
|
|
|
|
case GTK_ARROW_LEFT:
|
|
|
|
angle = 3 * (G_PI / 2);
|
|
|
|
size = height;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2002-11-08 21:55:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_arrow (context,
|
|
|
|
cr, angle,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
size);
|
2003-07-06 13:14:28 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_diamond (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
gint half_width;
|
|
|
|
gint half_height;
|
2010-07-14 22:35:15 +00:00
|
|
|
GdkColor *outer_nw = NULL;
|
|
|
|
GdkColor *outer_ne = NULL;
|
|
|
|
GdkColor *outer_sw = NULL;
|
|
|
|
GdkColor *outer_se = NULL;
|
|
|
|
GdkColor *middle_nw = NULL;
|
|
|
|
GdkColor *middle_ne = NULL;
|
|
|
|
GdkColor *middle_sw = NULL;
|
|
|
|
GdkColor *middle_se = NULL;
|
|
|
|
GdkColor *inner_nw = NULL;
|
|
|
|
GdkColor *inner_ne = NULL;
|
|
|
|
GdkColor *inner_sw = NULL;
|
|
|
|
GdkColor *inner_se = NULL;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
|
|
|
half_width = width / 2;
|
|
|
|
half_height = height / 2;
|
|
|
|
|
|
|
|
switch (shadow_type)
|
|
|
|
{
|
|
|
|
case GTK_SHADOW_IN:
|
2010-07-14 22:35:15 +00:00
|
|
|
inner_sw = inner_se = &style->bg[state_type];
|
|
|
|
middle_sw = middle_se = &style->light[state_type];
|
|
|
|
outer_sw = outer_se = &style->light[state_type];
|
|
|
|
inner_nw = inner_ne = &style->black;
|
|
|
|
middle_nw = middle_ne = &style->dark[state_type];
|
|
|
|
outer_nw = outer_ne = &style->dark[state_type];
|
1999-01-11 18:49:54 +00:00
|
|
|
break;
|
2001-02-19 22:25:30 +00:00
|
|
|
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_OUT:
|
2010-07-14 22:35:15 +00:00
|
|
|
inner_sw = inner_se = &style->dark[state_type];
|
|
|
|
middle_sw = middle_se = &style->dark[state_type];
|
|
|
|
outer_sw = outer_se = &style->black;
|
|
|
|
inner_nw = inner_ne = &style->bg[state_type];
|
|
|
|
middle_nw = middle_ne = &style->light[state_type];
|
|
|
|
outer_nw = outer_ne = &style->light[state_type];
|
2001-02-19 22:25:30 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
2010-07-14 22:35:15 +00:00
|
|
|
inner_sw = inner_se = &style->bg[state_type];
|
|
|
|
middle_sw = middle_se = &style->dark[state_type];
|
|
|
|
outer_sw = outer_se = &style->light[state_type];
|
|
|
|
inner_nw = inner_ne = &style->bg[state_type];
|
|
|
|
middle_nw = middle_ne = &style->light[state_type];
|
|
|
|
outer_nw = outer_ne = &style->dark[state_type];
|
2001-02-19 22:25:30 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2010-07-14 22:35:15 +00:00
|
|
|
inner_sw = inner_se = &style->bg[state_type];
|
|
|
|
middle_sw = middle_se = &style->light[state_type];
|
|
|
|
outer_sw = outer_se = &style->dark[state_type];
|
|
|
|
inner_nw = inner_ne = &style->bg[state_type];
|
|
|
|
middle_nw = middle_ne = &style->dark[state_type];
|
|
|
|
outer_nw = outer_ne = &style->light[state_type];
|
2001-02-19 22:25:30 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-07-14 22:35:15 +00:00
|
|
|
if (inner_sw)
|
1999-01-11 18:49:54 +00:00
|
|
|
{
|
2010-07-14 22:35:15 +00:00
|
|
|
_cairo_draw_line (cr, inner_sw,
|
|
|
|
x + 2, y + half_height,
|
|
|
|
x + half_width, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, inner_se,
|
|
|
|
x + half_width, y + height - 2,
|
|
|
|
x + width - 2, y + half_height);
|
|
|
|
_cairo_draw_line (cr, middle_sw,
|
|
|
|
x + 1, y + half_height,
|
|
|
|
x + half_width, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, middle_se,
|
|
|
|
x + half_width, y + height - 1,
|
|
|
|
x + width - 1, y + half_height);
|
|
|
|
_cairo_draw_line (cr, outer_sw,
|
|
|
|
x, y + half_height,
|
|
|
|
x + half_width, y + height);
|
|
|
|
_cairo_draw_line (cr, outer_se,
|
|
|
|
x + half_width, y + height,
|
|
|
|
x + width, y + half_height);
|
|
|
|
|
|
|
|
_cairo_draw_line (cr, inner_nw,
|
|
|
|
x + 2, y + half_height,
|
|
|
|
x + half_width, y + 2);
|
|
|
|
_cairo_draw_line (cr, inner_ne,
|
|
|
|
x + half_width, y + 2,
|
|
|
|
x + width - 2, y + half_height);
|
|
|
|
_cairo_draw_line (cr, middle_nw,
|
|
|
|
x + 1, y + half_height,
|
|
|
|
x + half_width, y + 1);
|
|
|
|
_cairo_draw_line (cr, middle_ne,
|
|
|
|
x + half_width, y + 1,
|
|
|
|
x + width - 1, y + half_height);
|
|
|
|
_cairo_draw_line (cr, outer_nw,
|
|
|
|
x, y + half_height,
|
|
|
|
x + half_width, y);
|
|
|
|
_cairo_draw_line (cr, outer_ne,
|
|
|
|
x + half_width, y,
|
|
|
|
x + width, y + half_height);
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
static void
|
|
|
|
option_menu_get_props (GtkWidget *widget,
|
|
|
|
GtkRequisition *indicator_size,
|
|
|
|
GtkBorder *indicator_spacing)
|
|
|
|
{
|
|
|
|
GtkRequisition *tmp_size = NULL;
|
|
|
|
GtkBorder *tmp_spacing = NULL;
|
|
|
|
|
|
|
|
if (tmp_size)
|
|
|
|
{
|
|
|
|
*indicator_size = *tmp_size;
|
2007-09-21 21:14:56 +00:00
|
|
|
gtk_requisition_free (tmp_size);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
*indicator_size = default_option_indicator_size;
|
|
|
|
|
|
|
|
if (tmp_spacing)
|
|
|
|
{
|
|
|
|
*indicator_spacing = *tmp_spacing;
|
2007-01-03 17:31:57 +00:00
|
|
|
gtk_border_free (tmp_spacing);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
*indicator_spacing = default_option_indicator_spacing;
|
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
1999-01-15 18:41:43 +00:00
|
|
|
gtk_default_draw_box (GtkStyle *style,
|
2010-08-16 13:48:06 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2004-02-19 23:20:07 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
1998-11-06 22:05:02 +00:00
|
|
|
else
|
2002-02-20 23:36:28 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2002-02-20 23:36:28 +00:00
|
|
|
}
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
switch (state_type)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
2010-08-16 16:40:03 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-11-21 18:38:07 +00:00
|
|
|
if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_PROGRESSBAR))
|
|
|
|
gtk_render_activity (context, cr, x, y, width, height);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_render_background (context, cr, x, y, width, height);
|
2010-12-28 14:15:39 +00:00
|
|
|
|
|
|
|
if (shadow_type != GTK_SHADOW_NONE)
|
|
|
|
gtk_render_frame (context, cr, x, y, width, height);
|
2010-11-21 18:38:07 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_flat_box (GtkStyle *style,
|
2010-08-16 19:50:08 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2010-08-16 19:36:49 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
2010-09-13 15:13:21 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2010-09-13 15:13:21 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
Another feature to create truly ugly TreeViews!: style properties for the
Wed Oct 23 01:03:43 2002 Kristian Rietveld <kris@gtk.org>
Another feature to create truly ugly TreeViews!: style properties
for the even/odd colors used for row hinting. (#71595, reported
by Owen Taylor).
* gtk/gtktreeview.c (gtk_tree_view_class_init): add even_row_color
and odd_row_color style properties.
* gtk/gtkstyle.c (get_darkened_gc): support darken_count == 0 case,
(gtk_default_draw_flat_box): rework cell coloring code to support
user-provided even/odd row colors.
Wed Oct 23 01:01:52 2002 Kristian Rietveld <kris@gtk.org>
Cache signal IDs to speed up signal emission. This is a good speedup
because GtkTreeModel emits a big number of signals.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): save IDs returned
by g_signal_new,
(gtk_tree_model_row_changed): use g_signal_emit instead of
g_signal_emit_by_name,
(gtk_tree_model_row_inserted): ditto,
(gtk_tree_model_row_has_child_toggled): ditto,
(gtk_tree_model_row_deleted): ditto,
(gtk_tree_model_rows_reordered): ditto.
Wed Oct 23 00:56:15 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (model_changed): new function,
(gtk_tree_selection_selected_foreach): monitor changes in the model,
bail out if the model has been changed from the foreach func.
(#50263, reported by Havoc Pennington).
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
free anchor if applicable (#94868, reported and testcase provided by
Daniel Elstner).
2002-10-22 23:05:29 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
2010-10-23 20:51:58 +00:00
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
2010-11-23 01:55:02 +00:00
|
|
|
case GTK_STATE_FOCUSED:
|
|
|
|
flags |= GTK_STATE_FLAG_FOCUSED;
|
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
Another feature to create truly ugly TreeViews!: style properties for the
Wed Oct 23 01:03:43 2002 Kristian Rietveld <kris@gtk.org>
Another feature to create truly ugly TreeViews!: style properties
for the even/odd colors used for row hinting. (#71595, reported
by Owen Taylor).
* gtk/gtktreeview.c (gtk_tree_view_class_init): add even_row_color
and odd_row_color style properties.
* gtk/gtkstyle.c (get_darkened_gc): support darken_count == 0 case,
(gtk_default_draw_flat_box): rework cell coloring code to support
user-provided even/odd row colors.
Wed Oct 23 01:01:52 2002 Kristian Rietveld <kris@gtk.org>
Cache signal IDs to speed up signal emission. This is a good speedup
because GtkTreeModel emits a big number of signals.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): save IDs returned
by g_signal_new,
(gtk_tree_model_row_changed): use g_signal_emit instead of
g_signal_emit_by_name,
(gtk_tree_model_row_inserted): ditto,
(gtk_tree_model_row_has_child_toggled): ditto,
(gtk_tree_model_row_deleted): ditto,
(gtk_tree_model_rows_reordered): ditto.
Wed Oct 23 00:56:15 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (model_changed): new function,
(gtk_tree_selection_selected_foreach): monitor changes in the model,
bail out if the model has been changed from the foreach func.
(#50263, reported by Havoc Pennington).
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
free anchor if applicable (#94868, reported and testcase provided by
Daniel Elstner).
2002-10-22 23:05:29 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
Another feature to create truly ugly TreeViews!: style properties for the
Wed Oct 23 01:03:43 2002 Kristian Rietveld <kris@gtk.org>
Another feature to create truly ugly TreeViews!: style properties
for the even/odd colors used for row hinting. (#71595, reported
by Owen Taylor).
* gtk/gtktreeview.c (gtk_tree_view_class_init): add even_row_color
and odd_row_color style properties.
* gtk/gtkstyle.c (get_darkened_gc): support darken_count == 0 case,
(gtk_default_draw_flat_box): rework cell coloring code to support
user-provided even/odd row colors.
Wed Oct 23 01:01:52 2002 Kristian Rietveld <kris@gtk.org>
Cache signal IDs to speed up signal emission. This is a good speedup
because GtkTreeModel emits a big number of signals.
* gtk/gtktreemodel.c (gtk_tree_model_base_init): save IDs returned
by g_signal_new,
(gtk_tree_model_row_changed): use g_signal_emit instead of
g_signal_emit_by_name,
(gtk_tree_model_row_inserted): ditto,
(gtk_tree_model_row_has_child_toggled): ditto,
(gtk_tree_model_row_deleted): ditto,
(gtk_tree_model_rows_reordered): ditto.
Wed Oct 23 00:56:15 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (model_changed): new function,
(gtk_tree_selection_selected_foreach): monitor changes in the model,
bail out if the model has been changed from the foreach func.
(#50263, reported by Havoc Pennington).
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
free anchor if applicable (#94868, reported and testcase provided by
Daniel Elstner).
2002-10-22 23:05:29 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_render_background (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
1999-01-15 18:41:43 +00:00
|
|
|
gtk_default_draw_check (GtkStyle *style,
|
2010-08-16 19:55:02 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
2005-03-17 01:54:40 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2005-03-17 01:54:40 +00:00
|
|
|
}
|
2002-02-20 22:09:25 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
default:
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
2010-08-02 14:15:06 +00:00
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
else if (shadow_type == GTK_SHADOW_ETCHED_IN)
|
|
|
|
flags |= GTK_STATE_FLAG_INCONSISTENT;
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_check (context,
|
|
|
|
cr, x, y,
|
|
|
|
width, height);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-01-15 18:41:43 +00:00
|
|
|
gtk_default_draw_option (GtkStyle *style,
|
2010-08-16 19:58:15 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
adapt to handle PangoColor
2001-01-26 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (convert_color): adapt to handle PangoColor
* gtk/gtktreeview.c (gtk_tree_view_widget_to_tree_coords): fix to
not offset by TREE_VIEW_HEADER_HEIGHT
(gtk_tree_view_tree_to_widget_coords): fix to not offset by
TREE_VIEW_HEADER_HEIGHT
* configure.in (included_loaders): for me, --with-included-loaders
generates the error "the specified loader yes does not exist",
i.e. the arg defaults to "yes", so change test for value ""
to test for value "yes", and include all loaders in that case.
* gtk/gtkrbtree.c (_gtk_rbtree_get_depth): new function
* gtk/gtktreeview.c (gtk_tree_view_get_cell_rect): fix to properly
handle TREE_VIEW_VERTICAL_SEPARATOR
(gtk_tree_view_bin_expose): fix to consider the row offset as
pointing halfway into vertical separator.
(gtk_tree_view_draw_node_focus_rect): ditto
* gtk/gtkdebug.h, gtk/gtkmain.c (gtk_init_check): Add
--gtk-debug=updates, which causes gdk_window_set_debug_updates
(TRUE) to be called.
* gdk/gdkwindow.c (gdk_window_set_debug_updates): Allow enabling a
debug mode where the invalid region is colored in on invalidate,
so you can see the flicker and know whether your redraw code is
doing a good job.
* gtk/gtktreeview.c (gtk_tree_view_queue_draw_node): Work in
tree window coordinates (clip rect is in tree window coords)
* gtk/Makefile.am: add gtktreednd.[hc]
* gtk/gtkliststore.c: implement gtktreednd interfaces.
* gtk/gtktreednd.c, gtk/gtktreednd.h: New interface to support
drag-and-drop data operations on a model (so we can set up tree
drag-and-drop automatically)
* gtk/testgtk.c: Add a window to change sensitivity in the
GtkLabel test; add a way to change the entry frame in GtkEntry
test
* gtk/gtkentry.c (gtk_entry_set_has_frame):
(gtk_entry_get_has_frame): new functions to remove the frame
around an entry
(gtk_entry_size_request): shrink requisition if no frame
(gtk_entry_draw_focus): don't draw frame if no frame
* gtk/gtkstyle.c (gtk_default_draw_check): draw custom look for
checks inside a cell renderer
(gtk_default_draw_option): ditto for options
* gtk/gtktreeviewcolumn.c (update_button_contents): add/remove
children from the alignment, not the button
(gtk_tree_view_column_init): ref/sink the column, to emulate
GObject refcounting.
* gtk/gtkcellrenderer.c (gtk_cell_renderer_init): ref/sink
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
Use theme functions to draw the toggles
* gdk/gdkpango.c (gdk_pango_get_gc): use GdkRGB to alloc colors
* gdk/gdkpango.h, gdk/gdkpango.c: Add GdkPangoAttrStipple and
GdkPangoAttrEmbossed to use in rendering insensitive text
* gdk/gdkpango.c (gdk_draw_layout_line): render new properties
* gtk/gtkstyle.c (gtk_default_draw_layout): handle sensitivity
using new GDK features
2001-01-26 21:12:05 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
switch (state_type)
|
2005-03-17 01:54:40 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
default:
|
2005-03-17 01:54:40 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
2010-08-02 14:15:06 +00:00
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
|
|
|
else if (shadow_type == GTK_SHADOW_ETCHED_IN)
|
|
|
|
flags |= GTK_STATE_FLAG_INCONSISTENT;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
gtk_render_option (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
1999-01-15 18:41:43 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_tab (GtkStyle *style,
|
2010-08-16 20:10:00 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2002-02-26 23:50:14 +00:00
|
|
|
#define ARROW_SPACE 4
|
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
GtkRequisition indicator_size;
|
|
|
|
GtkBorder indicator_spacing;
|
2002-02-26 23:50:14 +00:00
|
|
|
gint arrow_height;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
option_menu_get_props (widget, &indicator_size, &indicator_spacing);
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
indicator_size.width += (indicator_size.width % 2) - 1;
|
|
|
|
arrow_height = indicator_size.width / 2 + 1;
|
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
x += (width - indicator_size.width) / 2;
|
2002-02-26 23:50:14 +00:00
|
|
|
y += (height - (2 * arrow_height + ARROW_SPACE)) / 2;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
if (state_type == GTK_STATE_INSENSITIVE)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->white,
|
2002-02-26 23:50:14 +00:00
|
|
|
GTK_ARROW_UP, x + 1, y + 1,
|
|
|
|
indicator_size.width, arrow_height);
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->white,
|
2002-02-26 23:50:14 +00:00
|
|
|
GTK_ARROW_DOWN, x + 1, y + arrow_height + ARROW_SPACE + 1,
|
|
|
|
indicator_size.width, arrow_height);
|
|
|
|
}
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->fg[state_type],
|
2002-02-26 23:50:14 +00:00
|
|
|
GTK_ARROW_UP, x, y,
|
|
|
|
indicator_size.width, arrow_height);
|
|
|
|
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->fg[state_type],
|
2002-02-26 23:50:14 +00:00
|
|
|
GTK_ARROW_DOWN, x, y + arrow_height + ARROW_SPACE,
|
|
|
|
indicator_size.width, arrow_height);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_shadow_gap (GtkStyle *style,
|
2010-08-16 14:09:11 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
|
|
|
|
2010-12-28 14:15:39 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_NONE)
|
|
|
|
return;
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_ACTIVE:
|
2010-11-26 00:27:19 +00:00
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-07-14 22:55:26 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
gtk_render_frame_gap (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height,
|
|
|
|
gap_side,
|
|
|
|
(gdouble) gap_x,
|
|
|
|
(gdouble) gap_x + gap_width);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_box_gap (GtkStyle *style,
|
2010-08-16 20:15:43 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2010-08-16 19:36:49 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_ACTIVE:
|
2010-11-26 00:27:19 +00:00
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
gtk_render_background (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
|
|
|
|
|
|
|
|
2010-12-28 14:15:39 +00:00
|
|
|
if (shadow_type != GTK_SHADOW_NONE)
|
|
|
|
gtk_render_frame_gap (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height,
|
|
|
|
gap_side,
|
|
|
|
(gdouble) gap_x,
|
|
|
|
(gdouble) gap_x + gap_width);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_extension (GtkStyle *style,
|
2010-08-16 20:19:56 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2010-07-14 15:45:26 +00:00
|
|
|
}
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_ACTIVE:
|
2010-11-26 00:27:19 +00:00
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_extension (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height,
|
|
|
|
gap_side);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_focus (GtkStyle *style,
|
2010-08-16 20:24:46 +00:00
|
|
|
cairo_t *cr,
|
2001-12-04 03:27:30 +00:00
|
|
|
GtkStateType state_type,
|
2001-05-01 01:36:33 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
2001-12-04 03:27:30 +00:00
|
|
|
|
|
|
|
if (widget)
|
2010-08-02 14:15:06 +00:00
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
2002-01-03 00:30:39 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2002-01-03 00:30:39 +00:00
|
|
|
}
|
2001-12-04 03:27:30 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
2001-12-04 03:27:30 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_render_focus (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
2002-01-03 00:30:39 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_slider (GtkStyle *style,
|
2010-08-17 00:46:46 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
make this special-case hscale/vscale details, so we can use it for
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
hscale/vscale details, so we can use it for scrollbar as well.
* tests/testgtk.c (reformat_value): honor digits from GtkScale
* gtk/gtkenums.h (GtkTroughType): Remove this enum
(GtkScrollType): add START and END from GtkTroughType
* gtk/gtkstyle.c (gtk_default_draw_slider): was not properly using
its x/y arguments
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkscrollbar.h,
gtk/gtkscrollbar.c, gtk/gtkscale.h, gtk/gtkscale.c,
gtk/gtkhscrollbar.h, gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.h,
gtk/gtkvscrollbar.c, gtk/gtkhscale.h, gtk/gtkhscale.c,
gtk/gtkvscale.h, gtk/gtkvscale.c: Rewrite GtkRange and subclasses.
Notable changes in the process:
- stepper_size style property is the height for vertical
ranges, width for horizontal; the other dimension matches
the trough size
- add ability to do NeXT-style steppers (and several other styles
that don't make any sense)
- added min_slider_length, fixed_slider_length properties to
GtkScrollbar
- cleaned some private (or at least useless) functions out of
gtkscale.h
- moved bindings to GtkScale from subclasses, even arrow keys,
since blind users don't know scale orientation.
- change move_slider action signal to use new GtkScrollType,
remove GtkTroughType argument
- digits rounds the values a range will input to the given
number of decimals, but will not try to force adjustment
values set by other controllers. That is, we no longer
modify adjustment->value inside a value_changed handler.
- added getters for GtkScale setters
- middle-click begins a slider drag
2001-06-04 02:31:12 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_slider (context, cr, x, y, width, height, orientation);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
1999-01-15 18:41:43 +00:00
|
|
|
gtk_default_draw_handle (GtkStyle *style,
|
2010-08-17 01:26:20 +00:00
|
|
|
cairo_t *cr,
|
1999-01-15 18:41:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
2000-01-21 21:53:36 +00:00
|
|
|
const gchar *detail,
|
1999-01-15 18:41:43 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2004-02-19 23:20:07 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2000-02-23 22:55:27 +00:00
|
|
|
else
|
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
2000-02-23 22:55:27 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gtk_render_handle (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
2010-10-12 22:52:50 +00:00
|
|
|
(gdouble) height);
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_expander (GtkStyle *style,
|
2010-08-16 13:26:19 +00:00
|
|
|
cairo_t *cr,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2001-07-22 20:09:00 +00:00
|
|
|
GtkExpanderStyle expander_style)
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
|
|
|
gint size;
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
2005-04-04 20:51:24 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2005-04-04 20:51:24 +00:00
|
|
|
}
|
2001-07-22 20:09:00 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
2010-11-22 23:56:10 +00:00
|
|
|
gtk_style_context_add_class (context, "expander");
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
switch (state_type)
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2010-08-02 14:15:06 +00:00
|
|
|
break;
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
2002-02-03 21:18:44 +00:00
|
|
|
|
2010-11-16 12:52:27 +00:00
|
|
|
if (widget &&
|
|
|
|
gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
|
|
|
|
"expander-size"))
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_widget_style_get (widget, "expander-size", &size, NULL);
|
2005-04-04 20:51:24 +00:00
|
|
|
else
|
2010-08-02 14:15:06 +00:00
|
|
|
size = 12;
|
2005-04-04 20:51:24 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (expander_style == GTK_EXPANDER_EXPANDED)
|
|
|
|
flags |= GTK_STATE_FLAG_ACTIVE;
|
2005-04-04 20:51:24 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
2005-07-20 20:30:37 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
2005-07-20 20:30:37 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_render_expander (context, cr,
|
|
|
|
(gdouble) x - (size / 2),
|
|
|
|
(gdouble) y - (size / 2),
|
|
|
|
(gdouble) size,
|
|
|
|
(gdouble) size);
|
2005-04-04 20:51:24 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_default_draw_layout (GtkStyle *style,
|
2010-08-16 13:21:01 +00:00
|
|
|
cairo_t *cr,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkStateType state_type,
|
2001-04-30 23:23:54 +00:00
|
|
|
gboolean use_text,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoLayout *layout)
|
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
2010-08-07 00:14:10 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
2010-08-07 00:14:10 +00:00
|
|
|
}
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_save (context);
|
2010-09-12 13:55:57 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
|
|
|
|
|
|
|
switch (state_type)
|
adapt to handle PangoColor
2001-01-26 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (convert_color): adapt to handle PangoColor
* gtk/gtktreeview.c (gtk_tree_view_widget_to_tree_coords): fix to
not offset by TREE_VIEW_HEADER_HEIGHT
(gtk_tree_view_tree_to_widget_coords): fix to not offset by
TREE_VIEW_HEADER_HEIGHT
* configure.in (included_loaders): for me, --with-included-loaders
generates the error "the specified loader yes does not exist",
i.e. the arg defaults to "yes", so change test for value ""
to test for value "yes", and include all loaders in that case.
* gtk/gtkrbtree.c (_gtk_rbtree_get_depth): new function
* gtk/gtktreeview.c (gtk_tree_view_get_cell_rect): fix to properly
handle TREE_VIEW_VERTICAL_SEPARATOR
(gtk_tree_view_bin_expose): fix to consider the row offset as
pointing halfway into vertical separator.
(gtk_tree_view_draw_node_focus_rect): ditto
* gtk/gtkdebug.h, gtk/gtkmain.c (gtk_init_check): Add
--gtk-debug=updates, which causes gdk_window_set_debug_updates
(TRUE) to be called.
* gdk/gdkwindow.c (gdk_window_set_debug_updates): Allow enabling a
debug mode where the invalid region is colored in on invalidate,
so you can see the flicker and know whether your redraw code is
doing a good job.
* gtk/gtktreeview.c (gtk_tree_view_queue_draw_node): Work in
tree window coordinates (clip rect is in tree window coords)
* gtk/Makefile.am: add gtktreednd.[hc]
* gtk/gtkliststore.c: implement gtktreednd interfaces.
* gtk/gtktreednd.c, gtk/gtktreednd.h: New interface to support
drag-and-drop data operations on a model (so we can set up tree
drag-and-drop automatically)
* gtk/testgtk.c: Add a window to change sensitivity in the
GtkLabel test; add a way to change the entry frame in GtkEntry
test
* gtk/gtkentry.c (gtk_entry_set_has_frame):
(gtk_entry_get_has_frame): new functions to remove the frame
around an entry
(gtk_entry_size_request): shrink requisition if no frame
(gtk_entry_draw_focus): don't draw frame if no frame
* gtk/gtkstyle.c (gtk_default_draw_check): draw custom look for
checks inside a cell renderer
(gtk_default_draw_option): ditto for options
* gtk/gtktreeviewcolumn.c (update_button_contents): add/remove
children from the alignment, not the button
(gtk_tree_view_column_init): ref/sink the column, to emulate
GObject refcounting.
* gtk/gtkcellrenderer.c (gtk_cell_renderer_init): ref/sink
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
Use theme functions to draw the toggles
* gdk/gdkpango.c (gdk_pango_get_gc): use GdkRGB to alloc colors
* gdk/gdkpango.h, gdk/gdkpango.c: Add GdkPangoAttrStipple and
GdkPangoAttrEmbossed to use in rendering insensitive text
* gdk/gdkpango.c (gdk_draw_layout_line): render new properties
* gtk/gtkstyle.c (gtk_default_draw_layout): handle sensitivity
using new GDK features
2001-01-26 21:12:05 +00:00
|
|
|
{
|
2010-08-02 14:15:06 +00:00
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2010-07-14 15:45:26 +00:00
|
|
|
}
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_style_context_set_state (context, flags);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
gtk_render_layout (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
layout);
|
adapt to handle PangoColor
2001-01-26 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (convert_color): adapt to handle PangoColor
* gtk/gtktreeview.c (gtk_tree_view_widget_to_tree_coords): fix to
not offset by TREE_VIEW_HEADER_HEIGHT
(gtk_tree_view_tree_to_widget_coords): fix to not offset by
TREE_VIEW_HEADER_HEIGHT
* configure.in (included_loaders): for me, --with-included-loaders
generates the error "the specified loader yes does not exist",
i.e. the arg defaults to "yes", so change test for value ""
to test for value "yes", and include all loaders in that case.
* gtk/gtkrbtree.c (_gtk_rbtree_get_depth): new function
* gtk/gtktreeview.c (gtk_tree_view_get_cell_rect): fix to properly
handle TREE_VIEW_VERTICAL_SEPARATOR
(gtk_tree_view_bin_expose): fix to consider the row offset as
pointing halfway into vertical separator.
(gtk_tree_view_draw_node_focus_rect): ditto
* gtk/gtkdebug.h, gtk/gtkmain.c (gtk_init_check): Add
--gtk-debug=updates, which causes gdk_window_set_debug_updates
(TRUE) to be called.
* gdk/gdkwindow.c (gdk_window_set_debug_updates): Allow enabling a
debug mode where the invalid region is colored in on invalidate,
so you can see the flicker and know whether your redraw code is
doing a good job.
* gtk/gtktreeview.c (gtk_tree_view_queue_draw_node): Work in
tree window coordinates (clip rect is in tree window coords)
* gtk/Makefile.am: add gtktreednd.[hc]
* gtk/gtkliststore.c: implement gtktreednd interfaces.
* gtk/gtktreednd.c, gtk/gtktreednd.h: New interface to support
drag-and-drop data operations on a model (so we can set up tree
drag-and-drop automatically)
* gtk/testgtk.c: Add a window to change sensitivity in the
GtkLabel test; add a way to change the entry frame in GtkEntry
test
* gtk/gtkentry.c (gtk_entry_set_has_frame):
(gtk_entry_get_has_frame): new functions to remove the frame
around an entry
(gtk_entry_size_request): shrink requisition if no frame
(gtk_entry_draw_focus): don't draw frame if no frame
* gtk/gtkstyle.c (gtk_default_draw_check): draw custom look for
checks inside a cell renderer
(gtk_default_draw_option): ditto for options
* gtk/gtktreeviewcolumn.c (update_button_contents): add/remove
children from the alignment, not the button
(gtk_tree_view_column_init): ref/sink the column, to emulate
GObject refcounting.
* gtk/gtkcellrenderer.c (gtk_cell_renderer_init): ref/sink
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
Use theme functions to draw the toggles
* gdk/gdkpango.c (gdk_pango_get_gc): use GdkRGB to alloc colors
* gdk/gdkpango.h, gdk/gdkpango.c: Add GdkPangoAttrStipple and
GdkPangoAttrEmbossed to use in rendering insensitive text
* gdk/gdkpango.c (gdk_draw_layout_line): render new properties
* gtk/gtkstyle.c (gtk_default_draw_layout): handle sensitivity
using new GDK features
2001-01-26 21:12:05 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_resize_grip (GtkStyle *style,
|
2010-08-16 13:13:26 +00:00
|
|
|
cairo_t *cr,
|
2001-03-29 21:17:45 +00:00
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GdkWindowEdge edge,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2010-11-01 01:42:08 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GtkStateFlags flags = 0;
|
|
|
|
GtkJunctionSides sides = 0;
|
2004-11-09 14:49:01 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
if (widget)
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
context = priv->context;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
transform_detail_string (detail, context);
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
gtk_style_context_add_class (context, "grip");
|
|
|
|
|
|
|
|
switch (state_type)
|
|
|
|
{
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags |= GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, flags);
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2002-11-02 00:18:14 +00:00
|
|
|
switch (edge)
|
2001-06-04 23:15:51 +00:00
|
|
|
{
|
2002-11-02 00:18:14 +00:00
|
|
|
case GDK_WINDOW_EDGE_NORTH_WEST:
|
2010-11-23 03:37:19 +00:00
|
|
|
sides = GTK_JUNCTION_CORNER_TOPLEFT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH:
|
2010-11-01 01:42:08 +00:00
|
|
|
sides = GTK_JUNCTION_TOP;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_EAST:
|
2010-11-23 03:37:19 +00:00
|
|
|
sides = GTK_JUNCTION_CORNER_TOPRIGHT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_WEST:
|
2010-11-01 01:42:08 +00:00
|
|
|
sides = GTK_JUNCTION_LEFT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_EAST:
|
2010-11-01 01:42:08 +00:00
|
|
|
sides = GTK_JUNCTION_RIGHT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_WEST:
|
2010-11-23 03:37:19 +00:00
|
|
|
sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH:
|
2010-11-01 01:42:08 +00:00
|
|
|
sides = GTK_JUNCTION_BOTTOM;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
2010-11-23 03:37:19 +00:00
|
|
|
sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
2002-11-02 00:18:14 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
gtk_style_context_set_junction_sides (context, sides);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
cairo_save (cr);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
gtk_render_handle (context, cr,
|
|
|
|
(gdouble) x,
|
|
|
|
(gdouble) y,
|
|
|
|
(gdouble) width,
|
|
|
|
(gdouble) height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
2010-11-01 01:42:08 +00:00
|
|
|
cairo_restore (cr);
|
|
|
|
gtk_style_context_restore (context);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
|
|
|
|
2009-07-21 01:16:56 +00:00
|
|
|
static void
|
|
|
|
gtk_default_draw_spinner (GtkStyle *style,
|
2010-08-16 13:09:50 +00:00
|
|
|
cairo_t *cr,
|
2009-07-21 01:16:56 +00:00
|
|
|
GtkStateType state_type,
|
2009-11-27 06:23:55 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
2009-07-21 01:16:56 +00:00
|
|
|
guint step,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GdkColor *color;
|
|
|
|
guint num_steps;
|
|
|
|
gdouble dx, dy;
|
|
|
|
gdouble radius;
|
|
|
|
gdouble half;
|
|
|
|
gint i;
|
|
|
|
guint real_step;
|
|
|
|
|
2011-01-06 04:21:52 +00:00
|
|
|
num_steps = 12;
|
2009-07-21 01:16:56 +00:00
|
|
|
real_step = step % num_steps;
|
|
|
|
|
|
|
|
/* set a clip region for the expose event */
|
|
|
|
cairo_rectangle (cr, x, y, width, height);
|
|
|
|
cairo_clip (cr);
|
|
|
|
|
|
|
|
cairo_translate (cr, x, y);
|
|
|
|
|
|
|
|
/* draw clip region */
|
|
|
|
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
|
|
|
|
|
|
|
color = &style->fg[state_type];
|
|
|
|
dx = width / 2;
|
|
|
|
dy = height / 2;
|
|
|
|
radius = MIN (width / 2, height / 2);
|
|
|
|
half = num_steps / 2;
|
|
|
|
|
|
|
|
for (i = 0; i < num_steps; i++)
|
|
|
|
{
|
|
|
|
gint inset = 0.7 * radius;
|
|
|
|
|
|
|
|
/* transparency is a function of time and intial value */
|
|
|
|
gdouble t = (gdouble) ((i + num_steps - real_step)
|
|
|
|
% num_steps) / num_steps;
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
cairo_set_source_rgba (cr,
|
|
|
|
color->red / 65535.,
|
|
|
|
color->green / 65535.,
|
|
|
|
color->blue / 65535.,
|
|
|
|
t);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, 2.0);
|
|
|
|
cairo_move_to (cr,
|
|
|
|
dx + (radius - inset) * cos (i * G_PI / half),
|
|
|
|
dy + (radius - inset) * sin (i * G_PI / half));
|
|
|
|
cairo_line_to (cr,
|
|
|
|
dx + radius * cos (i * G_PI / half),
|
|
|
|
dy + radius * sin (i * G_PI / half));
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
_gtk_style_shade (const GdkColor *a,
|
|
|
|
GdkColor *b,
|
|
|
|
gdouble k)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gdouble red;
|
|
|
|
gdouble green;
|
|
|
|
gdouble blue;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
red = (gdouble) a->red / 65535.0;
|
|
|
|
green = (gdouble) a->green / 65535.0;
|
|
|
|
blue = (gdouble) a->blue / 65535.0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
rgb_to_hls (&red, &green, &blue);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
green *= k;
|
|
|
|
if (green > 1.0)
|
|
|
|
green = 1.0;
|
|
|
|
else if (green < 0.0)
|
|
|
|
green = 0.0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
blue *= k;
|
|
|
|
if (blue > 1.0)
|
|
|
|
blue = 1.0;
|
|
|
|
else if (blue < 0.0)
|
|
|
|
blue = 0.0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
hls_to_rgb (&red, &green, &blue);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
b->red = red * 65535.0;
|
|
|
|
b->green = green * 65535.0;
|
|
|
|
b->blue = blue * 65535.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
rgb_to_hls (gdouble *r,
|
1999-01-15 18:41:43 +00:00
|
|
|
gdouble *g,
|
|
|
|
gdouble *b)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gdouble min;
|
|
|
|
gdouble max;
|
|
|
|
gdouble red;
|
|
|
|
gdouble green;
|
|
|
|
gdouble blue;
|
|
|
|
gdouble h, l, s;
|
|
|
|
gdouble delta;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
red = *r;
|
|
|
|
green = *g;
|
|
|
|
blue = *b;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (red > green)
|
|
|
|
{
|
|
|
|
if (red > blue)
|
1999-01-15 18:41:43 +00:00
|
|
|
max = red;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
max = blue;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (green < blue)
|
1999-01-15 18:41:43 +00:00
|
|
|
min = green;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
min = blue;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (green > blue)
|
1999-01-15 18:41:43 +00:00
|
|
|
max = green;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
max = blue;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (red < blue)
|
1999-01-15 18:41:43 +00:00
|
|
|
min = red;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
min = blue;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
l = (max + min) / 2;
|
|
|
|
s = 0;
|
|
|
|
h = 0;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (max != min)
|
|
|
|
{
|
|
|
|
if (l <= 0.5)
|
1999-01-15 18:41:43 +00:00
|
|
|
s = (max - min) / (max + min);
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
s = (max - min) / (2 - max - min);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
delta = max -min;
|
|
|
|
if (red == max)
|
1999-01-15 18:41:43 +00:00
|
|
|
h = (green - blue) / delta;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (green == max)
|
1999-01-15 18:41:43 +00:00
|
|
|
h = 2 + (blue - red) / delta;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (blue == max)
|
1999-01-15 18:41:43 +00:00
|
|
|
h = 4 + (red - green) / delta;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
h *= 60;
|
|
|
|
if (h < 0.0)
|
1999-01-15 18:41:43 +00:00
|
|
|
h += 360;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
*r = h;
|
|
|
|
*g = l;
|
|
|
|
*b = s;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
hls_to_rgb (gdouble *h,
|
1999-01-15 18:41:43 +00:00
|
|
|
gdouble *l,
|
|
|
|
gdouble *s)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gdouble hue;
|
|
|
|
gdouble lightness;
|
|
|
|
gdouble saturation;
|
|
|
|
gdouble m1, m2;
|
|
|
|
gdouble r, g, b;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
lightness = *l;
|
|
|
|
saturation = *s;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (lightness <= 0.5)
|
|
|
|
m2 = lightness * (1 + saturation);
|
|
|
|
else
|
|
|
|
m2 = lightness + saturation - lightness * saturation;
|
|
|
|
m1 = 2 * lightness - m2;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (saturation == 0)
|
|
|
|
{
|
|
|
|
*h = lightness;
|
|
|
|
*l = lightness;
|
|
|
|
*s = lightness;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hue = *h + 120;
|
|
|
|
while (hue > 360)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue -= 360;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (hue < 0)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue += 360;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (hue < 60)
|
1999-01-15 18:41:43 +00:00
|
|
|
r = m1 + (m2 - m1) * hue / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 180)
|
1999-01-15 18:41:43 +00:00
|
|
|
r = m2;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 240)
|
1999-01-15 18:41:43 +00:00
|
|
|
r = m1 + (m2 - m1) * (240 - hue) / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
r = m1;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
hue = *h;
|
|
|
|
while (hue > 360)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue -= 360;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (hue < 0)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue += 360;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (hue < 60)
|
1999-01-15 18:41:43 +00:00
|
|
|
g = m1 + (m2 - m1) * hue / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 180)
|
1999-01-15 18:41:43 +00:00
|
|
|
g = m2;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 240)
|
1999-01-15 18:41:43 +00:00
|
|
|
g = m1 + (m2 - m1) * (240 - hue) / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
g = m1;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
hue = *h - 120;
|
|
|
|
while (hue > 360)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue -= 360;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (hue < 0)
|
1999-01-15 18:41:43 +00:00
|
|
|
hue += 360;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (hue < 60)
|
1999-01-15 18:41:43 +00:00
|
|
|
b = m1 + (m2 - m1) * hue / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 180)
|
1999-01-15 18:41:43 +00:00
|
|
|
b = m2;
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (hue < 240)
|
1999-01-15 18:41:43 +00:00
|
|
|
b = m1 + (m2 - m1) * (240 - hue) / 60;
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1999-01-15 18:41:43 +00:00
|
|
|
b = m1;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
*h = r;
|
|
|
|
*l = g;
|
|
|
|
*s = b;
|
|
|
|
}
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
Doc typo fix. (#68172)
* gtk/gtksocket.c (gtk_socket_get_id): Doc typo fix. (#68172)
* gtk/gtktreemodel.c (gtk_tree_path_is_descendant): Fix docs.
* gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Document.
* gtk/gtkwindow.c (gtk_window_remove_accel_group): Fix docs.
* gtk/gtkrc.c (gtk_rc_get_style_by_paths),
gtk/gtkwidget.c (gtk_widget_get_toplevel,
gtk_widget_push_composite_child), gtk/gtkdialog.c
(gtk_dialog_new_with_buttons, gtk_dialog_run): Keep gtk-doc
from messing up the indentation of inline examples.
* gtk/gtkmain.c, gtk/gtkrc.c: Consistently call g_getenv()
instead of getenv().
* gtk/gtktreemodel.c, gtk/gtkaccelgroup.c, gtk/gtkclipboard.c,
gtk/gtkdnd.c, gtk/gtkiconfactory.c, gtk/gtkrc.c,
gtk/gtkstyle.c, gtk/gtkselection.c: Doc fixes.
* gtk/gtkaccelmap.c (gtk_accel_map_add_filter,
gtk_accel_map_foreach_unfiltered, gtk_accel_map_load_scanner):
Document.
* gtk/tmpl/gtksocket.sgml: Mention gtk_socket_get_id()
instead of GTK_WINDOW_XWINDOW(). (#68172)
* gtk/gtk-sections.txt: Move functions which are documented
as "private" or "internal" into Private subsections.
* gtk/tmpl/gtkdnd.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtktooltips.sgml,
gtk/tmpl/gtkwidget.sgml, gtk/tmpl/gtkclipboard.sgml,
gtk/tmpl/gtkstyle.sgml, gtk/tmpl/gtkselection.sgml,
gtk/tmpl/gtkfeatures.sgml: Minor markup fixes.
* gtk/tmpl/gtksignal.sgml: Add link to GLib signal docs.
* gtk/tmpl/gtkpreview.sgml, gtk/tmpl/gtktext.sgml,
gtk/tmpl/gtktree.sgml: Remove "deprecated" from short desc.
* gtk/tmpl/gtkrc.sgml: Correct names of default RC files.
2002-01-08 00:04:57 +00:00
|
|
|
|
2010-08-16 13:35:58 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_hline:
|
2010-08-16 13:35:58 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #caio_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x1: the starting x coordinate
|
|
|
|
* @x2: the ending x coordinate
|
|
|
|
* @y: the y coordinate
|
|
|
|
*
|
|
|
|
* Draws a horizontal line from (@x1, @y) to (@x2, @y) in @cr
|
|
|
|
* using the given style and state.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_line() instead
|
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_hline (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x1,
|
|
|
|
gint x2,
|
|
|
|
gint y)
|
2010-08-16 13:35:58 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (cr != NULL);
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
|
2010-08-16 13:35:58 +00:00
|
|
|
|
2010-05-04 17:38:39 +00:00
|
|
|
cairo_save (cr);
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_hline (style, cr, state_type,
|
|
|
|
widget, detail,
|
|
|
|
x1, x2, y);
|
|
|
|
|
2010-08-16 13:35:58 +00:00
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:40:03 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_vline:
|
2010-08-16 13:40:03 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @y1_: the starting y coordinate
|
|
|
|
* @y2_: the ending y coordinate
|
|
|
|
* @x: the x coordinate
|
|
|
|
*
|
|
|
|
* Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @cr
|
|
|
|
* using the given style and state.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_line() instead
|
2010-08-16 13:40:03 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_vline (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint y1_,
|
|
|
|
gint y2_,
|
|
|
|
gint x)
|
2010-08-16 13:40:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (cr != NULL);
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
|
2010-08-16 13:40:03 +00:00
|
|
|
|
2010-05-04 17:38:39 +00:00
|
|
|
cairo_save (cr);
|
2010-08-02 14:15:06 +00:00
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_vline (style, cr, state_type,
|
|
|
|
widget, detail,
|
|
|
|
y1_, y2_, x);
|
|
|
|
|
2010-08-16 13:40:03 +00:00
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:48:06 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_shadow:
|
2010-08-16 13:48:06 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle
|
|
|
|
* @y: y origin of the rectangle
|
|
|
|
* @width: width of the rectangle
|
|
|
|
* @height: width of the rectangle
|
|
|
|
*
|
2010-11-25 19:26:39 +00:00
|
|
|
* Draws a shadow around the given rectangle in @cr
|
2010-08-16 13:48:06 +00:00
|
|
|
* using the given style and state and shadow type.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_frame() instead
|
2010-08-16 13:48:06 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_shadow (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:48:06 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
|
2010-08-16 13:48:06 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
2010-05-04 17:38:39 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_shadow (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 13:48:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:48:06 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_arrow:
|
2010-08-16 13:48:06 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @arrow_type: the type of arrow to draw
|
|
|
|
* @fill: %TRUE if the arrow tip should be filled
|
|
|
|
* @x: x origin of the rectangle to draw the arrow in
|
|
|
|
* @y: y origin of the rectangle to draw the arrow in
|
|
|
|
* @width: width of the rectangle to draw the arrow in
|
|
|
|
* @height: height of the rectangle to draw the arrow in
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Draws an arrow in the given rectangle on @cr using the given
|
2010-08-16 13:48:06 +00:00
|
|
|
* parameters. @arrow_type determines the direction of the arrow.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_arrow() instead
|
2010-08-16 13:48:06 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_arrow (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GtkArrowType arrow_type,
|
|
|
|
gboolean fill,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:48:06 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
|
2010-08-16 13:48:06 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_arrow (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
arrow_type, fill, x, y, width, height);
|
2010-08-16 13:48:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:48:06 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_diamond:
|
2010-08-16 13:48:06 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle to draw the diamond in
|
|
|
|
* @y: y origin of the rectangle to draw the diamond in
|
|
|
|
* @width: width of the rectangle to draw the diamond in
|
|
|
|
* @height: height of the rectangle to draw the diamond in
|
|
|
|
*
|
|
|
|
* Draws a diamond in the given rectangle on @window using the given
|
|
|
|
* parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use cairo instead
|
2010-08-16 13:48:06 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_diamond (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:48:06 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_diamond (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
x, y, width, height);
|
2010-08-16 13:48:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:48:06 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_box:
|
2010-08-16 13:48:06 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the box
|
|
|
|
* @y: y origin of the box
|
|
|
|
* @width: the width of the box
|
|
|
|
* @height: the height of the box
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2010-08-16 13:48:06 +00:00
|
|
|
* Draws a box on @cr with the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_frame() and gtk_render_background() instead
|
2010-08-16 13:48:06 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_box (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:48:06 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
|
2010-08-16 13:48:06 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
cairo_save (cr);
|
2010-05-04 17:38:39 +00:00
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_box (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 13:48:06 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 19:50:08 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_flat_box:
|
2010-08-16 19:50:08 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the box
|
|
|
|
* @y: y origin of the box
|
|
|
|
* @width: the width of the box
|
|
|
|
* @height: the height of the box
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2010-08-16 19:50:08 +00:00
|
|
|
* Draws a flat box on @cr with the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_frame() and gtk_render_background() instead
|
2010-08-16 19:50:08 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_flat_box (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 19:50:08 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
|
2010-08-16 19:50:08 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 19:50:08 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 19:55:02 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_check:
|
2010-08-16 19:55:02 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle to draw the check in
|
|
|
|
* @y: y origin of the rectangle to draw the check in
|
|
|
|
* @width: the width of the rectangle to draw the check in
|
|
|
|
* @height: the height of the rectangle to draw the check in
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Draws a check button indicator in the given rectangle on @cr with
|
2010-08-16 19:55:02 +00:00
|
|
|
* the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_check() instead
|
2010-08-16 19:55:02 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_check (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
2010-08-02 14:15:06 +00:00
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
2010-05-04 17:38:39 +00:00
|
|
|
|
2010-08-16 19:55:02 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_check (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 19:55:02 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 19:58:15 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_option:
|
2010-08-16 19:58:15 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle to draw the option in
|
|
|
|
* @y: y origin of the rectangle to draw the option in
|
|
|
|
* @width: the width of the rectangle to draw the option in
|
|
|
|
* @height: the height of the rectangle to draw the option in
|
|
|
|
*
|
2010-11-25 19:26:39 +00:00
|
|
|
* Draws a radio button indicator in the given rectangle on @cr with
|
2010-08-16 19:58:15 +00:00
|
|
|
* the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_option() instead
|
2010-08-16 19:58:15 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_option (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 19:58:15 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
|
2010-08-16 19:58:15 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_option (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 19:58:15 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2003-04-15 22:51:04 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_tab:
|
2003-04-15 22:51:04 +00:00
|
|
|
* @style: a #GtkStyle
|
2010-09-10 23:10:43 +00:00
|
|
|
* @cr: a #cairo_t
|
2010-08-16 20:10:00 +00:00
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: the type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle to draw the tab in
|
|
|
|
* @y: y origin of the rectangle to draw the tab in
|
|
|
|
* @width: the width of the rectangle to draw the tab in
|
|
|
|
* @height: the height of the rectangle to draw the tab in
|
|
|
|
*
|
|
|
|
* Draws an option menu tab (i.e. the up and down pointing arrows)
|
|
|
|
* in the given rectangle on @cr using the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use cairo instead
|
|
|
|
*/
|
2010-08-16 20:10:00 +00:00
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_tab (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 20:10:00 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_tab (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
x, y, width, height);
|
2010-08-16 20:10:00 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 14:09:11 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_shadow_gap:
|
2010-08-16 14:09:11 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle
|
|
|
|
* @y: y origin of the rectangle
|
|
|
|
* @width: width of the rectangle
|
|
|
|
* @height: width of the rectangle
|
|
|
|
* @gap_side: side in which to leave the gap
|
|
|
|
* @gap_x: starting position of the gap
|
|
|
|
* @gap_width: width of the gap
|
|
|
|
*
|
|
|
|
* Draws a shadow around the given rectangle in @cr
|
2010-11-25 19:26:39 +00:00
|
|
|
* using the given style and state and shadow type, leaving a
|
2010-08-16 14:09:11 +00:00
|
|
|
* gap in one side.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_frame_gap() instead
|
|
|
|
*/
|
2010-08-16 14:09:11 +00:00
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_shadow_gap (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width)
|
2010-08-16 14:09:11 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL);
|
2010-08-16 14:09:11 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, gap_side, gap_x, gap_width);
|
2010-08-16 14:09:11 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 20:15:43 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_box_gap:
|
2010-08-16 20:15:43 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the rectangle
|
|
|
|
* @y: y origin of the rectangle
|
|
|
|
* @width: width of the rectangle
|
|
|
|
* @height: width of the rectangle
|
|
|
|
* @gap_side: side in which to leave the gap
|
|
|
|
* @gap_x: starting position of the gap
|
|
|
|
* @gap_width: width of the gap
|
|
|
|
*
|
2010-11-25 19:26:39 +00:00
|
|
|
* Draws a box in @cr using the given style and state and shadow type,
|
2010-08-16 20:15:43 +00:00
|
|
|
* leaving a gap in one side.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_frame_gap() instead
|
2010-08-16 20:15:43 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_box_gap (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side,
|
|
|
|
gint gap_x,
|
|
|
|
gint gap_width)
|
2010-08-16 20:15:43 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL);
|
2010-08-16 20:15:43 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, gap_side, gap_x, gap_width);
|
2010-08-16 20:15:43 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 20:19:56 +00:00
|
|
|
/**
|
2010-11-25 19:26:39 +00:00
|
|
|
* gtk_paint_extension:
|
2010-08-16 20:19:56 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the extension
|
|
|
|
* @y: y origin of the extension
|
|
|
|
* @width: width of the extension
|
|
|
|
* @height: width of the extension
|
|
|
|
* @gap_side: the side on to which the extension is attached
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2010-08-16 20:19:56 +00:00
|
|
|
* Draws an extension, i.e. a notebook tab.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_extension() instead
|
2010-08-16 20:19:56 +00:00
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_extension (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkPositionType gap_side)
|
2010-08-16 20:19:56 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL);
|
2010-08-16 20:19:56 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_extension (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, gap_side);
|
2010-08-16 20:19:56 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 20:24:46 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_focus:
|
2010-08-16 20:24:46 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: the x origin of the rectangle around which to draw a focus indicator
|
|
|
|
* @y: the y origin of the rectangle around which to draw a focus indicator
|
|
|
|
* @width: the width of the rectangle around which to draw a focus indicator
|
|
|
|
* @height: the height of the rectangle around which to draw a focus indicator
|
|
|
|
*
|
|
|
|
* Draws a focus indicator around the given rectangle on @cr using the
|
|
|
|
* given style.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_focus() instead
|
2010-08-16 20:24:46 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_focus (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 20:24:46 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL);
|
2010-08-16 20:24:46 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_focus (style, cr, state_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height);
|
2010-08-16 20:24:46 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-17 00:46:46 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_slider:
|
2010-08-17 00:46:46 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: a shadow
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: the x origin of the rectangle in which to draw a slider
|
|
|
|
* @y: the y origin of the rectangle in which to draw a slider
|
|
|
|
* @width: the width of the rectangle in which to draw a slider
|
|
|
|
* @height: the height of the rectangle in which to draw a slider
|
|
|
|
* @orientation: the orientation to be used
|
|
|
|
*
|
|
|
|
* Draws a slider in the given rectangle on @cr using the
|
|
|
|
* given style and orientation.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_slider() instead
|
2010-08-17 00:46:46 +00:00
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_slider (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation)
|
2010-08-17 00:46:46 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL);
|
2010-08-17 00:46:46 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_slider (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, orientation);
|
2010-08-17 00:46:46 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-08-17 01:26:20 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_handle:
|
2010-08-17 01:26:20 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @shadow_type: type of shadow to draw
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin of the handle
|
|
|
|
* @y: y origin of the handle
|
|
|
|
* @width: with of the handle
|
|
|
|
* @height: height of the handle
|
|
|
|
* @orientation: the orientation of the handle
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2010-08-17 01:26:20 +00:00
|
|
|
* Draws a handle as used in #GtkHandleBox and #GtkPaned.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_handle() instead
|
2010-08-17 01:26:20 +00:00
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_handle (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkShadowType shadow_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GtkOrientation orientation)
|
2010-08-17 01:26:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL);
|
2010-08-17 01:26:20 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (width >= 0);
|
|
|
|
g_return_if_fail (height >= 0);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_handle (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, orientation);
|
2010-08-17 01:26:20 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
|
2010-08-16 13:26:19 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_expander:
|
2010-08-16 13:26:19 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: the x position to draw the expander at
|
|
|
|
* @y: the y position to draw the expander at
|
|
|
|
* @expander_style: the style to draw the expander in; determines
|
|
|
|
* whether the expander is collapsed, expanded, or in an
|
|
|
|
* intermediate state.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
2010-08-16 13:26:19 +00:00
|
|
|
* Draws an expander as used in #GtkTreeView. @x and @y specify the
|
|
|
|
* center the expander. The size of the expander is determined by the
|
|
|
|
* "expander-size" style property of @widget. (If widget is not
|
|
|
|
* specified or doesn't have an "expander-size" property, an
|
|
|
|
* unspecified default size will be used, since the caller doesn't
|
|
|
|
* have sufficient information to position the expander, this is
|
|
|
|
* likely not useful.) The expander is expander_size pixels tall
|
|
|
|
* in the collapsed position and expander_size pixels wide in the
|
|
|
|
* expanded position.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_expander() instead
|
2010-08-16 13:26:19 +00:00
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_expander (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkExpanderStyle expander_style)
|
2010-08-16 13:26:19 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL);
|
2010-08-16 13:26:19 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_expander (style, cr, state_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, expander_style);
|
2010-08-16 13:26:19 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:21:01 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_layout:
|
2010-08-16 13:21:01 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @use_text: whether to use the text or foreground
|
|
|
|
* graphics context of @style
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @x: x origin
|
|
|
|
* @y: y origin
|
|
|
|
* @layout: the layout to draw
|
|
|
|
*
|
|
|
|
* Draws a layout on @cr using the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_layout() instead
|
2010-08-16 13:21:01 +00:00
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_layout (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
gboolean use_text,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoLayout *layout)
|
2010-08-16 13:21:01 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
2010-08-02 14:15:06 +00:00
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
|
2010-08-16 13:21:01 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-08-02 14:15:06 +00:00
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_layout (style, cr, state_type, use_text,
|
|
|
|
widget, detail,
|
|
|
|
x, y, layout);
|
2010-08-16 13:21:01 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
|
|
|
|
2010-08-16 13:13:26 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_resize_grip:
|
2010-08-16 13:13:26 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget
|
|
|
|
* @detail: (allow-none): a style detail
|
|
|
|
* @edge: the edge in which to draw the resize grip
|
|
|
|
* @x: the x origin of the rectangle in which to draw the resize grip
|
|
|
|
* @y: the y origin of the rectangle in which to draw the resize grip
|
|
|
|
* @width: the width of the rectangle in which to draw the resize grip
|
|
|
|
* @height: the height of the rectangle in which to draw the resize grip
|
|
|
|
*
|
|
|
|
* Draws a resize grip in the given rectangle on @cr using the given
|
2010-11-25 19:26:39 +00:00
|
|
|
* parameters.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_handle() instead
|
2010-08-16 13:13:26 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_resize_grip (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
GdkWindowEdge edge,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:13:26 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_resize_grip != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_resize_grip (style, cr, state_type,
|
|
|
|
widget, detail,
|
|
|
|
edge, x, y, width, height);
|
|
|
|
cairo_restore (cr);
|
2001-03-29 21:17:45 +00:00
|
|
|
}
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
|
2010-08-16 13:09:50 +00:00
|
|
|
/**
|
2010-09-10 23:30:27 +00:00
|
|
|
* gtk_paint_spinner:
|
2010-08-16 13:09:50 +00:00
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @cr: a #cairo_t
|
|
|
|
* @state_type: a state
|
|
|
|
* @widget: (allow-none): the widget (may be %NULL)
|
|
|
|
* @detail: (allow-none): a style detail (may be %NULL)
|
|
|
|
* @step: the nth step, a value between 0 and #GtkSpinner:num-steps
|
|
|
|
* @x: the x origin of the rectangle in which to draw the spinner
|
|
|
|
* @y: the y origin of the rectangle in which to draw the spinner
|
|
|
|
* @width: the width of the rectangle in which to draw the spinner
|
|
|
|
* @height: the height of the rectangle in which to draw the spinner
|
|
|
|
*
|
|
|
|
* Draws a spinner on @window using the given parameters.
|
2010-11-25 19:26:39 +00:00
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_render_activity() instead
|
2010-08-16 13:09:50 +00:00
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_spinner (GtkStyle *style,
|
|
|
|
cairo_t *cr,
|
|
|
|
GtkStateType state_type,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *detail,
|
|
|
|
guint step,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2010-08-16 13:09:50 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_spinner != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_spinner (style, cr, state_type,
|
|
|
|
widget, detail,
|
2009-07-21 01:16:56 +00:00
|
|
|
step, x, y, width, height);
|
2010-08-16 13:09:50 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
2009-07-21 01:16:56 +00:00
|
|
|
}
|
2011-11-02 10:45:10 +00:00
|
|
|
|
|
|
|
static GtkStyle *gtk_default_style = NULL;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_get_default_style:
|
|
|
|
*
|
|
|
|
* Returns the default style used by all widgets initially.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): the default style. This #GtkStyle
|
|
|
|
* object is owned by GTK+ and should not be modified or freed.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead, and
|
|
|
|
* gtk_css_provider_get_default() to obtain a #GtkStyleProvider
|
|
|
|
* with the default widget style information.
|
|
|
|
*/
|
|
|
|
GtkStyle*
|
|
|
|
gtk_widget_get_default_style (void)
|
|
|
|
{
|
|
|
|
if (!gtk_default_style)
|
|
|
|
{
|
|
|
|
gtk_default_style = gtk_style_new ();
|
|
|
|
g_object_ref (gtk_default_style);
|
|
|
|
}
|
|
|
|
|
|
|
|
return gtk_default_style;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_style_attach:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
*
|
|
|
|
* This function attaches the widget's #GtkStyle to the widget's
|
|
|
|
* #GdkWindow. It is a replacement for
|
|
|
|
*
|
|
|
|
* <programlisting>
|
|
|
|
* widget->style = gtk_style_attach (widget->style, widget->window);
|
|
|
|
* </programlisting>
|
|
|
|
*
|
|
|
|
* and should only ever be called in a derived widget's "realize"
|
|
|
|
* implementation which does not chain up to its parent class'
|
|
|
|
* "realize" implementation, because one of the parent classes
|
|
|
|
* (finally #GtkWidget) would attach the style itself.
|
|
|
|
*
|
|
|
|
* Since: 2.20
|
|
|
|
*
|
|
|
|
* Deprecated: 3.0. This step is unnecessary with #GtkStyleContext.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_widget_style_attach (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (gtk_widget_get_realized (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_has_rc_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
*
|
|
|
|
* Determines if the widget style has been looked up through the rc mechanism.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the widget has been looked up through the rc
|
|
|
|
* mechanism, %FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Since: 2.20
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_widget_has_rc_style (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_set_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @style: (allow-none): a #GtkStyle, or %NULL to remove the effect
|
|
|
|
* of a previous call to gtk_widget_set_style() and go back to
|
|
|
|
* the default style
|
|
|
|
*
|
|
|
|
* Used to set the #GtkStyle for a widget (@widget->style). Since
|
|
|
|
* GTK 3, this function does nothing, the passed in style is ignored.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_set_style (GtkWidget *widget,
|
|
|
|
GtkStyle *style)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_ensure_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
*
|
|
|
|
* Ensures that @widget has a style (@widget->style).
|
|
|
|
*
|
|
|
|
* Not a very useful function; most of the time, if you
|
|
|
|
* want the style, the widget is realized, and realized
|
|
|
|
* widgets are guaranteed to have a style already.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_ensure_style (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
style = _gtk_widget_get_style (widget);
|
|
|
|
if (style == gtk_widget_get_default_style ())
|
|
|
|
{
|
|
|
|
g_object_unref (style);
|
|
|
|
_gtk_widget_set_style (widget, NULL);
|
|
|
|
|
|
|
|
g_signal_emit_by_name (widget, "style-set", 0, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_get_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
*
|
|
|
|
* Simply an accessor function that returns @widget->style.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): the widget's #GtkStyle
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead
|
|
|
|
*/
|
|
|
|
GtkStyle*
|
|
|
|
gtk_widget_get_style (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
|
|
|
|
|
|
|
style = _gtk_widget_get_style (widget);
|
|
|
|
|
|
|
|
if (style == NULL)
|
|
|
|
{
|
|
|
|
style = g_object_new (GTK_TYPE_STYLE,
|
|
|
|
"context", gtk_widget_get_style_context (widget),
|
|
|
|
NULL);
|
|
|
|
_gtk_widget_set_style (widget, style);
|
|
|
|
}
|
|
|
|
|
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @style: the #GtkRcStyle holding the style modifications
|
|
|
|
*
|
|
|
|
* Modifies style values on the widget.
|
|
|
|
*
|
|
|
|
* Modifications made using this technique take precedence over
|
|
|
|
* style values set via an RC file, however, they will be overridden
|
|
|
|
* if a style is explicitely set on the widget using gtk_widget_set_style().
|
|
|
|
* The #GtkRcStyle structure is designed so each field can either be
|
|
|
|
* set or unset, so it is possible, using this function, to modify some
|
|
|
|
* style values and leave the others unchanged.
|
|
|
|
*
|
|
|
|
* Note that modifications made with this function are not cumulative
|
|
|
|
* with previous calls to gtk_widget_modify_style() or with such
|
|
|
|
* functions as gtk_widget_modify_fg(). If you wish to retain
|
|
|
|
* previous values, you must first call gtk_widget_get_modifier_style(),
|
|
|
|
* make your modifications to the returned style, then call
|
|
|
|
* gtk_widget_modify_style() with that style. On the other hand,
|
|
|
|
* if you first call gtk_widget_modify_style(), subsequent calls
|
|
|
|
* to such functions gtk_widget_modify_fg() will have a cumulative
|
|
|
|
* effect with the initial modifications.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_style (GtkWidget *widget,
|
|
|
|
GtkRcStyle *style)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (GTK_IS_RC_STYLE (style));
|
|
|
|
|
|
|
|
g_object_set_data_full (G_OBJECT (widget),
|
|
|
|
"gtk-rc-style",
|
|
|
|
gtk_rc_style_copy (style),
|
|
|
|
(GDestroyNotify) g_object_unref);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_get_modifier_style:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
*
|
|
|
|
* Returns the current modifier style for the widget. (As set by
|
|
|
|
* gtk_widget_modify_style().) If no style has previously set, a new
|
|
|
|
* #GtkRcStyle will be created with all values unset, and set as the
|
|
|
|
* modifier style for the widget. If you make changes to this rc
|
|
|
|
* style, you must call gtk_widget_modify_style(), passing in the
|
|
|
|
* returned rc style, to make sure that your changes take effect.
|
|
|
|
*
|
|
|
|
* Caution: passing the style back to gtk_widget_modify_style() will
|
|
|
|
* normally end up destroying it, because gtk_widget_modify_style() copies
|
|
|
|
* the passed-in style and sets the copy as the new modifier style,
|
|
|
|
* thus dropping any reference to the old modifier style. Add a reference
|
|
|
|
* to the modifier style if you want to keep it alive.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): the modifier style for the widget.
|
|
|
|
* This rc style is owned by the widget. If you want to keep a
|
|
|
|
* pointer to value this around, you must add a refcount using
|
|
|
|
* g_object_ref().
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
|
|
|
|
*/
|
|
|
|
GtkRcStyle *
|
|
|
|
gtk_widget_get_modifier_style (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkRcStyle *rc_style;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
|
|
|
|
|
|
|
rc_style = g_object_get_data (G_OBJECT (widget), "gtk-rc-style");
|
|
|
|
|
|
|
|
if (!rc_style)
|
|
|
|
{
|
|
|
|
rc_style = gtk_rc_style_new ();
|
|
|
|
g_object_set_data_full (G_OBJECT (widget),
|
|
|
|
"gtk-rc-style",
|
|
|
|
rc_style,
|
|
|
|
(GDestroyNotify) g_object_unref);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc_style;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_widget_modify_color_component (GtkWidget *widget,
|
|
|
|
GtkRcFlags component,
|
|
|
|
GtkStateType state,
|
|
|
|
const GdkColor *color)
|
|
|
|
{
|
|
|
|
GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
|
|
|
switch (component)
|
|
|
|
{
|
|
|
|
case GTK_RC_FG:
|
|
|
|
rc_style->fg[state] = *color;
|
|
|
|
break;
|
|
|
|
case GTK_RC_BG:
|
|
|
|
rc_style->bg[state] = *color;
|
|
|
|
break;
|
|
|
|
case GTK_RC_TEXT:
|
|
|
|
rc_style->text[state] = *color;
|
|
|
|
break;
|
|
|
|
case GTK_RC_BASE:
|
|
|
|
rc_style->base[state] = *color;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
|
|
|
|
rc_style->color_flags[state] |= component;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rc_style->color_flags[state] &= ~component;
|
|
|
|
|
|
|
|
gtk_widget_modify_style (widget, rc_style);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_fg:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @state: the state for which to set the foreground color
|
|
|
|
* @color: (allow-none): the color to assign (does not need to be allocated),
|
|
|
|
* or %NULL to undo the effect of previous calls to
|
|
|
|
* of gtk_widget_modify_fg().
|
|
|
|
*
|
|
|
|
* Sets the foreground color for a widget in a particular state.
|
|
|
|
*
|
|
|
|
* All other style values are left untouched.
|
|
|
|
* See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_override_color() instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_fg (GtkWidget *widget,
|
|
|
|
GtkStateType state,
|
|
|
|
const GdkColor *color)
|
|
|
|
{
|
|
|
|
GtkStateFlags flags;
|
|
|
|
GdkRGBA rgba;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags = GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags = GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags = GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags = GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_NORMAL:
|
|
|
|
default:
|
|
|
|
flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
|
|
|
rgba.red = color->red / 65535.;
|
|
|
|
rgba.green = color->green / 65535.;
|
|
|
|
rgba.blue = color->blue / 65535.;
|
|
|
|
rgba.alpha = 1;
|
|
|
|
|
|
|
|
gtk_widget_override_color (widget, flags, &rgba);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_widget_override_color (widget, flags, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_bg:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @state: the state for which to set the background color
|
|
|
|
* @color: (allow-none): the color to assign (does not need
|
|
|
|
* to be allocated), or %NULL to undo the effect of previous
|
|
|
|
* calls to of gtk_widget_modify_bg().
|
|
|
|
*
|
|
|
|
* Sets the background color for a widget in a particular state.
|
|
|
|
*
|
|
|
|
* All other style values are left untouched.
|
|
|
|
* See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* <note><para>
|
|
|
|
* Note that "no window" widgets (which have the %GTK_NO_WINDOW
|
|
|
|
* flag set) draw on their parent container's window and thus may
|
|
|
|
* not draw any background themselves. This is the case for e.g.
|
|
|
|
* #GtkLabel.
|
|
|
|
* </para><para>
|
|
|
|
* To modify the background of such widgets, you have to set the
|
|
|
|
* background color on their parent; if you want to set the background
|
|
|
|
* of a rectangular area around a label, try placing the label in
|
|
|
|
* a #GtkEventBox widget and setting the background color on that.
|
|
|
|
* </para></note>
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_override_background_color() instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_bg (GtkWidget *widget,
|
|
|
|
GtkStateType state,
|
|
|
|
const GdkColor *color)
|
|
|
|
{
|
|
|
|
GtkStateFlags flags;
|
|
|
|
GdkRGBA rgba;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case GTK_STATE_ACTIVE:
|
|
|
|
flags = GTK_STATE_FLAG_ACTIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_PRELIGHT:
|
|
|
|
flags = GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_SELECTED:
|
|
|
|
flags = GTK_STATE_FLAG_SELECTED;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_INSENSITIVE:
|
|
|
|
flags = GTK_STATE_FLAG_INSENSITIVE;
|
|
|
|
break;
|
|
|
|
case GTK_STATE_NORMAL:
|
|
|
|
default:
|
|
|
|
flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
|
|
|
rgba.red = color->red / 65535.;
|
|
|
|
rgba.green = color->green / 65535.;
|
|
|
|
rgba.blue = color->blue / 65535.;
|
|
|
|
rgba.alpha = 1;
|
|
|
|
|
|
|
|
gtk_widget_override_background_color (widget, flags, &rgba);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_widget_override_background_color (widget, flags, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_text:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @state: the state for which to set the text color
|
|
|
|
* @color: (allow-none): the color to assign (does not need to
|
|
|
|
* be allocated), or %NULL to undo the effect of previous
|
|
|
|
* calls to of gtk_widget_modify_text().
|
|
|
|
*
|
|
|
|
* Sets the text color for a widget in a particular state.
|
|
|
|
*
|
|
|
|
* All other style values are left untouched.
|
|
|
|
* The text color is the foreground color used along with the
|
|
|
|
* base color (see gtk_widget_modify_base()) for widgets such
|
|
|
|
* as #GtkEntry and #GtkTextView.
|
|
|
|
* See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_override_color() instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_text (GtkWidget *widget,
|
|
|
|
GtkStateType state,
|
|
|
|
const GdkColor *color)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
|
|
|
|
|
|
|
|
gtk_widget_modify_color_component (widget, GTK_RC_TEXT, state, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_base:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @state: the state for which to set the base color
|
|
|
|
* @color: (allow-none): the color to assign (does not need to
|
|
|
|
* be allocated), or %NULL to undo the effect of previous
|
|
|
|
* calls to of gtk_widget_modify_base().
|
|
|
|
*
|
|
|
|
* Sets the base color for a widget in a particular state.
|
|
|
|
* All other style values are left untouched. The base color
|
|
|
|
* is the background color used along with the text color
|
|
|
|
* (see gtk_widget_modify_text()) for widgets such as #GtkEntry
|
|
|
|
* and #GtkTextView. See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* <note><para>
|
|
|
|
* Note that "no window" widgets (which have the %GTK_NO_WINDOW
|
|
|
|
* flag set) draw on their parent container's window and thus may
|
|
|
|
* not draw any background themselves. This is the case for e.g.
|
|
|
|
* #GtkLabel.
|
|
|
|
* </para><para>
|
|
|
|
* To modify the background of such widgets, you have to set the
|
|
|
|
* base color on their parent; if you want to set the background
|
|
|
|
* of a rectangular area around a label, try placing the label in
|
|
|
|
* a #GtkEventBox widget and setting the base color on that.
|
|
|
|
* </para></note>
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_override_background_color() instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_base (GtkWidget *widget,
|
|
|
|
GtkStateType state,
|
|
|
|
const GdkColor *color)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
|
|
|
|
|
|
|
|
gtk_widget_modify_color_component (widget, GTK_RC_BASE, state, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_cursor:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @primary: the color to use for primary cursor (does not need to be
|
|
|
|
* allocated), or %NULL to undo the effect of previous calls to
|
|
|
|
* of gtk_widget_modify_cursor().
|
|
|
|
* @secondary: the color to use for secondary cursor (does not need to be
|
|
|
|
* allocated), or %NULL to undo the effect of previous calls to
|
|
|
|
* of gtk_widget_modify_cursor().
|
|
|
|
*
|
|
|
|
* Sets the cursor color to use in a widget, overriding the
|
|
|
|
* #GtkWidget:cursor-color and #GtkWidget:secondary-cursor-color
|
|
|
|
* style properties.
|
|
|
|
*
|
|
|
|
* All other style values are left untouched.
|
|
|
|
* See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*
|
|
|
|
* Deprecated: 3.0. Use gtk_widget_override_cursor() instead.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_cursor (GtkWidget *widget,
|
|
|
|
const GdkColor *primary,
|
|
|
|
const GdkColor *secondary)
|
|
|
|
{
|
|
|
|
GdkRGBA primary_rgba, secondary_rgba;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
primary_rgba.red = primary->red / 65535.;
|
|
|
|
primary_rgba.green = primary->green / 65535.;
|
|
|
|
primary_rgba.blue = primary->blue / 65535.;
|
|
|
|
primary_rgba.alpha = 1;
|
|
|
|
|
|
|
|
secondary_rgba.red = secondary->red / 65535.;
|
|
|
|
secondary_rgba.green = secondary->green / 65535.;
|
|
|
|
secondary_rgba.blue = secondary->blue / 65535.;
|
|
|
|
secondary_rgba.alpha = 1;
|
|
|
|
|
|
|
|
gtk_widget_override_cursor (widget, &primary_rgba, &secondary_rgba);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_modify_font:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @font_desc: (allow-none): the font description to use, or %NULL
|
|
|
|
* to undo the effect of previous calls to gtk_widget_modify_font()
|
|
|
|
*
|
|
|
|
* Sets the font to use for a widget.
|
|
|
|
*
|
|
|
|
* All other style values are left untouched.
|
|
|
|
* See also gtk_widget_modify_style().
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_override_font() instead
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_modify_font (GtkWidget *widget,
|
|
|
|
PangoFontDescription *font_desc)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
gtk_widget_override_font (widget, font_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_reset_rc_styles:
|
|
|
|
* @widget: a #GtkWidget.
|
|
|
|
*
|
|
|
|
* Reset the styles of @widget and all descendents, so when
|
|
|
|
* they are looked up again, they get the correct values
|
|
|
|
* for the currently loaded RC file settings.
|
|
|
|
*
|
|
|
|
* This function is not useful for applications.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use #GtkStyleContext instead, and gtk_widget_reset_style()
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_widget_reset_rc_styles (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
gtk_widget_reset_style (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_path:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @path_length: (out) (allow-none): location to store length of the path,
|
|
|
|
* or %NULL
|
|
|
|
* @path: (out) (allow-none): location to store allocated path string,
|
|
|
|
* or %NULL
|
|
|
|
* @path_reversed: (out) (allow-none): location to store allocated reverse
|
|
|
|
* path string, or %NULL
|
|
|
|
*
|
|
|
|
* Obtains the full path to @widget. The path is simply the name of a
|
|
|
|
* widget and all its parents in the container hierarchy, separated by
|
|
|
|
* periods. The name of a widget comes from
|
|
|
|
* gtk_widget_get_name(). Paths are used to apply styles to a widget
|
|
|
|
* in gtkrc configuration files. Widget names are the type of the
|
|
|
|
* widget by default (e.g. "GtkButton") or can be set to an
|
|
|
|
* application-specific value with gtk_widget_set_name(). By setting
|
|
|
|
* the name of a widget, you allow users or theme authors to apply
|
|
|
|
* styles to that specific widget in their gtkrc
|
|
|
|
* file. @path_reversed_p fills in the path in reverse order,
|
|
|
|
* i.e. starting with @widget's name instead of starting with the name
|
|
|
|
* of @widget's outermost ancestor.
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_get_path() instead
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_widget_path (GtkWidget *widget,
|
|
|
|
guint *path_length,
|
|
|
|
gchar **path,
|
|
|
|
gchar **path_reversed)
|
|
|
|
{
|
|
|
|
static gchar *rev_path = NULL;
|
|
|
|
static guint tmp_path_len = 0;
|
|
|
|
guint len;
|
|
|
|
|
|
|
|
#define INIT_PATH_SIZE (512)
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
len = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
const gchar *string;
|
|
|
|
const gchar *s;
|
|
|
|
gchar *d;
|
|
|
|
guint l;
|
|
|
|
|
|
|
|
string = gtk_widget_get_name (widget);
|
|
|
|
l = strlen (string);
|
|
|
|
while (tmp_path_len <= len + l + 1)
|
|
|
|
{
|
|
|
|
tmp_path_len += INIT_PATH_SIZE;
|
|
|
|
rev_path = g_realloc (rev_path, tmp_path_len);
|
|
|
|
}
|
|
|
|
s = string + l - 1;
|
|
|
|
d = rev_path + len;
|
|
|
|
while (s >= string)
|
|
|
|
*(d++) = *(s--);
|
|
|
|
len += l;
|
|
|
|
|
|
|
|
widget = gtk_widget_get_parent (widget);
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
rev_path[len++] = '.';
|
|
|
|
else
|
|
|
|
rev_path[len++] = 0;
|
|
|
|
}
|
|
|
|
while (widget);
|
|
|
|
|
|
|
|
if (path_length)
|
|
|
|
*path_length = len - 1;
|
|
|
|
if (path_reversed)
|
|
|
|
*path_reversed = g_strdup (rev_path);
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
*path = g_strdup (rev_path);
|
|
|
|
g_strreverse (*path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_class_path:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @path_length: (out) (allow-none): location to store the length of the
|
|
|
|
* class path, or %NULL
|
|
|
|
* @path: (out) (allow-none): location to store the class path as an
|
|
|
|
* allocated string, or %NULL
|
|
|
|
* @path_reversed: (out) (allow-none): location to store the reverse
|
|
|
|
* class path as an allocated string, or %NULL
|
|
|
|
*
|
|
|
|
* Same as gtk_widget_path(), but always uses the name of a widget's type,
|
|
|
|
* never uses a custom name set with gtk_widget_set_name().
|
|
|
|
*
|
|
|
|
* Deprecated:3.0: Use gtk_widget_get_path() instead
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_widget_class_path (GtkWidget *widget,
|
|
|
|
guint *path_length,
|
|
|
|
gchar **path,
|
|
|
|
gchar **path_reversed)
|
|
|
|
{
|
|
|
|
static gchar *rev_path = NULL;
|
|
|
|
static guint tmp_path_len = 0;
|
|
|
|
guint len;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
len = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
const gchar *string;
|
|
|
|
const gchar *s;
|
|
|
|
gchar *d;
|
|
|
|
guint l;
|
|
|
|
|
|
|
|
string = g_type_name (G_OBJECT_TYPE (widget));
|
|
|
|
l = strlen (string);
|
|
|
|
while (tmp_path_len <= len + l + 1)
|
|
|
|
{
|
|
|
|
tmp_path_len += INIT_PATH_SIZE;
|
|
|
|
rev_path = g_realloc (rev_path, tmp_path_len);
|
|
|
|
}
|
|
|
|
s = string + l - 1;
|
|
|
|
d = rev_path + len;
|
|
|
|
while (s >= string)
|
|
|
|
*(d++) = *(s--);
|
|
|
|
len += l;
|
|
|
|
|
|
|
|
widget = gtk_widget_get_parent (widget);
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
rev_path[len++] = '.';
|
|
|
|
else
|
|
|
|
rev_path[len++] = 0;
|
|
|
|
}
|
|
|
|
while (widget);
|
|
|
|
|
|
|
|
if (path_length)
|
|
|
|
*path_length = len - 1;
|
|
|
|
if (path_reversed)
|
|
|
|
*path_reversed = g_strdup (rev_path);
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
*path = g_strdup (rev_path);
|
|
|
|
g_strreverse (*path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_render_icon:
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @stock_id: a stock ID
|
|
|
|
* @size: (type int): a stock size. A size of (GtkIconSize)-1 means
|
|
|
|
* render at the size of the source and don't scale (if there are
|
|
|
|
* multiple source sizes, GTK+ picks one of the available sizes).
|
|
|
|
* @detail: (allow-none): render detail to pass to theme engine
|
|
|
|
*
|
|
|
|
* A convenience function that uses the theme settings for @widget
|
|
|
|
* to look up @stock_id and render it to a pixbuf. @stock_id should
|
|
|
|
* be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. @size
|
|
|
|
* should be a size such as #GTK_ICON_SIZE_MENU. @detail should be a
|
|
|
|
* string that identifies the widget or code doing the rendering, so
|
|
|
|
* that theme engines can special-case rendering for that widget or
|
|
|
|
* code.
|
|
|
|
*
|
|
|
|
* The pixels in the returned #GdkPixbuf are shared with the rest of
|
|
|
|
* the application and should not be modified. The pixbuf should be
|
|
|
|
* freed after use with g_object_unref().
|
|
|
|
*
|
|
|
|
* Return value: (transfer full): a new pixbuf, or %NULL if the
|
|
|
|
* stock ID wasn't known
|
|
|
|
*
|
|
|
|
* Deprecated: 3.0: Use gtk_widget_render_icon_pixbuf() instead.
|
|
|
|
**/
|
|
|
|
GdkPixbuf*
|
|
|
|
gtk_widget_render_icon (GtkWidget *widget,
|
|
|
|
const gchar *stock_id,
|
|
|
|
GtkIconSize size,
|
|
|
|
const gchar *detail)
|
|
|
|
{
|
|
|
|
gtk_widget_ensure_style (widget);
|
|
|
|
|
|
|
|
return gtk_widget_render_icon_pixbuf (widget, stock_id, size);
|
|
|
|
}
|