while (widget != NULL && widget != wbar)
{
- widget = widget->parent;
+ widget = gtk_widget_get_parent (widget);
}
/* if widget == bar, the new focus widget is in the bar, so we
const gchar *search_string,
guint timestamp)
{
+#ifdef GDK_WINDOWING_X11
+ GdkWindow *gdk_window;
+#endif
+
if (screen) {
ev_stock_icons_set_screen (screen);
gtk_window_set_screen (GTK_WINDOW (ev_window), screen);
gtk_widget_realize (GTK_WIDGET (ev_window));
#ifdef GDK_WINDOWING_X11
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window));
+
if (timestamp <= 0)
- timestamp = gdk_x11_get_server_time (GTK_WIDGET (ev_window)->window);
- gdk_x11_window_set_user_time (GTK_WIDGET (ev_window)->window, timestamp);
+ timestamp = gdk_x11_get_server_time (gdk_window);
+ gdk_x11_window_set_user_time (gdk_window, timestamp);
ev_document_fc_mutex_lock ();
gtk_window_present (GTK_WINDOW (ev_window));
guint32 timestamp)
{
GtkWidget *new_window = ev_window_new ();
+#ifdef GDK_WINDOWING_X11
+ GdkWindow *gdk_window;
+#endif
if (screen) {
ev_stock_icons_set_screen (screen);
gtk_widget_realize (new_window);
#ifdef GDK_WINDOWING_X11
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (new_window));
+
if (timestamp <= 0)
- timestamp = gdk_x11_get_server_time (new_window->window);
- gdk_x11_window_set_user_time (new_window->window, timestamp);
+ timestamp = gdk_x11_get_server_time (gdk_window);
+ gdk_x11_window_set_user_time (gdk_window, timestamp);
gtk_window_present (GTK_WINDOW (new_window));
#else
show_progress_dialog (ConvertData *data)
{
GtkWidget *dialog;
+ GtkWidget *action_area;
GtkWidget *vbox, *pbox;
GtkWidget *label;
GtkWidget *progress;
GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_set_spacing (GTK_BOX (vbox), 12);
gtk_label_set_line_wrap (GTK_LABEL (area->priv->label), TRUE);
gtk_label_set_selectable (GTK_LABEL (area->priv->label), TRUE);
gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0.0, 0.5);
- GTK_WIDGET_SET_FLAGS (area->priv->label, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (area->priv->label, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), area->priv->label, TRUE, TRUE, 0);
gtk_widget_show (area->priv->label);
gtk_label_set_line_wrap (GTK_LABEL (area->priv->secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (area->priv->secondary_label), TRUE);
gtk_misc_set_alignment (GTK_MISC (area->priv->secondary_label), 0.0, 0.5);
- GTK_WIDGET_SET_FLAGS (area->priv->secondary_label, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (area->priv->secondary_label, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), area->priv->secondary_label, TRUE, TRUE, 0);
area->priv->image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG);
area->priv->message_type = GTK_MESSAGE_OTHER;
- parent = area->priv->image->parent;
+ parent = gtk_widget_get_parent (area->priv->image);
gtk_container_add (GTK_CONTAINER (parent), image);
gtk_container_remove (GTK_CONTAINER (parent), area->priv->image);
gtk_box_reorder_child (GTK_BOX (parent), image, 0);
{
GtkWidget *widget = GTK_WIDGET (button);
GtkRequisition menu_req;
+ GtkAllocation allocation;
GtkTextDirection direction;
+ GdkWindow *gdk_window;
GdkRectangle monitor;
gint monitor_num;
GdkScreen *screen;
direction = gtk_widget_get_direction (widget);
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
- monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window);
+ gdk_window = gtk_widget_get_window (widget);
+ monitor_num = gdk_screen_get_monitor_at_window (screen, gdk_window);
if (monitor_num < 0)
monitor_num = 0;
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
- gdk_window_get_origin (widget->window, x, y);
- *x += widget->allocation.x;
- *y += widget->allocation.y;
+ gdk_window_get_origin (gdk_window, x, y);
+ gtk_widget_get_allocation (widget, &allocation);
+ *x += allocation.x;
+ *y += allocation.y;
if (direction == GTK_TEXT_DIR_LTR)
- *x += MAX (widget->allocation.width - menu_req.width, 0);
- else if (menu_req.width > widget->allocation.width)
- *x -= menu_req.width - widget->allocation.width;
+ *x += MAX (allocation.width - menu_req.width, 0);
+ else if (menu_req.width > allocation.width)
+ *x -= menu_req.width - allocation.width;
- if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height)
- *y += widget->allocation.height;
+ if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height)
+ *y += allocation.height;
else if ((*y - menu_req.height) >= monitor.y)
*y -= menu_req.height;
- else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y)
- *y += widget->allocation.height;
+ else if (monitor.y + monitor.height - (*y + allocation.height) > *y)
+ *y += allocation.height;
else
*y -= menu_req.height;
title = ev_link_get_title (link);
item = gtk_image_menu_item_new_with_label (title);
- gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), TRUE);
+ label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
+ gtk_label_set_use_markup (label, TRUE);
g_object_set_data (G_OBJECT (item), "index",
GINT_TO_POINTER (index));
- label = GTK_LABEL (GTK_BIN (item)->child);
gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
gtk_label_set_max_width_chars (label, MAX_LABEL_LENGTH);
ev_password_view_ask_password (EvPasswordView *password_view)
{
GtkDialog *dialog;
+ GtkWidget *content_area, *action_area;
GtkWidget *entry_container;
GtkWidget *hbox, *main_vbox, *vbox, *icon;
GtkWidget *table;
gtk_widget_set_sensitive (GTK_WIDGET (password_view), FALSE);
dialog = GTK_DIALOG (gtk_dialog_new ());
-
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
+
/* Set the dialog up with HIG properties */
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_window_set_title (GTK_WINDOW (dialog), _("Enter password"));
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
/* Build contents */
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
static void
ev_properties_dialog_init (EvPropertiesDialog *properties)
{
+ GtkBox *content_area;
+
+ content_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (properties)));
+
gtk_window_set_title (GTK_WINDOW (properties), _("Properties"));
gtk_window_set_destroy_with_parent (GTK_WINDOW (properties), TRUE);
gtk_dialog_set_has_separator (GTK_DIALOG (properties), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (properties), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (properties)->vbox), 2);
+ gtk_box_set_spacing (content_area, 2);
gtk_dialog_add_button (GTK_DIALOG (properties), GTK_STOCK_CLOSE,
GTK_RESPONSE_CANCEL);
properties->notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (properties->notebook), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (properties)->vbox),
- properties->notebook, TRUE, TRUE, 0);
+ gtk_box_pack_start (content_area, properties->notebook, TRUE, TRUE, 0);
gtk_widget_show (properties->notebook);
g_signal_connect (properties, "response",
menu = gtk_menu_new ();
item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PRINT, NULL);
- gtk_label_set_label (GTK_LABEL (GTK_BIN (item)->child), _("Print…"));
+ gtk_label_set_label (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), _("Print…"));
gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (item, "activate",
EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv;
GtkTreePath *path = NULL;
GtkTreePath *path2 = NULL;
+ gdouble page_size;
+ gdouble value;
gint wy1;
gint wy2;
if (!gtk_widget_get_mapped (GTK_WIDGET (sidebar_thumbnails)))
return;
- if (priv->vadjustment->page_size == 0)
+ page_size = gtk_adjustment_get_page_size (priv->vadjustment);
+
+ if (page_size == 0)
return;
+
+ value = gtk_adjustment_get_value (priv->vadjustment);
if (priv->tree_view) {
if (! gtk_widget_get_realized (priv->tree_view))
return;
gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
- 0, (int) priv->vadjustment->value,
+ 0, (int) value,
NULL, &wy1);
gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
- 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size),
+ 0, (int) (value + page_size),
NULL, &wy2);
gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view),
1, wy1 + 1, &path,
gboolean *push_in,
gpointer user_data)
{
- GtkWidget *widget;
+ GtkWidget *widget;
+ GtkAllocation allocation;
g_return_if_fail (GTK_IS_BUTTON (user_data));
g_return_if_fail (!gtk_widget_get_has_window (GTK_WIDGET (user_data)));
widget = GTK_WIDGET (user_data);
- gdk_window_get_origin (widget->window, x, y);
+ gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+ gtk_widget_get_allocation (widget, &allocation);
- *x += widget->allocation.x;
- *y += widget->allocation.y + widget->allocation.height;
+ *x += allocation.x;
+ *y += allocation.y + allocation.height;
*push_in = FALSE;
}
if (event->button == 1) {
GtkRequisition requisition;
+ GtkAllocation allocation;
gint width;
-
- width = widget->allocation.width;
+
+ gtk_widget_get_allocation (widget, &allocation);
+ width = allocation.width;
gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1);
gtk_widget_size_request (ev_sidebar->priv->menu, &requisition);
gtk_widget_set_size_request (ev_sidebar->priv->menu,
GtkTreeView *tree_view = GTK_TREE_VIEW (user_data);
GtkWidget *widget = GTK_WIDGET (user_data);
GtkRequisition req;
+ GtkAllocation allocation;
GdkRectangle visible;
gtk_widget_size_request (GTK_WIDGET (menu), &req);
- gdk_window_get_origin (widget->window, x, y);
+ gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+ gtk_widget_get_allocation (widget, &allocation);
- *x += (widget->allocation.width - req.width) / 2;
+ *x += (allocation.width - req.width) / 2;
/* Add on height for the treeview title */
gtk_tree_view_get_visible_rect (tree_view, &visible);
- *y += widget->allocation.height - visible.height;
+ *y += allocation.height - visible.height;
selection = gtk_tree_view_get_selection (tree_view);
selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
{
GtkWidget *dialog;
GtkWidget *editor;
+ GtkWidget *content_area;
EggEditableToolbar *toolbar;
dialog = gtk_dialog_new_with_buttons (_("Toolbar Editor"),
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
gtk_container_set_border_width (GTK_CONTAINER (editor), 5);
gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor);
+ gtk_container_add (GTK_CONTAINER (content_area), editor);
egg_editable_toolbar_set_edit_mode (toolbar, TRUE);
if (!window->priv->metadata)
return FALSE;
- state = gdk_window_get_state (GTK_WIDGET (window)->window);
+ state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)));
if (!(state & GDK_WINDOW_STATE_FULLSCREEN)) {
if (!ev_window_is_empty (window) && window->priv->document) {