aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2009-11-13 13:29:35 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2009-11-17 07:53:40 +0800
commit6f9fe3b417a3870ce48288f1273843af05d39624 (patch)
treebf9836bcf0e67793ee18e3beca4835880ed656aa /src
parente836a987945a601d70082eef2c6f2fd6796c4fd3 (diff)
downloadgsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.gz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.bz2
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.lz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.xz
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.tar.zst
gsoc2013-empathy-6f9fe3b417a3870ce48288f1273843af05d39624.zip
Use accessor functions instead direct access.
Some functions still remaining because there is not API in GTK+ 2.19.0 yet. http://bugzilla.gnome.org/show_bug.cgi?id=586476 Reviewed-By: Danielle Madeley <danielle.madeley@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c21
-rw-r--r--src/empathy-chat-window.c4
-rw-r--r--src/empathy-chatrooms-window.c2
-rw-r--r--src/empathy-sidebar.c12
-rw-r--r--src/ephy-spinner.c18
5 files changed, 35 insertions, 22 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 07cad91f6..e1f8cd268 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2086,8 +2086,12 @@ empathy_call_window_state_event_cb (GtkWidget *widget,
if (set_fullscreen)
{
gboolean sidebar_was_visible;
- gint original_width = GTK_WIDGET (window)->allocation.width;
- gint original_height = GTK_WIDGET (window)->allocation.height;
+ GtkAllocation allocation;
+ gint original_width, original_height;
+
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+ original_width = allocation.width;
+ original_height = allocation.height;
g_object_get (priv->sidebar, "visible", &sidebar_was_visible, NULL);
@@ -2132,23 +2136,26 @@ empathy_call_window_sidebar_toggled_cb (GtkToggleButton *toggle,
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
GtkWidget *arrow;
- int w,h, handle_size;
+ int w, h, handle_size;
+ GtkAllocation allocation, sidebar_allocation;
- w = GTK_WIDGET (window)->allocation.width;
- h = GTK_WIDGET (window)->allocation.height;
+ gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
+ w = allocation.width;
+ h = allocation.height;
gtk_widget_style_get (priv->pane, "handle_size", &handle_size, NULL);
+ gtk_widget_get_allocation (priv->sidebar, &sidebar_allocation);
if (gtk_toggle_button_get_active (toggle))
{
arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
gtk_widget_show (priv->sidebar);
- w += priv->sidebar->allocation.width + handle_size;
+ w += sidebar_allocation.width + handle_size;
}
else
{
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
- w -= priv->sidebar->allocation.width + handle_size;
+ w -= sidebar_allocation.width + handle_size;
gtk_widget_hide (priv->sidebar);
}
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index ca3375306..278c8f044 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -268,8 +268,8 @@ chat_window_create_label (EmpathyChatWindow *window,
/* We don't want focus/keynav for the button to avoid clutter, and
* Ctrl-W works anyway.
*/
- GTK_WIDGET_UNSET_FLAGS (close_button, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (close_button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_focus (close_button, FALSE);
+ gtk_widget_set_can_default (close_button, FALSE);
/* Set the name to make the special rc style match. */
gtk_widget_set_name (close_button, "empathy-close-button");
diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c
index 278a1d686..6f2c8c24c 100644
--- a/src/empathy-chatrooms-window.c
+++ b/src/empathy-chatrooms-window.c
@@ -450,7 +450,7 @@ chatrooms_window_row_activated_cb (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
EmpathyChatroomsWindow *window)
{
- if (GTK_WIDGET_IS_SENSITIVE (window->button_edit)) {
+ if (gtk_widget_is_sensitive (window->button_edit)) {
chatrooms_window_model_action_selected (window);
}
}
diff --git a/src/empathy-sidebar.c b/src/empathy-sidebar.c
index 11fcbd6bb..7960c4ad9 100644
--- a/src/empathy-sidebar.c
+++ b/src/empathy-sidebar.c
@@ -238,16 +238,18 @@ empathy_sidebar_menu_position_under (GtkMenu *menu,
gpointer user_data)
{
GtkWidget *widget;
+ GtkAllocation allocation;
g_return_if_fail (GTK_IS_BUTTON (user_data));
- g_return_if_fail (GTK_WIDGET_NO_WINDOW (user_data));
+ g_return_if_fail (gtk_widget_get_has_window (user_data));
widget = GTK_WIDGET (user_data);
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;
}
@@ -263,8 +265,10 @@ empathy_sidebar_select_button_press_cb (GtkWidget *widget,
{
GtkRequisition requisition;
gint width;
+ GtkAllocation allocation;
- 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, &requisition);
diff --git a/src/ephy-spinner.c b/src/ephy-spinner.c
index d2d50453c..7efacb18a 100644
--- a/src/ephy-spinner.c
+++ b/src/ephy-spinner.c
@@ -601,7 +601,7 @@ ephy_spinner_init (EphySpinner *spinner)
details = spinner->details = EPHY_SPINNER_GET_PRIVATE (spinner);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE);
details->cache = ephy_spinner_cache_ref ();
details->size = GTK_ICON_SIZE_DIALOG;
@@ -621,8 +621,9 @@ ephy_spinner_expose (GtkWidget *widget,
GdkGC *gc;
int x_offset, y_offset, width, height;
GdkRectangle pix_area, dest;
+ GtkAllocation allocation;
- if (!GTK_WIDGET_DRAWABLE (spinner))
+ if (!gtk_widget_is_drawable (GTK_WIDGET (spinner)))
{
return FALSE;
}
@@ -652,11 +653,12 @@ ephy_spinner_expose (GtkWidget *widget,
height = gdk_pixbuf_get_height (pixbuf);
/* Compute the offsets for the image centered on our allocation */
- x_offset = (widget->allocation.width - width) / 2;
- y_offset = (widget->allocation.height - height) / 2;
+ gtk_widget_get_allocation (widget, &allocation);
+ x_offset = (allocation.width - width) / 2;
+ y_offset = (allocation.height - height) / 2;
- pix_area.x = x_offset + widget->allocation.x;
- pix_area.y = y_offset + widget->allocation.y;
+ pix_area.x = x_offset + allocation.x;
+ pix_area.y = y_offset + allocation.y;
pix_area.width = width;
pix_area.height = height;
@@ -667,8 +669,8 @@ ephy_spinner_expose (GtkWidget *widget,
gc = gdk_gc_new (gtk_widget_get_window (widget));
gdk_draw_pixbuf (gtk_widget_get_window (widget), gc, pixbuf,
- dest.x - x_offset - widget->allocation.x,
- dest.y - y_offset - widget->allocation.y,
+ dest.x - x_offset - allocation.x,
+ dest.y - y_offset - allocation.y,
dest.x, dest.y,
dest.width, dest.height,
GDK_RGB_DITHER_MAX, 0, 0);