[gnome-applets] Compile with -DGSEAL_ENABLE. Fixes bug 612473. Bumps gtk+ requirement to 2.18.
- From: Andre Klapper <aklapper src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] Compile with -DGSEAL_ENABLE. Fixes bug 612473. Bumps gtk+ requirement to 2.18.
- Date: Fri, 23 Apr 2010 15:14:34 +0000 (UTC)
commit d596fcf9846bb31823671ae83207ae796685e93d
Author: Andre Klapper <a9016009 gmx de>
Date: Fri Apr 23 00:46:25 2010 +0200
Compile with -DGSEAL_ENABLE. Fixes bug 612473. Bumps gtk+ requirement to 2.18.
accessx-status/applet.c | 38 ++++++++++-----
battstat/battstat_applet.c | 12 ++--
configure.in | 2 +-
cpufreq/src/cpufreq-applet.c | 22 +++++---
cpufreq/src/cpufreq-popup.c | 4 +-
drivemount/drive-button.c | 25 +++++++---
geyes/geyes.c | 14 ++++--
gweather/gweather-dialog.c | 4 +-
gweather/gweather-pref.c | 2 +-
mixer/applet.c | 72 +++++++++++++++-------------
mixer/dock.c | 10 ++--
mixer/preferences.c | 4 +-
multiload/load-graph.c | 38 ++++++++------
multiload/properties.c | 4 +-
stickynotes/stickynotes_applet.c | 6 ++-
stickynotes/stickynotes_applet_callbacks.c | 4 +-
trashapplet/src/trash-empty.c | 2 +-
trashapplet/src/trashapplet.c | 2 +-
trashapplet/src/xstuff.c | 16 ++++---
19 files changed, 166 insertions(+), 115 deletions(-)
---
diff --git a/accessx-status/applet.c b/accessx-status/applet.c
index e9c4e9a..5cae700 100644
--- a/accessx-status/applet.c
+++ b/accessx-status/applet.c
@@ -272,8 +272,11 @@ accessx_status_applet_xkb_select (AccessxStatusApplet *sapplet)
int opcode_rtn, error_rtn;
gboolean retval = FALSE;
Display *display = NULL;
- g_assert (sapplet && sapplet->applet && GTK_WIDGET (sapplet->applet)->window);
- display = GDK_WINDOW_XDISPLAY (GTK_WIDGET (sapplet->applet)->window);
+ GdkWindow *window;
+
+ window = gtk_widget_get_window (GTK_WIDGET (sapplet->applet));
+ g_assert (sapplet && sapplet->applet && window);
+ display = GDK_WINDOW_XDISPLAY (window);
g_assert (display);
retval = XkbQueryExtension (display, &opcode_rtn, &xkb_base_event_type,
&error_rtn, NULL, NULL);
@@ -424,6 +427,7 @@ accessx_status_applet_slowkeys_image (AccessxStatusApplet *sapplet,
XkbAccessXNotifyEvent *event)
{
GdkPixbuf *ret_pixbuf;
+ GdkWindow *window;
gboolean is_idle = TRUE;
gchar *stock_id = SLOWKEYS_IDLE_ICON;
GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (sapplet->applet));
@@ -470,9 +474,11 @@ accessx_status_applet_slowkeys_image (AccessxStatusApplet *sapplet,
ret_pixbuf = gdk_pixbuf_copy (tmp_pixbuf);
g_object_unref (tmp_pixbuf);
- if (event && GTK_WIDGET (sapplet->applet)->window) {
+ window = gtk_widget_get_window (GTK_WIDGET (sapplet->applet));
+
+ if (event && window) {
KeySym keysym = XKeycodeToKeysym (
- GDK_WINDOW_XDISPLAY (GTK_WIDGET (sapplet->applet)->window),
+ GDK_WINDOW_XDISPLAY (window),
event->keycode,
0);
glyphstring = XKeysymToString (keysym);
@@ -480,7 +486,7 @@ accessx_status_applet_slowkeys_image (AccessxStatusApplet *sapplet,
(g_utf8_strlen (glyphstring, -1) > 1))
glyphstring = "";
}
- fg = style->fg[GTK_WIDGET_STATE (sapplet->applet)];
+ fg = style->fg[gtk_widget_get_state (GTK_WIDGET (sapplet->applet))];
glyph_pixbuf = accessx_status_applet_get_glyph_pixbuf (sapplet,
GTK_WIDGET (sapplet->applet),
ret_pixbuf,
@@ -508,7 +514,7 @@ accessx_status_applet_bouncekeys_image (AccessxStatusApplet *sapplet, XkbAccessX
g_assert (sapplet->applet);
style = gtk_widget_get_style (GTK_WIDGET (sapplet->applet));
- fg = style->text[GTK_WIDGET_STATE (GTK_WIDGET (sapplet->applet))];
+ fg = style->text[gtk_widget_get_state (GTK_WIDGET (sapplet->applet))];
bg = style->base[GTK_STATE_NORMAL];
if (event != NULL) {
@@ -619,9 +625,9 @@ accessx_status_applet_update (AccessxStatusApplet *sapplet,
locked_mods = event->state.locked_mods;
latched_mods = event->state.latched_mods;
}
- else if (sapplet->applet && GTK_WIDGET (sapplet->applet)->window) {
+ else if (sapplet->applet && gtk_widget_get_window (GTK_WIDGET (sapplet->applet))) {
XkbStateRec state;
- XkbGetState (GDK_WINDOW_XDISPLAY (GTK_WIDGET (sapplet->applet)->window),
+ XkbGetState (GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (sapplet->applet))),
XkbUseCoreKbd, &state);
locked_mods = state.locked_mods;
latched_mods = state.latched_mods;
@@ -664,7 +670,7 @@ accessx_status_applet_update (AccessxStatusApplet *sapplet,
if (notify_type & ACCESSX_STATUS_ENABLED) {
/* Update the visibility of widgets in the box */
- XkbGetControls (GDK_WINDOW_XDISPLAY (GTK_WIDGET (sapplet->applet)->window),
+ XkbGetControls (GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (sapplet->applet))),
/* XkbMouseKeysMask | XkbStickyKeysMask |
XkbSlowKeysMask | XkbBounceKeysMask, */
XkbAllControlsMask,
@@ -933,9 +939,9 @@ static void
accessx_status_applet_reparent_widget (GtkWidget *widget, GtkContainer *container)
{
if (widget) {
- if (widget->parent) {
+ if (gtk_widget_get_parent (widget)) {
g_object_ref (G_OBJECT (widget));
- gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (widget)), widget);
}
gtk_container_add (container, widget);
}
@@ -977,7 +983,11 @@ accessx_status_applet_layout_box (AccessxStatusApplet *sapplet, GtkWidget *box,
gtk_widget_show (sapplet->box);
gtk_widget_show (GTK_WIDGET (sapplet->applet));
+#if GTK_CHECK_VERSION (2,20,0)
+ if (gtk_widget_get_realized (sapplet->box) &&
+#else
if (GTK_WIDGET_REALIZED (sapplet->box) &&
+#endif
sapplet->initialized)
accessx_status_applet_update (sapplet, ACCESSX_STATUS_ALL, NULL);
}
@@ -1185,7 +1195,7 @@ accessx_status_applet_background (PanelApplet *a,
case PANEL_PIXMAP_BACKGROUND:
style = gtk_style_copy (
- GTK_WIDGET (sapplet->applet)->style);
+ gtk_widget_get_style (GTK_WIDGET (sapplet->applet)));
if (style->bg_pixmap[GTK_STATE_NORMAL])
g_object_unref
(style->bg_pixmap[GTK_STATE_NORMAL]);
@@ -1280,7 +1290,11 @@ accessx_status_applet_fill (PanelApplet *applet)
sapplet = create_applet (applet);
+#if GTK_CHECK_VERSION (2,20,0)
+ if (!gtk_widget_get_realized (sapplet->box)) {
+#else
if (!GTK_WIDGET_REALIZED (sapplet->box)) {
+#endif
g_signal_connect_after (G_OBJECT (sapplet->box),
"realize", G_CALLBACK (accessx_status_applet_realize),
sapplet);
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index 42c1ae6..2af11d2 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -496,7 +496,7 @@ battery_full_dialog (GtkWidget *applet)
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 6);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
gtk_window_stick (GTK_WINDOW (dialog));
gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), TRUE);
@@ -657,7 +657,7 @@ battery_low_dialog( ProgressData *battery, BatteryStatus *info )
gtk_label_set_line_wrap( battery->battery_low_label, TRUE );
gtk_label_set_selectable( battery->battery_low_label, TRUE );
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (battery->battery_low_dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (battery->battery_low_dialog))), hbox);
gtk_window_set_keep_above (GTK_WINDOW (battery->battery_low_dialog), TRUE);
gtk_window_stick (GTK_WINDOW (battery->battery_low_dialog));
@@ -753,17 +753,17 @@ update_battery_image (ProgressData *battstat, int batt_percent, int batt_time)
if( battstat->pixgc == NULL )
{
gtk_widget_realize( battstat->applet );
- battstat->pixgc = gdk_gc_new( battstat->applet->window );
+ battstat->pixgc = gdk_gc_new( gtk_widget_get_window (battstat->applet) );
}
/* Depending on if the meter is horizontally oriented start out with the
appropriate XPM image (from pixmaps.h)
*/
if (battstat->horizont)
- pixmap = gdk_pixmap_create_from_xpm_d( battstat->applet->window, &pixmask,
+ pixmap = gdk_pixmap_create_from_xpm_d( gtk_widget_get_window (battstat->applet), &pixmask,
NULL, battery_gray_xpm );
else
- pixmap = gdk_pixmap_create_from_xpm_d( battstat->applet->window, &pixmask,
+ pixmap = gdk_pixmap_create_from_xpm_d( gtk_widget_get_window (battstat->applet), &pixmask,
NULL, battery_y_gray_xpm );
/* The core code responsible for painting the battery meter. For each
@@ -939,7 +939,7 @@ possibly_update_status_icon( ProgressData *battstat, BatteryStatus *info )
if( battstat->pixgc == NULL )
{
gtk_widget_realize( battstat->applet );
- battstat->pixgc = gdk_gc_new( battstat->applet->window );
+ battstat->pixgc = gdk_gc_new( gtk_widget_get_window (battstat->applet) );
}
/* Pull in a clean version of the icons so that we don't paint over
diff --git a/configure.in b/configure.in
index 6200313..e69b921 100644
--- a/configure.in
+++ b/configure.in
@@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR(m4)
dnl ***************************************************************************
dnl *** Minimum library versions for GNOME-APPLETS ***
dnl ***************************************************************************
-GTK_REQUIRED=2.14.0
+GTK_REQUIRED=2.18.0
GLIB_REQUIRED=2.22.0
GIO_REQUIRED=2.15.3
GCONF_REQUIRED=2.8.0
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index 7d9495a..3ee9e75 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -419,6 +419,7 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu,
{
GtkWidget *widget;
GtkRequisition requisition;
+ GtkAllocation allocation;
gint menu_xpos;
gint menu_ypos;
@@ -426,10 +427,12 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu,
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
- gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+ gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
- menu_xpos += widget->allocation.x;
- menu_ypos += widget->allocation.y;
+ gtk_widget_get_allocation (widget, &allocation);
+
+ menu_xpos += allocation.x;
+ menu_ypos += allocation.y;
switch (panel_applet_get_orient (PANEL_APPLET (widget))) {
case PANEL_APPLET_ORIENT_DOWN:
@@ -437,14 +440,14 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu,
if (menu_ypos > gdk_screen_get_height (gtk_widget_get_screen (widget)) / 2)
menu_ypos -= requisition.height;
else
- menu_ypos += widget->allocation.height;
+ menu_ypos += allocation.height;
break;
case PANEL_APPLET_ORIENT_RIGHT:
case PANEL_APPLET_ORIENT_LEFT:
if (menu_xpos > gdk_screen_get_width (gtk_widget_get_screen (widget)) / 2)
menu_xpos -= requisition.width;
else
- menu_xpos += widget->allocation.width;
+ menu_xpos += allocation.width;
break;
default:
g_assert_not_reached ();
@@ -530,19 +533,22 @@ static void
cpufreq_applet_change_orient (PanelApplet *pa, PanelAppletOrient orient)
{
CPUFreqApplet *applet;
+ GtkAllocation allocation;
gint size;
applet = CPUFREQ_APPLET (pa);
applet->orient = orient;
+ gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
+
if ((orient == PANEL_APPLET_ORIENT_LEFT) ||
(orient == PANEL_APPLET_ORIENT_RIGHT)) {
- size = GTK_WIDGET (applet)->allocation.width;
+ size = allocation.width;
gtk_alignment_set (GTK_ALIGNMENT (applet->container),
0.5, 0.5, 0, 0);
} else {
- size = GTK_WIDGET (applet)->allocation.height;
+ size = allocation.height;
gtk_alignment_set (GTK_ALIGNMENT (applet->container),
0, 0.5, 0, 0);
}
@@ -814,7 +820,7 @@ cpufreq_applet_get_widget_size (CPUFreqApplet *applet,
GtkRequisition req;
gint size;
- if (!GTK_WIDGET_VISIBLE (widget))
+ if (!gtk_widget_get_visible (widget))
return 0;
gtk_widget_size_request (widget, &req);
diff --git a/cpufreq/src/cpufreq-popup.c b/cpufreq/src/cpufreq-popup.c
index 806f604..9bc100e 100644
--- a/cpufreq/src/cpufreq-popup.c
+++ b/cpufreq/src/cpufreq-popup.c
@@ -198,7 +198,7 @@ cpufreq_popup_frequencies_menu_activate (GtkAction *action,
cpu = cpufreq_monitor_get_cpu (popup->priv->monitor);
name = gtk_action_get_name (action);
freq = (guint) atoi (name + strlen ("Frequency"));
- parent = GDK_WINDOW_XID (popup->priv->parent->window);
+ parent = GDK_WINDOW_XID (gtk_widget_get_window (popup->priv->parent));
cpufreq_selector_set_frequency_async (selector, cpu, freq, parent);
@@ -222,7 +222,7 @@ cpufreq_popup_governors_menu_activate (GtkAction *action,
cpu = cpufreq_monitor_get_cpu (popup->priv->monitor);
name = gtk_action_get_name (action);
governor = name + strlen ("Governor");
- parent = GDK_WINDOW_XID (popup->priv->parent->window);
+ parent = GDK_WINDOW_XID (gtk_widget_get_window (popup->priv->parent));
cpufreq_selector_set_governor_async (selector, cpu, governor, parent);
}
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index 1a4b9b5..17d64e0 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -170,6 +170,10 @@ position_menu (GtkMenu *menu, gint *x, gint *y,
GtkWidget *widget = GTK_WIDGET (user_data);
GdkScreen *screen;
gint twidth, theight, tx, ty;
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION (2,20,0)
+ GtkRequisition requisition;
+#endif
GtkTextDirection direction;
GdkRectangle monitor;
gint monitor_num;
@@ -182,8 +186,14 @@ position_menu (GtkMenu *menu, gint *x, gint *y,
direction = gtk_widget_get_direction (widget);
+#if GTK_CHECK_VERSION (2,20,0)
+ gtk_widget_get_requisition (GTK_WIDGET (menu), &requisition);
+ twidth = requisition.width;
+ theight = requisition.height;
+#else
twidth = GTK_WIDGET (menu)->requisition.width;
theight = GTK_WIDGET (menu)->requisition.height;
+#endif
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
@@ -195,18 +205,19 @@ position_menu (GtkMenu *menu, gint *x, gint *y,
return;
}
- tx += widget->allocation.x;
- ty += widget->allocation.y;
+ gtk_widget_get_allocation (widget, &allocation);
+ tx += allocation.x;
+ ty += allocation.y;
if (direction == GTK_TEXT_DIR_RTL)
- tx += widget->allocation.width - twidth;
+ tx += allocation.width - twidth;
- if ((ty + widget->allocation.height + theight) <= monitor.y + monitor.height)
- ty += widget->allocation.height;
+ if ((ty + allocation.height + theight) <= monitor.y + monitor.height)
+ ty += allocation.height;
else if ((ty - theight) >= monitor.y)
ty -= theight;
- else if (monitor.y + monitor.height - (ty + widget->allocation.height) > ty)
- ty += widget->allocation.height;
+ else if (monitor.y + monitor.height - (ty + allocation.height) > ty)
+ ty += allocation.height;
else
ty -= theight;
diff --git a/geyes/geyes.c b/geyes/geyes.c
index 9880cad..9e7e244 100644
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -50,8 +50,8 @@ applet_back_change (PanelApplet *a,
break;
case PANEL_PIXMAP_BACKGROUND:
- style = gtk_style_copy (GTK_WIDGET (
- eyes_applet->applet)->style);
+ style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (
+ eyes_applet->applet)));
if (style->bg_pixmap[GTK_STATE_NORMAL])
g_object_unref
(style->bg_pixmap[GTK_STATE_NORMAL]);
@@ -75,6 +75,7 @@ calculate_pupil_xy (EyesApplet *eyes_applet,
gint x, gint y,
gint *pupil_x, gint *pupil_y, GtkWidget* widget)
{
+ GtkAllocation allocation;
double sina;
double cosa;
double h;
@@ -84,8 +85,9 @@ calculate_pupil_xy (EyesApplet *eyes_applet,
gfloat xalign, yalign;
gint width, height;
- width = GTK_WIDGET(widget)->allocation.width;
- height = GTK_WIDGET(widget)->allocation.height;
+ gtk_widget_get_allocation (GTK_WIDGET(widget), &allocation);
+ width = allocation.width;
+ height = allocation.height;
gtk_misc_get_alignment(GTK_MISC(widget), &xalign, &yalign);
nx = x - MAX(width - eyes_applet->eye_width, 0) * xalign - eyes_applet->eye_width / 2;
@@ -152,7 +154,11 @@ timer_cb (EyesApplet *eyes_applet)
gint i;
for (i = 0; i < eyes_applet->num_eyes; i++) {
+#if GTK_CHECK_VERSION (2,20,0)
+ if (gtk_widget_get_realized (eyes_applet->eyes[i])) {
+#else
if (GTK_WIDGET_REALIZED (eyes_applet->eyes[i])) {
+#endif
gtk_widget_get_pointer (eyes_applet->eyes[i],
&x, &y);
if ((x != eyes_applet->pointer_last_x[i]) || (y != eyes_applet->pointer_last_y[i])) {
diff --git a/gweather/gweather-dialog.c b/gweather/gweather-dialog.c
index ba42bba..e276db0 100644
--- a/gweather/gweather-dialog.c
+++ b/gweather/gweather-dialog.c
@@ -218,7 +218,7 @@ gweather_dialog_create (GWeatherDialog *dialog)
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
if (gw_applet->gweather_pref.radar_enabled)
@@ -233,7 +233,7 @@ gweather_dialog_create (GWeatherDialog *dialog)
/* Must come after load geometry, otherwise it will get reset. */
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
- weather_vbox = GTK_DIALOG (dialog)->vbox;
+ weather_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_widget_show (weather_vbox);
weather_notebook = gtk_notebook_new ();
diff --git a/gweather/gweather-pref.c b/gweather/gweather-pref.c
index 5878189..9366e3a 100644
--- a/gweather/gweather-pref.c
+++ b/gweather/gweather-pref.c
@@ -816,7 +816,7 @@ gweather_pref_create (GWeatherPref *pref)
gtk_window_set_screen (GTK_WINDOW (pref),
gtk_widget_get_screen (GTK_WIDGET (pref->priv->applet->applet)));
- pref_vbox = GTK_DIALOG (pref)->vbox;
+ pref_vbox = gtk_dialog_get_content_area (GTK_DIALOG (pref));
gtk_box_set_spacing (GTK_BOX (pref_vbox), 2);
gtk_widget_show (pref_vbox);
diff --git a/mixer/applet.c b/mixer/applet.c
index 7dcb411..dfd4bda 100644
--- a/mixer/applet.c
+++ b/mixer/applet.c
@@ -559,35 +559,39 @@ gnome_volume_applet_get_dock_position (GnomeVolumeApplet *applet,
gint *_x, gint *_y)
{
GtkWidget *widget = GTK_WIDGET (applet);
+ GtkAllocation widget_allocation, dock_allocation;
gint x, y;
- gdk_window_get_origin (widget->window, &x, &y);
+ gtk_widget_get_allocation (GTK_WIDGET (applet->dock), &dock_allocation);
+ gtk_widget_get_allocation (widget, &widget_allocation);
+
+ gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
switch (panel_applet_get_orient (PANEL_APPLET (applet))) {
case PANEL_APPLET_ORIENT_DOWN:
- x += widget->allocation.x;
- x -= (GTK_WIDGET (applet->dock)->allocation.width -
- widget->allocation.width) / 2;
- y += widget->allocation.height + widget->allocation.y;
+ x += widget_allocation.x;
+ x -= (dock_allocation.width -
+ widget_allocation.width) / 2;
+ y += widget_allocation.height + widget_allocation.y;
break;
case PANEL_APPLET_ORIENT_UP:
- x += widget->allocation.x;
- x -= (GTK_WIDGET (applet->dock)->allocation.width -
- widget->allocation.width) / 2;
- y += widget->allocation.y;
- y -= GTK_WIDGET (applet->dock)->allocation.height;
+ x += widget_allocation.x;
+ x -= (dock_allocation.width -
+ widget_allocation.width) / 2;
+ y += widget_allocation.y;
+ y -= dock_allocation.height;
break;
case PANEL_APPLET_ORIENT_RIGHT:
- x += widget->allocation.width + widget->allocation.x;
- y += widget->allocation.y;
- y -= (GTK_WIDGET (applet->dock)->allocation.height -
- widget->allocation.height) / 2;
+ x += widget_allocation.width + widget_allocation.x;
+ y += widget_allocation.y;
+ y -= (dock_allocation.height -
+ widget_allocation.height) / 2;
break;
case PANEL_APPLET_ORIENT_LEFT:
- x += widget->allocation.x;
- x -= GTK_WIDGET (applet->dock)->allocation.width;
- y += widget->allocation.y;
- y -= (GTK_WIDGET (applet->dock)->allocation.height -
- widget->allocation.height) / 2;
+ x += widget_allocation.x;
+ x -= dock_allocation.width;
+ y += widget_allocation.y;
+ y -= (dock_allocation.height -
+ widget_allocation.height) / 2;
break;
default:
g_assert_not_reached ();
@@ -746,13 +750,13 @@ gnome_volume_applet_scroll (GtkWidget *widget,
gdouble volume = gtk_adjustment_get_value (applet->adjustment);
if (event->direction == GDK_SCROLL_UP) {
- volume += applet->adjustment->step_increment;
- if (volume > applet->adjustment->upper)
- volume = applet->adjustment->upper;
+ volume += gtk_adjustment_get_step_increment (applet->adjustment);
+ if (volume > gtk_adjustment_get_upper (applet->adjustment))
+ volume = gtk_adjustment_get_upper (applet->adjustment);
} else {
- volume -= applet->adjustment->step_increment;
- if (volume < applet->adjustment->lower)
- volume = applet->adjustment->lower;
+ volume -= gtk_adjustment_get_step_increment (applet->adjustment);
+ if (volume < gtk_adjustment_get_lower (applet->adjustment))
+ volume = gtk_adjustment_get_lower (applet->adjustment);
}
gtk_adjustment_set_value (applet->adjustment, volume);
@@ -775,11 +779,11 @@ gnome_volume_applet_button (GtkWidget *widget,
{
GnomeVolumeApplet *applet = GNOME_VOLUME_APPLET (widget);
- if (event->window != GTK_WIDGET (applet)->window &&
+ if (event->window != gtk_widget_get_window (GTK_WIDGET (applet)) &&
event->type == GDK_BUTTON_PRESS) {
gnome_volume_applet_popdown_dock (applet);
return TRUE;
- } else if (event->window == GTK_WIDGET (applet)->window) {
+ } else if (event->window == gtk_widget_get_window (GTK_WIDGET (applet))) {
switch (event->button) {
case 1:
switch (event->type) {
@@ -868,19 +872,19 @@ gnome_volume_applet_key (GtkWidget *widget,
if (event->keyval == GDK_Up || event->keyval == GDK_Down
||event->keyval == GDK_Left)
- increment = applet->adjustment->step_increment;
+ increment = gtk_adjustment_get_step_increment (applet->adjustment);
else
- increment = applet->adjustment->page_increment;
+ increment = gtk_adjustment_get_page_increment (applet->adjustment);
if (event->keyval == GDK_Page_Up || event->keyval == GDK_Up
||event->keyval == GDK_Right) {
volume += increment;
- if (volume > applet->adjustment->upper)
- volume = applet->adjustment->upper;
+ if (volume > gtk_adjustment_get_upper (applet->adjustment))
+ volume = gtk_adjustment_get_upper (applet->adjustment);
} else {
volume -= increment;
- if (volume < applet->adjustment->lower)
- volume = applet->adjustment->lower;
+ if (volume < gtk_adjustment_get_lower (applet->adjustment))
+ volume = gtk_adjustment_get_lower (applet->adjustment);
}
gtk_adjustment_set_value (applet->adjustment, volume);
@@ -980,7 +984,7 @@ gnome_volume_applet_background (PanelApplet *_applet,
GTK_STATE_NORMAL, colour);
break;
case PANEL_PIXMAP_BACKGROUND:
- style = gtk_style_copy (GTK_WIDGET (applet)->style);
+ style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (applet)));
if (style->bg_pixmap[GTK_STATE_NORMAL])
g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
diff --git a/mixer/dock.c b/mixer/dock.c
index 1b8f2bd..776f939 100644
--- a/mixer/dock.c
+++ b/mixer/dock.c
@@ -268,13 +268,13 @@ cb_timeout (gpointer data)
adj = gtk_range_get_adjustment (dock->scale);
volume = gtk_range_get_value (dock->scale);
- volume += dock->direction * adj->step_increment;
+ volume += dock->direction * gtk_adjustment_get_step_increment (adj);
- if (volume <= adj->lower) {
- volume = adj->lower;
+ if (volume <= gtk_adjustment_get_lower (adj)) {
+ volume = gtk_adjustment_get_lower (adj);
res = FALSE;
- } else if (volume >= adj->upper) {
- volume = adj->upper;
+ } else if (volume >= gtk_adjustment_get_upper (adj)) {
+ volume = gtk_adjustment_get_upper (adj);
res = FALSE;
}
diff --git a/mixer/preferences.c b/mixer/preferences.c
index ae700d0..745a416 100644
--- a/mixer/preferences.c
+++ b/mixer/preferences.c
@@ -90,7 +90,7 @@ gnome_volume_applet_preferences_init (GnomeVolumeAppletPreferences *prefs)
gtk_window_set_title (GTK_WINDOW (prefs), _("Volume Control Preferences"));
gtk_dialog_set_has_separator (GTK_DIALOG (prefs), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (prefs), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG(prefs)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG(prefs))), 2);
gtk_dialog_add_buttons (GTK_DIALOG (prefs),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
/* help goes here (future) */
@@ -149,7 +149,7 @@ gnome_volume_applet_preferences_init (GnomeVolumeAppletPreferences *prefs)
gtk_tree_view_set_search_column (GTK_TREE_VIEW (prefs->treeview), COL_LABEL);
/* and show */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prefs)->vbox), box,
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (prefs))), box,
TRUE, TRUE, 0);
gtk_widget_show (box);
}
diff --git a/multiload/load-graph.c b/multiload/load-graph.c
index a04eeaa..2624422 100644
--- a/multiload/load-graph.c
+++ b/multiload/load-graph.c
@@ -47,22 +47,25 @@ shift_right(LoadGraph *g)
static void
load_graph_draw (LoadGraph *g)
{
+ GtkStyle *style;
guint i, j;
-
+
/* we might get called before the configure event so that
* g->disp->allocation may not have the correct size
* (after the user resized the applet in the prop dialog). */
if (!g->pixmap)
- g->pixmap = gdk_pixmap_new (g->disp->window,
+ g->pixmap = gdk_pixmap_new (gtk_widget_get_window (g->disp),
g->draw_width, g->draw_height,
gtk_widget_get_visual (g->disp)->depth);
+ style = gtk_widget_get_style (g->disp);
+
/* Create GC if necessary. */
if (!g->gc)
{
- g->gc = gdk_gc_new (g->disp->window);
- gdk_gc_copy (g->gc, g->disp->style->black_gc);
+ g->gc = gdk_gc_new (gtk_widget_get_window (g->disp));
+ gdk_gc_copy (g->gc, style->black_gc);
}
/* Allocate colors. */
@@ -70,7 +73,7 @@ load_graph_draw (LoadGraph *g)
{
GdkColormap *colormap;
- colormap = gdk_drawable_get_colormap (g->disp->window);
+ colormap = gdk_drawable_get_colormap (gtk_widget_get_window (g->disp));
for (i = 0; i < g->n; i++)
gdk_colormap_alloc_color (colormap, &(g->colors [i]),
@@ -81,7 +84,7 @@ load_graph_draw (LoadGraph *g)
/* Erase Rectangle */
gdk_draw_rectangle (g->pixmap,
- g->disp->style->black_gc,
+ style->black_gc,
TRUE, 0, 0,
g->draw_width,
g->draw_height);
@@ -106,8 +109,8 @@ load_graph_draw (LoadGraph *g)
}
}
- gdk_draw_drawable (g->disp->window,
- g->disp->style->fg_gc [GTK_WIDGET_STATE(g->disp)],
+ gdk_draw_drawable (gtk_widget_get_window (g->disp),
+ style->fg_gc [gtk_widget_get_state (g->disp)],
g->pixmap,
0, 0,
0, 0,
@@ -192,30 +195,33 @@ static gint
load_graph_configure (GtkWidget *widget, GdkEventConfigure *event,
gpointer data_ptr)
{
+ GtkAllocation allocation;
LoadGraph *c = (LoadGraph *) data_ptr;
load_graph_unalloc (c);
- c->draw_width = c->disp->allocation.width;
- c->draw_height = c->disp->allocation.height;
+ gtk_widget_get_allocation (c->disp, &allocation);
+
+ c->draw_width = allocation.width;
+ c->draw_height = allocation.height;
c->draw_width = MAX (c->draw_width, 1);
c->draw_height = MAX (c->draw_height, 1);
load_graph_alloc (c);
if (!c->pixmap)
- c->pixmap = gdk_pixmap_new (c->disp->window,
+ c->pixmap = gdk_pixmap_new (gtk_widget_get_window (c->disp),
c->draw_width,
c->draw_height,
gtk_widget_get_visual (c->disp)->depth);
gdk_draw_rectangle (c->pixmap,
- widget->style->black_gc,
+ (gtk_widget_get_style (widget))->black_gc,
TRUE, 0,0,
c->draw_width,
c->draw_height);
- gdk_draw_drawable (widget->window,
- c->disp->style->fg_gc [GTK_WIDGET_STATE(widget)],
+ gdk_draw_drawable (gtk_widget_get_window (widget),
+ (gtk_widget_get_style (c->disp))->fg_gc [gtk_widget_get_state (widget)],
c->pixmap,
0, 0,
0, 0,
@@ -231,8 +237,8 @@ load_graph_expose (GtkWidget *widget, GdkEventExpose *event,
{
LoadGraph *g = (LoadGraph *) data_ptr;
- gdk_draw_drawable (widget->window,
- widget->style->fg_gc [GTK_WIDGET_STATE(widget)],
+ gdk_draw_drawable (gtk_widget_get_window (widget),
+ (gtk_widget_get_style (widget))->fg_gc [gtk_widget_get_state (widget)],
g->pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff --git a/multiload/properties.c b/multiload/properties.c
index 8b6fbd7..2dd32d3 100644
--- a/multiload/properties.c
+++ b/multiload/properties.c
@@ -343,7 +343,7 @@ fill_properties(GtkWidget *dialog, MultiloadApplet *ma)
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox,
TRUE, TRUE, 0);
categories_vbox = gtk_vbox_new (FALSE, 18);
@@ -666,7 +666,7 @@ multiload_properties_cb (BonoboUIComponent *uic,
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
fill_properties(dialog, ma);
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index 1c9a98c..f3fe776 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -599,6 +599,7 @@ void
stickynotes_applet_panel_icon_get_geometry (int *x, int *y, int *width, int *height)
{
GtkWidget *widget;
+ GtkAllocation allocation;
GtkRequisition requisition;
StickyNotesApplet *applet;
@@ -610,6 +611,7 @@ stickynotes_applet_panel_icon_get_geometry (int *x, int *y, int *width, int *hei
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
- *width = widget->allocation.x;
- *height = widget->allocation.y;
+ gtk_widget_get_allocation (widget, &allocation);
+ *width = allocation.x;
+ *height = allocation.y;
}
diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c
index e6be025..bffa3ad 100644
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -123,7 +123,7 @@ applet_key_cb (GtkWidget *widget,
/* Applet Callback : Cross (enter or leave) the applet. */
gboolean applet_cross_cb(GtkWidget *widget, GdkEventCrossing *event, StickyNotesApplet *applet)
{
- applet->prelighted = event->type == GDK_ENTER_NOTIFY || GTK_WIDGET_HAS_FOCUS(widget);
+ applet->prelighted = event->type == GDK_ENTER_NOTIFY || gtk_widget_has_focus(widget);
stickynotes_applet_update_icon(applet);
@@ -222,7 +222,7 @@ applet_change_bg_cb (PanelApplet *panel_applet,
break;
case PANEL_PIXMAP_BACKGROUND:
style = gtk_style_copy (
- GTK_WIDGET (applet->w_applet)->style);
+ gtk_widget_get_style (GTK_WIDGET (applet->w_applet)));
if (style->bg_pixmap[GTK_STATE_NORMAL])
g_object_unref (
style->bg_pixmap[GTK_STATE_NORMAL]);
diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c
index 529318b..858fe77 100644
--- a/trashapplet/src/trash-empty.c
+++ b/trashapplet/src/trash-empty.c
@@ -350,7 +350,7 @@ trash_empty_show_confirmation_dialog (GtkWidget *parent)
button = gtk_button_new_with_mnemonic (_("_Empty Trash"));
gtk_widget_show (button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
GTK_RESPONSE_YES);
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index aa1b0b6..c8e615c 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -537,7 +537,7 @@ trash_applet_drag_data_received (GtkWidget *widget,
GList *l;
GError *error = NULL;
- list = g_uri_list_extract_uris ((gchar *)selectiondata->data);
+ list = g_uri_list_extract_uris ((gchar *)gtk_selection_data_get_data (selectiondata));
for (i = 0; list[i]; i++)
{
diff --git a/trashapplet/src/xstuff.c b/trashapplet/src/xstuff.c
index f575525..3bc3aac 100644
--- a/trashapplet/src/xstuff.c
+++ b/trashapplet/src/xstuff.c
@@ -442,22 +442,24 @@ xstuff_zoom_animate (GtkWidget *widget, GdkRectangle *opt_rect)
{
GdkScreen *gscreen;
GdkRectangle rect, dest;
+ GtkAllocation allocation;
int monitor;
if (opt_rect)
rect = *opt_rect;
else {
- gdk_window_get_origin (widget->window, &rect.x, &rect.y);
- if (GTK_WIDGET_NO_WINDOW (widget)) {
- rect.x += widget->allocation.x;
- rect.y += widget->allocation.y;
+ gdk_window_get_origin (gtk_widget_get_window (widget), &rect.x, &rect.y);
+ gtk_widget_get_allocation (widget, &allocation);
+ if (!gtk_widget_get_has_window (widget)) {
+ rect.x += allocation.x;
+ rect.y += allocation.y;
}
- rect.height = widget->allocation.height;
- rect.width = widget->allocation.width;
+ rect.height = allocation.height;
+ rect.width = allocation.width;
}
gscreen = gtk_widget_get_screen (widget);
- monitor = gdk_screen_get_monitor_at_window (gscreen, widget->window);
+ monitor = gdk_screen_get_monitor_at_window (gscreen, gtk_widget_get_window (widget));
gdk_screen_get_monitor_geometry (gscreen, monitor, &dest);
draw_zoom_animation (gscreen,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]