Mercurial > hg > forks > geeqie
changeset 2034:9297985567b5
use accessor functions
gtk3 does not allow direct use of data structures,
use accessor functions instead
author | Vladimir Nadvornik <nadvornik@suse.cz> |
---|---|
date | Wed, 01 Aug 2012 00:17:18 +0200 |
parents | 27437eeb8c8d |
children | 4321c486aec7 |
files | src/bar.c src/bar_exif.c src/bar_histogram.c src/bar_keywords.c src/bar_sort.c src/cache_maint.c src/cellrenderericon.c src/collect-table.c src/collect.c src/desktop_file.c src/dnd.c src/dupe.c src/fullscreen.c src/image.c src/img-view.c src/layout.c src/layout_config.c src/layout_image.c src/logwindow.c src/main.c src/menu.c src/pan-view.c src/pixbuf-renderer.c src/pixbuf_util.c src/preferences.c src/print.c src/search.c src/ui_bookmark.c src/ui_fileops.c src/ui_help.c src/ui_menu.c src/ui_misc.c src/ui_pathsel.c src/ui_tabcomp.c src/ui_tree_edit.c src/ui_utildlg.c src/view_dir.c src/view_dir_tree.c src/view_file_icon.c src/view_file_list.c src/window.c |
diffstat | 41 files changed, 460 insertions(+), 389 deletions(-) [+] |
line wrap: on
line diff
--- a/src/bar.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/bar.c Wed Aug 01 00:17:18 2012 +0200 @@ -284,9 +284,9 @@ else { expander = widget; - bar = widget->parent; + bar = gtk_widget_get_parent(widget); while (bar && !g_object_get_data(G_OBJECT(bar), "bar_data")) - bar = bar->parent; + bar = gtk_widget_get_parent(bar); if (!bar) return; } @@ -496,7 +496,7 @@ if (!pd) return; - expander = pane->parent; + expander = gtk_widget_get_parent(pane); gtk_expander_set_expanded(GTK_EXPANDER(expander), pd->expanded); }
--- a/src/bar_exif.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/bar_exif.c Wed Aug 01 00:17:18 2012 +0200 @@ -350,7 +350,7 @@ switch (info) { case TARGET_APP_EXIF_ENTRY: - gtk_selection_data_set(selection_data, selection_data->target, + gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), 8, (gpointer) &entry, sizeof(entry)); break; @@ -378,14 +378,14 @@ switch (info) { case TARGET_APP_EXIF_ENTRY: - new_entry = *(gpointer *)selection_data->data; + new_entry = *(gpointer *)gtk_selection_data_get_data(selection_data); - if (new_entry->parent && new_entry->parent != ped->vbox) bar_pane_exif_reparent_entry(new_entry, pane); + if (gtk_widget_get_parent(new_entry) && gtk_widget_get_parent(new_entry) != ped->vbox) bar_pane_exif_reparent_entry(new_entry, pane); break; default: /* FIXME: this needs a check for valid exif keys */ - new_entry = bar_pane_exif_add_entry(ped, (gchar *)selection_data->data, NULL, TRUE, FALSE); + new_entry = bar_pane_exif_add_entry(ped, (gchar *)gtk_selection_data_get_data(selection_data), NULL, TRUE, FALSE); break; } @@ -396,17 +396,20 @@ { gint nx, ny; GtkWidget *entry = work->data; + GtkAllocation allocation; work = work->next; if (entry == new_entry) continue; + gtk_widget_get_allocation(entry, &allocation); + #if GTK_CHECK_VERSION(2,20,0) if (gtk_widget_is_drawable(entry) && #else if (GTK_WIDGET_DRAWABLE(entry) && #endif gtk_widget_translate_coordinates(pane, entry, x, y, &nx, &ny) && - ny < entry->allocation.height / 2) break; + ny < allocation.height / 2) break; pos++; } g_list_free(list); @@ -488,13 +491,13 @@ if (ee) { const gchar *title; - GtkWidget *pane = cdd->widget->parent; + GtkWidget *pane = gtk_widget_get_parent(cdd->widget); while (pane) { ped = g_object_get_data(G_OBJECT(pane), "pane_data"); if (ped) break; - pane = pane->parent; + pane = gtk_widget_get_parent(pane); } if (!pane) return;
--- a/src/bar_histogram.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/bar_histogram.c Wed Aug 01 00:17:18 2012 +0200 @@ -156,17 +156,11 @@ if (!phd->pixbuf) return TRUE; - gdk_draw_pixbuf(widget->window, -#if GTK_CHECK_VERSION(2,20,0) - widget->style->fg_gc[gtk_widget_get_state(widget)], -#else - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], -#endif - phd->pixbuf, - 0, 0, - 0, 0, - -1, -1, - GDK_RGB_DITHER_NORMAL, 0, 0); + cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(widget)); + gdk_cairo_set_source_pixbuf (cr, phd->pixbuf, 0, 0); + cairo_paint (cr); + cairo_destroy (cr); + return TRUE; }
--- a/src/bar_keywords.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/bar_keywords.c Wed Aug 01 00:17:18 2012 +0200 @@ -490,7 +490,7 @@ case TARGET_APP_KEYWORD_PATH: { GList *path = keyword_tree_get_path(keyword_tree, &child_iter); - gtk_selection_data_set(selection_data, selection_data->target, + gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), 8, (gpointer) &path, sizeof(path)); break; } @@ -611,13 +611,13 @@ { case TARGET_APP_KEYWORD_PATH: { - GList *path = *(gpointer *)selection_data->data; + GList *path = *(gpointer *)gtk_selection_data_get_data(selection_data); src_valid = keyword_tree_get_iter(keyword_tree, &src_kw_iter, path); string_list_free(path); break; } default: - new_keywords = string_to_keywords_list((gchar *)selection_data->data); + new_keywords = string_to_keywords_list((gchar *)gtk_selection_data_get_data(selection_data)); break; }
--- a/src/bar_sort.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/bar_sort.c Wed Aug 01 00:17:18 2012 +0200 @@ -599,12 +599,12 @@ gtk_box_pack_start(GTK_BOX(sd->vbox), label, FALSE, FALSE, 0); gtk_widget_show(label); - combo = gtk_combo_box_new_text(); + combo = gtk_combo_box_text_new(); gtk_box_pack_start(GTK_BOX(sd->vbox), combo, FALSE, FALSE, 0); gtk_widget_show(combo); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Folders")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Collections")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Folders")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Collections")); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(bar_sort_mode_cb), sd);
--- a/src/cache_maint.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/cache_maint.c Wed Aug 01 00:17:18 2012 +0200 @@ -338,7 +338,7 @@ gtk_widget_show(hbox); cm->entry = gtk_entry_new(); - GTK_WIDGET_UNSET_FLAGS(cm->entry, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(cm->entry, FALSE); gtk_editable_set_editable(GTK_EDITABLE(cm->entry), FALSE); gtk_box_pack_start(GTK_BOX(hbox), cm->entry, TRUE, TRUE, 0); gtk_widget_show(cm->entry); @@ -910,7 +910,7 @@ hbox = pref_box_new(cd->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); cd->progress = gtk_entry_new(); - GTK_WIDGET_UNSET_FLAGS(cd->progress, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(cd->progress, FALSE); gtk_editable_set_editable(GTK_EDITABLE(cd->progress), FALSE); gtk_entry_set_text(GTK_ENTRY(cd->progress), _("click start to begin")); gtk_box_pack_start(GTK_BOX(hbox), cd->progress, TRUE, TRUE, 0);
--- a/src/cellrenderericon.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/cellrenderericon.c Wed Aug 01 00:17:18 2012 +0200 @@ -126,8 +126,7 @@ gqv_cell_renderer_icon_init(GQvCellRendererIcon *cellicon) { GTK_CELL_RENDERER(cellicon)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE; - GTK_CELL_RENDERER(cellicon)->xpad = 2; - GTK_CELL_RENDERER(cellicon)->ypad = 2; + gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(cellicon), 2, 2); } static void @@ -553,6 +552,11 @@ GQvCellRendererIcon *cellicon = (GQvCellRendererIcon *) cell; gint calc_width; gint calc_height; + gint xpad, ypad; + gint xalign, yalign; + + gtk_cell_renderer_get_padding(cell, &xpad, &ypad); + gtk_cell_renderer_get_alignment(cell, &xalign, &yalign); if (cellicon->fixed_width > 0) { @@ -591,8 +595,8 @@ calc_width = MAX(calc_width, TOGGLE_SPACING * cellicon->num_marks); } - calc_width += (gint)cell->xpad * 2; - calc_height += (gint)cell->ypad * 2; + calc_width += xpad * 2; + calc_height += ypad * 2; if (x_offset) *x_offset = 0; if (y_offset) *y_offset = 0; @@ -601,13 +605,13 @@ { if (x_offset) { - *x_offset = (cell->xalign * (cell_area->width - calc_width - 2 * cell->xpad)); - *x_offset = MAX(*x_offset, 0) + cell->xpad; + *x_offset = (xalign * (cell_area->width - calc_width - 2 * xpad)); + *x_offset = MAX(*x_offset, 0) + xpad; } if (y_offset) { - *y_offset = (cell->yalign * (cell_area->height - calc_height - 2 * cell->ypad)); - *y_offset = MAX(*y_offset, 0) + cell->ypad; + *y_offset = (yalign * (cell_area->height - calc_height - 2 * ypad)); + *y_offset = MAX(*y_offset, 0) + ypad; } } @@ -630,20 +634,24 @@ const gchar *text; GdkRectangle cell_rect; GtkStateType state; + gint xpad, ypad; + pixbuf = cellicon->pixbuf; text = cellicon->text; if (!pixbuf && !text) return; + gtk_cell_renderer_get_padding(cell, &xpad, &ypad); + gqv_cell_renderer_icon_get_size(cell, widget, cell_area, &cell_rect.x, &cell_rect.y, &cell_rect.width, &cell_rect.height); - cell_rect.x += cell->xpad; - cell_rect.y += cell->ypad; - cell_rect.width -= cell->xpad * 2; - cell_rect.height -= cell->ypad * 2; + cell_rect.x += xpad; + cell_rect.y += ypad; + cell_rect.width -= xpad * 2; + cell_rect.height -= ypad * 2; if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) { @@ -680,7 +688,7 @@ if (cellicon->fixed_height > 0) { - pix_rect.y = cell_area->y + cell->ypad + (cellicon->fixed_height - pix_rect.height) / 2; + pix_rect.y = cell_area->y + ypad + (cellicon->fixed_height - pix_rect.height) / 2; } else { @@ -717,8 +725,8 @@ pix_rect.width = text_rect.width; pix_rect.height = text_rect.height; - pix_rect.x = cell_area->x + cell->xpad + (cell_rect.width - text_rect.width + 1) / 2; - pix_rect.y = cell_area->y + cell->ypad + (cell_rect.height - text_rect.height); + pix_rect.x = cell_area->x + xpad + (cell_rect.width - text_rect.width + 1) / 2; + pix_rect.y = cell_area->y + ypad + (cell_rect.height - text_rect.height); if (cellicon->show_marks) { @@ -747,8 +755,8 @@ pix_rect.width = TOGGLE_SPACING * cellicon->num_marks; pix_rect.height = TOGGLE_SPACING; - pix_rect.x = cell_area->x + cell->xpad + (cell_rect.width - pix_rect.width + 1) / 2 + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; - pix_rect.y = cell_area->y + cell->ypad + (cell_rect.height - pix_rect.height) + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; + pix_rect.x = cell_area->x + xpad + (cell_rect.width - pix_rect.width + 1) / 2 + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; + pix_rect.y = cell_area->y + ypad + (cell_rect.height - pix_rect.height) + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; if (gdk_rectangle_intersect(cell_area, &pix_rect, &draw_rect) && gdk_rectangle_intersect(expose_area, &draw_rect, &draw_rect)) @@ -800,22 +808,25 @@ GdkRectangle rect; GdkRectangle cell_rect; gint i; + gint xpad, ypad; + + gtk_cell_renderer_get_padding(cell, &xpad, &ypad); gqv_cell_renderer_icon_get_size(cell, widget, cell_area, &cell_rect.x, &cell_rect.y, &cell_rect.width, &cell_rect.height); - cell_rect.x += cell->xpad; - cell_rect.y += cell->ypad; - cell_rect.width -= cell->xpad * 2; - cell_rect.height -= cell->ypad * 2; + cell_rect.x += xpad; + cell_rect.y += ypad; + cell_rect.width -= xpad * 2; + cell_rect.height -= ypad * 2; rect.width = TOGGLE_WIDTH; rect.height = TOGGLE_WIDTH; - rect.y = cell_area->y + cell->ypad + (cell_rect.height - TOGGLE_SPACING) + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; + rect.y = cell_area->y + ypad + (cell_rect.height - TOGGLE_SPACING) + (TOGGLE_SPACING - TOGGLE_WIDTH) / 2; for (i = 0; i < cellicon->num_marks; i++) { - rect.x = cell_area->x + cell->xpad + (cell_rect.width - TOGGLE_SPACING * cellicon->num_marks + 1) / 2 + i * TOGGLE_SPACING; + rect.x = cell_area->x + xpad + (cell_rect.width - TOGGLE_SPACING * cellicon->num_marks + 1) / 2 + i * TOGGLE_SPACING; if (bevent->x >= rect.x && bevent->x < rect.x + rect.width && bevent->y >= rect.y && bevent->y < rect.y + rect.height)
--- a/src/collect-table.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/collect-table.c Wed Aug 01 00:17:18 2012 +0200 @@ -244,10 +244,12 @@ static void collection_table_toggle_filenames(CollectTable *ct) { + GtkAllocation allocation; ct->show_text = !ct->show_text; options->show_icon_names = ct->show_text; - collection_table_populate_at_new_size(ct, ct->listview->allocation.width, ct->listview->allocation.height, TRUE); + gtk_widget_get_allocation(ct->listview, &allocation); + collection_table_populate_at_new_size(ct, allocation.width, allocation.height, TRUE); } static gint collection_table_get_icon_width(CollectTable *ct) @@ -520,7 +522,7 @@ if (ct->tip_window) return; - gdk_window_get_pointer(ct->listview->window, &x, &y, NULL); + gdk_window_get_pointer(gtk_widget_get_window(ct->listview), &x, &y, NULL); ct->tip_info = collection_table_find_data_by_coord(ct, x, y, NULL); if (!ct->tip_info) return; @@ -1103,7 +1105,7 @@ gint ret; adj = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(ct->listview)); - page_size = (gint)adj->page_increment; + page_size = (gint)gtk_adjustment_get_page_increment(adj); row_height = options->thumbnails.max_height + THUMB_BORDER_PADDING * 2; if (ct->show_text) row_height += options->thumbnails.max_height / 3; @@ -1267,7 +1269,7 @@ store = gtk_tree_view_get_model(GTK_TREE_VIEW(ct->listview)); - if (!use_coord) gdk_window_get_pointer(ct->listview->window, &x, &y, NULL); + if (!use_coord) gdk_window_get_pointer(gtk_widget_get_window(ct->listview), &x, &y, NULL); if (source) { @@ -1395,7 +1397,7 @@ gdk_pixbuf_render_pixmap_and_mask(pb, &pixmap, &mask, 128); g_object_unref(pb); - gdk_drawable_get_size(pixmap, &w, &h); + gdk_pixmap_get_size(pixmap, &w, &h); attributes.window_type = GDK_WINDOW_CHILD; attributes.wclass = GDK_INPUT_OUTPUT; @@ -1417,7 +1419,8 @@ gint x, y; gint w, h; - gdk_drawable_get_size(ct->marker_window, &w, &h); + w = gdk_window_get_width(ct->marker_window); + h = gdk_window_get_height(ct->marker_window); if (!after) { @@ -1472,9 +1475,10 @@ if (!ct->drop_idle_id) return FALSE; - window = ct->listview->window; + window = gtk_widget_get_window(ct->listview); gdk_window_get_pointer(window, &x, &y, NULL); - gdk_drawable_get_size(window, &w, &h); + w = gdk_window_get_width(window); + h = gdk_window_get_height(window); if (x >= 0 && x < w && y >= 0 && y < h) { collection_table_motion_update(ct, x, y, TRUE); @@ -2174,8 +2178,7 @@ break; } - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, total); + gtk_selection_data_set_text(selection_data, uri_text, total); g_free(uri_text); } @@ -2192,7 +2195,7 @@ CollectInfo *drop_info; GList *work; - DEBUG_1("%s", selection_data->data); + DEBUG_1("%s", gtk_selection_data_get_data(selection_data)); collection_table_scroll(ct, FALSE); collection_table_insert_marker(ct, NULL, FALSE); @@ -2202,7 +2205,7 @@ switch (info) { case TARGET_APP_COLLECTION_MEMBER: - source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list); + source = collection_from_dnd_data((gchar *)gtk_selection_data_get_data(selection_data), &list, &info_list); if (source) { if (source == ct->cd) @@ -2226,7 +2229,7 @@ else { /* it is a move/copy across collections */ - if (context->action == GDK_ACTION_MOVE) + if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE) { collection_remove_by_info_list(source, info_list); } @@ -2235,7 +2238,7 @@ } break; case TARGET_URI_LIST: - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); work = list; while (work) {
--- a/src/collect.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/collect.c Wed Aug 01 00:17:18 2012 +0200 @@ -979,12 +979,15 @@ static void collection_window_get_geometry(CollectWindow *cw) { CollectionData *cd; + GdkWindow *window; if (!cw) return; cd = cw->cd; - gdk_window_get_position(cw->window->window, &cd->window_x, &cd->window_y); - gdk_drawable_get_size(cw->window->window, &cd->window_w, &cd->window_h); + window = gtk_widget_get_window(cw->window); + gdk_window_get_position(window, &cd->window_x, &cd->window_y); + cd->window_w = gdk_window_get_width(window); + cd->window_h = gdk_window_get_height(window); cd->window_read = TRUE; }
--- a/src/desktop_file.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/desktop_file.c Wed Aug 01 00:17:18 2012 +0200 @@ -217,7 +217,7 @@ ew->save_button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, G_CALLBACK(editor_window_save_cb), ew); gtk_container_add(GTK_CONTAINER(button_hbox), ew->save_button); - GTK_WIDGET_SET_FLAGS(ew->save_button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(ew->save_button, TRUE); gtk_widget_set_sensitive(ew->save_button, FALSE); gtk_widget_show(ew->save_button); ct_button = ew->save_button; @@ -225,7 +225,7 @@ button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, G_CALLBACK(editor_window_close_cb), ew); gtk_container_add(GTK_CONTAINER(button_hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); if (!generic_dialog_get_alternative_button_order(ew->window)) @@ -472,13 +472,13 @@ button = pref_button_new(NULL, GTK_STOCK_NEW, NULL, FALSE, G_CALLBACK(editor_list_window_new_cb), ewl); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); button = pref_button_new(NULL, GTK_STOCK_EDIT, NULL, FALSE, G_CALLBACK(editor_list_window_edit_cb), ewl); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); ewl->edit_button = button; @@ -486,7 +486,7 @@ button = pref_button_new(NULL, GTK_STOCK_DELETE, NULL, FALSE, G_CALLBACK(editor_list_window_delete_cb), ewl); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); ewl->delete_button = button; @@ -494,7 +494,7 @@ button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, G_CALLBACK(editor_list_window_close_cb), ewl); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); scrolled = gtk_scrolled_window_new(NULL, NULL);
--- a/src/dnd.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/dnd.c Wed Aug 01 00:17:18 2012 +0200 @@ -99,8 +99,6 @@ void dnd_set_drag_icon(GtkWidget *widget, GdkDragContext *context, GdkPixbuf *pixbuf, gint items) { - GdkPixmap *pixmap; - GdkBitmap *mask; GdkPixbuf *dest; gint w, h; gint sw, sh; @@ -151,21 +149,17 @@ pixbuf_draw_rect(dest, x, y, lw, lh, 128); } - gdk_pixbuf_render_pixmap_and_mask(dest, &pixmap, &mask, 128); - g_object_unref(dest); - if (layout) { - gdk_draw_layout(pixmap, widget->style->black_gc, x+1, y+1, layout); - gdk_draw_layout(pixmap, widget->style->white_gc, x, y, layout); + pixbuf_draw_layout(dest, layout, NULL, x+1, y+1, 0, 0, 0, 255); + pixbuf_draw_layout(dest, layout, NULL, x, y, 255, 255, 255, 255); g_object_unref(G_OBJECT(layout)); } - gtk_drag_set_icon_pixmap(context, gtk_widget_get_colormap(widget), pixmap, mask, -8, -6); + gtk_drag_set_icon_pixbuf(context, dest, -8, -6); - g_object_unref(pixmap); - if (mask) g_object_unref(mask); + g_object_unref(dest); } static void dnd_set_drag_label_end_cb(GtkWidget *widget, GdkDragContext *context, gpointer data)
--- a/src/dupe.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/dupe.c Wed Aug 01 00:17:18 2012 +0200 @@ -217,7 +217,7 @@ { GdkCursor *cursor; - if (!widget->window) return; + if (!gtk_widget_get_window(widget)) return; if (icon == -1) { @@ -228,7 +228,7 @@ cursor = gdk_cursor_new(icon); } - gdk_window_set_cursor(widget->window, cursor); + gdk_window_set_cursor(gtk_widget_get_window(widget), cursor); if (cursor) gdk_cursor_unref(cursor); } @@ -2581,7 +2581,7 @@ { DupeWindow *dw = data; - dw->second_set = GTK_TOGGLE_BUTTON(widget)->active; + dw->second_set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); if (dw->second_set) { @@ -2797,7 +2797,7 @@ { DupeWindow *dw = data; - dw->show_thumbs = GTK_TOGGLE_BUTTON(widget)->active; + dw->show_thumbs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); if (dw->show_thumbs) { @@ -3412,8 +3412,7 @@ break; } - if (uri_text) gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, length); + if (uri_text) gtk_selection_data_set_text(selection_data, uri_text, length); g_free(uri_text); } @@ -3435,10 +3434,10 @@ switch (info) { case TARGET_APP_COLLECTION_MEMBER: - collection_from_dnd_data((gchar *)selection_data->data, &list, NULL); + collection_from_dnd_data((gchar *)gtk_selection_data_get_data(selection_data), &list, NULL); break; case TARGET_URI_LIST: - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); work = list; while (work) {
--- a/src/fullscreen.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/fullscreen.c Wed Aug 01 00:17:18 2012 +0200 @@ -37,36 +37,28 @@ static void clear_mouse_cursor(GtkWidget *widget, gint state) { - if (!widget->window) return; + GdkWindow *window = gtk_widget_get_window(widget); + if (!window) return; if (state & FULLSCREEN_CURSOR_BUSY) { GdkCursor *cursor; cursor = gdk_cursor_new(GDK_WATCH); - gdk_window_set_cursor(widget->window, cursor); + gdk_window_set_cursor(window, cursor); gdk_cursor_unref(cursor); } else if (state & FULLSCREEN_CURSOR_NORMAL) { - gdk_window_set_cursor(widget->window, NULL); + gdk_window_set_cursor(window, NULL); } else { GdkCursor *cursor; - GdkPixmap *p; - - p = gdk_bitmap_create_from_data(widget->window, "\0\0\0", 1, 1); - - cursor = gdk_cursor_new_from_pixmap(p, p, - &widget->style->fg[GTK_STATE_ACTIVE], - &widget->style->bg[GTK_STATE_ACTIVE], - 0, 0); - - gdk_window_set_cursor(widget->window, cursor); - + + cursor = gdk_cursor_new(GDK_BLANK_CURSOR); + gdk_window_set_cursor(window, cursor); gdk_cursor_unref(cursor); - g_object_unref(p); } } @@ -510,13 +502,13 @@ if (height) *height = sd->height; if (dest_screen) *dest_screen = screen; - if (same_region) *same_region = (!widget || !widget->window || + if (same_region) *same_region = (!widget || !gtk_widget_get_window(widget) || (screen == gtk_widget_get_screen(widget) && (sd->number%100 == 0 || - sd->number%100 == gdk_screen_get_monitor_at_window(screen, widget->window)+1))); + sd->number%100 == gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(widget))+1))); } - else if (screen != 1 || !widget || !widget->window) + else if (screen != 1 || !widget || !gtk_widget_get_window(widget)) { GdkScreen *screen; @@ -544,7 +536,7 @@ GdkRectangle rect; screen = gtk_widget_get_screen(widget); - monitor = gdk_screen_get_monitor_at_window(screen, widget->window); + monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(widget)); gdk_screen_get_monitor_geometry(screen, monitor, &rect); @@ -566,10 +558,10 @@ gint monitor; gint n; - if (!widget || !widget->window) return 0; + if (!widget || !gtk_widget_get_window(widget)) return 0; screen = gtk_widget_get_screen(widget); - monitor = gdk_screen_get_monitor_at_window(screen, widget->window); + monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(widget)); n = (gdk_screen_get_number(screen)+1) * 100 + monitor + 1;
--- a/src/image.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/image.c Wed Aug 01 00:17:18 2012 +0200 @@ -892,21 +892,24 @@ GtkWidget *widget; widget = imd->widget; - if (!widget->window) return; + if (!gtk_widget_get_window(widget)) return; + + GtkAllocation allocation; + gtk_widget_get_allocation(widget, &allocation); if (has_focus) { - gtk_paint_focus(widget->style, widget->window, GTK_STATE_ACTIVE, + gtk_paint_focus(gtk_widget_get_style(widget), gtk_widget_get_window(widget), GTK_STATE_ACTIVE, area, widget, "image_window", - widget->allocation.x, widget->allocation.y, - widget->allocation.width - 1, widget->allocation.height - 1); + allocation.x, allocation.y, + allocation.width - 1, allocation.height - 1); } else { - gtk_paint_shadow(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, + gtk_paint_shadow(gtk_widget_get_style(widget), gtk_widget_get_window(widget), GTK_STATE_NORMAL, GTK_SHADOW_IN, area, widget, "image_window", - widget->allocation.x, widget->allocation.y, - widget->allocation.width - 1, widget->allocation.height - 1); + allocation.x, allocation.y, + allocation.width - 1, allocation.height - 1); } } @@ -926,7 +929,7 @@ { ImageWindow *imd = data; - GTK_WIDGET_SET_FLAGS(imd->widget, GTK_HAS_FOCUS); + gtk_widget_grab_focus(imd->widget); image_focus_paint(imd, TRUE, NULL); if (imd->func_focus_in) @@ -941,7 +944,7 @@ { ImageWindow *imd = data; - GTK_WIDGET_UNSET_FLAGS(imd->widget, GTK_HAS_FOCUS); +// GTK_WIDGET_UNSET_FLAGS(imd->widget, GTK_HAS_FOCUS); image_focus_paint(imd, FALSE, NULL); return TRUE; @@ -1770,15 +1773,18 @@ gboolean selectable_frame_expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data) { - gtk_paint_flat_box(widget->style, - widget->window, - widget->state, - (GTK_FRAME(widget))->shadow_type, + GtkAllocation allocation; + gtk_widget_get_allocation(widget, &allocation); + + gtk_paint_flat_box(gtk_widget_get_style(widget), + gtk_widget_get_window(widget), + gtk_widget_get_state(widget), + gtk_frame_get_shadow_type(GTK_FRAME(widget)), NULL, widget, NULL, - widget->allocation.x + 3, widget->allocation.y + 3, - widget->allocation.width - 6, widget->allocation.height - 6); + allocation.x + 3, allocation.y + 3, + allocation.width - 6, allocation.height - 6); return FALSE; @@ -1812,7 +1818,7 @@ g_signal_connect(G_OBJECT(imd->frame), "expose_event", G_CALLBACK(selectable_frame_expose_cb), NULL); - GTK_WIDGET_SET_FLAGS(imd->frame, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(imd->frame, TRUE); g_signal_connect(G_OBJECT(imd->frame), "focus_in_event", G_CALLBACK(image_focus_in_cb), imd); g_signal_connect(G_OBJECT(imd->frame), "focus_out_event",
--- a/src/img-view.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/img-view.c Wed Aug 01 00:17:18 2012 +0200 @@ -322,7 +322,7 @@ ImageWindow *imd; imd = view_window_active_image(vw); - gdk_window_get_origin(imd->pr->window, x, y); + gdk_window_get_origin(gtk_widget_get_window(imd->pr), x, y); popup_menu_position_clamp(menu, x, y, 0); } @@ -1487,7 +1487,7 @@ { GList *work; - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); work = list; while (work) @@ -1510,7 +1510,7 @@ } else { - source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list); + source = collection_from_dnd_data((gchar *)gtk_selection_data_get_data(selection_data), &list, &info_list); } if (list) @@ -1576,14 +1576,13 @@ g_list_free(list); if (text) { - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)text, len); + gtk_selection_data_set_text(selection_data, text, len); g_free(text); } } else { - gtk_selection_data_set(selection_data, selection_data->target, + gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), 8, NULL, 0); } }
--- a/src/layout.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/layout.c Wed Aug 01 00:17:18 2012 +0200 @@ -284,7 +284,7 @@ gtk_box_pack_start(GTK_BOX(box), tabcomp, FALSE, FALSE, 0); gtk_widget_show(tabcomp); - g_signal_connect(G_OBJECT(lw->path_entry->parent), "changed", + g_signal_connect(G_OBJECT(gtk_widget_get_parent(lw->path_entry)), "changed", G_CALLBACK(layout_path_entry_changed_cb), lw); lw->vd = vd_new(lw->options.dir_view_type, lw->dir_fd); @@ -1008,7 +1008,7 @@ lw->sort_method = type; lw->sort_ascend = ascend; - if (lw->info_sort) gtk_label_set_text(GTK_LABEL(GTK_BIN(lw->info_sort)->child), + if (lw->info_sort) gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(lw->info_sort))), sort_type_get_text(type)); layout_list_sync_sort(lw); } @@ -1025,10 +1025,13 @@ gboolean layout_geometry_get(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h) { + GdkWindow *window; if (!layout_valid(&lw)) return FALSE; - - gdk_window_get_root_origin(lw->window->window, x, y); - gdk_drawable_get_size(lw->window->window, w, h); + + window = gtk_widget_get_window(lw->window); + gdk_window_get_root_origin(window, x, y); + *w = gdk_window_get_width(window); + *h = gdk_window_get_height(window); return TRUE; } @@ -1037,18 +1040,18 @@ { if (!layout_valid(&lw)) return FALSE; - if (lw->h_pane && GTK_PANED(lw->h_pane)->child1->allocation.x >= 0) + if (lw->h_pane && gtk_paned_get_child1(GTK_PANED(lw->h_pane))->allocation.x >= 0) { - *h = GTK_PANED(lw->h_pane)->child1->allocation.width; + *h = gtk_paned_get_child1(GTK_PANED(lw->h_pane))->allocation.width; } else if (h != &lw->options.main_window.hdivider_pos) { *h = lw->options.main_window.hdivider_pos; } - if (lw->v_pane && GTK_PANED(lw->v_pane)->child1->allocation.x >= 0) + if (lw->v_pane && gtk_paned_get_child1(GTK_PANED(lw->v_pane))->allocation.x >= 0) { - *v = GTK_PANED(lw->v_pane)->child1->allocation.height; + *v = gtk_paned_get_child1(GTK_PANED(lw->v_pane))->allocation.height; } else if (v != &lw->options.main_window.vdivider_pos) { @@ -1142,6 +1145,7 @@ gboolean layout_geometry_get_tools(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h, gint *divider_pos) { + GdkWindow *window; if (!layout_valid(&lw)) return FALSE; #if GTK_CHECK_VERSION(2,20,0) @@ -1157,16 +1161,18 @@ return FALSE; } - gdk_window_get_root_origin(lw->tools->window, x, y); - gdk_drawable_get_size(lw->tools->window, w, h); + window = gtk_widget_get_window(lw->window); + gdk_window_get_root_origin(window, x, y); + *w = gdk_window_get_width(window); + *h = gdk_window_get_height(window); if (GTK_IS_VPANED(lw->tools_pane)) { - *divider_pos = GTK_PANED(lw->tools_pane)->child1->allocation.height; + *divider_pos = gtk_paned_get_child1(GTK_PANED(lw->tools_pane))->allocation.height; } else { - *divider_pos = GTK_PANED(lw->tools_pane)->child1->allocation.width; + *divider_pos = gtk_paned_get_child1(GTK_PANED(lw->tools_pane))->allocation.width; } return TRUE; @@ -1272,7 +1278,7 @@ { layout_tools_geometry_sync(lw); /* dump the contents */ - gtk_widget_destroy(GTK_BIN(lw->tools)->child); + gtk_widget_destroy(gtk_bin_get_child(GTK_BIN(lw->tools))); } layout_actions_add_window(lw, lw->tools); @@ -1401,8 +1407,8 @@ if (lw->split_images[i]) { gtk_widget_hide(lw->split_images[i]->widget); - if (lw->split_images[i]->widget->parent != lw->utility_paned) - gtk_container_remove(GTK_CONTAINER(lw->split_images[i]->widget->parent), lw->split_images[i]->widget); + if (gtk_widget_get_parent(lw->split_images[i]->widget) != lw->utility_paned) + gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->split_images[i]->widget)), lw->split_images[i]->widget); } } gtk_container_remove(GTK_CONTAINER(lw->utility_paned), lw->split_image_widget); @@ -1561,10 +1567,10 @@ /* preserve utility_box (image + sidebars), menu_bar and toolbars to be reused later in layout_grid_setup */ /* lw->image is preserved together with lw->utility_box */ - if (lw->utility_box) gtk_container_remove(GTK_CONTAINER(lw->utility_box->parent), lw->utility_box); - if (lw->menu_bar) gtk_container_remove(GTK_CONTAINER(lw->menu_bar->parent), lw->menu_bar); + if (lw->utility_box) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->utility_box)), lw->utility_box); + if (lw->menu_bar) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->menu_bar)), lw->menu_bar); for (i = 0; i < TOOLBAR_COUNT; i++) - if (lw->toolbar[i]) gtk_container_remove(GTK_CONTAINER(lw->toolbar[i]->parent), lw->toolbar[i]); + if (lw->toolbar[i]) gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(lw->toolbar[i])), lw->toolbar[i]); /* clear it all */ @@ -1894,7 +1900,7 @@ button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, G_CALLBACK(layout_config_ok_cb), lc); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button); gtk_widget_show(button); @@ -1909,13 +1915,13 @@ button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, G_CALLBACK(layout_config_apply_cb), lc); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, G_CALLBACK(layout_config_close_cb), lc); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); if (!generic_dialog_get_alternative_button_order(lc->configwindow))
--- a/src/layout_config.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/layout_config.c Wed Aug 01 00:17:18 2012 +0200 @@ -222,7 +222,7 @@ button = gtk_button_new_with_label(text); gtk_widget_set_sensitive(button, FALSE); - GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(button, FALSE); gtk_table_attach_defaults(GTK_TABLE(table), button, x1, x2, y1, y2); gtk_widget_show(button); }
--- a/src/layout_image.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/layout_image.c Wed Aug 01 00:17:18 2012 +0200 @@ -614,13 +614,13 @@ if (info == TARGET_URI_LIST) { - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); source = NULL; info_list = NULL; } else { - source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list); + source = collection_from_dnd_data((gchar *)gtk_selection_data_get_data(selection_data), &list, &info_list); } if (list) @@ -712,14 +712,13 @@ g_list_free(list); if (text) { - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)text, len); + gtk_selection_data_set_text(selection_data, text, len); g_free(text); } } else { - gtk_selection_data_set(selection_data, selection_data->target, + gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), 8, NULL, 0); } } @@ -727,7 +726,7 @@ static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data) { LayoutWindow *lw = data; - if (context->action == GDK_ACTION_MOVE) + if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE) { FileData *fd; gint row;
--- a/src/logwindow.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/logwindow.c Wed Aug 01 00:17:18 2012 +0200 @@ -127,7 +127,7 @@ memcpy(&logwin->colors[i], &logwin->colors[LOG_NORMAL], sizeof(GdkColor)); } - colormap = gdk_drawable_get_colormap(logwin->window->window); + colormap = gdk_drawable_get_colormap(gtk_widget_get_window(logwin->window)); gdk_colormap_alloc_colors(colormap, logwin->colors, LOG_COUNT, FALSE, TRUE, success); for (i = LOG_NORMAL; i < LOG_COUNT; i++)
--- a/src/main.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/main.c Wed Aug 01 00:17:18 2012 +0200 @@ -747,7 +747,7 @@ init_exec_time(); /* setup locale, i18n */ - gtk_set_locale(); + setlocale(LC_ALL, ""); #ifdef ENABLE_NLS bindtextdomain(PACKAGE, GQ_LOCALEDIR);
--- a/src/menu.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/menu.c Wed Aug 01 00:17:18 2012 +0200 @@ -54,9 +54,9 @@ gpointer submenu_item_get_data(GtkWidget *menu) { - if (!menu->parent || !GTK_IS_MENU(menu->parent)) return NULL; + if (!gtk_widget_get_parent(menu) || !GTK_IS_MENU(gtk_widget_get_parent(menu))) return NULL; - return g_object_get_data(G_OBJECT(menu->parent), "submenu_data"); + return g_object_get_data(G_OBJECT(gtk_widget_get_parent(menu)), "submenu_data"); } /*
--- a/src/pan-view.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/pan-view.c Wed Aug 01 00:17:18 2012 +0200 @@ -1193,7 +1193,7 @@ { PanWindow *pw = data; - gdk_window_get_origin(pw->imd->pr->window, x, y); + gdk_window_get_origin(gtk_widget_get_window(pw->imd->pr), x, y); popup_menu_position_clamp(menu, x, y, 0); } @@ -2199,12 +2199,12 @@ pixbuf_renderer_get_image_size(pr, &width, &height); adj = gtk_range_get_adjustment(GTK_RANGE(pw->scrollbar_h)); - adj->page_size = (gdouble)rect.width; - adj->page_increment = adj->page_size / 2.0; - adj->step_increment = 48.0 / pr->scale; - adj->lower = 0.0; - adj->upper = MAX((gdouble)width, 1.0); - adj->value = (gdouble)rect.x; + gtk_adjustment_set_page_size(adj, rect.width); + gtk_adjustment_set_page_increment(adj, gtk_adjustment_get_page_size(adj) / 2.0); + gtk_adjustment_set_step_increment(adj, 48.0 / pr->scale); + gtk_adjustment_set_lower(adj, 0.0); + gtk_adjustment_set_upper(adj, MAX((gdouble)width, 1.0)); + gtk_adjustment_set_value(adj, (gdouble)rect.x); pref_signal_block_data(pw->scrollbar_h, pw); gtk_adjustment_changed(adj); @@ -2212,12 +2212,12 @@ pref_signal_unblock_data(pw->scrollbar_h, pw); adj = gtk_range_get_adjustment(GTK_RANGE(pw->scrollbar_v)); - adj->page_size = (gdouble)rect.height; - adj->page_increment = adj->page_size / 2.0; - adj->step_increment = 48.0 / pr->scale; - adj->lower = 0.0; - adj->upper = MAX((gdouble)height, 1.0); - adj->value = (gdouble)rect.y; + gtk_adjustment_set_page_size(adj, rect.height); + gtk_adjustment_set_page_increment(adj, gtk_adjustment_get_page_size(adj) / 2.0); + gtk_adjustment_set_step_increment(adj, 48.0 / pr->scale); + gtk_adjustment_set_lower(adj, 0.0); + gtk_adjustment_set_upper(adj, MAX((gdouble)height, 1.0)); + gtk_adjustment_set_value(adj, (gdouble)rect.y); pref_signal_block_data(pw->scrollbar_v, pw); gtk_adjustment_changed(adj); @@ -2406,17 +2406,17 @@ pref_label_new(box, _("Location:")); combo = tab_completion_new_with_history(&pw->path_entry, dir_fd->path, "pan_view_path", -1, pan_window_entry_activate_cb, pw); - g_signal_connect(G_OBJECT(pw->path_entry->parent), "changed", + g_signal_connect(G_OBJECT(gtk_widget_get_parent(pw->path_entry)), "changed", G_CALLBACK(pan_window_entry_change_cb), pw); gtk_box_pack_start(GTK_BOX(box), combo, TRUE, TRUE, 0); gtk_widget_show(combo); - combo = gtk_combo_box_new_text(); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Timeline")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Calendar")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Folders")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Folders (flower)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Grid")); + combo = gtk_combo_box_text_new(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Timeline")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Calendar")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Folders")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Folders (flower)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Grid")); gtk_combo_box_set_active(GTK_COMBO_BOX(combo), pw->layout); g_signal_connect(G_OBJECT(combo), "changed", @@ -2424,17 +2424,17 @@ gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0); gtk_widget_show(combo); - combo = gtk_combo_box_new_text(); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Dots")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("No Images")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Small Thumbnails")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Normal Thumbnails")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Large Thumbnails")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("1:10 (10%)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("1:4 (25%)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("1:3 (33%)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("1:2 (50%)")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("1:1 (100%)")); + combo = gtk_combo_box_text_new(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Dots")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("No Images")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Small Thumbnails")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Normal Thumbnails")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Large Thumbnails")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("1:10 (10%)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("1:4 (25%)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("1:3 (33%)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("1:2 (50%)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("1:1 (100%)")); gtk_combo_box_set_active(GTK_COMBO_BOX(combo), pw->size); g_signal_connect(G_OBJECT(combo), "changed", @@ -2933,7 +2933,7 @@ { GList *list; - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); if (list && isdir(((FileData *)list->data)->path)) { FileData *fd = list->data; @@ -2975,14 +2975,13 @@ g_list_free(list); if (text) { - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)text, len); + gtk_selection_data_set_text(selection_data, text, len); g_free(text); } } else { - gtk_selection_data_set(selection_data, selection_data->target, + gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), 8, NULL, 0); } }
--- a/src/pixbuf-renderer.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/pixbuf-renderer.c Wed Aug 01 00:17:18 2012 +0200 @@ -611,7 +611,7 @@ if (!GTK_WIDGET_NO_WINDOW(widget)) #endif { - if (event->window != widget->window) + if (event->window != gtk_widget_get_window(widget)) { GdkRectangle area; @@ -643,7 +643,7 @@ { GdkCursor *cursor; - if (!widget->window) return; + if (!gtk_widget_get_window(widget)) return; if (icon == -1) { @@ -654,7 +654,7 @@ cursor = gdk_cursor_new(icon); } - gdk_window_set_cursor(widget->window, cursor); + gdk_window_set_cursor(gtk_widget_get_window(widget), cursor); if (cursor) gdk_cursor_unref(cursor); } @@ -686,10 +686,10 @@ if (!pr->parent_window) return FALSE; if (!pr->window_fit) return FALSE; - if (!GTK_WIDGET(pr)->window) return FALSE; - - if (!pr->parent_window->window) return FALSE; - state = gdk_window_get_state(pr->parent_window->window); + if (!gtk_widget_get_window(GTK_WIDGET(pr))) return FALSE; + + if (!gtk_widget_get_window(pr->parent_window)) return FALSE; + state = gdk_window_get_state(gtk_widget_get_window(pr->parent_window)); if (state & GDK_WINDOW_STATE_MAXIMIZED) return FALSE; return TRUE; @@ -700,6 +700,8 @@ GtkWidget *widget; GtkWidget *parent; gint ww, wh; + GtkAllocation widget_allocation; + GtkAllocation parent_allocation; if (!pr_parent_window_sizable(pr)) return FALSE; @@ -715,13 +717,17 @@ widget = GTK_WIDGET(pr); parent = GTK_WIDGET(pr->parent_window); - w += (parent->allocation.width - widget->allocation.width); - h += (parent->allocation.height - widget->allocation.height); - - gdk_drawable_get_size(parent->window, &ww, &wh); + gtk_widget_get_allocation(widget, &widget_allocation); + gtk_widget_get_allocation(parent, &parent_allocation); + + w += (parent_allocation.width - widget_allocation.width); + h += (parent_allocation.height - widget_allocation.height); + + ww = gdk_window_get_width(gtk_widget_get_window(parent)); + wh = gdk_window_get_height(gtk_widget_get_window(parent)); if (w == ww && h == wh) return FALSE; - gdk_window_resize(parent->window, w, h); + gdk_window_resize(gtk_widget_get_window(parent), w, h); return TRUE; } @@ -2137,7 +2143,7 @@ pr->drag_last_x = bevent->x; pr->drag_last_y = bevent->y; pr->drag_moved = 0; - gdk_pointer_grab(widget->window, FALSE, + gdk_pointer_grab(gtk_widget_get_window(widget), FALSE, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, NULL, bevent->time); gtk_grab_add(widget); @@ -2449,7 +2455,7 @@ if (GTK_WIDGET_REALIZED(box)) #endif { - gdk_window_clear(box->window); + gdk_window_clear(gtk_widget_get_window(box)); pr->renderer->overlay_draw(pr->renderer, 0, 0, pr->viewport_width, pr->viewport_height); if (pr->renderer2) pr->renderer2->overlay_draw(pr->renderer2, 0, 0, pr->viewport_width, pr->viewport_height); }
--- a/src/pixbuf_util.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/pixbuf_util.c Wed Aug 01 00:17:18 2012 +0200 @@ -780,32 +780,36 @@ gint x, gint y, guint8 r, guint8 g, guint8 b, guint8 a) { - GdkPixmap *pixmap; GdkPixbuf *buffer; gint w, h; GdkGC *gc; gint sx, sy; gint dw, dh; - - if (!widget || !widget->window) return; + cairo_surface_t *source; + cairo_t *cr; pango_layout_get_pixel_size(layout, &w, &h); if (w < 1 || h < 1) return; - pixmap = gdk_pixmap_new(widget->window, w, h, -1); + source = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h); + + cr = cairo_create (source); + cairo_set_source_rgb(cr, 0, 0, 0); + cairo_rectangle (cr, 0, 0, w, h); + cairo_fill (cr); + cairo_set_source_rgb(cr, 1, 1, 1); + pango_cairo_show_layout (cr, layout); + cairo_destroy (cr); - gc = gdk_gc_new(widget->window); - gdk_gc_copy(gc, widget->style->black_gc); - gdk_draw_rectangle(pixmap, gc, TRUE, 0, 0, w, h); - gdk_gc_copy(gc, widget->style->white_gc); - gdk_draw_layout(pixmap, gc, 0, 0, layout); - g_object_unref(gc); - - buffer = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, w, h); - gdk_pixbuf_get_from_drawable(buffer, pixmap, - gdk_drawable_get_colormap(widget->window), - 0, 0, 0, 0, w, h); - g_object_unref(pixmap); + buffer = gdk_pixbuf_new_from_data (cairo_image_surface_get_data (source), + GDK_COLORSPACE_RGB, + cairo_image_surface_get_format (source) == CAIRO_FORMAT_ARGB32, + 8, + cairo_image_surface_get_width (source), + cairo_image_surface_get_height (source), + cairo_image_surface_get_stride (source), + NULL, + NULL); sx = 0; sy = 0; @@ -834,6 +838,7 @@ r, g, b, a); g_object_unref(buffer); + cairo_surface_destroy(source); } /*
--- a/src/preferences.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/preferences.c Wed Aug 01 00:17:18 2012 +0200 @@ -125,13 +125,13 @@ static void zoom_mode_cb(GtkWidget *widget, gpointer data) { - if (GTK_TOGGLE_BUTTON (widget)->active) + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) c_options->image.zoom_mode = GPOINTER_TO_INT(data); } static void scroll_reset_cb(GtkWidget *widget, gpointer data) { - if (GTK_TOGGLE_BUTTON (widget)->active) + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) c_options->image.scroll_reset_method = GPOINTER_TO_INT(data); } @@ -433,15 +433,15 @@ pref_table_label(table, column, row, text, 0.0); - combo = gtk_combo_box_new_text(); - - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Nearest (worst, but fastest)")); + combo = gtk_combo_box_text_new(); + + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Nearest (worst, but fastest)")); if (option == GDK_INTERP_NEAREST) current = 0; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiles")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Tiles")); if (option == GDK_INTERP_TILES) current = 1; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Bilinear")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Bilinear")); if (option == GDK_INTERP_BILINEAR) current = 2; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Hyper (best, but slowest)")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Hyper (best, but slowest)")); if (option == GDK_INTERP_HYPER) current = 3; gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current); @@ -511,7 +511,7 @@ pref_table_label(table, column, row, text, 0.0); - combo = gtk_combo_box_new_text(); + combo = gtk_combo_box_text_new(); current = -1; for (i = 0; (guint) i < sizeof(thumb_size_list) / sizeof(ThumbSize); i++) @@ -523,7 +523,7 @@ h = thumb_size_list[i].h; buf = g_strdup_printf("%d x %d", w, h); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf); g_free(buf); if (w == options->thumbnails.max_width && h == options->thumbnails.max_height) current = i; @@ -534,7 +534,7 @@ gchar *buf; buf = g_strdup_printf("%s %d x %d", _("Custom"), options->thumbnails.max_width, options->thumbnails.max_height); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf); g_free(buf); current = i; @@ -596,27 +596,27 @@ pref_table_label(table, column, row, text, 0.0); - combo = gtk_combo_box_new_text(); - - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Single image")); - - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Red-Cyan")); + combo = gtk_combo_box_text_new(); + + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Single image")); + + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Red-Cyan")); if (option & PR_STEREO_ANAGLYPH_RC) current = 1; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Gray Red-Cyan")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Gray Red-Cyan")); if (option & PR_STEREO_ANAGLYPH_GRAY) current = 2; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Anaglyph Dubois")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Anaglyph Dubois")); if (option & PR_STEREO_ANAGLYPH_DB) current = 3; - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Side by Side Half size")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Side by Side")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Side by Side Half size")); if (option & PR_STEREO_HORIZ) { current = 4; if (option & PR_STEREO_HALF) current = 5; } - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom")); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Top - Bottom Half size")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Top - Bottom")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Top - Bottom Half size")); if (option & PR_STEREO_VERT) { current = 6; @@ -625,7 +625,7 @@ if (add_fixed) { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Fixed position")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Fixed position")); if (option & PR_STEREO_FIXED) current = 8; } @@ -903,7 +903,7 @@ _("This will remove the trash contents.")); generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, safe_delete_clear_ok_cb, TRUE); entry = gtk_entry_new(); - GTK_WIDGET_UNSET_FLAGS(entry, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(entry, FALSE); gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE); if (options->file_ops.safe_delete_path) gtk_entry_set_text(GTK_ENTRY(entry), options->file_ops.safe_delete_path); gtk_box_pack_start(GTK_BOX(gd->vbox), entry, FALSE, FALSE, 0); @@ -2184,7 +2184,7 @@ button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE, G_CALLBACK(config_window_ok_cb), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button); gtk_widget_show(button); @@ -2193,19 +2193,19 @@ button = pref_button_new(NULL, GTK_STOCK_SAVE, NULL, FALSE, G_CALLBACK(config_window_save_cb), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE, G_CALLBACK(config_window_apply_cb), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); button = pref_button_new(NULL, GTK_STOCK_CANCEL, NULL, FALSE, G_CALLBACK(config_window_close_cb), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); if (!generic_dialog_get_alternative_button_order(configwindow)) @@ -2333,13 +2333,13 @@ button = pref_button_new(NULL, NULL, _("Credits..."), FALSE, G_CALLBACK(about_credits_cb), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_show(button); button = pref_button_new(NULL, GTK_STOCK_CLOSE, NULL, FALSE, G_CALLBACK(about_window_close), NULL); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button); gtk_widget_show(button);
--- a/src/print.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/print.c Wed Aug 01 00:17:18 2012 +0200 @@ -2668,11 +2668,11 @@ GtkWidget *combo; gint i; - combo = gtk_combo_box_new_text(); + combo = gtk_combo_box_text_new(); for (i = 0 ; i < count; i++) { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _(text[i])); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _(text[i])); } if (preferred >= 0 && preferred < count) @@ -2700,12 +2700,12 @@ pref_table_label(table, column, row, (_("Format:")), 1.0); - combo = gtk_combo_box_new_text(); + combo = gtk_combo_box_text_new(); i = 0; while (print_paper_sizes[i].description) { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _(print_paper_sizes[i].description)); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _(print_paper_sizes[i].description)); i++; } @@ -2981,7 +2981,7 @@ work = work->next; buf = g_strdup_printf(PRINT_LPR_CUSTOM, name); - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), buf); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), buf); g_free(buf); } string_list_free(list);
--- a/src/search.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/search.c Wed Aug 01 00:17:18 2012 +0200 @@ -1394,8 +1394,7 @@ break; } - if (uri_text) gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, length); + if (uri_text) gtk_selection_data_set_text(selection_data, uri_text, length); g_free(uri_text); }
--- a/src/ui_bookmark.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_bookmark.c Wed Aug 01 00:17:18 2012 +0200 @@ -383,9 +383,11 @@ static void bookmark_menu_position_cb(GtkMenu *menu, gint *x, gint *y, gint *pushed_in, gpointer data) { GtkWidget *button = data; + GtkAllocation allocation; - gdk_window_get_origin(button->window, x, y); - *y += button->allocation.y + button->allocation.height; + gtk_widget_set_allocation(button, &allocation); + gdk_window_get_origin(gtk_widget_get_window(button), x, y); + *y += allocation.y + allocation.height; } static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button, @@ -472,7 +474,7 @@ gint length = 0; GList *list = NULL; - if (context->dest_window == bm->widget->window) return; +// if (context->dest_window == bm->widget->window) return; b = g_object_get_data(G_OBJECT(button), "bookbuttondata"); if (!b) return; @@ -493,8 +495,7 @@ if (!uri_text) return; - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, length); + gtk_selection_data_set_text(selection_data, uri_text, length); g_free(uri_text); } @@ -503,17 +504,20 @@ GdkPixbuf *pixbuf; GdkModifierType mask; gint x, y; + GtkAllocation allocation; + + gtk_widget_get_allocation(button, &allocation); pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, - button->allocation.width, button->allocation.height); - gdk_pixbuf_get_from_drawable(pixbuf, button->window, NULL, - button->allocation.x, button->allocation.y, - 0, 0, button->allocation.width, button->allocation.height); + allocation.width, allocation.height); + gdk_pixbuf_get_from_drawable(pixbuf, gtk_widget_get_window(button), NULL, + allocation.x, allocation.y, + 0, 0, allocation.width, allocation.height); - gdk_window_get_pointer(button->window, &x, &y, &mask); + gdk_window_get_pointer(gtk_widget_get_window(button), &x, &y, &mask); gtk_drag_set_icon_pixbuf(context, pixbuf, - x - button->allocation.x, y - button->allocation.y); + x - allocation.x, y - allocation.y); g_object_unref(pixbuf); } @@ -688,7 +692,7 @@ { case TARGET_URI_LIST: case TARGET_X_URL: - list = uri_list_from_text((gchar *)selection_data->data, FALSE); + list = uri_list_from_text((gchar *)gtk_selection_data_get_data(selection_data), FALSE); break; } @@ -871,13 +875,13 @@ hc->history_key = g_strdup(history_key); hc->history_levels = max_levels; - hc->combo = gtk_combo_box_entry_new_text(); + hc->combo = gtk_combo_box_text_new_with_entry(); #if 0 gtk_combo_set_case_sensitive(GTK_COMBO(hc->combo), TRUE); gtk_combo_set_use_arrows(GTK_COMBO(hc->combo), FALSE); #endif - hc->entry = GTK_BIN(hc->combo)->child; + hc->entry = gtk_bin_get_child(GTK_BIN(hc->combo)); g_object_set_data(G_OBJECT(hc->combo), "history_combo_data", hc); g_object_set_data(G_OBJECT(hc->entry), "history_combo_data", hc); @@ -887,7 +891,7 @@ work = history_list_get_by_key(hc->history_key); while (work) { - gtk_combo_box_append_text(GTK_COMBO_BOX(hc->combo), (gchar *)work->data); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(hc->combo), (gchar *)work->data); work = work->next; n++; } @@ -944,7 +948,7 @@ work = history_list_get_by_key(hc->history_key); while (work) { - gtk_combo_box_append_text(GTK_COMBO_BOX(hc->combo), (gchar *)work->data); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(hc->combo), (gchar *)work->data); work = work->next; } }
--- a/src/ui_fileops.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_fileops.c Wed Aug 01 00:17:18 2012 +0200 @@ -77,12 +77,12 @@ const gchar *bf; /* check that gtk is initialized (loop is level > 0) */ - if (gtk_main_level() == 0) - { +// if (gtk_main_level() == 0) +// { /* gtk not initialized */ - gtk_init_add(encoding_dialog_delay, g_strdup(path)); - return; - } +// gtk_init_add(encoding_dialog_delay, g_strdup(path)); +// return; +// } if (warned_user) return; warned_user = TRUE;
--- a/src/ui_help.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_help.c Wed Aug 01 00:17:18 2012 +0200 @@ -167,7 +167,7 @@ text = g_object_get_data(G_OBJECT(window), "text_widget"); if (!text) return; - gdk_window_raise(window->window); + gdk_window_raise(gtk_widget_get_window(window)); if (key) help_window_scroll(text, key); } @@ -181,7 +181,7 @@ text = g_object_get_data(G_OBJECT(window), "text_widget"); if (!text) return; - gdk_window_raise(window->window); + gdk_window_raise(gtk_widget_get_window(window)); help_window_load_text(text, path); help_window_scroll(text, key); @@ -249,7 +249,7 @@ g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(help_window_close), window); gtk_container_add(GTK_CONTAINER(hbox), button); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button); gtk_widget_show(button);
--- a/src/ui_menu.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_menu.c Wed Aug 01 00:17:18 2012 +0200 @@ -162,9 +162,11 @@ gboolean adjusted = FALSE; gint w, h; gint xw, xh; + GtkRequisition requisition; - w = GTK_WIDGET(menu)->requisition.width; - h = GTK_WIDGET(menu)->requisition.height; + gtk_widget_get_requisition(GTK_WIDGET(menu), &requisition); + w = requisition.width; + h = requisition.height; xw = gdk_screen_width(); xh = gdk_screen_height();
--- a/src/ui_misc.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_misc.c Wed Aug 01 00:17:18 2012 +0200 @@ -65,9 +65,14 @@ vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); /* add additional spacing if necessary */ - if (GTK_IS_VBOX(parent_box) && GTK_BOX(parent_box)->children != NULL) + if (GTK_IS_VBOX(parent_box)) { - pref_spacer(vbox, PREF_PAD_GROUP - PREF_PAD_GAP); + GList *list = gtk_container_get_children(GTK_CONTAINER(parent_box)); + if (list) + { + pref_spacer(vbox, PREF_PAD_GROUP - PREF_PAD_GAP); + } + g_list_free(list); } gtk_box_pack_start(GTK_BOX(parent_box), vbox, fill, fill, 0); @@ -928,12 +933,15 @@ gint x, y; gint w, h; gint xr, yr; + GdkWindow *window; xr = (gint)event->x_root; yr = (gint)event->y_root; - gdk_window_get_origin(ds->window->window, &x, &y); - gdk_drawable_get_size(ds->window->window, &w, &h); + window = gtk_widget_get_window(ds->window); + gdk_window_get_origin(window, &x, &y); + w = gdk_window_get_width(window); + h = gdk_window_get_height(window); if (xr < x || yr < y || xr > x + w || yr > y + h) { @@ -995,6 +1003,8 @@ gint x, y; gint wx, wy; gint day, month, year; + GtkAllocation button_allocation; + GtkAllocation window_allocation; if (ds->window) return; @@ -1020,14 +1030,17 @@ gtk_widget_realize(ds->window); - gdk_window_get_origin(ds->button->window, &wx, &wy); + gdk_window_get_origin(gtk_widget_get_window(ds->button), &wx, &wy); - x = wx + ds->button->allocation.x + ds->button->allocation.width - ds->window->allocation.width; - y = wy + ds->button->allocation.y + ds->button->allocation.height; + gtk_widget_get_allocation(ds->button, &button_allocation); + gtk_widget_get_allocation(ds->window, &window_allocation); + + x = wx + button_allocation.x + button_allocation.width - window_allocation.width; + y = wy + button_allocation.y + button_allocation.height; - if (y + ds->window->allocation.height > gdk_screen_height()) + if (y + window_allocation.height > gdk_screen_height()) { - y = wy + ds->button->allocation.y - ds->window->allocation.height; + y = wy + button_allocation.y - window_allocation.height; } if (x < 0) x = 0; if (y < 0) y = 0; @@ -1036,10 +1049,10 @@ gtk_widget_show(ds->window); gtk_widget_grab_focus(ds->calendar); - gdk_pointer_grab(ds->window->window, TRUE, + gdk_pointer_grab(gtk_widget_get_window(ds->window), TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK, NULL, NULL, GDK_CURRENT_TIME); - gdk_keyboard_grab(ds->window->window, TRUE, GDK_CURRENT_TIME); + gdk_keyboard_grab(gtk_widget_get_window(ds->window), TRUE, GDK_CURRENT_TIME); gtk_grab_add(ds->window); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ds->button), TRUE); @@ -1058,15 +1071,19 @@ static void button_size_allocate_cb(GtkWidget *button, GtkAllocation *allocation, gpointer data) { GtkWidget *spin = data; + GtkRequisition spin_requisition; + gtk_widget_get_requisition(spin, &spin_requisition); - if (allocation->height > spin->requisition.height) + if (allocation->height > spin_requisition.height) { GtkAllocation button_allocation; + GtkAllocation spin_allocation; - button_allocation = button->allocation; - button_allocation.height = spin->requisition.height; - button_allocation.y = spin->allocation.y + - (spin->allocation.height - spin->requisition.height) / 2; + gtk_widget_get_allocation(button, &button_allocation); + gtk_widget_get_allocation(spin, &spin_allocation); + button_allocation.height = spin_requisition.height; + button_allocation.y = spin_allocation.y + + (spin_allocation.height - spin_requisition.height) / 2; gtk_widget_size_allocate(button, &button_allocation); } } @@ -1232,6 +1249,7 @@ SizerData *sd = data; gint x, y; gint w, h; + GtkAllocation parent_allocation; if (!sd->in_drag) return FALSE; @@ -1264,20 +1282,27 @@ if (sd->bounding_widget) { - w = CLAMP(w, sd->sizer->allocation.width, sd->bounding_widget->allocation.width); - h = CLAMP(h, sd->sizer->allocation.height, sd->bounding_widget->allocation.height); + GtkAllocation sizer_allocation; + GtkAllocation bounding_allocation; + gtk_widget_get_allocation(sd->sizer, &sizer_allocation); + gtk_widget_get_allocation(sd->bounding_widget, &bounding_allocation); + w = CLAMP(w, sizer_allocation.width, bounding_allocation.width); + h = CLAMP(h, sizer_allocation.height, bounding_allocation.height); } else { - if (w < sd->sizer->allocation.width) w = sd->sizer->allocation.width; - if (h < sd->sizer->allocation.height) h = sd->sizer->allocation.height; + GtkAllocation sizer_allocation; + gtk_widget_get_allocation(sd->sizer, &sizer_allocation); + if (w < sizer_allocation.width) w = sizer_allocation.width; + if (h < sizer_allocation.height) h = sizer_allocation.height; } if (sd->hsize_max >= 0) w = MIN(w, sd->hsize_max); if (sd->vsize_max >= 0) h = MIN(h, sd->vsize_max); - if (w == sd->parent->allocation.width) w = -1; - if (h == sd->parent->allocation.height) h = -1; + gtk_widget_get_allocation(sd->parent, &parent_allocation); + if (w == parent_allocation.width) w = -1; + if (h == parent_allocation.height) h = -1; if (w > 0 || h > 0) gtk_widget_set_size_request(sd->parent, w, h); @@ -1287,6 +1312,7 @@ static gboolean sizer_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { SizerData *sd = data; + GtkAllocation parent_allocation; if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; @@ -1294,10 +1320,11 @@ sd->press_x = bevent->x_root; sd->press_y = bevent->y_root; - sd->press_width = sd->parent->allocation.width; - sd->press_height = sd->parent->allocation.height; + gtk_widget_get_allocation(sd->parent, &parent_allocation); + sd->press_width = parent_allocation.width; + sd->press_height = parent_allocation.height; - gdk_pointer_grab(sd->sizer->window, FALSE, + gdk_pointer_grab(gtk_widget_get_window(sd->sizer), FALSE, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, NULL, NULL, bevent->time); gtk_grab_add(sd->sizer); @@ -1328,9 +1355,12 @@ static void sizer_set_prelight(SizerData *sd, gboolean prelit) { + GtkAllocation sizer_allocation; + gtk_widget_get_allocation(sd->sizer, &sizer_allocation); + sd->handle_prelit = prelit; gtk_widget_queue_draw_area(sd->sizer, 0, 0, - sd->sizer->allocation.width, sd->sizer->allocation.height); + sizer_allocation.width, sizer_allocation.height); } static gboolean sizer_enter_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) @@ -1355,6 +1385,7 @@ GdkRectangle clip; GtkOrientation orientation; GtkStateType state; + GtkAllocation allocation; gdk_region_get_clipbox(event->region, &clip); @@ -1373,13 +1404,14 @@ } else { - state = widget->state; + state = gtk_widget_get_state(widget); } - gtk_paint_handle(widget->style, widget->window, state, + gtk_widget_get_allocation(widget, &allocation); + gtk_paint_handle(gtk_widget_get_style(widget), gtk_widget_get_window(widget), state, GTK_SHADOW_NONE, &clip, widget, "paned", 0, 0, - widget->allocation.width, widget->allocation.height, + allocation.width, allocation.height, orientation); return TRUE; @@ -1400,11 +1432,11 @@ n = (n != 0) ? GDK_FLEUR : GDK_SB_H_DOUBLE_ARROW; } - if (n != 0 && widget->window) + if (n != 0 && gtk_widget_get_window(widget)) { GdkCursor *cursor; cursor = gdk_cursor_new(n); - gdk_window_set_cursor(widget->window, cursor); + gdk_window_set_cursor(gtk_widget_get_window(widget), cursor); gdk_cursor_unref(cursor); } }
--- a/src/ui_pathsel.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_pathsel.c Wed Aug 01 00:17:18 2012 +0200 @@ -360,8 +360,7 @@ if (!uri_text) return; - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, length); + gtk_selection_data_set_text(selection_data, uri_text, length); g_free(uri_text); } @@ -905,7 +904,7 @@ if (!dd->filter_list || !dd->filter_combo) return; - entry = GTK_BIN(dd->filter_combo)->child; + entry = gtk_bin_get_child(GTK_BIN(dd->filter_combo)); old_text = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); store = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(dd->filter_combo))); @@ -972,7 +971,7 @@ } dd->filter_text_list = uig_list_insert_link(dd->filter_text_list, g_list_last(dd->filter_text_list), buf); - if (set) gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dd->filter_combo)->child), filter); + if (set) gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(dd->filter_combo))), filter); dest_filter_list_sync(dd); } @@ -994,7 +993,7 @@ const gchar *buf; gchar *path; - entry = GTK_BIN(dd->filter_combo)->child; + entry = gtk_bin_get_child(GTK_BIN(dd->filter_combo)); buf = gtk_entry_get_text(GTK_ENTRY(entry)); g_free(dd->filter); @@ -1144,8 +1143,7 @@ store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); - dd->filter_combo = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(store), - FILTER_COLUMN_FILTER); + dd->filter_combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(store)); g_object_unref(store); gtk_cell_layout_clear(GTK_CELL_LAYOUT(dd->filter_combo)); renderer = gtk_cell_renderer_text_new(); @@ -1208,7 +1206,7 @@ dest_filter_clear(dd); dest_filter_add(dd, filter, filter_desc, TRUE); - dd->filter = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_BIN(dd->filter_combo)->child))); + dd->filter = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(dd->filter_combo))))); } if (path && path[0] == G_DIR_SEPARATOR && isdir(path)) @@ -1235,7 +1233,7 @@ if (dd->filter_combo) { - g_signal_connect(G_OBJECT(GTK_BIN(dd->filter_combo)->child), "changed", + g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(dd->filter_combo))), "changed", G_CALLBACK(dest_filter_changed_cb), dd); } g_signal_connect(G_OBJECT(dd->entry), "changed",
--- a/src/ui_tabcomp.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_tabcomp.c Wed Aug 01 00:17:18 2012 +0200 @@ -300,11 +300,13 @@ GdkScreen *screen; gint monitor_num; GdkRectangle monitor; + GtkRequisition requisition; + GtkAllocation allocation; - gdk_window_get_origin(td->entry->window, x, y); + gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(td->entry)), x, y); screen = gtk_widget_get_screen(GTK_WIDGET(menu)); - monitor_num = gdk_screen_get_monitor_at_window(screen, td->entry->window); + monitor_num = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(GTK_WIDGET(td->entry))); gdk_screen_get_monitor_geometry(screen, monitor_num, &monitor); gtk_widget_size_request(GTK_WIDGET(menu), &req); @@ -317,7 +319,10 @@ *x += strong_pos.x / PANGO_SCALE + xoffset; - height = MIN(td->entry->requisition.height, td->entry->allocation.height); + gtk_widget_get_requisition(td->entry, &requisition); + gtk_widget_get_allocation(td->entry, &allocation); + + height = MIN(requisition.height, allocation.height); if (req.height > monitor.y + monitor.height - *y - height && *y - monitor.y > monitor.y + monitor.height - *y) @@ -668,15 +673,17 @@ static void tab_completion_button_size_allocate(GtkWidget *button, GtkAllocation *allocation, gpointer data) { GtkWidget *parent = data; + GtkAllocation parent_allocation; + gtk_widget_get_allocation(parent, &parent_allocation); - if (allocation->height > parent->allocation.height) + if (allocation->height > parent_allocation.height) { GtkAllocation button_allocation; - button_allocation = button->allocation; - button_allocation.height = parent->allocation.height; - button_allocation.y = parent->allocation.y + - (parent->allocation.height - parent->allocation.height) / 2; + gtk_widget_get_allocation(button, &button_allocation); + button_allocation.height = parent_allocation.height; + button_allocation.y = parent_allocation.y + + (parent_allocation.height - parent_allocation.height) / 2; gtk_widget_size_allocate(button, &button_allocation); } } @@ -688,7 +695,7 @@ GdkPixbuf *pixbuf; button = gtk_button_new(); - GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(button, FALSE); g_signal_connect(G_OBJECT(button), "size_allocate", G_CALLBACK(tab_completion_button_size_allocate), parent); g_signal_connect(G_OBJECT(button), "clicked", @@ -724,11 +731,11 @@ box = gtk_hbox_new(FALSE, 0); - combo = gtk_combo_box_entry_new_text(); + combo = gtk_combo_box_text_new_with_entry(); gtk_box_pack_start(GTK_BOX(box), combo, TRUE, TRUE, 0); gtk_widget_show(combo); - combo_entry = GTK_BIN(combo)->child; + combo_entry = gtk_bin_get_child(GTK_BIN(combo)); #if 0 gtk_combo_set_case_sensitive(GTK_COMBO(combo), TRUE); gtk_combo_set_use_arrows(GTK_COMBO(combo), FALSE); @@ -753,7 +760,7 @@ work = history_list_get_by_key(history_key); while (work) { - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), (gchar *)work->data); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), (gchar *)work->data); work = work->next; n++; } @@ -810,7 +817,7 @@ work = history_list_get_by_key(td->history_key); while (work) { - gtk_combo_box_append_text(GTK_COMBO_BOX(td->combo), (gchar *)work->data); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(td->combo), (gchar *)work->data); work = work->next; n++; }
--- a/src/ui_tree_edit.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_tree_edit.c Wed Aug 01 00:17:18 2012 +0200 @@ -74,6 +74,7 @@ static gboolean tree_edit_click_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) { TreeEditData *ted = data; + GdkWindow *window = gtk_widget_get_window(ted->window); gint x, y; gint w, h; @@ -83,8 +84,9 @@ xr = (gint)event->x_root; yr = (gint)event->y_root; - gdk_window_get_origin(ted->window->window, &x, &y); - gdk_drawable_get_size(ted->window->window, &w, &h); + gdk_window_get_origin(window, &x, &y); + w = gdk_window_get_width(window); + h = gdk_window_get_height(window); if (xr < x || yr < y || xr > x + w || yr > y + h) { @@ -164,12 +166,12 @@ /* explicitely set the focus flag for the entry, for some reason on popup windows this * is not set, and causes no edit cursor to appear ( popups not allowed focus? ) */ - GTK_WIDGET_SET_FLAGS(ted->entry, GTK_HAS_FOCUS); + gtk_widget_grab_focus(ted->entry); gtk_grab_add(ted->window); - gdk_pointer_grab(ted->window->window, TRUE, + gdk_pointer_grab(gtk_widget_get_window(ted->window), TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK, NULL, NULL, GDK_CURRENT_TIME); - gdk_keyboard_grab(ted->window->window, TRUE, GDK_CURRENT_TIME); + gdk_keyboard_grab(gtk_widget_get_window(ted->window), TRUE, GDK_CURRENT_TIME); return FALSE; } @@ -185,7 +187,7 @@ if (!edit_func) return FALSE; #if GTK_CHECK_VERSION(2,20,0) - if (!gtk_widget_get_visible(tree)) return FALSE; + if (!gtk_widget_get_visible(GTK_WIDGET(tree))) return FALSE; #else if (!GTK_WIDGET_VISIBLE(tree)) return FALSE; #endif @@ -278,11 +280,13 @@ #else gtk_tree_view_tree_to_widget_coords(widget, 0, 0, &x_offset, &y_offset); #endif - gdk_window_get_origin(GTK_WIDGET(widget)->window, &x_origin, &y_origin); + gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(widget)), &x_origin, &y_origin); if (gtk_tree_view_get_headers_visible(widget)) { - header_size = tv_column->button->allocation.height; + GtkAllocation allocation; + gtk_widget_get_allocation(tv_column->button, &allocation); + header_size = allocation.height; } else { @@ -337,9 +341,12 @@ gint wx, wy, ww, wh; GdkWindow *window; - window = GTK_WIDGET(widget)->window; + window = gtk_widget_get_window(GTK_WIDGET(widget)); gdk_window_get_origin(window, &wx, &wy); - gdk_drawable_get_size(window, &ww, &wh); + + ww = gdk_window_get_width(window); + wh = gdk_window_get_height(window); + if (!tree_view_get_cell_origin(widget, tpath, column, text_cell_only, x, y, width, height)) { *x = wx; @@ -617,9 +624,10 @@ sd->max_step = MIN(sd->region_size, sd->max_step + 2); } - window = sd->widget->window; + window = gtk_widget_get_window(sd->widget); gdk_window_get_pointer(window, &x, &y, NULL); - gdk_drawable_get_size(window, &w, &h); + w = gdk_window_get_width(window); + h = gdk_window_get_height(window); if (x < 0 || x >= w || y < 0 || y >= h) { @@ -649,7 +657,7 @@ { amt = CLAMP(amt, 0 - sd->max_step, sd->max_step); - if (sd->adj->value != CLAMP(sd->adj->value + amt, sd->adj->lower, sd->adj->upper - sd->adj->page_size)) + if (gtk_adjustment_get_value(sd->adj) != CLAMP(gtk_adjustment_get_value(sd->adj) + amt, gtk_adjustment_get_lower(sd->adj), gtk_adjustment_get_upper(sd->adj) - gtk_adjustment_get_page_size(sd->adj))) { /* only notify when scrolling is needed */ if (sd->notify_func && !sd->notify_func(sd->widget, x, y, sd->notify_data)) @@ -660,7 +668,7 @@ } gtk_adjustment_set_value(sd->adj, - CLAMP(sd->adj->value + amt, sd->adj->lower, sd->adj->upper - sd->adj->page_size)); + CLAMP(gtk_adjustment_get_value(sd->adj) + amt, gtk_adjustment_get_lower(sd->adj), gtk_adjustment_get_upper(sd->adj) - gtk_adjustment_get_page_size(sd->adj))); } }
--- a/src/ui_utildlg.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/ui_utildlg.c Wed Aug 01 00:17:18 2012 +0200 @@ -150,7 +150,7 @@ button = pref_button_new(NULL, stock_id, text, FALSE, G_CALLBACK(generic_dialog_click_cb), gd); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_widget_set_can_default(button, TRUE); g_object_set_data(G_OBJECT(button), "dialog_function", func_cb); gtk_container_add(GTK_CONTAINER(gd->hbox), button);
--- a/src/view_dir.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/view_dir.c Wed Aug 01 00:17:18 2012 +0200 @@ -744,8 +744,7 @@ } if (uritext) { - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uritext, length); + gtk_selection_data_set_text(selection_data, uritext, length); g_free(uritext); } } @@ -764,7 +763,7 @@ vd_color_set(vd, vd->click_fd, FALSE); - if (vd->type == DIRVIEW_LIST && context->action == GDK_ACTION_MOVE) + if (vd->type == DIRVIEW_LIST && gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE) { vd_refresh(vd); } @@ -797,7 +796,7 @@ gint active; gboolean done = FALSE; - list = uri_filelist_from_text((gchar *)selection_data->data, TRUE); + list = uri_filelist_from_text((gchar *)gtk_selection_data_get_data(selection_data), TRUE); if (!list) return; active = access_file(fd->path, W_OK | X_OK); @@ -806,13 +805,13 @@ if (active) { - if (context->actions == GDK_ACTION_COPY) + if (gdk_drag_context_get_actions(context) == GDK_ACTION_COPY) { file_util_copy_simple(list, fd->path, vd->widget); done = TRUE; list = NULL; } - else if (context->actions == GDK_ACTION_MOVE) + else if (gdk_drag_context_get_actions(context) == GDK_ACTION_MOVE) { file_util_move_simple(list, fd->path, vd->widget); done = TRUE; @@ -872,9 +871,10 @@ gint x, y; gint w, h; - window = vd->view->window; + window = gtk_widget_get_window(vd->view); gdk_window_get_pointer(window, &x, &y, NULL); - gdk_drawable_get_size(window, &w, &h); + w = gdk_window_get_width(window); + h = gdk_window_get_height(window); if (x >= 0 && x < w && y >= 0 && y < h) { vd_dnd_drop_update(vd, x, y); @@ -911,7 +911,7 @@ } else { - gdk_drag_status(context, context->suggested_action, time); + gdk_drag_status(context, gdk_drag_context_get_suggested_action(context), time); } vd_dnd_drop_update(vd, x, y);
--- a/src/view_dir_tree.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/view_dir_tree.c Wed Aug 01 00:17:18 2012 +0200 @@ -53,10 +53,10 @@ { GdkCursor *cursor = NULL; - if (!widget || !widget->window) return; + if (!widget || !gtk_widget_get_window(widget)) return; if (cursor_type > -1) cursor = gdk_cursor_new(cursor_type); - gdk_window_set_cursor(widget->window, cursor); + gdk_window_set_cursor(gtk_widget_get_window(widget), cursor); if (cursor) gdk_cursor_unref(cursor); gdk_flush(); }
--- a/src/view_file_icon.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/view_file_icon.c Wed Aug 01 00:17:18 2012 +0200 @@ -267,10 +267,12 @@ static void vficon_toggle_filenames(ViewFile *vf) { + GtkAllocation allocation; VFICON(vf)->show_text = !VFICON(vf)->show_text; options->show_icon_names = VFICON(vf)->show_text; - vficon_populate_at_new_size(vf, vf->listview->allocation.width, vf->listview->allocation.height, TRUE); + gtk_widget_get_allocation(vf->listview, &allocation); + vficon_populate_at_new_size(vf, allocation.width, allocation.height, TRUE); } static gint vficon_get_icon_width(ViewFile *vf) @@ -460,7 +462,7 @@ #else if (GTK_WIDGET_SENSITIVE(window) && #endif - GTK_WINDOW(window)->has_focus) + gtk_window_has_toplevel_focus(GTK_WINDOW(window))) { tip_show(vf); } @@ -560,8 +562,7 @@ DEBUG_1("%s", uri_text); - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, total); + gtk_selection_data_set_text(selection_data, uri_text, total); g_free(uri_text); } @@ -577,7 +578,7 @@ if (id && id->fd) { /* Add keywords to file */ FileData *fd = id->fd; - gchar *str = g_strndup((gchar *)selection->data, selection->length); + gchar *str = gtk_selection_data_get_text(selection); GList *kw_list = string_to_keywords_list(str); metadata_append_list(fd, KEYWORD_KEY, kw_list); @@ -618,7 +619,7 @@ vficon_selection_remove(vf, VFICON(vf)->click_id, SELECTION_PRELIGHT, NULL); - if (context->action == GDK_ACTION_MOVE) + if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE) { vf_refresh(vf); } @@ -696,7 +697,9 @@ void vficon_marks_set(ViewFile *vf, gint enable) { - vficon_populate_at_new_size(vf, vf->listview->allocation.width, vf->listview->allocation.height, TRUE); + GtkAllocation allocation; + gtk_widget_get_allocation(vf->listview, &allocation); + vficon_populate_at_new_size(vf, allocation.width, allocation.height, TRUE); } /* @@ -1251,7 +1254,7 @@ gint ret; adj = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(vf->listview)); - page_size = (gint)adj->page_increment; + page_size = (gint)gtk_adjustment_get_page_increment(adj); row_height = options->thumbnails.max_height + THUMB_BORDER_PADDING * 2; if (VFICON(vf)->show_text) row_height += options->thumbnails.max_height / 3;
--- a/src/view_file_list.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/view_file_list.c Wed Aug 01 00:17:18 2012 +0200 @@ -274,8 +274,7 @@ DEBUG_1("%s", uri_text); - gtk_selection_data_set(selection_data, selection_data->target, - 8, (guchar *)uri_text, total); + gtk_selection_data_set_text(selection_data, uri_text, total); g_free(uri_text); } @@ -305,7 +304,7 @@ vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE); - if (context->action == GDK_ACTION_MOVE) + if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE) { vf_refresh(vf); } @@ -322,7 +321,7 @@ if (fd) { /* Add keywords to file */ - gchar *str = g_strndup((gchar *)selection->data, selection->length); + gchar *str = gtk_selection_data_get_text(selection); GList *kw_list = string_to_keywords_list(str); metadata_append_list(fd, KEYWORD_KEY, kw_list);
--- a/src/window.c Fri Aug 10 22:51:57 2012 +0200 +++ b/src/window.c Wed Aug 01 00:17:18 2012 +0200 @@ -69,9 +69,9 @@ { GdkWindowState state; - if (!window || !window->window) return FALSE; + if (!window || !gtk_widget_get_window(window)) return FALSE; - state = gdk_window_get_state(window->window); + state = gdk_window_get_state(gtk_widget_get_window(window)); return !!(state & GDK_WINDOW_STATE_MAXIMIZED); }