Commit 04e7a59f authored by Jonh Wendell's avatar Jonh Wendell
Browse files

Build with GSEAL. Closes #615407.

parent 24f0b3ef
......@@ -74,7 +74,7 @@ GNOME_DOC_INIT
#*******************************************************************************
GLIB_REQUIRED=2.17.0
GTK_REQUIRED=2.20.0
GTK_REQUIRED=2.21.3
GCONF_REQUIRED=2.16.0
GTHREAD_REQUIRED=2.0.0
GTK_VNC_REQUIRED=0.3.10
......
......@@ -577,7 +577,7 @@ vnc_pointer_ungrab_cb (VncDisplay *vnc, VinagreVncTab *vnc_tab)
static void
vnc_bell_cb (VncDisplay *vnc, VinagreVncTab *vnc_tab)
{
gdk_window_beep (GTK_WIDGET (vnc_tab)->window);
gdk_window_beep (gtk_widget_get_window (GTK_WIDGET (vnc_tab)));
}
static void
......
......@@ -206,7 +206,7 @@ vinagre_app_get_active_window (VinagreApp *app)
* first one shows its window.
*/
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (app->priv->active_window)))
if (!gtk_widget_get_realized (GTK_WIDGET (app->priv->active_window)))
gtk_widget_realize (GTK_WIDGET (app->priv->active_window));
return app->priv->active_window;
......@@ -249,8 +249,8 @@ is_in_viewport (VinagreWindow *window,
return FALSE;
/* Check for viewport match */
gdk_window_get_position (GTK_WIDGET (window)->window, &x, &y);
gdk_drawable_get_size (GTK_WIDGET (window)->window, &width, &height);
gdk_window_get_position (gtk_widget_get_window (GTK_WIDGET (window)), &x, &y);
gdk_drawable_get_size (gtk_widget_get_window (GTK_WIDGET (window)), &width, &height);
vinagre_utils_get_current_viewport (screen, &vp_x, &vp_y);
x += vp_x;
y += vp_y;
......
......@@ -99,34 +99,40 @@ vinagre_applet_get_icon (VinagreApplet *applet)
static void
vinagre_applet_check_size (VinagreApplet *applet)
{
GtkAllocation allocation;
gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
/* we don't use the size function here, but the yet allocated size because the
size value is false (kind of rounded) */
if (PANEL_APPLET_VERTICAL(panel_applet_get_orient (PANEL_APPLET (applet))))
{
if (applet->size != GTK_WIDGET(applet)->allocation.width)
if (applet->size != allocation.width)
{
applet->size = GTK_WIDGET(applet)->allocation.width;
applet->size = allocation.width;
vinagre_applet_get_icon (applet);
gtk_widget_set_size_request (GTK_WIDGET(applet), applet->size, applet->icon_height + 2);
}
/* Adjusting in case the icon size has changed */
if (GTK_WIDGET(applet)->allocation.height < applet->icon_height + 2)
gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
if (allocation.height < applet->icon_height + 2)
{
gtk_widget_set_size_request (GTK_WIDGET(applet), applet->size, applet->icon_height + 2);
}
}
else
{
if (applet->size != GTK_WIDGET(applet)->allocation.height)
if (applet->size != allocation.height)
{
applet->size = GTK_WIDGET(applet)->allocation.height;
applet->size = allocation.height;
vinagre_applet_get_icon (applet);
gtk_widget_set_size_request (GTK_WIDGET(applet), applet->icon_width + 2, applet->size);
}
/* Adjusting in case the icon size has changed */
if (GTK_WIDGET(applet)->allocation.width < applet->icon_width + 2)
gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
if (allocation.width < applet->icon_width + 2)
{
gtk_widget_set_size_request (GTK_WIDGET(applet), applet->icon_width + 2, applet->size);
}
......@@ -140,12 +146,14 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
GdkColor color;
GdkGC *gc;
GdkPixmap *background;
GtkAllocation allocation;
GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (applet));
if (GTK_WIDGET (applet)->window == NULL)
if (window == NULL)
return FALSE;
/* Clear the window so we can draw on it later */
gdk_window_clear (GTK_WIDGET(applet)->window);
gdk_window_clear (window);
/* retrieve applet size */
vinagre_applet_get_icon (applet);
......@@ -157,17 +165,18 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
if (applet->icon == NULL)
return FALSE;
w = GTK_WIDGET(applet)->allocation.width;
h = GTK_WIDGET(applet)->allocation.height;
gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
w = allocation.width;
h = allocation.height;
gc = gdk_gc_new (GTK_WIDGET(applet)->window);
gc = gdk_gc_new (window);
/* draw pixmap background */
bg_type = panel_applet_get_background (PANEL_APPLET (applet), &color, &background);
if (bg_type == PANEL_PIXMAP_BACKGROUND)
{
/* fill with given background pixmap */
gdk_draw_drawable (GTK_WIDGET(applet)->window, gc, background, 0, 0, 0, 0, w, h);
gdk_draw_drawable (window, gc, background, 0, 0, 0, 0, w, h);
}
/* draw color background */
......@@ -175,11 +184,11 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
{
gdk_gc_set_rgb_fg_color (gc,&color);
gdk_gc_set_fill (gc,GDK_SOLID);
gdk_draw_rectangle (GTK_WIDGET(applet)->window, gc, TRUE, 0, 0, w, h);
gdk_draw_rectangle (window, gc, TRUE, 0, 0, w, h);
}
/* draw icon at center */
gdk_draw_pixbuf (GTK_WIDGET(applet)->window, gc, applet->icon,
gdk_draw_pixbuf (window, gc, applet->icon,
0, 0, (w - applet->icon_width)/2, (h - applet->icon_height)/2,
applet->icon_width, applet->icon_height,
GDK_RGB_DITHER_NONE, 0, 0);
......@@ -219,9 +228,10 @@ menu_position (GtkMenu *menu,
{
int applet_height, applet_width;
GtkRequisition requisition;
GdkWindow *window = gtk_widget_get_window (applet);
gdk_window_get_origin (applet->window, x, y);
gdk_drawable_get_size (applet->window, &applet_width, &applet_height);
gdk_window_get_origin (window, x, y);
gdk_drawable_get_size (window, &applet_width, &applet_height);
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
switch (panel_applet_get_orient (PANEL_APPLET (applet)))
......
......@@ -166,13 +166,13 @@ vinagre_bacon_message_received (const char *message,
* terminal. We also need to make sure that the window
* has been realized otherwise it will not work. lame.
*/
if (!GTK_WIDGET_REALIZED (window))
if (!gtk_widget_get_realized (GTK_WIDGET (window)))
gtk_widget_realize (GTK_WIDGET (window));
if (startup_timestamp <= 0)
startup_timestamp = gdk_x11_get_server_time (GTK_WIDGET (window)->window);
startup_timestamp = gdk_x11_get_server_time (gtk_widget_get_window GTK_WIDGET ((window)));
gdk_x11_window_set_user_time (GTK_WIDGET (window)->window,
gdk_x11_window_set_user_time (gtk_widget_get_window (GTK_WIDGET (window)),
startup_timestamp);
gtk_window_present (GTK_WINDOW (window));
......
......@@ -250,7 +250,7 @@ vinagre_cmd_view_show_toolbar (GtkAction *action,
vinagre_cache_prefs_set_boolean ("window",
"toolbar-visible",
GTK_WIDGET_VISIBLE (window->priv->toolbar));
gtk_widget_get_visible (window->priv->toolbar));
}
void
......@@ -263,7 +263,7 @@ vinagre_cmd_view_show_statusbar (GtkAction *action,
vinagre_cache_prefs_set_boolean ("window",
"statusbar-visible",
GTK_WIDGET_VISIBLE (window->priv->statusbar));
gtk_widget_get_visible (window->priv->statusbar));
}
void
......@@ -276,7 +276,7 @@ vinagre_cmd_view_show_fav_panel (GtkAction *action,
vinagre_cache_prefs_set_boolean ("window",
"side-panel-visible",
GTK_WIDGET_VISIBLE (window->priv->fav_panel));
gtk_widget_get_visible (window->priv->fav_panel));
}
void
......
......@@ -221,6 +221,7 @@ menu_position (GtkMenu *menu,
gint wx, wy;
GtkRequisition requisition;
GtkWidget *w;
GtkAllocation allocation;
w = fav->priv->tree;
path = get_current_path (fav);
......@@ -233,17 +234,18 @@ menu_position (GtkMenu *menu,
wx = rect.x;
wy = rect.y;
gdk_window_get_origin (w->window, x, y);
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
gtk_widget_get_allocation (w, &allocation);
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
*x += w->allocation.x + w->allocation.width - requisition.width - 10;
*x += allocation.x + allocation.width - requisition.width - 10;
else
*x += w->allocation.x + 10 ;
*x += allocation.x + 10 ;
wy = MAX (*y + 5, *y + wy + 5);
wy = MIN (wy, *y + w->allocation.height - requisition.height - 5);
wy = MIN (wy, *y + allocation.height - requisition.height - 5);
*y = wy;
......@@ -726,12 +728,12 @@ drag_data_received_handl (GtkWidget *widget,
gchar *_sdata;
gboolean success = FALSE;
if ((selection_data != NULL) && (selection_data->length >= 0))
if ((selection_data != NULL) && (gtk_selection_data_get_length (selection_data) >= 0))
{
switch (target_type)
{
case TARGET_VINAGRE:
_sdata = (gchar*)selection_data-> data;
_sdata = (gchar*)gtk_selection_data_get_data (selection_data);
success = TRUE;
break;
......@@ -788,12 +790,14 @@ drag_drop_handl (GtkWidget *widget,
{
gboolean is_valid_drop_site;
GdkAtom target_type;
GList *targets;
is_valid_drop_site = FALSE;
targets = gdk_drag_context_list_targets (context);
if (context->targets)
if (targets)
{
target_type = GDK_POINTER_TO_ATOM (g_list_nth_data (context->targets, TARGET_VINAGRE));
target_type = GDK_POINTER_TO_ATOM (g_list_nth_data (targets, TARGET_VINAGRE));
gtk_drag_get_data (widget,
context,
target_type,
......
......@@ -178,7 +178,7 @@ drag_data_get_handl (GtkWidget *widget,
/*FIXME: Set other properties of the connection*/
gtk_selection_data_set (selection_data,
selection_data->target,
gtk_selection_data_get_target (selection_data),
8,
(guchar*) data,
strlen (data));
......
......@@ -861,13 +861,7 @@ vinagre_plugins_engine_configure_plugin (VinagrePluginsEngine *engine,
gtk_window_set_transient_for (GTK_WINDOW (conf_dlg),
parent);
wg = parent->group;
if (wg == NULL)
{
wg = gtk_window_group_new ();
gtk_window_group_add_window (wg, parent);
}
wg = gtk_window_get_group (parent);
gtk_window_group_add_window (wg,
GTK_WINDOW (conf_dlg));
......
......@@ -270,10 +270,10 @@ active_connections_button_clicked (GtkToolButton *button,
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
label = vinagre_connection_get_best_name (conn);
if ((l->data == tab) && (GTK_IS_LABEL (GTK_BIN (item)->child)))
if ((l->data == tab) && (GTK_IS_LABEL (gtk_bin_get_child (GTK_BIN (item)))))
{
str = g_strdup_printf ("<b>%s</b>", label);
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (item)->child), TRUE);
gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child GTK_BIN (item)), TRUE);
g_free (label);
label = str;
}
......@@ -316,7 +316,7 @@ setup_layout (VinagreTab *tab)
tab->priv->toolbar = gtk_toolbar_new ();
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (tab->priv->toolbar), FALSE);
GTK_WIDGET_SET_FLAGS (tab->priv->toolbar, GTK_NO_SHOW_ALL);
gtk_widget_set_no_show_all (tab->priv->toolbar, TRUE);
gtk_toolbar_set_style (GTK_TOOLBAR (tab->priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
......
......@@ -112,10 +112,7 @@ vinagre_utils_show_many_errors (const gchar *title, GSList *items, GtkWindow *pa
void
vinagre_utils_toggle_widget_visible (GtkWidget *widget)
{
if (GTK_WIDGET_VISIBLE (widget))
gtk_widget_hide (widget);
else
gtk_widget_show_all (widget);
gtk_widget_set_visible (widget, !gtk_widget_get_visible (widget));
}
const gchar *
......@@ -328,9 +325,9 @@ vinagre_utils_get_window_workspace (GtkWindow *gtkwindow)
guint ret = VINAGRE_ALL_WORKSPACES;
g_return_val_if_fail (GTK_IS_WINDOW (gtkwindow), 0);
g_return_val_if_fail (GTK_WIDGET_REALIZED (GTK_WIDGET (gtkwindow)), 0);
g_return_val_if_fail (gtk_widget_get_realized (GTK_WIDGET (gtkwindow)), 0);
window = GTK_WIDGET (gtkwindow)->window;
window = gtk_widget_get_window (GTK_WIDGET (gtkwindow));
display = gdk_drawable_get_display (window);
gdk_error_trap_push ();
......@@ -616,10 +613,10 @@ control_ok_button (GtkEditable *entry, ControlOKButton *data)
{
gboolean enabled = TRUE;
if (GTK_WIDGET_VISIBLE (data->uname))
if (gtk_widget_get_visible (data->uname))
enabled = enabled && gtk_entry_get_text_length (GTK_ENTRY (data->uname)) > 0;
if (GTK_WIDGET_VISIBLE (data->pw))
if (gtk_widget_get_visible (data->pw))
enabled = enabled && gtk_entry_get_text_length (GTK_ENTRY (data->pw)) > 0;
gtk_widget_set_sensitive (data->button, enabled);
......
......@@ -103,15 +103,15 @@ vinagre_window_show_hide_controls (VinagreWindow *window)
{
if (window->priv->fullscreen)
{
window->priv->fav_panel_visible = GTK_WIDGET_VISIBLE (window->priv->fav_panel);
window->priv->fav_panel_visible = gtk_widget_get_visible (window->priv->fav_panel);
gtk_widget_hide (window->priv->fav_panel);
window->priv->toolbar_visible = GTK_WIDGET_VISIBLE (window->priv->toolbar);
window->priv->toolbar_visible = gtk_widget_get_visible (window->priv->toolbar);
gtk_widget_hide (window->priv->toolbar);
gtk_widget_hide (window->priv->menubar);
window->priv->statusbar_visible = GTK_WIDGET_VISIBLE (window->priv->statusbar);
window->priv->statusbar_visible = gtk_widget_get_visible (window->priv->statusbar);
gtk_widget_hide (window->priv->statusbar);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment