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
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
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"
|
1997-11-28 06:47:01 +00:00
|
|
|
#include "gtkwidget.h"
|
1998-11-06 22:05:02 +00:00
|
|
|
#include "gtkthemes.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"
|
2001-04-03 13:18:00 +00:00
|
|
|
#include "gtksettings.h" /* _gtk_settings_parse_convert() */
|
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"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2010-05-15 22:44:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gtkstyle
|
|
|
|
* @Short_description: An object that hold style information for widgets
|
|
|
|
* @Title: GtkStyle
|
|
|
|
*
|
|
|
|
* A #GtkStyle object encapsulates the information that provides the look and
|
|
|
|
* feel for a widget. 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
GSList *color_hashes;
|
|
|
|
};
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* --- prototypes --- */
|
|
|
|
static void gtk_style_finalize (GObject *object);
|
|
|
|
static void gtk_style_realize (GtkStyle *style,
|
2010-08-28 21:19:18 +00:00
|
|
|
GdkVisual *visual);
|
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-07-22 00:55:12 +00:00
|
|
|
static void style_unrealize_cursors (GtkStyle *style);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
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
|
|
|
/**
|
|
|
|
* _gtk_style_init_for_settings:
|
|
|
|
* @style: a #GtkStyle
|
|
|
|
* @settings: a #GtkSettings
|
|
|
|
*
|
2004-06-10 03:12:04 +00:00
|
|
|
* Initializes the font description in @style according to the default
|
2002-08-01 23:43:13 +00:00
|
|
|
* font name of @settings. This is called for gtk_style_new() with
|
|
|
|
* the settings for the default screen (if any); if we are creating
|
|
|
|
* a style for a particular screen, we then call it again in a
|
|
|
|
* location where we know the correct settings.
|
|
|
|
* The reason for this is that gtk_rc_style_create_style() doesn't
|
|
|
|
* take the screen for an argument.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
_gtk_style_init_for_settings (GtkStyle *style,
|
|
|
|
GtkSettings *settings)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-08-01 23:43:13 +00:00
|
|
|
const gchar *font_name = _gtk_rc_context_get_default_font_name (settings);
|
2002-02-24 05:05:15 +00:00
|
|
|
|
2002-08-01 23:43:13 +00:00
|
|
|
if (style->font_desc)
|
|
|
|
pango_font_description_free (style->font_desc);
|
|
|
|
|
2002-02-24 02:24:51 +00:00
|
|
|
style->font_desc = pango_font_description_from_string (font_name);
|
2002-08-01 23:43:13 +00:00
|
|
|
|
2002-02-24 05:05:15 +00:00
|
|
|
if (!pango_font_description_get_family (style->font_desc))
|
|
|
|
{
|
|
|
|
g_warning ("Default font does not have a family set");
|
|
|
|
pango_font_description_set_family (style->font_desc, "Sans");
|
|
|
|
}
|
|
|
|
if (pango_font_description_get_size (style->font_desc) <= 0)
|
|
|
|
{
|
|
|
|
g_warning ("Default font does not have a positive size");
|
|
|
|
pango_font_description_set_size (style->font_desc, 10 * PANGO_SCALE);
|
|
|
|
}
|
2002-08-01 23:43:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_init (GtkStyle *style)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
GtkSettings *settings = gtk_settings_get_default ();
|
|
|
|
|
|
|
|
if (settings)
|
|
|
|
_gtk_style_init_for_settings (style, settings);
|
|
|
|
else
|
|
|
|
style->font_desc = pango_font_description_from_string ("Sans 10");
|
2002-02-24 05:05:15 +00:00
|
|
|
|
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;
|
|
|
|
|
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));
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-09-08 17:55:02 +00:00
|
|
|
clear_property_cache (GtkStyle *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
|
|
|
{
|
2001-03-18 04:50:34 +00:00
|
|
|
if (style->property_cache)
|
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
2001-09-08 17:55:02 +00:00
|
|
|
for (i = 0; i < style->property_cache->len; i++)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
2001-09-08 17:55:02 +00:00
|
|
|
PropertyValue *node = &g_array_index (style->property_cache, PropertyValue, i);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
g_param_spec_unref (node->pspec);
|
|
|
|
g_value_unset (&node->value);
|
|
|
|
}
|
2001-09-08 17:55:02 +00:00
|
|
|
g_array_free (style->property_cache, TRUE);
|
2001-03-18 04:50:34 +00:00
|
|
|
style->property_cache = NULL;
|
|
|
|
}
|
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);
|
2001-09-08 17:55:02 +00:00
|
|
|
|
|
|
|
g_return_if_fail (style->attach_count == 0);
|
|
|
|
|
|
|
|
clear_property_cache (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
|
|
|
|
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
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_unref, NULL);
|
|
|
|
g_slist_free (priv->color_hashes);
|
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);
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkStyle*
|
|
|
|
gtk_style_duplicate (GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkStyle *new_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_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
|
|
|
|
|
|
|
new_style = gtk_style_copy (style);
|
|
|
|
|
2004-07-16 02:22:48 +00:00
|
|
|
/* All the styles in the list have the same
|
|
|
|
* style->styles pointer. When we insert a new
|
|
|
|
* style, we append it to the list to avoid having
|
|
|
|
* to update the existing ones.
|
|
|
|
*/
|
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->styles = g_slist_append (style->styles, new_style);
|
|
|
|
new_style->styles = style->styles;
|
|
|
|
|
|
|
|
return new_style;
|
|
|
|
}
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
/**
|
|
|
|
* gtk_style_new:
|
|
|
|
* @returns: a new #GtkStyle.
|
|
|
|
*
|
|
|
|
* Creates a new #GtkStyle.
|
|
|
|
**/
|
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)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
|
2000-07-11 04:46:11 +00:00
|
|
|
style = g_object_new (GTK_TYPE_STYLE, NULL);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
2001-12-06 21:38:12 +00:00
|
|
|
/**
|
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
|
|
|
* gtk_style_attach:
|
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.
|
|
|
|
*/
|
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
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
GSList *styles;
|
|
|
|
GtkStyle *new_style = NULL;
|
2010-08-28 21:19:18 +00:00
|
|
|
GdkVisual *visual;
|
1999-01-11 18:49:54 +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);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-28 23:18:43 +00:00
|
|
|
visual = gdk_window_get_visual (window);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
if (!style->styles)
|
|
|
|
style->styles = g_slist_append (NULL, style);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
styles = style->styles;
|
|
|
|
while (styles)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
new_style = styles->data;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-28 21:19:18 +00:00
|
|
|
if (new_style->visual == visual)
|
1999-01-15 18:41:43 +00:00
|
|
|
break;
|
2004-07-16 02:22:48 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
new_style = NULL;
|
|
|
|
styles = styles->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2004-07-16 02:22:48 +00:00
|
|
|
|
|
|
|
if (!new_style)
|
|
|
|
{
|
|
|
|
styles = style->styles;
|
|
|
|
|
|
|
|
while (styles)
|
|
|
|
{
|
|
|
|
new_style = styles->data;
|
|
|
|
|
|
|
|
if (new_style->attach_count == 0)
|
|
|
|
{
|
2010-08-28 21:19:18 +00:00
|
|
|
gtk_style_realize (new_style, visual);
|
2004-07-16 02:22:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
new_style = NULL;
|
|
|
|
styles = styles->next;
|
|
|
|
}
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
if (!new_style)
|
|
|
|
{
|
|
|
|
new_style = gtk_style_duplicate (style);
|
2010-08-28 21:19:18 +00:00
|
|
|
gtk_style_realize (new_style, visual);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
/* A style gets a refcount from being attached */
|
1998-11-06 22:05:02 +00:00
|
|
|
if (new_style->attach_count == 0)
|
2001-09-18 20:06:48 +00:00
|
|
|
g_object_ref (new_style);
|
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
|
|
|
|
|
|
|
/* Another refcount belongs to the parent */
|
|
|
|
if (style != new_style)
|
|
|
|
{
|
2001-09-18 20:06:48 +00:00
|
|
|
g_object_unref (style);
|
|
|
|
g_object_ref (new_style);
|
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
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
new_style->attach_count++;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
return new_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().
|
|
|
|
*
|
|
|
|
*/
|
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));
|
2005-10-05 13:23:21 +00:00
|
|
|
g_return_if_fail (style->attach_count > 0);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
style->attach_count -= 1;
|
|
|
|
if (style->attach_count == 0)
|
|
|
|
{
|
2004-02-25 18:03:12 +00:00
|
|
|
g_signal_emit (style, unrealize_signal, 0);
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-28 21:19:18 +00:00
|
|
|
g_object_unref (style->visual);
|
|
|
|
style->visual = NULL;
|
2002-06-20 19:29:16 +00:00
|
|
|
|
|
|
|
if (style->private_font_desc)
|
|
|
|
{
|
|
|
|
pango_font_description_free (style->private_font_desc);
|
|
|
|
style->private_font_desc = NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-18 20:06:48 +00:00
|
|
|
g_object_unref (style);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
static void
|
2010-08-28 21:19:18 +00:00
|
|
|
gtk_style_realize (GtkStyle *style,
|
|
|
|
GdkVisual *visual)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-08-28 21:19:18 +00:00
|
|
|
style->visual = g_object_ref (visual);
|
2000-07-17 23:18:29 +00:00
|
|
|
|
2004-02-25 18:03:12 +00:00
|
|
|
g_signal_emit (style, realize_signal, 0);
|
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.
|
|
|
|
*
|
|
|
|
* Return value: icon set of @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
|
|
|
GtkIconSet*
|
|
|
|
gtk_style_lookup_icon_set (GtkStyle *style,
|
|
|
|
const char *stock_id)
|
|
|
|
{
|
|
|
|
GSList *iter;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
|
|
|
g_return_val_if_fail (stock_id != NULL, NULL);
|
|
|
|
|
|
|
|
iter = style->icon_factories;
|
|
|
|
while (iter != NULL)
|
|
|
|
{
|
2001-03-18 04:50:34 +00:00
|
|
|
GtkIconSet *icon_set = gtk_icon_factory_lookup (GTK_ICON_FACTORY (iter->data),
|
|
|
|
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
|
|
|
if (icon_set)
|
|
|
|
return icon_set;
|
|
|
|
|
|
|
|
iter = g_slist_next (iter);
|
|
|
|
}
|
|
|
|
|
|
|
|
return gtk_icon_factory_lookup_default (stock_id);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
* @color: the #GdkColor to fill in
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_style_lookup_color (GtkStyle *style,
|
|
|
|
const char *color_name,
|
|
|
|
GdkColor *color)
|
|
|
|
{
|
|
|
|
GtkStylePrivate *priv;
|
|
|
|
GSList *iter;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
for (iter = priv->color_hashes; iter != NULL; iter = iter->next)
|
|
|
|
{
|
|
|
|
GHashTable *hash = iter->data;
|
|
|
|
GdkColor *mapping = g_hash_table_lookup (hash, color_name);
|
|
|
|
|
|
|
|
if (mapping)
|
|
|
|
{
|
|
|
|
color->red = mapping->red;
|
|
|
|
color->green = mapping->green;
|
|
|
|
color->blue = mapping->blue;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
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.
|
|
|
|
*/
|
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)
|
|
|
|
{
|
2004-11-19 23:18:38 +00:00
|
|
|
return g_object_new (G_OBJECT_TYPE (style), NULL);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_copy (GtkStyle *style,
|
|
|
|
GtkStyle *src)
|
|
|
|
{
|
2006-09-22 20:47:23 +00:00
|
|
|
GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
|
|
|
|
GtkStylePrivate *src_priv = GTK_STYLE_GET_PRIVATE (src);
|
2000-07-17 23:18:29 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_unref, NULL);
|
|
|
|
g_slist_free (priv->color_hashes);
|
|
|
|
priv->color_hashes = g_slist_copy (src_priv->color_hashes);
|
|
|
|
g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_ref, NULL);
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* don't copy, just clear cache */
|
2001-09-08 17:55:02 +00:00
|
|
|
clear_property_cache (style);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_init_from_rc (GtkStyle *style,
|
|
|
|
GtkRcStyle *rc_style)
|
|
|
|
{
|
2005-11-23 10:33:58 +00:00
|
|
|
GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
|
2000-07-17 23:18:29 +00:00
|
|
|
gint i;
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* cache _should_ be still empty */
|
2001-09-08 17:55:02 +00:00
|
|
|
clear_property_cache (style);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
if (rc_style->font_desc)
|
2001-12-26 17:06:13 +00:00
|
|
|
pango_font_description_merge (style->font_desc, rc_style->font_desc, TRUE);
|
2000-07-17 23:18:29 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
1999-01-12 15:12:14 +00:00
|
|
|
{
|
2000-07-17 23:18:29 +00:00
|
|
|
if (rc_style->color_flags[i] & GTK_RC_FG)
|
|
|
|
style->fg[i] = rc_style->fg[i];
|
|
|
|
if (rc_style->color_flags[i] & GTK_RC_BG)
|
|
|
|
style->bg[i] = rc_style->bg[i];
|
|
|
|
if (rc_style->color_flags[i] & GTK_RC_TEXT)
|
|
|
|
style->text[i] = rc_style->text[i];
|
|
|
|
if (rc_style->color_flags[i] & GTK_RC_BASE)
|
|
|
|
style->base[i] = rc_style->base[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc_style->xthickness >= 0)
|
|
|
|
style->xthickness = rc_style->xthickness;
|
|
|
|
if (rc_style->ythickness >= 0)
|
|
|
|
style->ythickness = rc_style->ythickness;
|
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
|
|
|
style->icon_factories = g_slist_copy (rc_style->icon_factories);
|
|
|
|
g_slist_foreach (style->icon_factories, (GFunc) g_object_ref, 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
|
|
|
|
2005-11-23 10:33:58 +00:00
|
|
|
priv->color_hashes = g_slist_copy (_gtk_rc_style_get_color_hashes (rc_style));
|
|
|
|
g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_ref, NULL);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
static gint
|
|
|
|
style_property_values_cmp (gconstpointer bsearch_node1,
|
|
|
|
gconstpointer bsearch_node2)
|
|
|
|
{
|
|
|
|
const PropertyValue *val1 = bsearch_node1;
|
|
|
|
const PropertyValue *val2 = bsearch_node2;
|
|
|
|
|
2001-09-08 17:55:02 +00:00
|
|
|
if (val1->widget_type == val2->widget_type)
|
|
|
|
return val1->pspec < val2->pspec ? -1 : val1->pspec == val2->pspec ? 0 : 1;
|
|
|
|
else
|
|
|
|
return val1->widget_type < val2->widget_type ? -1 : 1;
|
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
|
|
|
{
|
|
|
|
GtkWidgetClass *klass;
|
|
|
|
GParamSpec *pspec;
|
|
|
|
GtkRcPropertyParser parser;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
parser = g_param_spec_get_qdata (pspec,
|
|
|
|
g_quark_from_static_string ("gtk-rc-property-parser"));
|
|
|
|
|
|
|
|
peek_value = _gtk_style_peek_property_value (style, widget_type, pspec, parser);
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
const char *property_name;
|
|
|
|
GtkWidgetClass *klass;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_STYLE (style));
|
|
|
|
|
|
|
|
klass = g_type_class_ref (widget_type);
|
|
|
|
|
|
|
|
property_name = first_property_name;
|
|
|
|
while (property_name)
|
|
|
|
{
|
|
|
|
GParamSpec *pspec;
|
|
|
|
GtkRcPropertyParser parser;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
parser = g_param_spec_get_qdata (pspec,
|
|
|
|
g_quark_from_static_string ("gtk-rc-property-parser"));
|
|
|
|
|
|
|
|
peek_value = _gtk_style_peek_property_value (style, widget_type, pspec, parser);
|
|
|
|
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
|
|
|
|
* @Varargs: pairs of property names and locations to
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
const GValue*
|
|
|
|
_gtk_style_peek_property_value (GtkStyle *style,
|
|
|
|
GType widget_type,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkRcPropertyParser parser)
|
|
|
|
{
|
|
|
|
PropertyValue *pcache, key = { 0, NULL, { 0, } };
|
|
|
|
const GtkRcProperty *rcprop = NULL;
|
2001-09-08 17:55:02 +00:00
|
|
|
guint i;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
|
|
|
|
g_return_val_if_fail (g_type_is_a (pspec->owner_type, GTK_TYPE_WIDGET), NULL);
|
|
|
|
g_return_val_if_fail (g_type_is_a (widget_type, pspec->owner_type), NULL);
|
|
|
|
|
2001-09-10 12:23:49 +00:00
|
|
|
key.widget_type = widget_type;
|
|
|
|
key.pspec = pspec;
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* need value cache array */
|
|
|
|
if (!style->property_cache)
|
2001-09-08 17:55:02 +00:00
|
|
|
style->property_cache = g_array_new (FALSE, FALSE, sizeof (PropertyValue));
|
2001-09-10 10:54:43 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
pcache = bsearch (&key,
|
|
|
|
style->property_cache->data, style->property_cache->len,
|
|
|
|
sizeof (PropertyValue), style_property_values_cmp);
|
|
|
|
if (pcache)
|
|
|
|
return &pcache->value;
|
|
|
|
}
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2001-09-08 17:55:02 +00:00
|
|
|
i = 0;
|
|
|
|
while (i < style->property_cache->len &&
|
|
|
|
style_property_values_cmp (&key, &g_array_index (style->property_cache, PropertyValue, i)) >= 0)
|
|
|
|
i++;
|
|
|
|
|
|
|
|
g_array_insert_val (style->property_cache, i, key);
|
|
|
|
pcache = &g_array_index (style->property_cache, PropertyValue, i);
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
/* cache miss, initialize value type, then set contents */
|
2001-04-03 13:18:00 +00:00
|
|
|
g_param_spec_ref (pcache->pspec);
|
2001-03-18 04:50:34 +00:00
|
|
|
g_value_init (&pcache->value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
|
|
|
|
|
|
|
/* value provided by rc style? */
|
|
|
|
if (style->rc_style)
|
|
|
|
{
|
|
|
|
GQuark prop_quark = g_quark_from_string (pspec->name);
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
rcprop = _gtk_rc_style_lookup_rc_property (style->rc_style,
|
|
|
|
g_type_qname (widget_type),
|
|
|
|
prop_quark);
|
|
|
|
if (rcprop)
|
|
|
|
break;
|
|
|
|
widget_type = g_type_parent (widget_type);
|
|
|
|
}
|
|
|
|
while (g_type_is_a (widget_type, pspec->owner_type));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* when supplied by rc style, we need to convert */
|
2001-04-03 13:18:00 +00:00
|
|
|
if (rcprop && !_gtk_settings_parse_convert (parser, &rcprop->value,
|
|
|
|
pspec, &pcache->value))
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
2001-04-03 13:18:00 +00:00
|
|
|
gchar *contents = g_strdup_value_contents (&rcprop->value);
|
|
|
|
|
2001-10-03 19:48:55 +00:00
|
|
|
g_message ("%s: failed to retrieve property `%s::%s' of type `%s' from rc file value \"%s\" of type `%s'",
|
2006-07-06 05:14:03 +00:00
|
|
|
rcprop->origin ? rcprop->origin : "(for origin information, set GTK_DEBUG)",
|
2001-04-03 13:18:00 +00:00
|
|
|
g_type_name (pspec->owner_type), pspec->name,
|
|
|
|
g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)),
|
|
|
|
contents,
|
|
|
|
G_VALUE_TYPE_NAME (&rcprop->value));
|
|
|
|
g_free (contents);
|
|
|
|
rcprop = NULL; /* needs default */
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* not supplied by rc style (or conversion failed), revert to default */
|
|
|
|
if (!rcprop)
|
|
|
|
g_param_value_set_default (pspec, &pcache->value);
|
|
|
|
|
|
|
|
return &pcache->value;
|
|
|
|
}
|
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
static cairo_pattern_t *
|
2010-08-28 21:19:18 +00:00
|
|
|
load_background (GdkVisual *visual,
|
2010-08-15 12:36:05 +00:00
|
|
|
GdkColor *bg_color,
|
|
|
|
const gchar *filename)
|
2001-06-21 17:45:26 +00:00
|
|
|
{
|
2010-08-15 12:36:05 +00:00
|
|
|
if (filename == NULL)
|
|
|
|
{
|
|
|
|
return cairo_pattern_create_rgb (bg_color->red / 65535.0,
|
|
|
|
bg_color->green / 65535.0,
|
|
|
|
bg_color->blue / 65535.0);
|
|
|
|
}
|
2001-06-21 17:45:26 +00:00
|
|
|
if (strcmp (filename, "<parent>") == 0)
|
2010-08-15 12:36:05 +00:00
|
|
|
return NULL;
|
2001-06-21 17:45:26 +00:00
|
|
|
else
|
|
|
|
{
|
2010-08-06 14:02:24 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
2010-08-15 12:36:05 +00:00
|
|
|
cairo_surface_t *surface;
|
|
|
|
cairo_pattern_t *pattern;
|
2010-08-06 14:02:24 +00:00
|
|
|
cairo_t *cr;
|
2010-08-28 21:19:18 +00:00
|
|
|
GdkScreen *screen = gdk_visual_get_screen (visual);
|
2010-08-06 14:02:24 +00:00
|
|
|
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
|
|
|
if (!pixbuf)
|
|
|
|
return NULL;
|
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen),
|
|
|
|
CAIRO_CONTENT_COLOR,
|
|
|
|
gdk_pixbuf_get_width (pixbuf),
|
|
|
|
gdk_pixbuf_get_height (pixbuf));
|
2010-08-06 14:02:24 +00:00
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
cr = cairo_create (surface);
|
2010-08-06 14:02:24 +00:00
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, bg_color);
|
|
|
|
cairo_paint (cr);
|
|
|
|
|
|
|
|
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
|
|
|
|
cairo_paint (cr);
|
|
|
|
|
|
|
|
cairo_destroy (cr);
|
|
|
|
g_object_unref (pixbuf);
|
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
pattern = cairo_pattern_create_for_surface (surface);
|
|
|
|
|
|
|
|
cairo_surface_destroy (surface);
|
|
|
|
|
|
|
|
return pattern;
|
2001-06-21 17:45:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
static void
|
|
|
|
gtk_style_real_realize (GtkStyle *style)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
2005-11-23 10:33:58 +00:00
|
|
|
_gtk_style_shade (&style->bg[i], &style->light[i], LIGHTNESS_MULT);
|
|
|
|
_gtk_style_shade (&style->bg[i], &style->dark[i], DARKNESS_MULT);
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
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;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
|
|
|
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;
|
1999-01-12 15:12:14 +00:00
|
|
|
}
|
2002-10-09 00:38:22 +00:00
|
|
|
|
|
|
|
style->black.red = 0x0000;
|
|
|
|
style->black.green = 0x0000;
|
|
|
|
style->black.blue = 0x0000;
|
|
|
|
|
|
|
|
style->white.red = 0xffff;
|
|
|
|
style->white.green = 0xffff;
|
|
|
|
style->white.blue = 0xffff;
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
2010-08-15 12:36:05 +00:00
|
|
|
const char *image_name;
|
|
|
|
|
|
|
|
if (style->rc_style)
|
|
|
|
image_name = style->rc_style->bg_pixmap_name[i];
|
|
|
|
else
|
|
|
|
image_name = NULL;
|
|
|
|
|
2010-08-28 21:19:18 +00:00
|
|
|
style->background[i] = load_background (style->visual,
|
2010-08-15 12:36:05 +00:00
|
|
|
&style->bg[i],
|
|
|
|
image_name);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_style_real_unrealize (GtkStyle *style)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
2010-08-15 12:36:05 +00:00
|
|
|
if (style->background[i])
|
2004-07-16 02:22:48 +00:00
|
|
|
{
|
2010-08-15 12:36:05 +00:00
|
|
|
cairo_pattern_destroy (style->background[i]);
|
|
|
|
style->background[i] = NULL;
|
2004-07-16 02:22:48 +00:00
|
|
|
}
|
|
|
|
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
|
2010-07-22 00:55:12 +00:00
|
|
|
style_unrealize_cursors (style);
|
2000-07-17 23:18:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
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:
|
2010-08-16 19:36:49 +00:00
|
|
|
* @cr:
|
2009-12-10 10:23:40 +00:00
|
|
|
* @window:
|
|
|
|
* @set_bg:
|
|
|
|
* @state_type:
|
|
|
|
* @area: (allow-none):
|
|
|
|
* @x:
|
|
|
|
* @y:
|
|
|
|
* @width:
|
|
|
|
* @height:
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
|
2008-01-25 09:30:40 +00:00
|
|
|
static GdkPixbuf *
|
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
|
|
|
scale_or_ref (GdkPixbuf *src,
|
2008-01-25 09:30:40 +00:00
|
|
|
gint width,
|
|
|
|
gint height)
|
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
|
|
|
{
|
|
|
|
if (width == gdk_pixbuf_get_width (src) &&
|
|
|
|
height == gdk_pixbuf_get_height (src))
|
|
|
|
{
|
2002-10-09 00:38:22 +00:00
|
|
|
return g_object_ref (src);
|
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
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return gdk_pixbuf_scale_simple (src,
|
|
|
|
width, height,
|
|
|
|
GDK_INTERP_BILINEAR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-16 17:01:18 +00:00
|
|
|
static gboolean
|
|
|
|
lookup_icon_size (GtkStyle *style,
|
|
|
|
GtkWidget *widget,
|
|
|
|
GtkIconSize size,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
GdkScreen *screen;
|
|
|
|
GtkSettings *settings;
|
|
|
|
|
|
|
|
if (widget && gtk_widget_has_screen (widget))
|
|
|
|
{
|
|
|
|
screen = gtk_widget_get_screen (widget);
|
|
|
|
settings = gtk_settings_get_for_screen (screen);
|
|
|
|
}
|
2010-08-28 21:19:18 +00:00
|
|
|
else if (style && style->visual)
|
2010-03-16 17:01:18 +00:00
|
|
|
{
|
2010-08-28 21:19:18 +00:00
|
|
|
screen = gdk_visual_get_screen (style->visual);
|
2010-03-16 17:01:18 +00:00
|
|
|
settings = gtk_settings_get_for_screen (screen);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
settings = gtk_settings_get_default ();
|
|
|
|
GTK_NOTE (MULTIHEAD,
|
|
|
|
g_warning ("Using the default screen for gtk_default_render_icon()"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return gtk_icon_size_lookup_for_settings (settings, size, width, height);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
|
|
|
gint width = 1;
|
|
|
|
gint height = 1;
|
|
|
|
GdkPixbuf *scaled;
|
|
|
|
GdkPixbuf *stated;
|
2001-03-19 22:40:35 +00:00
|
|
|
GdkPixbuf *base_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
|
|
|
|
|
|
|
/* Oddly, style can be NULL in this function, because
|
|
|
|
* GtkIconSet can be used without a style and if so
|
|
|
|
* it uses this function.
|
|
|
|
*/
|
2001-03-19 22:40:35 +00:00
|
|
|
|
|
|
|
base_pixbuf = gtk_icon_source_get_pixbuf (source);
|
|
|
|
|
|
|
|
g_return_val_if_fail (base_pixbuf != NULL, NULL);
|
2002-09-24 21:03:58 +00:00
|
|
|
|
2010-03-16 17:01:18 +00:00
|
|
|
if (size != (GtkIconSize) -1 && !lookup_icon_size(style, widget, size, &width, &height))
|
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
|
|
|
{
|
2002-09-24 21:03:58 +00:00
|
|
|
g_warning (G_STRLOC ": invalid icon size '%d'", 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
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-01-30 00:08:41 +00:00
|
|
|
/* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
|
|
|
|
* leave it alone.
|
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
|
|
|
*/
|
2002-01-30 00:08:41 +00:00
|
|
|
if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source))
|
2001-03-19 22:40:35 +00:00
|
|
|
scaled = scale_or_ref (base_pixbuf, width, height);
|
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
|
|
|
else
|
2002-10-09 00:38:22 +00:00
|
|
|
scaled = g_object_ref (base_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
|
|
|
|
|
|
|
/* If the state was wildcarded, then generate a state. */
|
2001-03-19 22:40:35 +00:00
|
|
|
if (gtk_icon_source_get_state_wildcarded (source))
|
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
|
|
|
{
|
|
|
|
if (state == GTK_STATE_INSENSITIVE)
|
|
|
|
{
|
|
|
|
stated = gdk_pixbuf_copy (scaled);
|
|
|
|
|
|
|
|
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
|
|
|
|
0.8, TRUE);
|
|
|
|
|
2002-10-09 00:38:22 +00:00
|
|
|
g_object_unref (scaled);
|
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
|
|
|
}
|
|
|
|
else if (state == GTK_STATE_PRELIGHT)
|
|
|
|
{
|
|
|
|
stated = gdk_pixbuf_copy (scaled);
|
|
|
|
|
|
|
|
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
|
|
|
|
1.2, FALSE);
|
|
|
|
|
2002-10-09 00:38:22 +00:00
|
|
|
g_object_unref (scaled);
|
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
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
stated = scaled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
stated = scaled;
|
|
|
|
|
|
|
|
return stated;
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cairo_draw_rectangle (cairo_t *cr,
|
|
|
|
GdkColor *color,
|
|
|
|
gboolean filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
gdk_cairo_set_source_color (cr, color);
|
|
|
|
|
|
|
|
if (filled)
|
|
|
|
{
|
|
|
|
cairo_rectangle (cr, x, y, width, height);
|
|
|
|
cairo_fill (cr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cairo_rectangle (cr, x + 0.5, y + 0.5, width, height);
|
|
|
|
cairo_stroke (cr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cairo_draw_point (cairo_t *cr,
|
|
|
|
GdkColor *color,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
gdk_cairo_set_source_color (cr, color);
|
|
|
|
cairo_rectangle (cr, x, y, 1, 1);
|
|
|
|
cairo_fill (cr);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
2010-08-16 13:35:58 +00:00
|
|
|
gtk_default_draw_hline (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 x1,
|
|
|
|
gint x2,
|
|
|
|
gint y)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
gint thickness_light;
|
|
|
|
gint thickness_dark;
|
|
|
|
gint i;
|
|
|
|
|
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
|
|
|
thickness_light = style->ythickness / 2;
|
|
|
|
thickness_dark = style->ythickness - thickness_light;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
1999-01-11 18:49:54 +00:00
|
|
|
if (detail && !strcmp (detail, "label"))
|
|
|
|
{
|
|
|
|
if (state_type == GTK_STATE_INSENSITIVE)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->white, x1 + 1, y + 1, x2 + 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, &style->fg[state_type], x1, y, x2, y);
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (i = 0; i < thickness_dark; i++)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state_type], x1, y + i, x2 - i - 1, y + i);
|
|
|
|
_cairo_draw_line (cr, &style->light[state_type], x2 - i, y + i, x2, y + i);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
|
|
|
y += thickness_dark;
|
|
|
|
for (i = 0; i < thickness_light; i++)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state_type], x1, y + i, x1 + thickness_light - i - 1, y + i);
|
|
|
|
_cairo_draw_line (cr, &style->light[state_type], x1 + thickness_light - i, y + i, x2, y + i);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
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
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
gint thickness_light;
|
|
|
|
gint thickness_dark;
|
|
|
|
gint i;
|
|
|
|
|
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
|
|
|
thickness_light = style->xthickness / 2;
|
|
|
|
thickness_dark = style->xthickness - thickness_light;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
1999-01-11 18:49:54 +00:00
|
|
|
for (i = 0; i < thickness_dark; i++)
|
2003-07-06 13:14:28 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state_type],
|
|
|
|
x + i, y1, x + i, y2 - i - 1);
|
|
|
|
_cairo_draw_line (cr, &style->light[state_type],
|
|
|
|
x + i, y2 - i, x + i, y2);
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
x += thickness_dark;
|
|
|
|
for (i = 0; i < thickness_light; i++)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state_type],
|
|
|
|
x + i, y1, x + i, y1 + thickness_light - i - 1);
|
|
|
|
_cairo_draw_line (cr, &style->light[state_type],
|
|
|
|
x + i, y1 + thickness_light - i, x + i, y2);
|
1999-01-11 18:49:54 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2002-01-31 15:48:58 +00:00
|
|
|
static void
|
2001-05-01 01:36:33 +00:00
|
|
|
draw_thin_shadow (GtkStyle *style,
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_t *cr,
|
2001-05-01 01:36:33 +00:00
|
|
|
GtkStateType state,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
GdkColor *gc1, *gc2;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->light[state];
|
|
|
|
gc2 = &style->dark[state];
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
|
|
|
|
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x + width - 2, y);
|
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x, y + height - 2);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-02-20 23:36:28 +00:00
|
|
|
draw_spinbutton_shadow (GtkStyle *style,
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_t *cr,
|
2002-02-20 23:36:28 +00:00
|
|
|
GtkStateType state,
|
|
|
|
GtkTextDirection direction,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
if (direction == GTK_TEXT_DIR_LTR)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x, y + 1, x + width - 2, y + 1);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + width - 2, y + 2, x + width - 2, y + height - 3);
|
|
|
|
_cairo_draw_line (cr, &style->light[state],
|
|
|
|
x + width - 1, y + 1, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &style->light[state],
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &style->bg[state],
|
|
|
|
x, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x, y + 2, x, y + height - 3);
|
2002-02-20 23:36:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x, y + 1, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + 1, y + 1, x + width - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + 1, y + 2, x + 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + width - 1, y + 2, x + width - 1, y + height - 3);
|
|
|
|
_cairo_draw_line (cr, &style->light[state],
|
|
|
|
x + 1, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &style->bg[state],
|
|
|
|
x + 2, y + height - 2, x + width - 1, y + height - 2);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-06 13:14:28 +00:00
|
|
|
static void
|
|
|
|
draw_menu_shadow (GtkStyle *style,
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_t *cr,
|
2003-07-06 13:14:28 +00:00
|
|
|
GtkStateType state,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
if (style->ythickness > 0)
|
|
|
|
{
|
|
|
|
if (style->ythickness > 1)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x + 1, y + height - 2,
|
|
|
|
x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
2003-07-06 13:14:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x + 1, y + height - 1, x + width - 1, y + height - 1);
|
2003-07-06 13:14:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (style->xthickness > 0)
|
|
|
|
{
|
|
|
|
if (style->xthickness > 1)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x + width - 2, y + 1,
|
|
|
|
x + width - 2, y + height - 2);
|
|
|
|
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
2003-07-06 13:14:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->dark[state],
|
|
|
|
x + width - 1, y + 1, x + width - 1, y + height - 1);
|
2003-07-06 13:14:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Light around top and left */
|
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->black,
|
2003-07-06 13:14:28 +00:00
|
|
|
x, y, x + width - 2, y);
|
|
|
|
if (style->xthickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x, y, x, y + height - 2);
|
2003-07-06 13:14:28 +00:00
|
|
|
|
|
|
|
if (style->ythickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->light[state],
|
|
|
|
x + 1, y + 1, x + width - 3, y + 1);
|
2003-07-06 13:14:28 +00:00
|
|
|
if (style->xthickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->light[state],
|
|
|
|
x + 1, y + 1, x + 1, y + height - 3);
|
2003-07-06 13:14:28 +00:00
|
|
|
}
|
|
|
|
|
2004-07-09 14:40:36 +00:00
|
|
|
static GtkTextDirection
|
|
|
|
get_direction (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkTextDirection dir;
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
dir = gtk_widget_get_direction (widget);
|
|
|
|
else
|
|
|
|
dir = GTK_TEXT_DIR_LTR;
|
|
|
|
|
|
|
|
return dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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-07-14 15:45:26 +00:00
|
|
|
GdkColor *gc1 = NULL;
|
|
|
|
GdkColor *gc2 = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint thickness_light;
|
|
|
|
gint thickness_dark;
|
|
|
|
gint i;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
|
|
|
{
|
2006-08-03 09:49:37 +00:00
|
|
|
if (detail && strcmp (detail, "buttondefault") == 0)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_rectangle (cr, &style->black, FALSE,
|
|
|
|
x, y, width - 1, height - 1);
|
2001-05-01 01:36:33 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (detail && strcmp (detail, "trough") == 0)
|
|
|
|
{
|
2010-08-16 13:48:06 +00:00
|
|
|
draw_thin_shadow (style, cr, state_type,
|
2010-07-14 15:45:26 +00:00
|
|
|
x, y, width, height);
|
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
return;
|
|
|
|
}
|
2006-08-03 09:49:37 +00:00
|
|
|
if (GTK_IS_SPIN_BUTTON (widget) &&
|
2002-02-24 02:24:51 +00:00
|
|
|
detail && strcmp (detail, "spinbutton") == 0)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_spinbutton_shadow (style, cr, state_type,
|
2010-08-16 13:48:06 +00:00
|
|
|
get_direction (widget), x, y, width, height);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
2001-05-01 01:36:33 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2003-07-06 13:14:28 +00:00
|
|
|
|
|
|
|
if (shadow_type == GTK_SHADOW_OUT && detail && strcmp (detail, "menu") == 0)
|
|
|
|
{
|
2010-08-16 13:48:06 +00:00
|
|
|
draw_menu_shadow (style, cr, state_type, x, y, width, height);
|
2003-07-06 13:14:28 +00:00
|
|
|
return;
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
|
|
|
case GTK_SHADOW_NONE:
|
1998-11-06 22:05:02 +00:00
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SHADOW_IN:
|
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->light[state_type];
|
|
|
|
gc2 = &style->dark[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
case GTK_SHADOW_OUT:
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->dark[state_type];
|
|
|
|
gc2 = &style->light[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
|
|
|
switch (shadow_type)
|
|
|
|
{
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SHADOW_NONE:
|
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SHADOW_IN:
|
2001-06-04 23:15:51 +00:00
|
|
|
/* Light around right and bottom edge */
|
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
if (style->ythickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->bg[state_type],
|
|
|
|
x + 1, y + height - 2, x + width - 2, y + height - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->bg[state_type],
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
/* Dark around left and top */
|
|
|
|
|
|
|
|
if (style->ythickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + 1, y + 1, x + width - 2, y + 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x + width - 1, y);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x, y + height - 1);
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SHADOW_OUT:
|
2001-06-04 23:15:51 +00:00
|
|
|
/* Dark around right and bottom edge */
|
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
|
|
|
{
|
|
|
|
if (style->ythickness > 1)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + 1, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + 1, y + height - 1, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (style->xthickness > 0)
|
|
|
|
{
|
|
|
|
if (style->xthickness > 1)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->black,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + width - 1, y + 1, x + width - 1, y + height - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2001-06-04 23:15:51 +00:00
|
|
|
/* Light around top and left */
|
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x + width - 2, y);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 0)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x, y, x, y + height - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
if (style->ythickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->bg[state_type],
|
|
|
|
x + 1, y + 1, x + width - 3, y + 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 1)
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &style->bg[state_type],
|
|
|
|
x + 1, y + 1, x + 1, y + height - 3);
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->xthickness > 0)
|
|
|
|
{
|
|
|
|
if (style->xthickness > 1)
|
|
|
|
{
|
|
|
|
thickness_light = 1;
|
|
|
|
thickness_dark = 1;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2001-06-04 23:15:51 +00:00
|
|
|
for (i = 0; i < thickness_dark; i++)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + width - i - 1,
|
|
|
|
y + i,
|
|
|
|
x + width - i - 1,
|
|
|
|
y + height - i - 1);
|
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x + i,
|
|
|
|
y + i,
|
|
|
|
x + i,
|
|
|
|
y + height - i - 2);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < thickness_light; i++)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + thickness_dark + i,
|
|
|
|
y + thickness_dark + i,
|
|
|
|
x + thickness_dark + i,
|
|
|
|
y + height - thickness_dark - i - 1);
|
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x + width - thickness_light - i - 1,
|
|
|
|
y + thickness_dark + i,
|
|
|
|
x + width - thickness_light - i - 1,
|
|
|
|
y + height - thickness_light - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, y, x, y + height);
|
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x + width, y, x + width, y + height);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (style->ythickness > 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2001-06-04 23:15:51 +00:00
|
|
|
if (style->ythickness > 1)
|
|
|
|
{
|
|
|
|
thickness_light = 1;
|
|
|
|
thickness_dark = 1;
|
|
|
|
|
|
|
|
for (i = 0; i < thickness_dark; i++)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + i,
|
|
|
|
y + height - i - 1,
|
|
|
|
x + width - i - 1,
|
|
|
|
y + height - i - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x + i,
|
|
|
|
y + i,
|
|
|
|
x + width - i - 2,
|
|
|
|
y + i);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2001-06-04 23:15:51 +00:00
|
|
|
for (i = 0; i < thickness_light; i++)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc1,
|
|
|
|
x + thickness_dark + i,
|
|
|
|
y + thickness_dark + i,
|
|
|
|
x + width - thickness_dark - i - 2,
|
|
|
|
y + thickness_dark + i);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, gc2,
|
|
|
|
x + thickness_dark + i,
|
|
|
|
y + height - thickness_light - i - 1,
|
|
|
|
x + width - thickness_light - 1,
|
|
|
|
y + height - thickness_light - i - 1);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, y, x + width, y);
|
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, y + height, x + width, y + height);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2001-06-04 23:15:51 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
if (shadow_type == GTK_SHADOW_IN &&
|
2006-08-03 09:49:37 +00:00
|
|
|
GTK_IS_SPIN_BUTTON (widget) &&
|
2002-02-20 23:36:28 +00:00
|
|
|
detail && strcmp (detail, "entry") == 0)
|
|
|
|
{
|
2004-07-09 14:40:36 +00:00
|
|
|
if (get_direction (widget) == GTK_TEXT_DIR_LTR)
|
2002-02-20 23:36:28 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->base[state_type],
|
|
|
|
x + width - 1, y + 2,
|
|
|
|
x + width - 1, y + height - 3);
|
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->base[state_type],
|
|
|
|
x + width - 2, y + 2,
|
|
|
|
x + width - 2, y + height - 3);
|
|
|
|
/* draw point */
|
|
|
|
_cairo_draw_point (cr,
|
|
|
|
&style->black,
|
|
|
|
x + width - 1, y + 1);
|
|
|
|
_cairo_draw_point (cr,
|
|
|
|
&style->bg[state_type],
|
|
|
|
x + width - 1, y + height - 2);
|
2002-02-20 23:36:28 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->base[state_type],
|
|
|
|
x, y + 2,
|
|
|
|
x, y + height - 3);
|
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->base[state_type],
|
|
|
|
x + 1, y + 2,
|
|
|
|
x + 1, y + height - 3);
|
|
|
|
|
|
|
|
_cairo_draw_point (cr,
|
|
|
|
&style->black,
|
|
|
|
x, y + 1);
|
|
|
|
|
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->bg[state_type],
|
|
|
|
x, y + height - 2,
|
|
|
|
x + 1, y + height - 2);
|
|
|
|
_cairo_draw_point (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
x, y + height - 1);
|
2002-02-20 23:36:28 +00:00
|
|
|
}
|
|
|
|
}
|
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
|
2002-02-26 23:50:14 +00:00
|
|
|
calculate_arrow_geometry (GtkArrowType arrow_type,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
gint w = *width;
|
|
|
|
gint h = *height;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
switch (arrow_type)
|
1999-01-11 18:49:54 +00:00
|
|
|
{
|
2002-02-26 23:50:14 +00:00
|
|
|
case GTK_ARROW_UP:
|
|
|
|
case GTK_ARROW_DOWN:
|
|
|
|
w += (w % 2) - 1;
|
|
|
|
h = (w / 2 + 1);
|
|
|
|
|
|
|
|
if (h > *height)
|
|
|
|
{
|
|
|
|
h = *height;
|
|
|
|
w = 2 * h - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (arrow_type == GTK_ARROW_DOWN)
|
|
|
|
{
|
|
|
|
if (*height % 2 == 1 || h % 2 == 0)
|
|
|
|
*height += 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*height % 2 == 0 || h % 2 == 0)
|
|
|
|
*height -= 1;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
case GTK_ARROW_RIGHT:
|
|
|
|
case GTK_ARROW_LEFT:
|
|
|
|
h += (h % 2) - 1;
|
|
|
|
w = (h / 2 + 1);
|
|
|
|
|
|
|
|
if (w > *width)
|
|
|
|
{
|
|
|
|
w = *width;
|
|
|
|
h = 2 * w - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (arrow_type == GTK_ARROW_RIGHT)
|
|
|
|
{
|
|
|
|
if (*width % 2 == 1 || w % 2 == 0)
|
|
|
|
*width += 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*width % 2 == 0 || w % 2 == 0)
|
|
|
|
*width -= 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* should not be reached */
|
|
|
|
break;
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
*x += (*width - w) / 2;
|
|
|
|
*y += (*height - h) / 2;
|
|
|
|
*height = h;
|
|
|
|
*width = w;
|
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)
|
|
|
|
{
|
2002-02-26 23:50:14 +00:00
|
|
|
calculate_arrow_geometry (arrow_type, &x, &y, &width, &height);
|
2002-11-08 21:55:43 +00:00
|
|
|
|
2003-07-06 13:14:28 +00:00
|
|
|
if (detail && strcmp (detail, "menu_scroll_arrow_up") == 0)
|
|
|
|
y++;
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
if (state == GTK_STATE_INSENSITIVE)
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->white, arrow_type,
|
2002-02-26 23:50:14 +00:00
|
|
|
x + 1, y + 1, width, height);
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_arrow (cr, &style->fg[state], arrow_type,
|
2002-02-26 23:50:14 +00:00
|
|
|
x, y, width, height);
|
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;
|
|
|
|
}
|
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
static gboolean
|
|
|
|
background_is_solid (GtkStyle *style,
|
|
|
|
GtkStateType type)
|
|
|
|
{
|
|
|
|
if (style->background[type] == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return cairo_pattern_get_type (style->background[type]) == CAIRO_PATTERN_TYPE_SOLID;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
gboolean is_spinbutton_box = FALSE;
|
|
|
|
|
2006-08-03 09:49:37 +00:00
|
|
|
if (GTK_IS_SPIN_BUTTON (widget) && detail)
|
2002-02-20 23:36:28 +00:00
|
|
|
{
|
|
|
|
if (strcmp (detail, "spinbutton_up") == 0)
|
|
|
|
{
|
|
|
|
y += 2;
|
|
|
|
width -= 3;
|
|
|
|
height -= 2;
|
|
|
|
|
2004-07-09 14:40:36 +00:00
|
|
|
if (get_direction (widget) == GTK_TEXT_DIR_RTL)
|
2002-02-20 23:36:28 +00:00
|
|
|
x += 2;
|
|
|
|
else
|
|
|
|
x += 1;
|
|
|
|
|
|
|
|
is_spinbutton_box = TRUE;
|
|
|
|
}
|
|
|
|
else if (strcmp (detail, "spinbutton_down") == 0)
|
|
|
|
{
|
|
|
|
width -= 3;
|
|
|
|
height -= 2;
|
|
|
|
|
2004-07-09 14:40:36 +00:00
|
|
|
if (get_direction (widget) == GTK_TEXT_DIR_RTL)
|
2002-02-20 23:36:28 +00:00
|
|
|
x += 2;
|
|
|
|
else
|
|
|
|
x += 1;
|
|
|
|
|
|
|
|
is_spinbutton_box = TRUE;
|
|
|
|
}
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
if (background_is_solid (style, state_type))
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
GdkColor *gc = &style->bg[state_type];
|
|
|
|
|
2005-01-18 16:01:19 +00:00
|
|
|
if (state_type == GTK_STATE_SELECTED && detail && strcmp (detail, "paned") == 0)
|
2004-02-19 23:20:07 +00:00
|
|
|
{
|
2010-03-01 03:21:41 +00:00
|
|
|
if (widget && !gtk_widget_has_focus (widget))
|
2010-07-14 15:45:26 +00:00
|
|
|
gc = &style->base[GTK_STATE_ACTIVE];
|
2004-02-19 23:20:07 +00:00
|
|
|
}
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_rectangle (cr, gc, TRUE,
|
|
|
|
x, y, width, height);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
else
|
2010-08-16 13:48:06 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
|
2010-08-16 19:36:49 +00:00
|
|
|
state_type, x, y, width, height);
|
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
if (is_spinbutton_box)
|
|
|
|
{
|
2010-07-22 00:55:12 +00:00
|
|
|
GdkColor *upper;
|
|
|
|
GdkColor *lower;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-07-22 00:55:12 +00:00
|
|
|
lower = &style->dark[state_type];
|
2002-02-20 23:36:28 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_OUT)
|
2010-07-22 00:55:12 +00:00
|
|
|
upper = &style->light[state_type];
|
2002-02-20 23:36:28 +00:00
|
|
|
else
|
2010-07-22 00:55:12 +00:00
|
|
|
upper = &style->dark[state_type];
|
2002-02-20 23:36:28 +00:00
|
|
|
|
2010-07-22 00:55:12 +00:00
|
|
|
_cairo_draw_line (cr, upper, x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, lower, x, y + height - 1, x + width - 1, y + height - 1);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_shadow (style, cr, state_type, shadow_type, widget, detail,
|
2010-08-16 13:48:06 +00:00
|
|
|
x, y, width, height);
|
2001-05-01 01:36:33 +00:00
|
|
|
|
|
|
|
if (detail && strcmp (detail, "optionmenu") == 0)
|
|
|
|
{
|
|
|
|
GtkRequisition indicator_size;
|
|
|
|
GtkBorder indicator_spacing;
|
2002-11-02 00:18:14 +00:00
|
|
|
gint vline_x;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
|
|
|
option_menu_get_props (widget, &indicator_size, &indicator_spacing);
|
|
|
|
|
2004-07-09 14:40:36 +00:00
|
|
|
if (get_direction (widget) == GTK_TEXT_DIR_RTL)
|
2002-11-02 00:18:14 +00:00
|
|
|
vline_x = x + indicator_size.width + indicator_spacing.left + indicator_spacing.right;
|
|
|
|
else
|
|
|
|
vline_x = x + width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - style->xthickness;
|
|
|
|
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_vline (style, cr, state_type, widget,
|
2010-08-16 13:48:06 +00:00
|
|
|
detail,
|
|
|
|
y + style->ythickness + 1,
|
|
|
|
y + height - style->ythickness - 3,
|
|
|
|
vline_x);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
static GdkColor *
|
|
|
|
get_darkened (const GdkColor *color,
|
2008-01-25 09:30:40 +00:00
|
|
|
gint darken_count)
|
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
|
|
|
{
|
|
|
|
GdkColor src = *color;
|
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
|
|
|
GdkColor shaded = *color;
|
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
|
|
|
|
|
|
|
while (darken_count)
|
|
|
|
{
|
2005-11-23 10:33:58 +00:00
|
|
|
_gtk_style_shade (&src, &shaded, 0.93);
|
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
|
|
|
src = shaded;
|
|
|
|
--darken_count;
|
|
|
|
}
|
2002-09-11 10:40:57 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
return gdk_color_copy (&shaded);
|
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
|
|
|
}
|
|
|
|
|
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-07-14 15:45:26 +00:00
|
|
|
GdkColor *gc1;
|
|
|
|
GdkColor *freeme = NULL;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-16 19:36:49 +00:00
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
1999-01-15 18:41:43 +00:00
|
|
|
if (detail)
|
|
|
|
{
|
2010-09-13 15:13:21 +00:00
|
|
|
int trimmed_len = strlen (detail);
|
|
|
|
|
|
|
|
if (g_str_has_prefix (detail, "cell_"))
|
|
|
|
{
|
|
|
|
if (g_str_has_suffix (detail, "_start"))
|
|
|
|
trimmed_len -= 6;
|
|
|
|
else if (g_str_has_suffix (detail, "_middle"))
|
|
|
|
trimmed_len -= 7;
|
|
|
|
else if (g_str_has_suffix (detail, "_end"))
|
|
|
|
trimmed_len -= 4;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
if (state_type == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
if (!strcmp ("text", detail))
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->bg[GTK_STATE_SELECTED];
|
2010-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_even", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_odd", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_even_ruled", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_even_ruled_sorted", detail, trimmed_len))
|
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
|
|
|
{
|
2001-08-29 21:30:20 +00:00
|
|
|
/* This has to be really broken; alex made me do it. -jrb */
|
2010-03-01 03:21:41 +00:00
|
|
|
if (widget && gtk_widget_has_focus (widget))
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->base[state_type];
|
2006-01-31 15:58:23 +00:00
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->base[GTK_STATE_ACTIVE];
|
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-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_odd_ruled", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_odd_ruled_sorted", detail, trimmed_len))
|
2006-01-31 15:58:23 +00:00
|
|
|
{
|
2010-03-01 03:21:41 +00:00
|
|
|
if (widget && gtk_widget_has_focus (widget))
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (&style->base[state_type], 1);
|
2006-01-31 15:58:23 +00:00
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (&style->base[GTK_STATE_ACTIVE], 1);
|
2006-01-31 15:58:23 +00:00
|
|
|
gc1 = freeme;
|
|
|
|
}
|
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
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->bg[state_type];
|
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
|
|
|
}
|
|
|
|
}
|
1999-01-15 18:41:43 +00:00
|
|
|
else
|
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
|
|
|
{
|
|
|
|
if (!strcmp ("viewportbin", detail))
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->bg[GTK_STATE_NORMAL];
|
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
|
|
|
else if (!strcmp ("entry_bg", detail))
|
2010-09-03 15:09:00 +00:00
|
|
|
gc1 = &style->base[gtk_widget_get_state (widget)];
|
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
|
|
|
|
|
|
|
/* For trees: even rows are base color, odd rows are a shade of
|
|
|
|
* the base color, the sort column is a shade of the original color
|
|
|
|
* for that row.
|
|
|
|
*/
|
|
|
|
|
2010-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_even", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_odd", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_even_ruled", detail, trimmed_len))
|
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
|
|
|
{
|
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
|
|
|
GdkColor *color = NULL;
|
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"even-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 0);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
|
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->base[state_type];
|
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-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_odd_ruled", detail, trimmed_len))
|
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
|
|
|
{
|
2006-08-06 02:33:15 +00:00
|
|
|
GdkColor *color = NULL;
|
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
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"odd-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 0);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
|
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"even-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 1);
|
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
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (&style->base[state_type], 1);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
}
|
|
|
|
}
|
2010-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_even_sorted", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_odd_sorted", detail, trimmed_len) ||
|
|
|
|
!strncmp ("cell_even_ruled_sorted", detail, trimmed_len))
|
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
|
|
|
{
|
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
|
|
|
GdkColor *color = NULL;
|
|
|
|
|
2010-09-13 15:13:21 +00:00
|
|
|
if (!strncmp ("cell_odd_sorted", detail, trimmed_len))
|
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
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"odd-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
else
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"even-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 1);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
|
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (&style->base[state_type], 1);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
}
|
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-09-13 15:13:21 +00:00
|
|
|
else if (!strncmp ("cell_odd_ruled_sorted", detail, trimmed_len))
|
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
|
|
|
{
|
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
|
|
|
GdkColor *color = NULL;
|
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"odd-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 1);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
|
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_style_get (widget,
|
2005-03-26 05:49:15 +00:00
|
|
|
"even-row-color", &color,
|
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
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (color, 2);
|
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
|
|
|
gdk_color_free (color);
|
|
|
|
}
|
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
freeme = get_darkened (&style->base[state_type], 2);
|
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
|
|
|
gc1 = freeme;
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->bg[state_type];
|
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
|
|
|
}
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
1998-11-06 22:05:02 +00:00
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
gc1 = &style->bg[state_type];
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-15 12:36:05 +00:00
|
|
|
if (background_is_solid (style, state_type) || gc1 != &style->bg[state_type])
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_rectangle (cr, gc1, TRUE,
|
|
|
|
x, y, width, height);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
|
|
|
if (detail && !strcmp ("tooltip", detail))
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_rectangle (cr, &style->black, FALSE,
|
|
|
|
x, y, width - 1, height - 1);
|
1998-11-06 22:05:02 +00:00
|
|
|
}
|
|
|
|
else
|
2010-08-16 19:50:08 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
|
2010-08-16 19:36:49 +00:00
|
|
|
state_type, x, y, width, 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
|
|
|
|
|
|
|
if (freeme)
|
2010-07-14 15:45:26 +00:00
|
|
|
gdk_color_free (freeme);
|
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
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
enum { BUTTON, MENU, CELL } type = BUTTON;
|
|
|
|
int exterior_size;
|
|
|
|
int interior_size;
|
|
|
|
int pad;
|
|
|
|
|
|
|
|
if (detail)
|
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
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
if (strcmp (detail, "cellcheck") == 0)
|
|
|
|
type = CELL;
|
|
|
|
else if (strcmp (detail, "check") == 0)
|
|
|
|
type = MENU;
|
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
|
|
|
}
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
exterior_size = MIN (width, height);
|
|
|
|
if (exterior_size % 2 == 0) /* Ensure odd */
|
2007-07-27 12:11:07 +00:00
|
|
|
exterior_size -= 1;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
pad = style->xthickness + MAX (1, (exterior_size - 2 * style->xthickness) / 9);
|
|
|
|
interior_size = MAX (1, exterior_size - 2 * pad);
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
if (interior_size < 7)
|
|
|
|
{
|
|
|
|
interior_size = 7;
|
|
|
|
pad = MAX (0, (exterior_size - interior_size) / 2);
|
|
|
|
}
|
2002-02-20 22:09:25 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
x -= (1 + exterior_size - width) / 2;
|
|
|
|
y -= (1 + exterior_size - height) / 2;
|
2001-05-01 01:36:33 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BUTTON:
|
|
|
|
case CELL:
|
|
|
|
if (type == BUTTON)
|
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
else
|
|
|
|
gdk_cairo_set_source_color (cr, &style->text[state_type]);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, &style->base[state_type]);
|
|
|
|
cairo_rectangle (cr, x + 1, y + 1, exterior_size - 2, exterior_size - 2);
|
|
|
|
cairo_fill (cr);
|
|
|
|
break;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
case MENU:
|
|
|
|
break;
|
2002-11-13 12:58:43 +00:00
|
|
|
}
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BUTTON:
|
|
|
|
case CELL:
|
|
|
|
gdk_cairo_set_source_color (cr, &style->text[state_type]);
|
|
|
|
break;
|
|
|
|
case MENU:
|
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
|
|
|
{
|
|
|
|
cairo_translate (cr,
|
|
|
|
x + pad, y + pad);
|
|
|
|
|
|
|
|
cairo_scale (cr, interior_size / 7., interior_size / 7.);
|
|
|
|
|
|
|
|
cairo_move_to (cr, 7.0, 0.0);
|
|
|
|
cairo_line_to (cr, 7.5, 1.0);
|
|
|
|
cairo_curve_to (cr, 5.3, 2.0,
|
|
|
|
4.3, 4.0,
|
|
|
|
3.5, 7.0);
|
|
|
|
cairo_curve_to (cr, 3.0, 5.7,
|
|
|
|
1.3, 4.7,
|
|
|
|
0.0, 4.7);
|
|
|
|
cairo_line_to (cr, 0.2, 3.5);
|
|
|
|
cairo_curve_to (cr, 1.1, 3.5,
|
|
|
|
2.3, 4.3,
|
|
|
|
3.0, 5.0);
|
|
|
|
cairo_curve_to (cr, 1.0, 3.9,
|
|
|
|
2.4, 4.1,
|
|
|
|
3.2, 4.9);
|
|
|
|
cairo_curve_to (cr, 3.5, 3.1,
|
|
|
|
5.2, 2.0,
|
|
|
|
7.0, 0.0);
|
|
|
|
|
|
|
|
cairo_fill (cr);
|
|
|
|
}
|
|
|
|
else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */
|
|
|
|
{
|
|
|
|
int line_thickness = MAX (1, (3 + interior_size * 2) / 7);
|
|
|
|
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
x + pad,
|
|
|
|
y + pad + (1 + interior_size - line_thickness) / 2,
|
|
|
|
interior_size,
|
|
|
|
line_thickness);
|
|
|
|
cairo_fill (cr);
|
|
|
|
}
|
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
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
enum { BUTTON, MENU, CELL } type = BUTTON;
|
|
|
|
int exterior_size;
|
|
|
|
|
|
|
|
if (detail)
|
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
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
if (strcmp (detail, "radio") == 0)
|
|
|
|
type = CELL;
|
|
|
|
else if (strcmp (detail, "option") == 0)
|
|
|
|
type = MENU;
|
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
|
|
|
}
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
|
|
exterior_size = MIN (width, height);
|
|
|
|
if (exterior_size % 2 == 0) /* Ensure odd */
|
2007-07-27 12:11:07 +00:00
|
|
|
exterior_size -= 1;
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
|
|
x -= (1 + exterior_size - width) / 2;
|
|
|
|
y -= (1 + exterior_size - height) / 2;
|
|
|
|
|
|
|
|
switch (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
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
case BUTTON:
|
|
|
|
case CELL:
|
|
|
|
gdk_cairo_set_source_color (cr, &style->base[state_type]);
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_arc (cr,
|
|
|
|
x + exterior_size / 2.,
|
|
|
|
y + exterior_size / 2.,
|
|
|
|
(exterior_size - 1) / 2.,
|
2005-04-03 21:03:08 +00:00
|
|
|
0, 2 * G_PI);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
Add a draw-border style property to allow themes to draw outside the
2005-04-28 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Add a draw-border style property to allow
themes to draw outside the widget's allocation.
* gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs
that were working around the clip-leakage bug in Cairo.
* gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than
save/fill/restore.
* gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context()
That updates a Cairo context to match a GC.
* gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support
for tiles/stipples/clipping to gdk_draw_glyphs(),
gdk_draw_trapezoids().
* gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal
implementation of stipples. Use one cairo_t across the entire
drawing operation. Replace cairo_matrix_create() with
stack-allocated matrices.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c: Save various aspects of the
GC state (fill, tile, stipple, foreground, background, clip region)
in instance-private-data for future use. Add getters.
Get rid of _gdk_windowing_gc_get_foreground() function implemented
by the backends.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add
_gdk_gc_init() to do initial setup of the GC from values;
fixes some problems from drawable redirection.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move
gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into
the generic code, add _gdk_windowing_gc_copy(),
_gdk_windowing_gc_set_clip_region() to do backend specific
stuff.
* gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}:
Don't duplicate state that now is stored by the generic code.
* gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
|
|
|
cairo_fill_preserve (cr);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
|
|
if (type == BUTTON)
|
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
else
|
|
|
|
gdk_cairo_set_source_color (cr, &style->text[state_type]);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, 1.);
|
|
|
|
cairo_stroke (cr);
|
|
|
|
break;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
case MENU:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BUTTON:
|
|
|
|
gdk_cairo_set_source_color (cr, &style->text[state_type]);
|
|
|
|
break;
|
|
|
|
case CELL:
|
|
|
|
break;
|
|
|
|
case MENU:
|
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
break;
|
|
|
|
}
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
if (shadow_type == GTK_SHADOW_IN)
|
|
|
|
{
|
|
|
|
int pad = style->xthickness + MAX (1, 2 * (exterior_size - 2 * style->xthickness) / 9);
|
|
|
|
int interior_size = MAX (1, exterior_size - 2 * pad);
|
|
|
|
|
|
|
|
if (interior_size < 5)
|
2001-05-01 01:36:33 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
interior_size = 7;
|
|
|
|
pad = MAX (0, (exterior_size - interior_size) / 2);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2002-02-20 22:09:25 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_arc (cr,
|
|
|
|
x + pad + interior_size / 2.,
|
|
|
|
y + pad + interior_size / 2.,
|
|
|
|
interior_size / 2.,
|
2005-04-03 21:03:08 +00:00
|
|
|
0, 2 * G_PI);
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_fill (cr);
|
|
|
|
}
|
|
|
|
else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */
|
|
|
|
{
|
|
|
|
int pad = style->xthickness + MAX (1, (exterior_size - 2 * style->xthickness) / 9);
|
|
|
|
int interior_size = MAX (1, exterior_size - 2 * pad);
|
|
|
|
int line_thickness;
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
if (interior_size < 7)
|
2002-11-13 12:58:43 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
interior_size = 7;
|
|
|
|
pad = MAX (0, (exterior_size - interior_size) / 2);
|
2001-05-01 01:36:33 +00:00
|
|
|
}
|
2002-11-13 12:58:43 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
line_thickness = MAX (1, (3 + interior_size * 2) / 7);
|
|
|
|
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
x + pad,
|
|
|
|
y + pad + (interior_size - line_thickness) / 2.,
|
|
|
|
interior_size,
|
|
|
|
line_thickness);
|
|
|
|
cairo_fill (cr);
|
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
|
|
|
}
|
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-07-14 22:55:26 +00:00
|
|
|
GdkColor *color1 = NULL;
|
|
|
|
GdkColor *color2 = NULL;
|
|
|
|
GdkColor *color3 = NULL;
|
|
|
|
GdkColor *color4 = NULL;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_NONE:
|
2010-07-14 22:55:26 +00:00
|
|
|
default:
|
1998-11-06 22:05:02 +00:00
|
|
|
return;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_IN:
|
2010-07-14 22:55:26 +00:00
|
|
|
color1 = &style->dark[state_type];
|
|
|
|
color2 = &style->black;
|
|
|
|
color3 = &style->bg[state_type];
|
|
|
|
color4 = &style->light[state_type];
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
2010-07-14 22:55:26 +00:00
|
|
|
color1 = &style->dark[state_type];
|
|
|
|
color2 = &style->light[state_type];
|
|
|
|
color3 = &style->dark[state_type];
|
|
|
|
color4 = &style->light[state_type];
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_OUT:
|
2010-07-14 22:55:26 +00:00
|
|
|
color1 = &style->light[state_type];
|
|
|
|
color2 = &style->bg[state_type];
|
|
|
|
color3 = &style->dark[state_type];
|
|
|
|
color4 = &style->black;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2010-07-14 22:55:26 +00:00
|
|
|
color1 = &style->light[state_type];
|
|
|
|
color2 = &style->dark[state_type];
|
|
|
|
color3 = &style->light[state_type];
|
|
|
|
color4 = &style->dark[state_type];
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-07-14 22:55:26 +00:00
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
|
|
|
case GTK_SHADOW_NONE:
|
|
|
|
case GTK_SHADOW_IN:
|
|
|
|
case GTK_SHADOW_OUT:
|
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
|
|
|
switch (gap_side)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
|
|
|
case GTK_POS_TOP:
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + 1, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 2, y, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x + gap_x - 1, y);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + gap_x - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + gap_x, y, x + gap_x, y);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x + gap_x + gap_width, y, x + width - 2, y);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + gap_x + gap_width, y + 1, x + width - 3, y + 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_BOTTOM:
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + width - 2, y + 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x, y + height - 1, x + gap_x - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + gap_x, y + height - 1, x + gap_x, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_LEFT:
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x, y + 1, x + width - 2, y + 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + 1, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x, y + gap_x, x, y + gap_x);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y + gap_x + gap_width, x, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_RIGHT:
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + width - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + 1, y + height - 2, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 1, y + gap_x, x + width - 1, y + gap_x);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 22:55:26 +00:00
|
|
|
_cairo_draw_line (cr, color4,
|
|
|
|
x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, color3,
|
|
|
|
x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
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-07-14 15:45:26 +00:00
|
|
|
GdkColor color1;
|
|
|
|
GdkColor color2;
|
|
|
|
GdkColor color3;
|
|
|
|
GdkColor color4;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-08-16 20:15:43 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
|
2010-08-16 19:36:49 +00:00
|
|
|
state_type, x, y, width, height);
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_NONE:
|
1998-11-06 22:05:02 +00:00
|
|
|
return;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_IN:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->dark[state_type];
|
|
|
|
color2 = style->black;
|
|
|
|
color3 = style->bg[state_type];
|
|
|
|
color4 = style->light[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->dark[state_type];
|
|
|
|
color2 = style->light[state_type];
|
|
|
|
color3 = style->dark[state_type];
|
|
|
|
color4 = style->light[state_type];
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_OUT:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->light[state_type];
|
|
|
|
color2 = style->bg[state_type];
|
|
|
|
color3 = style->dark[state_type];
|
|
|
|
color4 = style->black;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->light[state_type];
|
|
|
|
color2 = style->dark[state_type];
|
|
|
|
color3 = style->light[state_type];
|
|
|
|
color4 = style->dark[state_type];
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
|
|
|
case GTK_SHADOW_NONE:
|
|
|
|
case GTK_SHADOW_IN:
|
|
|
|
case GTK_SHADOW_OUT:
|
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
1998-11-11 23:40:17 +00:00
|
|
|
switch (gap_side)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
|
|
|
case GTK_POS_TOP:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + 1, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x + gap_x - 1, y);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + gap_x - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + gap_x, y, x + gap_x, y);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x + gap_x + gap_width, y, x + width - 2, y);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + gap_x + gap_width, y + 1, x + width - 2, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_BOTTOM:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + width - 2, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x, y + height - 1, x + gap_x - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + gap_x, y + height - 1, x + gap_x, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
if ((width - (gap_x + gap_width)) > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_LEFT:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x, y + 1, x + width - 2, y + 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + 1, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x, y + gap_x, x, y + gap_x);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
2006-07-24 02:02:14 +00:00
|
|
|
if ((height - (gap_x + gap_width)) > 0)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y + gap_x + gap_width, x, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_POS_RIGHT:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + width - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + 1, y + height - 2, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x, y + height - 1, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
if (gap_x > 0)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 1, y + gap_x, x + width - 1, y + gap_x);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
2006-07-24 02:02:14 +00:00
|
|
|
if ((height - (gap_x + gap_width)) > 0)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
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_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-16 20:19:56 +00:00
|
|
|
GdkWindow *window = gtk_widget_get_window (widget);
|
2010-07-14 15:45:26 +00:00
|
|
|
GdkColor color1;
|
|
|
|
GdkColor color2;
|
|
|
|
GdkColor color3;
|
|
|
|
GdkColor color4;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
switch (gap_side)
|
|
|
|
{
|
|
|
|
case GTK_POS_TOP:
|
2010-08-16 19:36:49 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, window,
|
|
|
|
state_type,
|
2010-07-14 15:45:26 +00:00
|
|
|
x + 1,
|
|
|
|
y,
|
|
|
|
width - 2,
|
|
|
|
height - 1);
|
|
|
|
break;
|
|
|
|
case GTK_POS_BOTTOM:
|
2010-08-16 19:36:49 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, window,
|
|
|
|
state_type,
|
2010-07-14 15:45:26 +00:00
|
|
|
x + 1,
|
|
|
|
y + 1,
|
|
|
|
width - 2,
|
|
|
|
height - 1);
|
|
|
|
break;
|
|
|
|
case GTK_POS_LEFT:
|
2010-08-16 19:36:49 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, window,
|
|
|
|
state_type,
|
2010-07-14 15:45:26 +00:00
|
|
|
x,
|
|
|
|
y + 1,
|
|
|
|
width - 1,
|
|
|
|
height - 2);
|
|
|
|
break;
|
|
|
|
case GTK_POS_RIGHT:
|
2010-08-16 19:36:49 +00:00
|
|
|
gtk_style_apply_default_background (style, cr, window,
|
|
|
|
state_type,
|
2010-07-14 15:45:26 +00:00
|
|
|
x + 1,
|
|
|
|
y + 1,
|
|
|
|
width - 1,
|
|
|
|
height - 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
switch (shadow_type)
|
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_NONE:
|
1998-11-06 22:05:02 +00:00
|
|
|
return;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_IN:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->dark[state_type];
|
|
|
|
color2 = style->black;
|
|
|
|
color3 = style->bg[state_type];
|
|
|
|
color4 = style->light[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->dark[state_type];
|
|
|
|
color2 = style->light[state_type];
|
|
|
|
color3 = style->dark[state_type];
|
|
|
|
color4 = style->light[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_OUT:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->light[state_type];
|
|
|
|
color2 = style->bg[state_type];
|
|
|
|
color3 = style->dark[state_type];
|
|
|
|
color4 = style->black;
|
1998-11-06 22:05:02 +00:00
|
|
|
break;
|
1999-01-11 18:49:54 +00:00
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
2010-07-14 15:45:26 +00:00
|
|
|
color1 = style->light[state_type];
|
|
|
|
color2 = style->dark[state_type];
|
|
|
|
color3 = style->light[state_type];
|
|
|
|
color4 = style->dark[state_type];
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_set_line_width (cr, 1.0);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
1999-01-11 18:49:54 +00:00
|
|
|
switch (shadow_type)
|
1998-11-06 22:05:02 +00:00
|
|
|
{
|
|
|
|
case GTK_SHADOW_NONE:
|
|
|
|
case GTK_SHADOW_IN:
|
|
|
|
case GTK_SHADOW_OUT:
|
|
|
|
case GTK_SHADOW_ETCHED_IN:
|
|
|
|
case GTK_SHADOW_ETCHED_OUT:
|
|
|
|
switch (gap_side)
|
1999-01-15 18:41:43 +00:00
|
|
|
{
|
|
|
|
case GTK_POS_TOP:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + 2, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + 1, y + height - 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y, x + width - 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
break;
|
|
|
|
case GTK_POS_BOTTOM:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x + 1, y, x + width - 2, y);
|
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y + 1, x, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + width - 2, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + 2, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y + 1, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
break;
|
|
|
|
case GTK_POS_LEFT:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y, x + width - 2, y);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + width - 2, y + 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x, y + height - 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + width - 2, y + 2, x + width - 2, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x, y + height - 1, x + width - 2, y + height - 1);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + width - 1, y + 1, x + width - 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
break;
|
|
|
|
case GTK_POS_RIGHT:
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x + 1, y, x + width - 1, y);
|
|
|
|
_cairo_draw_line (cr, &color1,
|
|
|
|
x, y + 1, x, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + width - 1, y + 1);
|
|
|
|
_cairo_draw_line (cr, &color2,
|
|
|
|
x + 1, y + 1, x + 1, y + height - 2);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr, &color3,
|
|
|
|
x + 2, y + height - 2, x + width - 1, y + height - 2);
|
|
|
|
_cairo_draw_line (cr, &color4,
|
|
|
|
x + 1, y + height - 1, x + width - 1, y + height - 1);
|
1999-01-15 18:41:43 +00:00
|
|
|
break;
|
|
|
|
}
|
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_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
|
|
|
{
|
2002-01-03 00:30:39 +00:00
|
|
|
gboolean free_dash_list = FALSE;
|
2001-12-04 03:27:30 +00:00
|
|
|
gint line_width = 1;
|
2007-11-14 09:45:14 +00:00
|
|
|
gint8 *dash_list = (gint8 *) "\1\1";
|
2001-12-04 03:27:30 +00:00
|
|
|
|
|
|
|
if (widget)
|
2002-01-03 00:30:39 +00:00
|
|
|
{
|
|
|
|
gtk_widget_style_get (widget,
|
|
|
|
"focus-line-width", &line_width,
|
|
|
|
"focus-line-pattern", (gchar *)&dash_list,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
free_dash_list = TRUE;
|
|
|
|
}
|
|
|
|
|
1999-01-11 18:49:54 +00:00
|
|
|
if (detail && !strcmp (detail, "add-mode"))
|
2002-01-03 00:30:39 +00:00
|
|
|
{
|
|
|
|
if (free_dash_list)
|
|
|
|
g_free (dash_list);
|
2007-11-14 09:45:14 +00:00
|
|
|
|
|
|
|
dash_list = (gint8 *) "\4\4";
|
2002-01-03 00:30:39 +00:00
|
|
|
free_dash_list = FALSE;
|
|
|
|
}
|
2001-12-04 03:27:30 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
if (detail && !strcmp (detail, "colorwheel_light"))
|
2005-04-18 15:11:01 +00:00
|
|
|
cairo_set_source_rgb (cr, 0., 0., 0.);
|
2005-03-17 01:54:40 +00:00
|
|
|
else if (detail && !strcmp (detail, "colorwheel_dark"))
|
2005-04-18 15:11:01 +00:00
|
|
|
cairo_set_source_rgb (cr, 1., 1., 1.);
|
2001-12-04 03:27:30 +00:00
|
|
|
else
|
2005-03-17 01:54:40 +00:00
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, line_width);
|
|
|
|
|
|
|
|
if (dash_list[0])
|
2001-12-04 03:27:30 +00:00
|
|
|
{
|
2007-11-14 09:45:14 +00:00
|
|
|
gint n_dashes = strlen ((const gchar *) dash_list);
|
2005-03-17 01:54:40 +00:00
|
|
|
gdouble *dashes = g_new (gdouble, n_dashes);
|
|
|
|
gdouble total_length = 0;
|
|
|
|
gdouble dash_offset;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_dashes; i++)
|
2001-12-04 03:27:30 +00:00
|
|
|
{
|
2005-03-17 01:54:40 +00:00
|
|
|
dashes[i] = dash_list[i];
|
|
|
|
total_length += dash_list[i];
|
2001-12-04 03:27:30 +00:00
|
|
|
}
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
|
|
/* The dash offset here aligns the pattern to integer pixels
|
|
|
|
* by starting the dash at the right side of the left border
|
|
|
|
* Negative dash offsets in cairo don't work
|
|
|
|
* (https://bugs.freedesktop.org/show_bug.cgi?id=2729)
|
|
|
|
*/
|
|
|
|
dash_offset = - line_width / 2.;
|
|
|
|
while (dash_offset < 0)
|
|
|
|
dash_offset += total_length;
|
2001-12-04 03:27:30 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_set_dash (cr, dashes, n_dashes, dash_offset);
|
|
|
|
g_free (dashes);
|
2001-12-04 03:27:30 +00:00
|
|
|
}
|
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_rectangle (cr,
|
|
|
|
x + line_width / 2.,
|
|
|
|
y + line_width / 2.,
|
|
|
|
width - line_width,
|
|
|
|
height - line_width);
|
|
|
|
cairo_stroke (cr);
|
2002-01-03 00:30:39 +00:00
|
|
|
|
|
|
|
if (free_dash_list)
|
|
|
|
g_free (dash_list);
|
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-09-10 23:30:27 +00:00
|
|
|
gtk_paint_box (style, cr, state_type, shadow_type,
|
2010-08-17 00:46:46 +00:00
|
|
|
widget, detail, x, y, width, height);
|
1999-01-15 18:41:43 +00:00
|
|
|
|
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
|
|
|
if (detail &&
|
|
|
|
(strcmp ("hscale", detail) == 0 ||
|
|
|
|
strcmp ("vscale", detail) == 0))
|
|
|
|
{
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_vline (style, cr, state_type, widget, detail,
|
2010-08-17 00:46:46 +00:00
|
|
|
y + style->ythickness,
|
|
|
|
y + height - style->ythickness - 1, x + width / 2);
|
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
|
|
|
else
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_hline (style, cr, state_type, widget, detail,
|
2010-08-17 00:46:46 +00:00
|
|
|
x + style->xthickness,
|
|
|
|
x + width - style->xthickness - 1, y + height / 2);
|
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
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2000-02-23 22:55:27 +00:00
|
|
|
static void
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_dot (cairo_t *cr,
|
|
|
|
GdkColor *light,
|
|
|
|
GdkColor *dark,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gushort size)
|
2000-02-23 22:55:27 +00:00
|
|
|
{
|
|
|
|
size = CLAMP (size, 2, 3);
|
|
|
|
|
|
|
|
if (size == 2)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_point (cr, light, x, y);
|
|
|
|
_cairo_draw_point (cr, light, x+1, y+1);
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
2004-03-11 01:16:09 +00:00
|
|
|
else if (size == 3)
|
2000-02-23 22:55:27 +00:00
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_point (cr, light, x, y);
|
|
|
|
_cairo_draw_point (cr, light, x+1, y);
|
|
|
|
_cairo_draw_point (cr, light, x, y+1);
|
|
|
|
_cairo_draw_point (cr, dark, x+1, y+2);
|
|
|
|
_cairo_draw_point (cr, dark, x+2, y+1);
|
|
|
|
_cairo_draw_point (cr, dark, x+2, y+2);
|
2000-02-23 22:55:27 +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
|
|
|
{
|
1999-01-11 18:49:54 +00:00
|
|
|
gint xx, yy;
|
|
|
|
gint xthick, ythick;
|
2010-07-14 15:45:26 +00:00
|
|
|
GdkColor light, dark;
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_box (style, cr, state_type, shadow_type, widget,
|
2010-08-17 01:26:20 +00:00
|
|
|
detail, x, y, width, height);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
2005-01-18 16:01:19 +00:00
|
|
|
if (detail && !strcmp (detail, "paned"))
|
2000-02-23 22:55:27 +00:00
|
|
|
{
|
|
|
|
/* we want to ignore the shadow border in paned widgets */
|
|
|
|
xthick = 0;
|
|
|
|
ythick = 0;
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (state_type == GTK_STATE_SELECTED && widget && !gtk_widget_has_focus (widget))
|
2010-07-14 15:45:26 +00:00
|
|
|
_gtk_style_shade (&style->base[GTK_STATE_ACTIVE], &light,
|
2005-11-23 10:33:58 +00:00
|
|
|
LIGHTNESS_MULT);
|
2004-02-19 23:20:07 +00:00
|
|
|
else
|
2010-07-14 15:45:26 +00:00
|
|
|
light = style->light[state_type];
|
2004-02-19 23:20:07 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
dark = style->black;
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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
|
|
|
xthick = style->xthickness;
|
|
|
|
ythick = style->ythickness;
|
2000-02-23 22:55:27 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
light = style->light[state_type];
|
|
|
|
dark = style->dark[state_type];
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
1999-01-11 18:49:54 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_rectangle(cr, x + xthick, y + ythick,
|
|
|
|
width - (xthick * 2), height - (ythick * 2));
|
|
|
|
cairo_clip (cr);
|
2000-02-23 22:55:27 +00:00
|
|
|
|
2005-01-18 16:44:25 +00:00
|
|
|
if (detail && !strcmp (detail, "paned"))
|
2000-02-23 22:55:27 +00:00
|
|
|
{
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
2001-11-16 15:20:28 +00:00
|
|
|
for (xx = x + width/2 - 15; xx <= x + width/2 + 15; xx += 5)
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_dot (cr, &light, &dark, xx, y + height/2 - 1, 3);
|
2000-02-23 22:55:27 +00:00
|
|
|
else
|
2001-11-16 15:20:28 +00:00
|
|
|
for (yy = y + height/2 - 15; yy <= y + height/2 + 15; yy += 5)
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_dot (cr, &light, &dark, x + width/2 - 1, yy, 3);
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
|
|
|
|
for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
draw_dot (cr, &light, &dark, xx, yy, 2);
|
|
|
|
draw_dot (cr, &light, &dark, xx + 3, yy + 1, 2);
|
2000-02-23 22:55:27 +00:00
|
|
|
}
|
|
|
|
}
|
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
|
|
|
{
|
2005-04-04 20:51:24 +00:00
|
|
|
#define DEFAULT_EXPANDER_SIZE 12
|
|
|
|
|
2001-07-22 20:09:00 +00:00
|
|
|
gint expander_size;
|
2005-04-04 20:51:24 +00:00
|
|
|
gint line_width;
|
|
|
|
double vertical_overshoot;
|
|
|
|
int diameter;
|
|
|
|
double radius;
|
2005-07-20 20:30:37 +00:00
|
|
|
double interp; /* interpolation factor for center position */
|
|
|
|
double x_double_horz, y_double_horz;
|
|
|
|
double x_double_vert, y_double_vert;
|
2005-04-04 20:51:24 +00:00
|
|
|
double x_double, y_double;
|
2001-07-22 20:09:00 +00:00
|
|
|
gint degrees = 0;
|
2002-02-03 21:18:44 +00:00
|
|
|
|
2005-04-04 20:51:24 +00:00
|
|
|
if (widget &&
|
|
|
|
gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
|
|
|
|
"expander-size"))
|
|
|
|
{
|
|
|
|
gtk_widget_style_get (widget,
|
|
|
|
"expander-size", &expander_size,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
expander_size = DEFAULT_EXPANDER_SIZE;
|
|
|
|
|
|
|
|
line_width = MAX (1, expander_size/9);
|
2001-07-22 20:09:00 +00:00
|
|
|
|
|
|
|
switch (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
|
|
|
{
|
2001-07-22 20:09:00 +00:00
|
|
|
case GTK_EXPANDER_COLLAPSED:
|
2004-07-09 14:40:36 +00:00
|
|
|
degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 180 : 0;
|
2005-07-20 20:30:37 +00:00
|
|
|
interp = 0.0;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
|
|
|
case GTK_EXPANDER_SEMI_COLLAPSED:
|
2004-07-09 14:40:36 +00:00
|
|
|
degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 150 : 30;
|
2005-07-20 20:30:37 +00:00
|
|
|
interp = 0.25;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
|
|
|
case GTK_EXPANDER_SEMI_EXPANDED:
|
2004-07-09 14:40:36 +00:00
|
|
|
degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 120 : 60;
|
2005-07-20 20:30:37 +00:00
|
|
|
interp = 0.75;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
|
|
|
case GTK_EXPANDER_EXPANDED:
|
|
|
|
degrees = 90;
|
2005-07-20 20:30:37 +00:00
|
|
|
interp = 1.0;
|
2001-07-22 20:09:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
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
|
|
|
|
2005-04-04 20:51:24 +00:00
|
|
|
/* Compute distance that the stroke extends beyonds the end
|
|
|
|
* of the triangle we draw.
|
|
|
|
*/
|
|
|
|
vertical_overshoot = line_width / 2.0 * (1. / tan (G_PI / 8));
|
2001-07-22 20:09:00 +00:00
|
|
|
|
2005-04-04 20:51:24 +00:00
|
|
|
/* For odd line widths, we end the vertical line of the triangle
|
|
|
|
* at a half pixel, so we round differently.
|
|
|
|
*/
|
|
|
|
if (line_width % 2 == 1)
|
|
|
|
vertical_overshoot = ceil (0.5 + vertical_overshoot) - 0.5;
|
|
|
|
else
|
|
|
|
vertical_overshoot = ceil (vertical_overshoot);
|
|
|
|
|
|
|
|
/* Adjust the size of the triangle we draw so that the entire stroke fits
|
|
|
|
*/
|
|
|
|
diameter = MAX (3, expander_size - 2 * vertical_overshoot);
|
|
|
|
|
|
|
|
/* If the line width is odd, we want the diameter to be even,
|
2005-07-20 20:30:37 +00:00
|
|
|
* and vice versa, so force the sum to be odd. This relationship
|
|
|
|
* makes the point of the triangle look right.
|
2005-04-04 20:51:24 +00:00
|
|
|
*/
|
|
|
|
diameter -= (1 - (diameter + line_width) % 2);
|
|
|
|
|
|
|
|
radius = diameter / 2.;
|
|
|
|
|
|
|
|
/* Adjust the center so that the stroke is properly aligned with
|
2005-07-20 20:30:37 +00:00
|
|
|
* the pixel grid. The center adjustment is different for the
|
|
|
|
* horizontal and vertical orientations. For intermediate positions
|
|
|
|
* we interpolate between the two.
|
2005-04-04 20:51:24 +00:00
|
|
|
*/
|
2005-07-20 20:30:37 +00:00
|
|
|
x_double_vert = floor (x - (radius + line_width) / 2.) + (radius + line_width) / 2.;
|
|
|
|
y_double_vert = y - 0.5;
|
|
|
|
|
|
|
|
x_double_horz = x - 0.5;
|
|
|
|
y_double_horz = floor (y - (radius + line_width) / 2.) + (radius + line_width) / 2.;
|
|
|
|
|
|
|
|
x_double = x_double_vert * (1 - interp) + x_double_horz * interp;
|
|
|
|
y_double = y_double_vert * (1 - interp) + y_double_horz * interp;
|
2005-04-04 20:51:24 +00:00
|
|
|
|
|
|
|
cairo_translate (cr, x_double, y_double);
|
2005-07-03 15:47:42 +00:00
|
|
|
cairo_rotate (cr, degrees * G_PI / 180);
|
2005-04-04 20:51:24 +00:00
|
|
|
|
|
|
|
cairo_move_to (cr, - radius / 2., - radius);
|
|
|
|
cairo_line_to (cr, radius / 2., 0);
|
|
|
|
cairo_line_to (cr, - radius / 2., radius);
|
|
|
|
cairo_close_path (cr);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, line_width);
|
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-08-19 23:46:59 +00:00
|
|
|
if (state_type == GTK_STATE_PRELIGHT)
|
2005-04-04 20:51:24 +00:00
|
|
|
gdk_cairo_set_source_color (cr,
|
|
|
|
&style->fg[GTK_STATE_PRELIGHT]);
|
2001-08-19 23:46:59 +00:00
|
|
|
else if (state_type == GTK_STATE_ACTIVE)
|
2005-04-04 20:51:24 +00:00
|
|
|
gdk_cairo_set_source_color (cr,
|
|
|
|
&style->light[GTK_STATE_ACTIVE]);
|
2001-08-19 23:46:59 +00:00
|
|
|
else
|
2005-04-04 20:51:24 +00:00
|
|
|
gdk_cairo_set_source_color (cr,
|
|
|
|
&style->base[GTK_STATE_NORMAL]);
|
|
|
|
|
Add a draw-border style property to allow themes to draw outside the
2005-04-28 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Add a draw-border style property to allow
themes to draw outside the widget's allocation.
* gdk/gdkwindow.c gtk/gtkstyle.c: Remove some save/restore pairs
that were working around the clip-leakage bug in Cairo.
* gtk/gtkstyle.c: Use cairo_fill_preserve() rathe than
save/fill/restore.
* gdk/gdkgc.c gdk/gdkinternals.h: Add _gdk_gc_update_context()
That updates a Cairo context to match a GC.
* gdk/gdkdraw.c: Use _gdk_gc_update_context() to add support
for tiles/stipples/clipping to gdk_draw_glyphs(),
gdk_draw_trapezoids().
* gdk/gdkpango.c: Use _gdk_gc_update_context() instead of internal
implementation of stipples. Use one cairo_t across the entire
drawing operation. Replace cairo_matrix_create() with
stack-allocated matrices.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c: Save various aspects of the
GC state (fill, tile, stipple, foreground, background, clip region)
in instance-private-data for future use. Add getters.
Get rid of _gdk_windowing_gc_get_foreground() function implemented
by the backends.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Add
_gdk_gc_init() to do initial setup of the GC from values;
fixes some problems from drawable redirection.
* gdk/gdkgc.c gdk/gdkinternals.h gdk/x11/gdkgc-x11.c
gdk/win32/gdkgc-win32.c gdk/linux-fb/gdkgc-fb.c: Move
gdk_gc_copy() and gdk_gc_set_clip_{region,rectangle}() into
the generic code, add _gdk_windowing_gc_copy(),
_gdk_windowing_gc_set_clip_region() to do backend specific
stuff.
* gdk/x11/{gdkprivate-x11.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/win32/{gdkprivate-win32.h,gdkgc-x11.c.c,gdkdrawable-x11.c}
gdk/linux-fb/{gdkprivate-fb.h,gdkgc-fb.c.c,gdkdrawable-fb.c}:
Don't duplicate state that now is stored by the generic code.
* gdk/gdk.symbols Update
2005-05-02 23:29:24 +00:00
|
|
|
cairo_fill_preserve (cr);
|
2005-04-04 20:51:24 +00:00
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
|
|
|
|
cairo_stroke (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
|
|
|
}
|
|
|
|
|
|
|
|
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-07-14 15:45:26 +00:00
|
|
|
GdkColor *gc;
|
2010-08-07 00:14:10 +00:00
|
|
|
const PangoMatrix *matrix;
|
2010-07-14 15:45:26 +00:00
|
|
|
|
2010-08-07 00:14:10 +00:00
|
|
|
matrix = pango_context_get_matrix (pango_layout_get_context (layout));
|
|
|
|
if (matrix)
|
|
|
|
{
|
|
|
|
cairo_matrix_t cairo_matrix;
|
|
|
|
PangoMatrix tmp_matrix;
|
|
|
|
PangoRectangle rect;
|
|
|
|
|
|
|
|
cairo_matrix_init (&cairo_matrix,
|
|
|
|
matrix->xx, matrix->yx,
|
|
|
|
matrix->xy, matrix->yy,
|
|
|
|
matrix->x0, matrix->y0);
|
|
|
|
|
|
|
|
pango_layout_get_extents (layout, NULL, &rect);
|
|
|
|
pango_matrix_transform_rectangle (matrix, &rect);
|
|
|
|
pango_extents_to_pixels (&rect, NULL);
|
|
|
|
|
|
|
|
tmp_matrix = *matrix;
|
|
|
|
cairo_matrix.x0 += x - rect.x;
|
|
|
|
cairo_matrix.y0 += y - rect.y;
|
|
|
|
|
|
|
|
cairo_set_matrix (cr, &cairo_matrix);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cairo_translate (cr, x, y);
|
|
|
|
|
2010-09-12 13:55:57 +00:00
|
|
|
cairo_new_path (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
|
|
|
if (state_type == GTK_STATE_INSENSITIVE)
|
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-07-14 15:45:26 +00:00
|
|
|
gdk_cairo_set_source_color (cr, &style->white);
|
2010-08-07 00:14:10 +00:00
|
|
|
cairo_move_to (cr, 1, 1);
|
2010-08-07 00:18:06 +00:00
|
|
|
_gtk_pango_fill_layout (cr, layout);
|
2010-09-12 13:55:57 +00:00
|
|
|
cairo_new_path (cr);
|
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-07-14 15:45:26 +00:00
|
|
|
gc = use_text ? &style->text[state_type] : &style->fg[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-07-14 15:45:26 +00:00
|
|
|
gdk_cairo_set_source_color (cr, gc);
|
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-07-14 15:45:26 +00:00
|
|
|
pango_cairo_show_layout (cr, layout);
|
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-07-14 15:45:26 +00:00
|
|
|
gint skip;
|
2004-11-09 14:49:01 +00:00
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
cairo_rectangle (cr, x, y, width, height);
|
|
|
|
cairo_clip (cr);
|
|
|
|
|
|
|
|
cairo_set_line_width (cr, 1.0);
|
|
|
|
|
2004-11-09 14:49:01 +00:00
|
|
|
skip = -1;
|
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:
|
|
|
|
/* make it square */
|
|
|
|
if (width < height)
|
2004-11-09 14:49:01 +00:00
|
|
|
height = width;
|
2002-11-02 00:18:14 +00:00
|
|
|
else if (height < width)
|
2004-11-09 14:49:01 +00:00
|
|
|
width = height;
|
|
|
|
skip = 2;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH:
|
|
|
|
if (width < height)
|
2004-11-09 14:49:01 +00:00
|
|
|
height = width;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_EAST:
|
|
|
|
/* make it square, aligning to top right */
|
|
|
|
if (width < height)
|
2004-11-09 14:49:01 +00:00
|
|
|
height = width;
|
2002-11-02 00:18:14 +00:00
|
|
|
else if (height < width)
|
|
|
|
{
|
|
|
|
x += (width - height);
|
|
|
|
width = height;
|
|
|
|
}
|
2004-11-09 14:49:01 +00:00
|
|
|
skip = 3;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_WEST:
|
|
|
|
if (height < width)
|
2004-11-09 14:49:01 +00:00
|
|
|
width = height;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_EAST:
|
|
|
|
/* aligning to right */
|
|
|
|
if (height < width)
|
|
|
|
{
|
|
|
|
x += (width - height);
|
|
|
|
width = height;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_WEST:
|
|
|
|
/* make it square, aligning to bottom left */
|
|
|
|
if (width < height)
|
|
|
|
{
|
|
|
|
y += (height - width);
|
|
|
|
height = width;
|
|
|
|
}
|
|
|
|
else if (height < width)
|
2004-11-09 14:49:01 +00:00
|
|
|
width = height;
|
|
|
|
skip = 1;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH:
|
|
|
|
/* align to bottom */
|
|
|
|
if (width < height)
|
|
|
|
{
|
|
|
|
y += (height - width);
|
|
|
|
height = width;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
|
|
|
/* make it square, aligning to bottom right */
|
|
|
|
if (width < height)
|
|
|
|
{
|
|
|
|
y += (height - width);
|
|
|
|
height = width;
|
|
|
|
}
|
|
|
|
else if (height < width)
|
|
|
|
{
|
|
|
|
x += (width - height);
|
|
|
|
width = height;
|
|
|
|
}
|
2004-11-09 14:49:01 +00:00
|
|
|
skip = 0;
|
2002-11-02 00:18:14 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
2004-11-09 14:49:01 +00:00
|
|
|
|
2001-03-29 21:17:45 +00:00
|
|
|
switch (edge)
|
|
|
|
{
|
2002-11-02 00:18:14 +00:00
|
|
|
case GDK_WINDOW_EDGE_WEST:
|
|
|
|
case GDK_WINDOW_EDGE_EAST:
|
|
|
|
{
|
|
|
|
gint xi;
|
|
|
|
|
|
|
|
xi = x;
|
|
|
|
|
|
|
|
while (xi < x + width)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
xi, y,
|
|
|
|
xi, y + height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
xi++;
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y,
|
|
|
|
xi, y + height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
xi += 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH:
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH:
|
|
|
|
{
|
|
|
|
gint yi;
|
|
|
|
|
|
|
|
yi = y;
|
|
|
|
|
|
|
|
while (yi < y + height)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
x, yi,
|
|
|
|
x + width, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
yi++;
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, yi,
|
|
|
|
x + width, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
yi+= 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_WEST:
|
|
|
|
{
|
|
|
|
gint xi, yi;
|
|
|
|
|
|
|
|
xi = x + width;
|
|
|
|
yi = y + height;
|
|
|
|
|
|
|
|
while (xi > x + 3)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y,
|
|
|
|
x, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
--xi;
|
|
|
|
--yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y,
|
|
|
|
x, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
--xi;
|
|
|
|
--yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
xi, y,
|
|
|
|
x, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
xi -= 3;
|
|
|
|
yi -= 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_NORTH_EAST:
|
|
|
|
{
|
|
|
|
gint xi, yi;
|
|
|
|
|
|
|
|
xi = x;
|
|
|
|
yi = y + height;
|
|
|
|
|
|
|
|
while (xi < (x + width - 3))
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
xi, y,
|
|
|
|
x + width, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
++xi;
|
|
|
|
--yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y,
|
|
|
|
x + width, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
++xi;
|
|
|
|
--yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y,
|
|
|
|
x + width, yi);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
xi += 3;
|
|
|
|
yi -= 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_WINDOW_EDGE_SOUTH_WEST:
|
|
|
|
{
|
|
|
|
gint xi, yi;
|
|
|
|
|
|
|
|
xi = x + width;
|
|
|
|
yi = y;
|
|
|
|
|
|
|
|
while (xi > x + 3)
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, yi,
|
|
|
|
xi, y + height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
--xi;
|
|
|
|
++yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
x, yi,
|
|
|
|
xi, y + height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
--xi;
|
|
|
|
++yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
x, yi,
|
|
|
|
xi, y + height);
|
2002-11-02 00:18:14 +00:00
|
|
|
|
|
|
|
xi -= 3;
|
|
|
|
yi += 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2001-03-29 21:17:45 +00:00
|
|
|
case GDK_WINDOW_EDGE_SOUTH_EAST:
|
|
|
|
{
|
|
|
|
gint xi, yi;
|
|
|
|
|
|
|
|
xi = x;
|
|
|
|
yi = y;
|
|
|
|
|
|
|
|
while (xi < (x + width - 3))
|
|
|
|
{
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->light[state_type],
|
|
|
|
xi, y + height,
|
|
|
|
x + width, yi);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
|
|
++xi;
|
|
|
|
++yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y + height,
|
|
|
|
x + width, yi);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
|
|
++xi;
|
|
|
|
++yi;
|
|
|
|
|
2010-07-14 15:45:26 +00:00
|
|
|
_cairo_draw_line (cr,
|
|
|
|
&style->dark[state_type],
|
|
|
|
xi, y + height,
|
|
|
|
x + width, yi);
|
2001-03-29 21:17:45 +00:00
|
|
|
|
|
|
|
xi += 3;
|
|
|
|
yi += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2001-04-03 13:18:00 +00:00
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
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;
|
|
|
|
|
|
|
|
gtk_style_get (style, GTK_TYPE_SPINNER,
|
|
|
|
"num-steps", &num_steps,
|
|
|
|
NULL);
|
|
|
|
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.
|
|
|
|
**/
|
|
|
|
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);
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_hline (style, cr, state_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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);
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_vline (style, cr, state_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a shadow around the given rectangle in @cr
|
|
|
|
* using the given style and state and shadow type.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != 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_shadow (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_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
|
|
|
|
*
|
|
|
|
* Draws an arrow in the given rectangle on @cr using the given
|
|
|
|
* parameters. @arrow_type determines the direction of the arrow.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != 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_arrow (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a box on @cr with the given parameters.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_box (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 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
|
|
|
|
* @area: (allow-none): clip rectangle, or %NULL if the
|
|
|
|
* output should not be clipped
|
|
|
|
* @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
|
|
|
|
*
|
|
|
|
* Draws a flat box on @cr with the given parameters.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != 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_flat_box (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a check button indicator in the given rectangle on @cr with
|
|
|
|
* the given parameters.
|
|
|
|
*/
|
|
|
|
void
|
2010-09-10 23:30:27 +00:00
|
|
|
gtk_paint_check (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:55:02 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_check (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a radio button indicator in the given rectangle on @cr with
|
|
|
|
* the given parameters.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_option (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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
|
|
|
|
* using the given style and state and shadow type, leaving a
|
|
|
|
* gap in one side.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != 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_shadow_gap (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a box in @cr using the given style and state and shadow type,
|
|
|
|
* leaving a gap in one side.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != 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_box_gap (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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-09-10 23:30:27 +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
|
|
|
|
*
|
|
|
|
* Draws an extension, i.e. a notebook tab.
|
|
|
|
**/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != 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_extension (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != 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_focus (style, cr, state_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
**/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != 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_slider (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
|
|
|
x, y, width, height, orientation);
|
|
|
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
* Draws a handle as used in #GtkHandleBox and #GtkPaned.
|
|
|
|
**/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != 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_handle (style, cr, state_type, shadow_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
**/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_expander (style, cr, state_type,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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.
|
|
|
|
**/
|
|
|
|
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));
|
|
|
|
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
GTK_STYLE_GET_CLASS (style)->draw_layout (style, cr, state_type, use_text,
|
|
|
|
widget, detail,
|
2008-01-25 09:30:40 +00:00
|
|
|
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
|
|
|
|
* parameters.
|
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2007-12-27 14:04:37 +00:00
|
|
|
/**
|
|
|
|
* gtk_border_new:
|
|
|
|
*
|
|
|
|
* Allocates a new #GtkBorder structure and initializes its elements to zero.
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
* Returns: a new empty #GtkBorder. The newly allocated #GtkBorder should be
|
|
|
|
* freed with gtk_border_free()
|
|
|
|
*
|
|
|
|
* Since: 2.14
|
2007-12-27 14:04:37 +00:00
|
|
|
**/
|
|
|
|
GtkBorder *
|
|
|
|
gtk_border_new (void)
|
|
|
|
{
|
|
|
|
return g_slice_new0 (GtkBorder);
|
|
|
|
}
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
/**
|
|
|
|
* gtk_border_copy:
|
2002-11-08 19:41:50 +00:00
|
|
|
* @border_: a #GtkBorder.
|
|
|
|
* @returns: a copy of @border_.
|
2001-12-07 23:39:54 +00:00
|
|
|
*
|
|
|
|
* Copies a #GtkBorder structure.
|
|
|
|
**/
|
2001-04-02 03:47:25 +00:00
|
|
|
GtkBorder *
|
|
|
|
gtk_border_copy (const GtkBorder *border)
|
|
|
|
{
|
2006-12-24 05:32:38 +00:00
|
|
|
g_return_val_if_fail (border != NULL, NULL);
|
|
|
|
|
2007-12-27 14:04:37 +00:00
|
|
|
return g_slice_dup (GtkBorder, border);
|
2001-04-02 03:47:25 +00:00
|
|
|
}
|
|
|
|
|
2001-12-07 23:39:54 +00:00
|
|
|
/**
|
|
|
|
* gtk_border_free:
|
2002-11-08 19:41:50 +00:00
|
|
|
* @border_: a #GtkBorder.
|
2001-12-07 23:39:54 +00:00
|
|
|
*
|
|
|
|
* Frees a #GtkBorder structure.
|
|
|
|
**/
|
2001-04-02 03:47:25 +00:00
|
|
|
void
|
|
|
|
gtk_border_free (GtkBorder *border)
|
|
|
|
{
|
2006-12-24 05:32:38 +00:00
|
|
|
g_slice_free (GtkBorder, border);
|
2001-04-02 03:47:25 +00:00
|
|
|
}
|
|
|
|
|
2010-04-27 11:31:23 +00:00
|
|
|
G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border,
|
|
|
|
gtk_border_copy,
|
|
|
|
gtk_border_free)
|
2002-03-02 19:11:47 +00:00
|
|
|
|
2002-03-03 19:59:29 +00:00
|
|
|
typedef struct _CursorInfo CursorInfo;
|
|
|
|
|
|
|
|
struct _CursorInfo
|
|
|
|
{
|
|
|
|
GType for_type;
|
2010-07-25 16:09:06 +00:00
|
|
|
GdkColor primary;
|
|
|
|
GdkColor secondary;
|
2002-03-03 19:59:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2010-07-22 00:55:12 +00:00
|
|
|
style_unrealize_cursors (GtkStyle *style)
|
2002-03-03 19:59:29 +00:00
|
|
|
{
|
|
|
|
CursorInfo *
|
|
|
|
|
|
|
|
cursor_info = g_object_get_data (G_OBJECT (style), "gtk-style-cursor-info");
|
|
|
|
if (cursor_info)
|
|
|
|
{
|
|
|
|
g_free (cursor_info);
|
2005-09-01 05:11:46 +00:00
|
|
|
g_object_set_data (G_OBJECT (style), I_("gtk-style-cursor-info"), NULL);
|
2002-03-03 19:59:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
static const GdkColor *
|
|
|
|
get_insertion_cursor_color (GtkWidget *widget,
|
|
|
|
gboolean is_primary)
|
2002-03-03 19:59:29 +00:00
|
|
|
{
|
|
|
|
CursorInfo *cursor_info;
|
2010-08-11 20:54:01 +00:00
|
|
|
GtkStyle *style;
|
2010-07-25 16:09:06 +00:00
|
|
|
GdkColor *cursor_color;
|
2002-03-03 19:59:29 +00:00
|
|
|
|
2010-08-11 20:54:01 +00:00
|
|
|
style = gtk_widget_get_style (widget);
|
|
|
|
|
|
|
|
cursor_info = g_object_get_data (G_OBJECT (style), "gtk-style-cursor-info");
|
2002-03-03 19:59:29 +00:00
|
|
|
if (!cursor_info)
|
|
|
|
{
|
2010-07-25 16:09:06 +00:00
|
|
|
cursor_info = g_new0 (CursorInfo, 1);
|
2010-08-11 20:54:01 +00:00
|
|
|
g_object_set_data (G_OBJECT (style), I_("gtk-style-cursor-info"), cursor_info);
|
2002-03-03 19:59:29 +00:00
|
|
|
cursor_info->for_type = G_TYPE_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have to keep track of the type because gtk_widget_style_get()
|
|
|
|
* can return different results when called on the same property and
|
|
|
|
* same style but for different widgets. :-(. That is,
|
|
|
|
* GtkEntry::cursor-color = "red" in a style will modify the cursor
|
|
|
|
* color for entries but not for text view.
|
|
|
|
*/
|
|
|
|
if (cursor_info->for_type != G_OBJECT_TYPE (widget))
|
|
|
|
{
|
|
|
|
cursor_info->for_type = G_OBJECT_TYPE (widget);
|
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
/* Cursors in text widgets are drawn only in NORMAL state,
|
|
|
|
* so we can use text[GTK_STATE_NORMAL] as text color here */
|
|
|
|
gtk_widget_style_get (widget, "cursor-color", &cursor_color, NULL);
|
|
|
|
if (cursor_color)
|
|
|
|
{
|
|
|
|
cursor_info->primary = *cursor_color;
|
|
|
|
gdk_color_free (cursor_color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-08-11 20:54:01 +00:00
|
|
|
cursor_info->primary = style->text[GTK_STATE_NORMAL];
|
2010-07-25 16:09:06 +00:00
|
|
|
}
|
2007-06-01 05:02:05 +00:00
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
gtk_widget_style_get (widget, "secondary-cursor-color", &cursor_color, NULL);
|
|
|
|
if (cursor_color)
|
|
|
|
{
|
|
|
|
cursor_info->secondary = *cursor_color;
|
|
|
|
gdk_color_free (cursor_color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* text_aa is the average of text and base colors,
|
|
|
|
* in usual black-on-white case it's grey. */
|
2010-08-11 20:54:01 +00:00
|
|
|
cursor_info->secondary = style->text_aa[GTK_STATE_NORMAL];
|
2010-07-25 16:09:06 +00:00
|
|
|
}
|
2002-03-03 19:59:29 +00:00
|
|
|
}
|
2007-06-01 05:02:05 +00:00
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
if (is_primary)
|
|
|
|
return &cursor_info->primary;
|
|
|
|
else
|
|
|
|
return &cursor_info->secondary;
|
2002-03-03 19:59:29 +00:00
|
|
|
}
|
|
|
|
|
Implement block-cursor for overwrite mode. (#80378)
2007-06-12 Yevgen Muntyan <muntyan@tamu.edu>
* gtk/gtkentry.c (gtk_entry_expose), (gtk_entry_toggle_overwrite),
(gtk_entry_draw_cursor):
* gtk/gtkstyle.c (_gtk_widget_get_cursor_gc),
(_gtk_widget_get_cursor_color):
* gtk/gtkstyle.h:
* gtk/gtktextdisplay.c (gtk_text_renderer_prepare_run),
(gtk_text_renderer_draw_shape), (text_renderer_set_state),
(render_para):
* gtk/gtktextlayout.c (gtk_text_layout_set_overwrite_mode),
(gtk_text_layout_invalidate_cache), (get_block_cursor),
(add_cursor), (gtk_text_layout_get_line_display),
(_gtk_text_layout_get_block_cursor):
* gtk/gtktextlayout.h:
* gtk/gtktextutil.c (layout_get_char_width),
(_gtk_text_util_get_block_cursor_location):
* gtk/gtktextutil.h:
* gtk/gtktextview.c (gtk_text_view_set_editable),
(gtk_text_view_toggle_overwrite), (gtk_text_view_set_overwrite),
(gtk_text_view_ensure_layout), (text_window_invalidate_cursors):
Implement block-cursor for overwrite mode. (#80378)
svn path=/trunk/; revision=18108
2007-06-12 05:32:57 +00:00
|
|
|
void
|
|
|
|
_gtk_widget_get_cursor_color (GtkWidget *widget,
|
|
|
|
GdkColor *color)
|
|
|
|
{
|
|
|
|
GdkColor *style_color;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
gtk_widget_style_get (widget, "cursor-color", &style_color, NULL);
|
|
|
|
|
|
|
|
if (style_color)
|
|
|
|
{
|
|
|
|
*color = *style_color;
|
|
|
|
gdk_color_free (style_color);
|
|
|
|
}
|
|
|
|
else
|
2010-08-11 20:54:01 +00:00
|
|
|
*color = gtk_widget_get_style (widget)->text[GTK_STATE_NORMAL];
|
Implement block-cursor for overwrite mode. (#80378)
2007-06-12 Yevgen Muntyan <muntyan@tamu.edu>
* gtk/gtkentry.c (gtk_entry_expose), (gtk_entry_toggle_overwrite),
(gtk_entry_draw_cursor):
* gtk/gtkstyle.c (_gtk_widget_get_cursor_gc),
(_gtk_widget_get_cursor_color):
* gtk/gtkstyle.h:
* gtk/gtktextdisplay.c (gtk_text_renderer_prepare_run),
(gtk_text_renderer_draw_shape), (text_renderer_set_state),
(render_para):
* gtk/gtktextlayout.c (gtk_text_layout_set_overwrite_mode),
(gtk_text_layout_invalidate_cache), (get_block_cursor),
(add_cursor), (gtk_text_layout_get_line_display),
(_gtk_text_layout_get_block_cursor):
* gtk/gtktextlayout.h:
* gtk/gtktextutil.c (layout_get_char_width),
(_gtk_text_util_get_block_cursor_location):
* gtk/gtktextutil.h:
* gtk/gtktextview.c (gtk_text_view_set_editable),
(gtk_text_view_toggle_overwrite), (gtk_text_view_set_overwrite),
(gtk_text_view_ensure_layout), (text_window_invalidate_cursors):
Implement block-cursor for overwrite mode. (#80378)
svn path=/trunk/; revision=18108
2007-06-12 05:32:57 +00:00
|
|
|
}
|
|
|
|
|
2010-08-15 17:38:32 +00:00
|
|
|
/**
|
2010-09-10 23:54:48 +00:00
|
|
|
* gtk_draw_insertion_cursor:
|
2010-08-15 17:38:32 +00:00
|
|
|
* @widget: a #GtkWidget
|
|
|
|
* @cr: cairo context to draw to
|
|
|
|
* @location: location where to draw the cursor (@location->width is ignored)
|
|
|
|
* @is_primary: if the cursor should be the primary cursor color.
|
|
|
|
* @direction: whether the cursor is left-to-right or
|
|
|
|
* right-to-left. Should never be #GTK_TEXT_DIR_NONE
|
|
|
|
* @draw_arrow: %TRUE to draw a directional arrow on the
|
|
|
|
* cursor. Should be %FALSE unless the cursor is split.
|
|
|
|
*
|
|
|
|
* Draws a text caret on @cr at @location. This is not a style function
|
|
|
|
* but merely a convenience function for drawing the standard cursor shape.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2010-09-10 23:54:48 +00:00
|
|
|
gtk_draw_insertion_cursor (GtkWidget *widget,
|
|
|
|
cairo_t *cr,
|
|
|
|
const GdkRectangle *location,
|
|
|
|
gboolean is_primary,
|
|
|
|
GtkTextDirection direction,
|
|
|
|
gboolean draw_arrow)
|
2001-09-25 20:40:20 +00:00
|
|
|
{
|
2002-02-14 21:49:02 +00:00
|
|
|
gint stem_width;
|
|
|
|
gint arrow_width;
|
2001-09-25 20:40:20 +00:00
|
|
|
gint x, y;
|
2002-02-14 21:49:02 +00:00
|
|
|
gfloat cursor_aspect_ratio;
|
2002-02-25 04:19:05 +00:00
|
|
|
gint offset;
|
|
|
|
|
2010-08-15 17:38:32 +00:00
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (cr != NULL);
|
|
|
|
g_return_if_fail (location != NULL);
|
|
|
|
g_return_if_fail (direction != GTK_TEXT_DIR_NONE);
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, get_insertion_cursor_color (widget, is_primary));
|
|
|
|
|
2005-05-25 10:22:37 +00:00
|
|
|
/* When changing the shape or size of the cursor here,
|
|
|
|
* propagate the changes to gtktextview.c:text_window_invalidate_cursors().
|
|
|
|
*/
|
|
|
|
|
2002-02-14 21:49:02 +00:00
|
|
|
gtk_widget_style_get (widget, "cursor-aspect-ratio", &cursor_aspect_ratio, NULL);
|
|
|
|
|
|
|
|
stem_width = location->height * cursor_aspect_ratio + 1;
|
|
|
|
arrow_width = stem_width + 1;
|
2002-02-25 04:19:05 +00:00
|
|
|
|
|
|
|
/* put (stem_width % 2) on the proper side of the cursor */
|
|
|
|
if (direction == GTK_TEXT_DIR_LTR)
|
|
|
|
offset = stem_width / 2;
|
|
|
|
else
|
|
|
|
offset = stem_width - stem_width / 2;
|
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
cairo_rectangle (cr,
|
|
|
|
location->x - offset, location->y,
|
|
|
|
stem_width, location->height);
|
|
|
|
cairo_fill (cr);
|
2001-09-25 20:40:20 +00:00
|
|
|
|
2002-02-25 04:19:05 +00:00
|
|
|
if (draw_arrow)
|
2001-09-25 20:40:20 +00:00
|
|
|
{
|
2002-02-25 04:19:05 +00:00
|
|
|
if (direction == GTK_TEXT_DIR_RTL)
|
|
|
|
{
|
|
|
|
x = location->x - offset - 1;
|
|
|
|
y = location->y + location->height - arrow_width * 2 - arrow_width + 1;
|
2001-09-25 20:40:20 +00:00
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
cairo_move_to (cr, x, y + 1);
|
|
|
|
cairo_line_to (cr, x - arrow_width, y + arrow_width);
|
|
|
|
cairo_line_to (cr, x, y + 2 * arrow_width);
|
|
|
|
cairo_fill (cr);
|
2002-02-25 04:19:05 +00:00
|
|
|
}
|
|
|
|
else if (direction == GTK_TEXT_DIR_LTR)
|
|
|
|
{
|
|
|
|
x = location->x + stem_width - offset;
|
|
|
|
y = location->y + location->height - arrow_width * 2 - arrow_width + 1;
|
2001-09-25 20:40:20 +00:00
|
|
|
|
2010-07-25 16:09:06 +00:00
|
|
|
cairo_move_to (cr, x, y + 1);
|
|
|
|
cairo_line_to (cr, x + arrow_width, y + arrow_width);
|
|
|
|
cairo_line_to (cr, x, y + 2 * arrow_width);
|
|
|
|
cairo_fill (cr);
|
2002-02-25 04:19:05 +00:00
|
|
|
}
|
2001-09-25 20:40:20 +00:00
|
|
|
}
|
|
|
|
}
|