gint popup_width, popup_height;
gint width, height;
GdkPixbuf *pixbuf;
+ GtkAllocation allocation;
priv = GET_PRIV (widget);
popup_width = gdk_pixbuf_get_width (priv->pixbuf);
popup_height = gdk_pixbuf_get_height (priv->pixbuf);
- width = priv->image->allocation.width;
- height = priv->image->allocation.height;
+ gtk_widget_get_allocation (priv->image, &allocation);
+ width = allocation.width;
+ height = allocation.height;
/* Don't show a popup if the popup is smaller then the currently avatar
* image.
{
GdkWindow *bin_window;
GdkRectangle rect;
+ GtkAllocation allocation;
bin_window = gtk_tree_view_get_bin_window (tree_view);
gtk_tree_view_get_background_area (tree_view, path, NULL, &rect);
rect.x = 0;
- rect.width = GTK_WIDGET (tree_view)->allocation.width;
+ gtk_widget_get_allocation (GTK_WIDGET (tree_view), &allocation);
+ rect.width = allocation.width;
gdk_window_invalidate_rect (bin_window, &rect, TRUE);
}
{
EmpathyChatPriv *priv = GET_PRIV (chat);
gboolean show;
+ GtkAllocation allocation;
show = priv->remote_contact == NULL && priv->show_contacts;
* chat view is bigger the contact list will take some space on
* it but we make sure the chat view don't become smaller than
* 250. Relax the size request once the resize is done */
- min_width = MIN (priv->vbox_left->allocation.width, 250);
+ gtk_widget_get_allocation (priv->vbox_left, &allocation);
+ min_width = MIN (allocation.width, 250);
gtk_widget_set_size_request (priv->vbox_left, min_width, -1);
g_idle_add (chat_reset_size_request, priv->vbox_left);
child = gtk_bin_get_child (bin);
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
GtkWidget *child;
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
child = gtk_bin_get_child (bin);
- if (child && GTK_WIDGET_VISIBLE (child))
+ if (child && gtk_widget_get_visible (child))
{
child_allocation.x = allocation->x + gtk_container_get_border_width (GTK_CONTAINER (widget));
child_allocation.y = allocation->y + gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
button,
GTK_RESPONSE_CLOSE);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_window_set_default (GTK_WINDOW (dialog), button);
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
button,
GTK_RESPONSE_CLOSE);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_window_set_default (GTK_WINDOW (dialog), button);
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (personal_dialog),
button,
GTK_RESPONSE_CLOSE);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_window_set_default (GTK_WINDOW (personal_dialog), button);
gtk_widget_show (button);
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item));
- if (!GTK_WIDGET_TOPLEVEL (toplevel) || !GTK_IS_WINDOW (toplevel)) {
+ if (!gtk_widget_is_toplevel (toplevel) || !GTK_IS_WINDOW (toplevel)) {
toplevel = NULL;
}
PangoLayout *layout;
PangoRectangle rect;
GtkAllocation real_allocation;
+ GtkAllocation allocation;
gboolean r;
layout = gtk_label_get_layout (GTK_LABEL (self));
* layout when painting it. This really sucks. We're going to compensate by
* adding this value to the allocation.
*/
- real_allocation = self->allocation;
- self->allocation.x += rect.x;
+ gtk_widget_get_allocation (self, &allocation);
+ real_allocation = allocation;
+ allocation.x += rect.x;
+ gtk_widget_set_allocation (self, &allocation);
r = GTK_WIDGET_CLASS (empathy_kludge_label_parent_class)->expose_event (
self, event);
- self->allocation = real_allocation;
+ gtk_widget_set_allocation (self, &real_allocation);
return r;
}
/* attempt to get the toplevel for this widget */
window = gtk_widget_get_toplevel (GTK_WIDGET (self));
- if (GTK_WIDGET_TOPLEVEL (window) && GTK_IS_WINDOW (window)) {
+ if (gtk_widget_is_toplevel (window) && GTK_IS_WINDOW (window)) {
/* unset the focus */
gtk_window_set_focus (GTK_WINDOW (window), NULL);
}
if (!priv->editing_status &&
event->button == 1 &&
- !GTK_WIDGET_HAS_FOCUS (entry)) {
+ !gtk_widget_has_focus (entry)) {
gtk_widget_grab_focus (entry);
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
/* attempt to get the toplevel for this widget */
window = gtk_widget_get_toplevel (GTK_WIDGET (self));
- if (!GTK_WIDGET_TOPLEVEL (window) || !GTK_IS_WINDOW (window)) {
+ if (!gtk_widget_is_toplevel (window) || !GTK_IS_WINDOW (window)) {
window = NULL;
}
GdkEventButton *event,
EmpathyStatusPresetDialog *self)
{
- if (!GTK_WIDGET_HAS_FOCUS (widget)) {
+ if (!gtk_widget_has_focus (widget)) {
/* if the widget isn't focused, focus it and select the text */
gtk_widget_grab_focus (widget);
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
toplevel = gtk_widget_get_toplevel (widget);
if (GTK_IS_WINDOW (toplevel) &&
- GTK_WIDGET_TOPLEVEL (toplevel)) {
+ gtk_widget_is_toplevel (toplevel)) {
return GTK_WINDOW (toplevel);
}
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (widget), button,
GTK_RESPONSE_OK);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_dialog_set_default_response (GTK_DIALOG (widget),
GTK_RESPONSE_OK);
gtk_widget_modify_bg (GTK_WIDGET (obj), GTK_STATE_NORMAL,
&black);
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (obj), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (obj), FALSE);
}
static void
{
EmpathyVideoWidget *self = EMPATHY_VIDEO_WIDGET (widget);
EmpathyVideoWidgetPriv *priv = GET_PRIV (self);
+ GtkAllocation allocation;
if (event != NULL && event->count > 0)
return TRUE;
if (priv->overlay == NULL)
{
+ gtk_widget_get_allocation (widget, &allocation);
gdk_window_clear_area (gtk_widget_get_window (widget), 0, 0,
- widget->allocation.width, widget->allocation.height);
+ allocation.width, allocation.height);
return TRUE;
}
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);
{
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);
}
/* 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");
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);
}
}
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;
}
{
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);
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;
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;
}
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;
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);