[gnome-utils] Fix GSEAL issues
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils] Fix GSEAL issues
- Date: Tue, 22 Jun 2010 20:18:50 +0000 (UTC)
commit 432bc51d88c6ca8092855ddc1dddbb69d0ac5231
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Tue Jun 22 21:27:36 2010 +0200
Fix GSEAL issues
GNOME bug #612485
gnome-dictionary/src/gdict-aligned-window.c | 13 +++++++------
gnome-dictionary/src/gdict-applet.c | 15 +++++++++------
gnome-dictionary/src/gdict-sidebar.c | 10 +++++++---
gnome-dictionary/src/gdict-window.c | 11 +++++++----
4 files changed, 30 insertions(+), 19 deletions(-)
---
diff --git a/gnome-dictionary/src/gdict-aligned-window.c b/gnome-dictionary/src/gdict-aligned-window.c
index 66035aa..c7ddf83 100644
--- a/gnome-dictionary/src/gdict-aligned-window.c
+++ b/gnome-dictionary/src/gdict-aligned-window.c
@@ -105,7 +105,6 @@ gdict_aligned_window_init (GdictAlignedWindow *aligned_window)
priv->motion_id = 0;
/* set window properties */
- window->type = GTK_WINDOW_TOPLEVEL;
#if 0
gtk_window_set_modal (window, TRUE);
#endif
@@ -161,6 +160,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window)
gint entry_x, entry_y, entry_width, entry_height;
gint x, y;
GdkGravity gravity = GDK_GRAVITY_NORTH_WEST;
+ GdkWindow *gdk_window;
g_assert (GDICT_IS_ALIGNED_WINDOW (window));
priv = window->priv;
@@ -169,10 +169,11 @@ gdict_aligned_window_position (GdictAlignedWindow *window)
return;
align_widget = priv->align_widget;
+ gdk_window = gtk_widget_get_window (align_widget);
gdk_flush ();
- gdk_window_get_geometry (GTK_WIDGET (window)->window,
+ gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (window)),
NULL,
NULL,
&our_width,
@@ -188,10 +189,10 @@ gdict_aligned_window_position (GdictAlignedWindow *window)
gtk_widget_realize (align_widget);
/* get the positional and dimensional attributes of the align widget */
- gdk_window_get_origin (align_widget->window,
+ gdk_window_get_origin (gdk_window,
&entry_x,
&entry_y);
- gdk_window_get_geometry (align_widget->window,
+ gdk_window_get_geometry (gdk_window,
NULL,
NULL,
&entry_width,
@@ -253,14 +254,14 @@ gdict_aligned_window_motion_notify_cb (GtkWidget *widget,
GtkAllocation alloc;
GdkRectangle rect;
- alloc = GTK_WIDGET (aligned_window)->allocation;
+ gtk_widget_get_allocation (GTK_WIDGET (aligned_window), &alloc);
rect.x = 0;
rect.y = 0;
rect.width = alloc.width;
rect.height = alloc.height;
- gdk_window_invalidate_rect (GTK_WIDGET (aligned_window)->window,
+ gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (aligned_window)),
&rect,
FALSE);
diff --git a/gnome-dictionary/src/gdict-applet.c b/gnome-dictionary/src/gdict-applet.c
index 5e9afd5..acd7dd7 100644
--- a/gnome-dictionary/src/gdict-applet.c
+++ b/gnome-dictionary/src/gdict-applet.c
@@ -141,7 +141,7 @@ set_window_default_size (GdictApplet *applet)
defbox = priv->defbox;
/* Size based on the font size */
- font_size = pango_font_description_get_size (defbox->style->font_desc);
+ font_size = pango_font_description_get_size (gtk_widget_get_style (defbox)->font_desc);
font_size = PANGO_PIXELS (font_size);
width = font_size * WINDOW_NUM_COLUMNS;
@@ -154,7 +154,8 @@ set_window_default_size (GdictApplet *applet)
/* ... but make it no larger than half the monitor size */
screen = gtk_widget_get_screen (widget);
- monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window);
+ monitor_num = gdk_screen_get_monitor_at_window (screen,
+ gtk_widget_get_window (widget));
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
@@ -348,8 +349,8 @@ gdict_applet_build_window (GdictApplet *applet)
gtk_box_pack_start (GTK_BOX (vbox), priv->defbox, TRUE, TRUE, 0);
gtk_widget_show (priv->defbox);
- GTK_WIDGET_SET_FLAGS (priv->defbox, GTK_CAN_FOCUS);
- GTK_WIDGET_SET_FLAGS (priv->defbox, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_focus (priv->defbox, TRUE);
+ gtk_widget_set_can_default (priv->defbox, TRUE);
bbox = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
@@ -772,18 +773,20 @@ gdict_applet_change_orient (PanelApplet *applet,
{
GdictAppletPrivate *priv = GDICT_APPLET (applet)->priv;
guint new_size;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
switch (orient)
{
case PANEL_APPLET_ORIENT_LEFT:
case PANEL_APPLET_ORIENT_RIGHT:
priv->orient = GTK_ORIENTATION_VERTICAL;
- new_size = GTK_WIDGET (applet)->allocation.width;
+ new_size = allocation.width;
break;
case PANEL_APPLET_ORIENT_UP:
case PANEL_APPLET_ORIENT_DOWN:
priv->orient = GTK_ORIENTATION_HORIZONTAL;
- new_size = GTK_WIDGET (applet)->allocation.height;
+ new_size = allocation.height;
break;
}
diff --git a/gnome-dictionary/src/gdict-sidebar.c b/gnome-dictionary/src/gdict-sidebar.c
index 9829149..1e13986 100644
--- a/gnome-dictionary/src/gdict-sidebar.c
+++ b/gnome-dictionary/src/gdict-sidebar.c
@@ -145,6 +145,7 @@ gdict_sidebar_menu_position_function (GtkMenu *menu,
gpointer user_data)
{
GtkWidget *widget;
+ GtkAllocation allocation;
g_assert (GTK_IS_BUTTON (user_data));
@@ -152,8 +153,9 @@ gdict_sidebar_menu_position_function (GtkMenu *menu,
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
- *x += widget->allocation.x;
- *y += widget->allocation.y + widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+ *x += allocation.x;
+ *y += allocation.y + allocation.height;
*push_in = FALSE;
}
@@ -164,13 +166,15 @@ gdict_sidebar_select_button_press_cb (GtkWidget *widget,
gpointer user_data)
{
GdictSidebar *sidebar = GDICT_SIDEBAR (user_data);
+ GtkAllocation allocation;
if (event->button == 1)
{
GtkRequisition req;
gint width;
- width = widget->allocation.width;
+ gtk_widget_get_allocation (widget, &allocation);
+ width = allocation.width;
gtk_widget_set_size_request (sidebar->priv->menu, -1, -1);
gtk_widget_size_request (sidebar->priv->menu, &req);
gtk_widget_set_size_request (sidebar->priv->menu,
diff --git a/gnome-dictionary/src/gdict-window.c b/gnome-dictionary/src/gdict-window.c
index 2d63ad6..f79e9d1 100644
--- a/gnome-dictionary/src/gdict-window.c
+++ b/gnome-dictionary/src/gdict-window.c
@@ -1625,7 +1625,7 @@ set_window_default_size (GdictWindow *window)
/* Size based on the font size */
GtkWidget *defbox = window->defbox;
- font_size = pango_font_description_get_size (defbox->style->font_desc);
+ font_size = pango_font_description_get_size (gtk_widget_get_style (defbox)->font_desc);
font_size = PANGO_PIXELS (font_size);
width = font_size * GDICT_WINDOW_COLUMNS;
@@ -1673,9 +1673,11 @@ gdict_window_handle_notify_position_cb (GtkWidget *widget,
{
GdictWindow *window = GDICT_WINDOW (user_data);
gint window_width, pos;
+ GtkAllocation allocation;
pos = gtk_paned_get_position (GTK_PANED (widget));
- window_width = GTK_WIDGET (window)->allocation.width;
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+ window_width = allocation.width;
window->sidebar_width = window_width - pos;
}
@@ -1702,6 +1704,7 @@ gdict_window_constructor (GType type,
GError *error;
gboolean sidebar_visible;
gboolean statusbar_visible;
+ GtkAllocation allocation;
object = G_OBJECT_CLASS (gdict_window_parent_class)->constructor (type,
n_construct_properties,
@@ -1957,8 +1960,8 @@ gdict_window_constructor (GType type,
if (is_maximized)
gtk_window_maximize (GTK_WINDOW (window));
- gtk_paned_set_position (GTK_PANED (handle),
- GTK_WIDGET (window)->allocation.width - sidebar_width);
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+ gtk_paned_set_position (GTK_PANED (handle), allocation.width - sidebar_width);
if (sidebar_page)
{
gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar), sidebar_page);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]