summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2010-06-22 21:27:36 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2010-06-22 22:18:34 +0200
commitfb1d0534557ef3f0e406676c3cc927f31e232d40 (patch)
tree1a628bcd62c63f7eb48f45cf8ad3b13aabfc2e31 /src
parentf42852f4ba59210ed8751dcc8d3d62ad8510f184 (diff)
downloadgnome-dictionary-fb1d0534557ef3f0e406676c3cc927f31e232d40.tar.gz
Fix GSEAL issues
GNOME bug #612485
Diffstat (limited to 'src')
-rw-r--r--src/gdict-aligned-window.c13
-rw-r--r--src/gdict-applet.c15
-rw-r--r--src/gdict-sidebar.c10
-rw-r--r--src/gdict-window.c11
4 files changed, 30 insertions, 19 deletions
diff --git a/src/gdict-aligned-window.c b/src/gdict-aligned-window.c
index 66035aa..c7ddf83 100644
--- a/src/gdict-aligned-window.c
+++ b/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/src/gdict-applet.c b/src/gdict-applet.c
index 5e9afd5..acd7dd7 100644
--- a/src/gdict-applet.c
+++ b/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/src/gdict-sidebar.c b/src/gdict-sidebar.c
index 9829149..1e13986 100644
--- a/src/gdict-sidebar.c
+++ b/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/src/gdict-window.c b/src/gdict-window.c
index 2d63ad6..f79e9d1 100644
--- a/src/gdict-window.c
+++ b/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);