From 3731b35d212b5efed3835efe7e50be55970dfe8e Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 14:02:27 +0200 Subject: [lc-p] port CajaCellRendererPixbufEmblem to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=dfbf8b9b5636dceb3d6291c980d2c349afc849d7 --- libcaja-private/caja-cell-renderer-pixbuf-emblem.c | 49 +++++++--------------- 1 file changed, 16 insertions(+), 33 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-cell-renderer-pixbuf-emblem.c b/libcaja-private/caja-cell-renderer-pixbuf-emblem.c index 4fec3a4a..63cbf3db 100644 --- a/libcaja-private/caja-cell-renderer-pixbuf-emblem.c +++ b/libcaja-private/caja-cell-renderer-pixbuf-emblem.c @@ -428,10 +428,10 @@ caja_cell_renderer_pixbuf_emblem_render (GtkCellRenderer *cell, GdkPixbuf *pixbuf; GdkRectangle pix_rect; GdkRectangle pix_emblem_rect; - GdkRectangle draw_rect; gboolean stock_pixbuf = FALSE; gint xpad, ypad; gboolean is_expander, is_expanded; + cairo_t *cr; pixbuf = cellpixbuf->pixbuf; g_object_get (cell, @@ -476,22 +476,15 @@ caja_cell_renderer_pixbuf_emblem_render (GtkCellRenderer *cell, pix_rect.width -= xpad * 2; pix_rect.height -= ypad * 2; - if (gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect) && - gdk_rectangle_intersect (expose_area, &draw_rect, &draw_rect)) - { - gdk_draw_pixbuf (window, - gtk_widget_get_style (widget)->black_gc, - pixbuf, - /* pixbuf 0, 0 is at pix_rect.x, pix_rect.y */ - draw_rect.x - pix_rect.x, - draw_rect.y - pix_rect.y, - draw_rect.x, - draw_rect.y, - draw_rect.width, - draw_rect.height, - GDK_RGB_DITHER_NORMAL, - 0, 0); - } + cr = gdk_cairo_create (window); + gdk_cairo_rectangle (cr, expose_area); + cairo_clip (cr); + gdk_cairo_rectangle (cr, cell_area); + cairo_clip (cr); + + gdk_cairo_set_source_pixbuf (cr, pixbuf, pix_rect.x, pix_rect.y); + gdk_cairo_rectangle (cr, &pix_rect); + cairo_fill (cr); if (cellpixbuf->pixbuf_emblem) { @@ -499,21 +492,11 @@ caja_cell_renderer_pixbuf_emblem_render (GtkCellRenderer *cell, pix_emblem_rect.height = gdk_pixbuf_get_height (cellpixbuf->pixbuf_emblem); pix_emblem_rect.x = pix_rect.x; pix_emblem_rect.y = pix_rect.y + pix_rect.height - pix_emblem_rect.height; - if (gdk_rectangle_intersect (cell_area, &pix_emblem_rect, &draw_rect) && - gdk_rectangle_intersect (expose_area, &draw_rect, &draw_rect)) - { - gdk_draw_pixbuf (window, - gtk_widget_get_style (widget)->black_gc, - cellpixbuf->pixbuf_emblem, - /* pixbuf 0, 0 is at pix_emblem_rect.x, pix_emblem_rect.y */ - draw_rect.x - pix_emblem_rect.x, - draw_rect.y - pix_emblem_rect.y, - draw_rect.x, - draw_rect.y, - draw_rect.width, - draw_rect.height, - GDK_RGB_DITHER_NORMAL, - 0, 0); - } + gdk_cairo_set_source_pixbuf (cr, cellpixbuf->pixbuf_emblem, + pix_emblem_rect.x, pix_emblem_rect.y); + gdk_cairo_rectangle (cr, &pix_emblem_rect); + cairo_fill (cr); } + + cairo_destory (cr); } -- cgit v1.2.1 From fada3fccfa2e72360fc932a9d58a01268bff0fea Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 14:05:37 +0200 Subject: [lc-p] port CajaDirectoryBackground to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=6c691075c09ec23620484da00ffd43d3dfe0b75b --- libcaja-private/caja-directory-background.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-directory-background.c b/libcaja-private/caja-directory-background.c index 05a0f8e5..21aea675 100644 --- a/libcaja-private/caja-directory-background.c +++ b/libcaja-private/caja-directory-background.c @@ -126,8 +126,6 @@ read_color (const char *key, GdkColor *color) { gdk_color_parse ("black", color); } - - gdk_rgb_find_color (gdk_rgb_get_colormap (), color); } static void -- cgit v1.2.1 From d51a2a8235d5d6dc380e0482d2fdddeb60b29dc1 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 14:47:33 +0200 Subject: [lc-p] port CajaIconCanvasItem to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=89bd44de6bb11450b88d9d160593b65d62467579 --- libcaja-private/caja-icon-canvas-item.c | 181 ++++++++++++++------------------ 1 file changed, 77 insertions(+), 104 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index db0b5280..cfb16105 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -243,8 +243,7 @@ static void draw_label_layout (CajaIconCanvasItem gboolean highlight, GdkColor *label_color, int x, - int y, - GdkGC *gc); + int y); static gboolean hit_test_stretch_handle (CajaIconCanvasItem *item, EelIRect canvas_rect, GtkCornerType *corner); @@ -548,7 +547,6 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, GdkPixmap *pixmap; EelCanvas *canvas; GdkScreen *screen; - GdkGC *gc; int width, height; int item_offset_x, item_offset_y; EelIRect icon_rect; @@ -618,34 +616,21 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, GDK_INTERP_BILINEAR, 255); } - /* clear the pixmap */ + /* draw pixbuf to mask and pixmap */ cr = gdk_cairo_create (pixmap); - cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); cairo_paint (cr); cairo_destroy (cr); - gc = gdk_gc_new (pixmap); - gdk_draw_pixbuf (pixmap, gc, pixbuf, - 0, 0, 0, 0, - gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), - GDK_RGB_DITHER_NORMAL, - 0, 0); - g_object_unref (gc); - *mask = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, 1); - gc = gdk_gc_new (*mask); - gdk_draw_rectangle (*mask, gc, - TRUE, - 0, 0, - width, height); - g_object_unref (gc); - - gdk_pixbuf_render_threshold_alpha (pixbuf, *mask, - 0, 0, 0, 0, - gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), - 128); + cr = gdk_cairo_create (*mask); + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); + cairo_paint (cr); + cairo_destroy (cr); draw_embedded_text (item, GDK_DRAWABLE (pixmap), item_offset_x, item_offset_y); @@ -1389,7 +1374,6 @@ draw_label_text (CajaIconCanvasItem *item, PangoLayout *editable_layout; PangoLayout *additional_layout; GdkColor *label_color; - GdkGC *gc; gboolean have_editable, have_additional; gboolean needs_frame, needs_highlight, prelight_label, is_rtl_label_beside; EelIRect text_rect; @@ -1400,8 +1384,6 @@ draw_label_text (CajaIconCanvasItem *item, return; #endif - gc = NULL; - canvas_item = EEL_CANVAS_ITEM (item); details = item->details; @@ -1497,7 +1479,7 @@ draw_label_text (CajaIconCanvasItem *item, } } - gc = caja_icon_container_get_label_color_and_gc + caja_icon_container_get_label_color (CAJA_ICON_CONTAINER (canvas_item->canvas), &label_color, TRUE, needs_highlight, prelight_label & item->details->is_prelit); @@ -1506,7 +1488,7 @@ draw_label_text (CajaIconCanvasItem *item, editable_layout, needs_highlight, label_color, x, - text_rect.y0 + TEXT_BACK_PADDING_Y, gc); + text_rect.y0 + TEXT_BACK_PADDING_Y); } if (have_additional) @@ -1514,7 +1496,7 @@ draw_label_text (CajaIconCanvasItem *item, additional_layout = get_label_layout (&item->details->additional_text_layout, item, item->details->additional_text); prepare_pango_layout_for_draw (item, additional_layout); - gc = caja_icon_container_get_label_color_and_gc + caja_icon_container_get_label_color (CAJA_ICON_CONTAINER (canvas_item->canvas), &label_color, FALSE, needs_highlight, FALSE); @@ -1523,7 +1505,7 @@ draw_label_text (CajaIconCanvasItem *item, additional_layout, needs_highlight, label_color, x, - text_rect.y0 + details->editable_text_height + LABEL_LINE_SPACING + TEXT_BACK_PADDING_Y, gc); + text_rect.y0 + details->editable_text_height + LABEL_LINE_SPACING + TEXT_BACK_PADDING_Y); } if (!create_mask && item->details->is_highlighted_as_keyboard_focus) @@ -1615,11 +1597,10 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, const EelIRect *rect) { GtkWidget *widget; - GdkGC *gc; GdkPixbuf *knob_pixbuf; - GdkBitmap *stipple; int knob_width, knob_height; - GtkStyle *style; + double dash[2] = { 1.0, 1.0 }; + cairo_t *cr; if (!item->details->show_stretch_handles) { @@ -1627,44 +1608,41 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, } widget = GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas); - style = gtk_widget_get_style (widget); - gc = gdk_gc_new (drawable); + cr = gdk_cairo_create (drawable); knob_pixbuf = get_knob_pixbuf (); knob_width = gdk_pixbuf_get_width (knob_pixbuf); knob_height = gdk_pixbuf_get_height (knob_pixbuf); - stipple = eel_stipple_bitmap_for_screen ( - gdk_drawable_get_screen (GDK_DRAWABLE (drawable))); - /* first draw the box */ - gdk_gc_set_rgb_fg_color (gc, &style->white); - gdk_draw_rectangle - (drawable, gc, FALSE, - rect->x0, - rect->y0, - rect->x1 - rect->x0 - 1, - rect->y1 - rect->y0 - 1); - - gdk_gc_set_rgb_fg_color (gc, &style->black); - gdk_gc_set_stipple (gc, stipple); - gdk_gc_set_fill (gc, GDK_STIPPLED); - gdk_draw_rectangle - (drawable, gc, FALSE, - rect->x0, - rect->y0, - rect->x1 - rect->x0 - 1, - rect->y1 - rect->y0 - 1); + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_set_line_width (cr, 1.0); + cairo_rectangle (cr, + rect->x0 + 0.5, + rect->y0 + 0.5, + rect->x1 - rect->x0 - 1, + rect->y1 - rect->y0 - 1); + cairo_stroke (cr); + + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_set_dash (cr, dash, G_N_ELEMENTS (dash), 0); + cairo_rectangle (cr, + rect->x0 + 0.5, + rect->y0 + 0.5, + rect->x1 - rect->x0 - 1, + rect->y1 - rect->y0 - 1); + cairo_stroke (cr); /* draw the stretch handles themselves */ - draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y0); - draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y1 - knob_height); - draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y0); - draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y1 - knob_height); - g_object_unref (knob_pixbuf); + gdk_cairo_set_source_pixbuf (cr, knob_pixbuf, rect->x0, rect->y0); + cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT); + cairo_rectangle (cr, + rect->x1 - knob_width, rect->y1 - knob_height, + 2 * knob_width, 2 * knob_height); + cairo_fill (cr); - g_object_unref (gc); + cairo_destroy (cr); } static void @@ -1827,13 +1805,12 @@ emblem_layout_next (EmblemLayout *layout, static void draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y) { - /* FIXME bugzilla.gnome.org 40703: - * Dither would be better if we passed dither values. - */ - gdk_draw_pixbuf (drawable, NULL, pixbuf, 0, 0, x, y, - gdk_pixbuf_get_width (pixbuf), - gdk_pixbuf_get_height (pixbuf), - GDK_RGB_DITHER_NORMAL, 0, 0); + cairo_t *cr = gdk_cairo_create (drawable); + + gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y); + cairo_paint (cr); + + cairo_destroy (cr); } /* shared code to highlight or dim the passed-in pixbuf */ @@ -2003,11 +1980,10 @@ draw_embedded_text (CajaIconCanvasItem *item, GdkDrawable *drawable, int x, int y) { - GdkGC *gc; - GdkRectangle clip_rect; PangoLayout *layout; PangoContext *context; PangoFontDescription *desc; + cairo_t *cr; if (item->details->embedded_text == NULL || item->details->embedded_text_rect.width == 0 || @@ -2036,22 +2012,22 @@ draw_embedded_text (CajaIconCanvasItem *item, } } - gc = gdk_gc_new (drawable); - - clip_rect.x = x + item->details->embedded_text_rect.x; - clip_rect.y = y + item->details->embedded_text_rect.y; - clip_rect.width = item->details->embedded_text_rect.width; - clip_rect.height = item->details->embedded_text_rect.height; - - gdk_gc_set_clip_rectangle (gc, &clip_rect); + cr = gdk_cairo_create (drawable); - gdk_draw_layout (drawable, gc, + cairo_rectangle (cr, x + item->details->embedded_text_rect.x, y + item->details->embedded_text_rect.y, - layout); + item->details->embedded_text_rect.width, + item->details->embedded_text_rect.height); + cairo_clip (cr); - g_object_unref (gc); - g_object_unref (layout); + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_move_to (cr, + x + item->details->embedded_text_rect.x, + y + item->details->embedded_text_rect.y); + pango_cairo_show_layout (cr, layout); + + cairo_destroy (cr); } /* Draw the icon item for non-anti-aliased mode. */ @@ -2064,8 +2040,9 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, EelIRect icon_rect, emblem_rect; EmblemLayout emblem_layout; GdkPixbuf *emblem_pixbuf, *temp_pixbuf; - GdkRectangle draw_rect, pixbuf_rect; + GdkRectangle pixbuf_rect; gboolean is_rtl; + cairo_t *cr; icon_item = CAJA_ICON_CANVAS_ITEM (item); details = icon_item->details; @@ -2085,20 +2062,14 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, pixbuf_rect.y = icon_rect.y0; pixbuf_rect.width = gdk_pixbuf_get_width (temp_pixbuf); pixbuf_rect.height = gdk_pixbuf_get_height (temp_pixbuf); - if (gdk_rectangle_intersect (&(expose->area), &pixbuf_rect, &draw_rect)) - { - gdk_draw_pixbuf (drawable, - NULL, - temp_pixbuf, - draw_rect.x - pixbuf_rect.x, - draw_rect.y - pixbuf_rect.y, - draw_rect.x, - draw_rect.y, - draw_rect.width, - draw_rect.height, - GDK_RGB_DITHER_NORMAL, - 0,0); - } + + cr = gdk_cairo_create (drawable); + gdk_cairo_rectangle (cr, &expose->area); + cairo_clip (cr); + gdk_cairo_set_source_pixbuf (cr, temp_pixbuf, pixbuf_rect.x, pixbuf_rect.y); + gdk_cairo_rectangle (cr, &pixbuf_rect); + cairo_fill (cr); + cairo_destroy (cr); g_object_unref (temp_pixbuf); draw_embedded_text (icon_item, drawable, icon_rect.x0, icon_rect.y0); @@ -2239,8 +2210,7 @@ draw_label_layout (CajaIconCanvasItem *item, gboolean highlight, GdkColor *label_color, int x, - int y, - GdkGC *gc) + int y) { if (drawable == NULL) { @@ -2255,7 +2225,7 @@ draw_label_layout (CajaIconCanvasItem *item, if (!highlight && (CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas)->details->use_drop_shadows)) { /* draw a drop shadow */ - eel_gdk_draw_layout_with_drop_shadow (drawable, gc, + eel_gdk_draw_layout_with_drop_shadow (drawable, label_color, >k_widget_get_style (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas))->black, x, y, @@ -2263,9 +2233,12 @@ draw_label_layout (CajaIconCanvasItem *item, } else { - gdk_draw_layout (drawable, gc, - x, y, - layout); + cairo_t *cr = gdk_cairo_create (drawable); + + gdk_cairo_set_source_color (cr, label_color); + cairo_move_to (cr, x, y); + pango_cairo_show_layout (cr, layout); + cairo_destroy (cr); } } -- cgit v1.2.1 From a694648f1a1a373f96e97b632627bb30d1c5646b Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 14:52:27 +0200 Subject: [lc-p] port CajaIconContainer to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=8eab39c06628da7cf919be77d922024198105f0a --- libcaja-private/caja-icon-container.c | 40 ++++------------------------------- 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index e3457f31..b9a7dfc4 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4565,7 +4565,6 @@ size_allocate (GtkWidget *widget, static void realize (GtkWidget *widget) { - GdkBitmap *stipple; GtkAdjustment *vadj, *hadj; CajaIconContainer *container; @@ -4581,15 +4580,10 @@ realize (GtkWidget *widget) } /* Set up DnD. */ - caja_icon_dnd_init (container, NULL); + caja_icon_dnd_init (container); setup_label_gcs (container); - stipple = eel_stipple_bitmap_for_screen - (gdk_drawable_get_screen (GDK_DRAWABLE (gtk_widget_get_window (widget)))); - - caja_icon_dnd_set_stipple (container, stipple); - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (widget)); g_signal_connect (hadj, "value_changed", G_CALLBACK (handle_hadjustment_changed), widget); @@ -4603,20 +4597,10 @@ realize (GtkWidget *widget) static void unrealize (GtkWidget *widget) { - int i; CajaIconContainer *container; container = CAJA_ICON_CONTAINER (widget); - for (i = 0; i < LAST_LABEL_COLOR; i++) - { - if (container->details->label_gcs [i]) - { - g_object_unref (container->details->label_gcs [i]); - container->details->label_gcs [i] = NULL; - } - } - caja_icon_dnd_fini (container); if (container->details->typeselect_flush_timeout) @@ -9331,8 +9315,8 @@ caja_icon_container_set_single_click_mode (CajaIconContainer *container, /* update the label color when the background changes */ -GdkGC * -caja_icon_container_get_label_color_and_gc (CajaIconContainer *container, +void +caja_icon_container_get_label_color (CajaIconContainer *container, GdkColor **color, gboolean is_name, gboolean is_highlight, @@ -9388,28 +9372,12 @@ caja_icon_container_get_label_color_and_gc (CajaIconContainer *container, { *color = &container->details->label_colors [idx]; } - - return container->details->label_gcs [idx]; } static void setup_gc_with_fg (CajaIconContainer *container, int idx, guint32 color) { - GdkGC *gc; - GdkColor gcolor; - - gcolor = eel_gdk_rgb_to_color (color); - container->details->label_colors [idx] = gcolor; - - gc = gdk_gc_new (gtk_layout_get_bin_window (GTK_LAYOUT (container))); - gdk_gc_set_rgb_fg_color (gc, &gcolor); - - if (container->details->label_gcs [idx]) - { - g_object_unref (container->details->label_gcs [idx]); - } - - container->details->label_gcs [idx] = gc; + container->details->label_colors [idx] = eel_gdk_rgb_to_color (color); } static void -- cgit v1.2.1 From c28f508865f21658ad4319a561f999c87cf94703 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:00:30 +0200 Subject: [lc-p] port caja-icon-dnd to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=34a376c97717cb05187b3d880e991c2d23511109 --- libcaja-private/caja-icon-dnd.c | 46 +++++++---------------------------------- libcaja-private/caja-icon-dnd.h | 8 +------ 2 files changed, 9 insertions(+), 45 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 12cc5cbf..204f9e80 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -98,7 +98,6 @@ create_selection_shadow (CajaIconContainer *container, { EelCanvasGroup *group; EelCanvas *canvas; - GdkBitmap *stipple; int max_x, max_y; int min_x, min_y; GList *p; @@ -115,9 +114,6 @@ create_selection_shadow (CajaIconContainer *container, return NULL; } - stipple = container->details->dnd_info->stipple; - g_return_val_if_fail (stipple != NULL, NULL); - canvas = EEL_CANVAS (container); gtk_widget_get_allocation (GTK_WIDGET (container), &allocation); @@ -164,7 +160,6 @@ create_selection_shadow (CajaIconContainer *container, "x2", (double) x2, "y2", (double) y2, "outline_color", "black", - "outline_stipple", stipple, "width_pixels", 1, NULL); } @@ -1664,6 +1659,7 @@ drag_highlight_expose (GtkWidget *widget, { gint x, y, width, height; GdkWindow *window; + cairo_t *cr; x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); @@ -1682,10 +1678,12 @@ drag_highlight_expose (GtkWidget *widget, NULL, widget, "dnd", x, y, width, height); - gdk_draw_rectangle (window, - (gtk_widget_get_style(widget))->black_gc, - FALSE, - x, y, width - 1, height - 1); + cr = gdk_cairo_create (window); + cairo_set_line_width (cr, 1.0); + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1); + cairo_stroke (cr); + cairo_destroy (cr); return FALSE; } @@ -2029,25 +2027,7 @@ drag_data_received_callback (GtkWidget *widget, } void -caja_icon_dnd_set_stipple (CajaIconContainer *container, - GdkBitmap *stipple) -{ - if (stipple != NULL) - { - g_object_ref (stipple); - } - - if (container->details->dnd_info->stipple != NULL) - { - g_object_unref (container->details->dnd_info->stipple); - } - - container->details->dnd_info->stipple = stipple; -} - -void -caja_icon_dnd_init (CajaIconContainer *container, - GdkBitmap *stipple) +caja_icon_dnd_init (CajaIconContainer *container) { GtkTargetList *targets; int n_elements; @@ -2096,11 +2076,6 @@ caja_icon_dnd_init (CajaIconContainer *container, G_CALLBACK (drag_drop_callback), NULL); g_signal_connect (container, "drag_leave", G_CALLBACK (drag_leave_callback), NULL); - - if (stipple != NULL) - { - container->details->dnd_info->stipple = g_object_ref (stipple); - } } void @@ -2112,11 +2087,6 @@ caja_icon_dnd_fini (CajaIconContainer *container) { stop_auto_scroll (container); - if (container->details->dnd_info->stipple != NULL) - { - g_object_unref (container->details->dnd_info->stipple); - } - caja_drag_finalize (&container->details->dnd_info->drag_info); container->details->dnd_info = NULL; } diff --git a/libcaja-private/caja-icon-dnd.h b/libcaja-private/caja-icon-dnd.h index 1070c41f..6cf14aa0 100644 --- a/libcaja-private/caja-icon-dnd.h +++ b/libcaja-private/caja-icon-dnd.h @@ -39,19 +39,13 @@ typedef struct gboolean highlighted; - /* Stipple for drawing icon shadows during DnD. */ - GdkBitmap *stipple; - /* Shadow for the icons being dragged. */ EelCanvasItem *shadow; } CajaIconDndInfo; -void caja_icon_dnd_init (CajaIconContainer *container, - GdkBitmap *stipple); +void caja_icon_dnd_init (CajaIconContainer *container); void caja_icon_dnd_fini (CajaIconContainer *container); -void caja_icon_dnd_set_stipple (CajaIconContainer *container, - GdkBitmap *stipple); void caja_icon_dnd_begin_drag (CajaIconContainer *container, GdkDragAction actions, gint button, -- cgit v1.2.1 From 3b6a715fca493281fdb2d0c83d69ce28a21732dc Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:02:37 +0200 Subject: [lc-p] port caja-icon-private to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=cbdf5829637093c0a5c0a4ff4d303ad184847627 --- libcaja-private/caja-icon-private.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-private.h b/libcaja-private/caja-icon-private.h index 8258ca15..cf7ef592 100644 --- a/libcaja-private/caja-icon-private.h +++ b/libcaja-private/caja-icon-private.h @@ -219,7 +219,6 @@ struct CajaIconContainerDetails guint32 normal_icon_color_rgba; /* colors for text labels */ - GdkGC *label_gcs [LAST_LABEL_COLOR]; GdkColor label_colors [LAST_LABEL_COLOR]; /* State used so arrow keys don't wander if icons aren't lined up. @@ -327,10 +326,10 @@ gboolean caja_icon_container_scroll (CajaIconContainer void caja_icon_container_update_scroll_region (CajaIconContainer *container); /* label color for items */ -GdkGC *caja_icon_container_get_label_color_and_gc (CajaIconContainer *container, +void caja_icon_container_get_label_color (CajaIconContainer *container, GdkColor **color, gboolean first_line, gboolean needs_highlight, - gboolean is_prelit); + gboolean is_prelit); #endif /* CAJA_ICON_CONTAINER_PRIVATE_H */ -- cgit v1.2.1 From b8b05eb092ded402d9b0d1b0a80e0627ddbc657a Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:15:34 +0200 Subject: [lc-p] make drawing of resize knobs work again http://git.gnome.org/browse/nautilus/commit/?id=29d7b86087f6ab86f6abd6c3c08c4e1d94b92b36 --- libcaja-private/caja-icon-canvas-item.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index cfb16105..64ba3020 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -1633,16 +1633,15 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, rect->y1 - rect->y0 - 1); cairo_stroke (cr); - /* draw the stretch handles themselves */ + cairo_destroy (cr); - gdk_cairo_set_source_pixbuf (cr, knob_pixbuf, rect->x0, rect->y0); - cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT); - cairo_rectangle (cr, - rect->x1 - knob_width, rect->y1 - knob_height, - 2 * knob_width, 2 * knob_height); - cairo_fill (cr); + /* draw the stretch handles themselves */ + draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y0); + draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y1 - knob_height); + draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y0); + draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y1 - knob_height); - cairo_destroy (cr); + g_object_unref (knob_pixbuf); } static void -- cgit v1.2.1 From d602f60fa4df0d2913e2d6b45f32c4bb1020583a Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:18:56 +0200 Subject: [lc-p] properly dash the icon when resizing it http://git.gnome.org/browse/nautilus/commit/?id=b10d8c00395026719dc0840e9d82e682c7c4e436 --- libcaja-private/caja-icon-canvas-item.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index 64ba3020..e35efec2 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -1599,7 +1599,7 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, GtkWidget *widget; GdkPixbuf *knob_pixbuf; int knob_width, knob_height; - double dash[2] = { 1.0, 1.0 }; + double dash = { 2.0 }; cairo_t *cr; if (!item->details->show_stretch_handles) @@ -1615,17 +1615,9 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, knob_height = gdk_pixbuf_get_height (knob_pixbuf); /* first draw the box */ - cairo_set_source_rgb (cr, 1, 1, 1); - cairo_set_line_width (cr, 1.0); - cairo_rectangle (cr, - rect->x0 + 0.5, - rect->y0 + 0.5, - rect->x1 - rect->x0 - 1, - rect->y1 - rect->y0 - 1); - cairo_stroke (cr); - cairo_set_source_rgb (cr, 0, 0, 0); - cairo_set_dash (cr, dash, G_N_ELEMENTS (dash), 0); + cairo_set_dash (cr, &dash, 1, 0); + cairo_set_line_width (cr, 1.0); cairo_rectangle (cr, rect->x0 + 0.5, rect->y0 + 0.5, -- cgit v1.2.1 From dc5d53f773d3a7fa9a0c5ce4e99185cc97789960 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:25:58 +0200 Subject: [lc-p] use the 'outline-stippling' property on DnD http://git.gnome.org/browse/nautilus/commit/?id=aa43821e73d60804a3f0f2ebafb66aab53b440e1 --- libcaja-private/caja-icon-dnd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 204f9e80..2e7dc32a 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -160,6 +160,7 @@ create_selection_shadow (CajaIconContainer *container, "x2", (double) x2, "y2", (double) y2, "outline_color", "black", + "outline-stippling", TRUE, "width_pixels", 1, NULL); } -- cgit v1.2.1 From 4c9e9bc2b097323bd7b0717f055d5ee034260d22 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 16:31:50 +0200 Subject: [lc-p|eel-gtk-extensions] Don't include eel-pango-extensions.h http://git.gnome.org/browse/nautilus/commit/?id=f080b86daeb571def4c092e1524e9adfc7700699 --- libcaja-private/caja-customization-data.c | 1 - libcaja-private/caja-file-operations.c | 1 - libcaja-private/caja-icon-canvas-item.c | 1 - 3 files changed, 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-customization-data.c b/libcaja-private/caja-customization-data.c index f29eee40..aeeab942 100644 --- a/libcaja-private/caja-customization-data.c +++ b/libcaja-private/caja-customization-data.c @@ -31,7 +31,6 @@ #include "caja-file-utilities.h" #include #include -#include #include #include #include diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index f89e00cc..55140e6b 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -46,7 +46,6 @@ #include #include -#include #include #include #include diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index e35efec2..d6bba70b 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.1 From 4799c0deb39be1abc4fadc693e73cd44aa7c4d36 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 21:19:09 +0200 Subject: [ln-p] remove NautilusCellRendererPixbufEmblem it's useless now http://git.gnome.org/browse/nautilus/commit/?id=25b48e9d1f4c847e2fc95b9b9893e63ba7081658 --- libcaja-private/Makefile.am | 2 - libcaja-private/caja-cell-renderer-pixbuf-emblem.c | 502 --------------------- libcaja-private/caja-cell-renderer-pixbuf-emblem.h | 68 --- 3 files changed, 572 deletions(-) delete mode 100644 libcaja-private/caja-cell-renderer-pixbuf-emblem.c delete mode 100644 libcaja-private/caja-cell-renderer-pixbuf-emblem.h (limited to 'libcaja-private') diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index 6d1c343d..9d53c844 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -46,8 +46,6 @@ libcaja_private_la_SOURCES = \ caja-autorun.h \ caja-bookmark.c \ caja-bookmark.h \ - caja-cell-renderer-pixbuf-emblem.c \ - caja-cell-renderer-pixbuf-emblem.h \ caja-cell-renderer-text-ellipsized.c \ caja-cell-renderer-text-ellipsized.h \ caja-clipboard-monitor.c \ diff --git a/libcaja-private/caja-cell-renderer-pixbuf-emblem.c b/libcaja-private/caja-cell-renderer-pixbuf-emblem.c deleted file mode 100644 index 63cbf3db..00000000 --- a/libcaja-private/caja-cell-renderer-pixbuf-emblem.c +++ /dev/null @@ -1,502 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- - - caja-cell-renderer-pixbuf-emblem.c: cell renderer which can render - an emblem on top of a pixbuf (for use in FMListView and FMTreeView) - - Copyright (C) 2003 Juerg Billeter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. - - This is based on GtkCellRendererPixbuf written by - Jonathan Blandford - - Author: Juerg Billeter -*/ - -#include "caja-cell-renderer-pixbuf-emblem.h" - -static void caja_cell_renderer_pixbuf_emblem_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec); -static void caja_cell_renderer_pixbuf_emblem_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec); -static void caja_cell_renderer_pixbuf_emblem_init (CajaCellRendererPixbufEmblem *cellpixbuf); -static void caja_cell_renderer_pixbuf_emblem_class_init (CajaCellRendererPixbufEmblemClass *klass); -static void caja_cell_renderer_pixbuf_emblem_finalize (GObject *object); -static void caja_cell_renderer_pixbuf_emblem_create_stock_pixbuf (CajaCellRendererPixbufEmblem *cellpixbuf, - GtkWidget *widget); -static void caja_cell_renderer_pixbuf_emblem_get_size (GtkCellRenderer *cell, - GtkWidget *widget, - GdkRectangle *rectangle, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height); -static void caja_cell_renderer_pixbuf_emblem_render (GtkCellRenderer *cell, - GdkWindow *window, - GtkWidget *widget, - GdkRectangle *background_area, - GdkRectangle *cell_area, - GdkRectangle *expose_area, - GtkCellRendererState flags); - -enum -{ - PROP_ZERO, - PROP_PIXBUF, - PROP_PIXBUF_EXPANDER_OPEN, - PROP_PIXBUF_EXPANDER_CLOSED, - PROP_STOCK_ID, - PROP_STOCK_SIZE, - PROP_STOCK_DETAIL, - PROP_PIXBUF_EMBLEM -}; - -#define CELLINFO_KEY "caja-cell-renderer-pixbuf-emblem-info" - -typedef struct _CajaCellRendererPixbufEmblemInfo CajaCellRendererPixbufEmblemInfo; -struct _CajaCellRendererPixbufEmblemInfo -{ - gchar *stock_id; - GtkIconSize stock_size; - gchar *stock_detail; -}; - -G_DEFINE_TYPE (CajaCellRendererPixbufEmblem, caja_cell_renderer_pixbuf_emblem, GTK_TYPE_CELL_RENDERER); - -static void -caja_cell_renderer_pixbuf_emblem_init (CajaCellRendererPixbufEmblem *cellpixbuf) -{ - CajaCellRendererPixbufEmblemInfo *cellinfo; - - cellinfo = g_new0 (CajaCellRendererPixbufEmblemInfo, 1); - cellinfo->stock_size = GTK_ICON_SIZE_MENU; - g_object_set_data (G_OBJECT (cellpixbuf), CELLINFO_KEY, cellinfo); -} - -static void -caja_cell_renderer_pixbuf_emblem_class_init (CajaCellRendererPixbufEmblemClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass); - - object_class->finalize = caja_cell_renderer_pixbuf_emblem_finalize; - - object_class->get_property = caja_cell_renderer_pixbuf_emblem_get_property; - object_class->set_property = caja_cell_renderer_pixbuf_emblem_set_property; - - cell_class->get_size = caja_cell_renderer_pixbuf_emblem_get_size; - cell_class->render = caja_cell_renderer_pixbuf_emblem_render; - - g_object_class_install_property (object_class, - PROP_PIXBUF, - g_param_spec_object ("pixbuf", - "Pixbuf Object", - "The pixbuf to render", - GDK_TYPE_PIXBUF, - G_PARAM_READABLE | - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, - PROP_PIXBUF_EXPANDER_OPEN, - g_param_spec_object ("pixbuf_expander_open", - "Pixbuf Expander Open", - "Pixbuf for open expander", - GDK_TYPE_PIXBUF, - G_PARAM_READABLE | - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, - PROP_PIXBUF_EXPANDER_CLOSED, - g_param_spec_object ("pixbuf_expander_closed", - "Pixbuf Expander Closed", - "Pixbuf for closed expander", - GDK_TYPE_PIXBUF, - G_PARAM_READABLE | - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, - PROP_STOCK_ID, - g_param_spec_string ("stock_id", - "Stock ID", - "The stock ID of the stock icon to render", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, - PROP_STOCK_SIZE, - g_param_spec_enum ("stock_size", - "Size", - "The size of the rendered icon", - GTK_TYPE_ICON_SIZE, - GTK_ICON_SIZE_MENU, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, - PROP_STOCK_DETAIL, - g_param_spec_string ("stock_detail", - "Detail", - "Render detail to pass to the theme engine", - NULL, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, - PROP_PIXBUF_EMBLEM, - g_param_spec_object ("pixbuf_emblem", - "Pixbuf Emblem Object", - "The emblem to overlay", - GDK_TYPE_PIXBUF, - G_PARAM_READABLE | - G_PARAM_WRITABLE)); -} - -static void -caja_cell_renderer_pixbuf_emblem_finalize (GObject *object) -{ - CajaCellRendererPixbufEmblem *cellpixbuf = CAJA_CELL_RENDERER_PIXBUF_EMBLEM (object); - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (object, CELLINFO_KEY); - - if (cellpixbuf->pixbuf && cellinfo->stock_id) - { - g_object_unref (cellpixbuf->pixbuf); - } - - if (cellinfo->stock_id) - { - g_free (cellinfo->stock_id); - } - - if (cellinfo->stock_detail) - { - g_free (cellinfo->stock_detail); - } - - g_free (cellinfo); - g_object_set_data (object, CELLINFO_KEY, NULL); - - (* G_OBJECT_CLASS (caja_cell_renderer_pixbuf_emblem_parent_class)->finalize) (object); -} - -static void -caja_cell_renderer_pixbuf_emblem_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - CajaCellRendererPixbufEmblem *cellpixbuf = CAJA_CELL_RENDERER_PIXBUF_EMBLEM (object); - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (object, CELLINFO_KEY); - - switch (param_id) - { - case PROP_PIXBUF: - g_value_set_object (value, - cellpixbuf->pixbuf ? G_OBJECT (cellpixbuf->pixbuf) : NULL); - break; - case PROP_PIXBUF_EXPANDER_OPEN: - g_value_set_object (value, - cellpixbuf->pixbuf_expander_open ? G_OBJECT (cellpixbuf->pixbuf_expander_open) : NULL); - break; - case PROP_PIXBUF_EXPANDER_CLOSED: - g_value_set_object (value, - cellpixbuf->pixbuf_expander_closed ? G_OBJECT (cellpixbuf->pixbuf_expander_closed) : NULL); - break; - case PROP_STOCK_ID: - g_value_set_string (value, cellinfo->stock_id); - break; - case PROP_STOCK_SIZE: - g_value_set_enum (value, cellinfo->stock_size); - break; - case PROP_STOCK_DETAIL: - g_value_set_string (value, cellinfo->stock_detail); - break; - case PROP_PIXBUF_EMBLEM: - g_value_set_object (value, - cellpixbuf->pixbuf_emblem ? G_OBJECT (cellpixbuf->pixbuf_emblem) : NULL); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -static void -caja_cell_renderer_pixbuf_emblem_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - GdkPixbuf *pixbuf; - CajaCellRendererPixbufEmblem *cellpixbuf = CAJA_CELL_RENDERER_PIXBUF_EMBLEM (object); - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (object, CELLINFO_KEY); - - switch (param_id) - { - case PROP_PIXBUF: - pixbuf = (GdkPixbuf*) g_value_get_object (value); - if (pixbuf) - { - g_object_ref (pixbuf); - } - if (cellpixbuf->pixbuf) - { - g_object_unref (cellpixbuf->pixbuf); - } - cellpixbuf->pixbuf = pixbuf; - break; - case PROP_PIXBUF_EXPANDER_OPEN: - pixbuf = (GdkPixbuf*) g_value_get_object (value); - if (pixbuf) - { - g_object_ref (pixbuf); - } - if (cellpixbuf->pixbuf_expander_open) - { - g_object_unref (cellpixbuf->pixbuf_expander_open); - } - cellpixbuf->pixbuf_expander_open = pixbuf; - break; - case PROP_PIXBUF_EXPANDER_CLOSED: - pixbuf = (GdkPixbuf*) g_value_get_object (value); - if (pixbuf) - { - g_object_ref (pixbuf); - } - if (cellpixbuf->pixbuf_expander_closed) - { - g_object_unref (cellpixbuf->pixbuf_expander_closed); - } - cellpixbuf->pixbuf_expander_closed = pixbuf; - break; - case PROP_STOCK_ID: - if (cellinfo->stock_id) - { - g_free (cellinfo->stock_id); - } - cellinfo->stock_id = g_strdup (g_value_get_string (value)); - break; - case PROP_STOCK_SIZE: - cellinfo->stock_size = g_value_get_enum (value); - break; - case PROP_STOCK_DETAIL: - if (cellinfo->stock_detail) - { - g_free (cellinfo->stock_detail); - } - cellinfo->stock_detail = g_strdup (g_value_get_string (value)); - break; - case PROP_PIXBUF_EMBLEM: - pixbuf = (GdkPixbuf *) g_value_get_object (value); - if (pixbuf) - { - g_object_ref (pixbuf); - } - if (cellpixbuf->pixbuf_emblem) - { - g_object_unref (cellpixbuf->pixbuf_emblem); - } - cellpixbuf->pixbuf_emblem = pixbuf; - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -GtkCellRenderer * -caja_cell_renderer_pixbuf_emblem_new (void) -{ - return g_object_new (CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM, NULL); -} - -static void -caja_cell_renderer_pixbuf_emblem_create_stock_pixbuf (CajaCellRendererPixbufEmblem *cellpixbuf, - GtkWidget *widget) -{ - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (G_OBJECT (cellpixbuf), CELLINFO_KEY); - - if (cellpixbuf->pixbuf) - { - g_object_unref (cellpixbuf->pixbuf); - } - - cellpixbuf->pixbuf = gtk_widget_render_icon (widget, - cellinfo->stock_id, - cellinfo->stock_size, - cellinfo->stock_detail); -} - -static void -caja_cell_renderer_pixbuf_emblem_get_size (GtkCellRenderer *cell, - GtkWidget *widget, - GdkRectangle *cell_area, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height) -{ - CajaCellRendererPixbufEmblem *cellpixbuf = (CajaCellRendererPixbufEmblem *) cell; - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (G_OBJECT (cell), CELLINFO_KEY); - gint pixbuf_width = 0; - gint pixbuf_height = 0; - gint calc_width; - gint calc_height; - gint xpad, ypad; - - if (!cellpixbuf->pixbuf && cellinfo->stock_id) - caja_cell_renderer_pixbuf_emblem_create_stock_pixbuf (cellpixbuf, widget); - - if (cellpixbuf->pixbuf) - { - pixbuf_width = gdk_pixbuf_get_width (cellpixbuf->pixbuf); - pixbuf_height = gdk_pixbuf_get_height (cellpixbuf->pixbuf); - } - if (cellpixbuf->pixbuf_expander_open) - { - pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_open)); - pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_open)); - } - if (cellpixbuf->pixbuf_expander_closed) - { - pixbuf_width = MAX (pixbuf_width, gdk_pixbuf_get_width (cellpixbuf->pixbuf_expander_closed)); - pixbuf_height = MAX (pixbuf_height, gdk_pixbuf_get_height (cellpixbuf->pixbuf_expander_closed)); - } - - gtk_cell_renderer_get_padding (cell, &xpad, &ypad); - calc_width = xpad * 2 + pixbuf_width; - calc_height = ypad * 2 + pixbuf_height; - - if (x_offset) *x_offset = 0; - if (y_offset) *y_offset = 0; - - if (cell_area && pixbuf_width > 0 && pixbuf_height > 0) - { - gfloat xalign, yalign; - - gtk_cell_renderer_get_alignment (cell, &xalign, &yalign); - if (x_offset) - { - *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? - 1.0 - xalign : xalign) * - (cell_area->width - calc_width - 2 * xpad)); - *x_offset = MAX (*x_offset, 0) + xpad; - } - if (y_offset) - { - *y_offset = (yalign * - (cell_area->height - calc_height - 2 * ypad)); - *y_offset = MAX (*y_offset, 0) + ypad; - } - } - - if (width) - *width = calc_width; - - if (height) - *height = calc_height; -} - -static void -caja_cell_renderer_pixbuf_emblem_render (GtkCellRenderer *cell, - GdkWindow *window, - GtkWidget *widget, - GdkRectangle *background_area, - GdkRectangle *cell_area, - GdkRectangle *expose_area, - GtkCellRendererState flags) - -{ - CajaCellRendererPixbufEmblem *cellpixbuf = (CajaCellRendererPixbufEmblem *) cell; - CajaCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (G_OBJECT (cell), CELLINFO_KEY); - GdkPixbuf *pixbuf; - GdkRectangle pix_rect; - GdkRectangle pix_emblem_rect; - gboolean stock_pixbuf = FALSE; - gint xpad, ypad; - gboolean is_expander, is_expanded; - cairo_t *cr; - - pixbuf = cellpixbuf->pixbuf; - g_object_get (cell, - "is-expander", &is_expander, - "is-expanded", &is_expanded, - NULL); - if (is_expander) - { - if (is_expanded && - cellpixbuf->pixbuf_expander_open != NULL) - { - pixbuf = cellpixbuf->pixbuf_expander_open; - } - else if (!is_expanded && - cellpixbuf->pixbuf_expander_closed != NULL) - { - pixbuf = cellpixbuf->pixbuf_expander_closed; - } - } - - if (!pixbuf && !cellinfo->stock_id) - { - return; - } - else if (!pixbuf && cellinfo->stock_id) - { - stock_pixbuf = TRUE; - } - - caja_cell_renderer_pixbuf_emblem_get_size (cell, widget, cell_area, - &pix_rect.x, - &pix_rect.y, - &pix_rect.width, - &pix_rect.height); - - if (stock_pixbuf) - pixbuf = cellpixbuf->pixbuf; - - gtk_cell_renderer_get_padding (cell, &xpad, &ypad); - pix_rect.x += cell_area->x; - pix_rect.y += cell_area->y; - pix_rect.width -= xpad * 2; - pix_rect.height -= ypad * 2; - - cr = gdk_cairo_create (window); - gdk_cairo_rectangle (cr, expose_area); - cairo_clip (cr); - gdk_cairo_rectangle (cr, cell_area); - cairo_clip (cr); - - gdk_cairo_set_source_pixbuf (cr, pixbuf, pix_rect.x, pix_rect.y); - gdk_cairo_rectangle (cr, &pix_rect); - cairo_fill (cr); - - if (cellpixbuf->pixbuf_emblem) - { - pix_emblem_rect.width = gdk_pixbuf_get_width (cellpixbuf->pixbuf_emblem); - pix_emblem_rect.height = gdk_pixbuf_get_height (cellpixbuf->pixbuf_emblem); - pix_emblem_rect.x = pix_rect.x; - pix_emblem_rect.y = pix_rect.y + pix_rect.height - pix_emblem_rect.height; - gdk_cairo_set_source_pixbuf (cr, cellpixbuf->pixbuf_emblem, - pix_emblem_rect.x, pix_emblem_rect.y); - gdk_cairo_rectangle (cr, &pix_emblem_rect); - cairo_fill (cr); - } - - cairo_destory (cr); -} diff --git a/libcaja-private/caja-cell-renderer-pixbuf-emblem.h b/libcaja-private/caja-cell-renderer-pixbuf-emblem.h deleted file mode 100644 index cfdf93d4..00000000 --- a/libcaja-private/caja-cell-renderer-pixbuf-emblem.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- - - caja-cell-renderer-pixbuf-emblem.h: cell renderer which can render - an emblem on top of a pixbuf (for use in FMListView and FMTreeView) - - Copyright (C) 2003 Juerg Billeter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. - - This is based on GtkCellRendererPixbuf written by - Jonathan Blandford - - Author: Juerg Billeter -*/ - -#ifndef CAJA_CELL_RENDERER_PIXBUF_EMBLEM_H -#define CAJA_CELL_RENDERER_PIXBUF_EMBLEM_H - -#include - -#define CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM caja_cell_renderer_pixbuf_emblem_get_type() -#define CAJA_CELL_RENDERER_PIXBUF_EMBLEM(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM, CajaCellRendererPixbufEmblem)) -#define CAJA_CELL_RENDERER_PIXBUF_EMBLEM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM, CajaCellRendererPixbufEmblemClass)) -#define CAJA_IS_CELL_RENDERER_PIXBUF_EMBLEM(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM)) -#define CAJA_IS_CELL_RENDERER_PIXBUF_EMBLEM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM)) -#define CAJA_CELL_RENDERER_PIXBUF_EMBLEM_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_CELL_RENDERER_PIXBUF_EMBLEM, CajaCellRendererPixbufEmblemClass)) - -typedef struct _CajaCellRendererPixbufEmblem CajaCellRendererPixbufEmblem; -typedef struct _CajaCellRendererPixbufEmblemClass CajaCellRendererPixbufEmblemClass; - -struct _CajaCellRendererPixbufEmblem -{ - GtkCellRenderer parent; - - /*< private >*/ - GdkPixbuf *pixbuf; - GdkPixbuf *pixbuf_expander_open; - GdkPixbuf *pixbuf_expander_closed; - GdkPixbuf *pixbuf_emblem; -}; - -struct _CajaCellRendererPixbufEmblemClass -{ - GtkCellRendererClass parent_class; -}; - -GType caja_cell_renderer_pixbuf_emblem_get_type (void); -GtkCellRenderer *caja_cell_renderer_pixbuf_emblem_new (void); - -#endif /* CAJA_CELL_RENDERER_PIXBUF_EMBLEM_H */ -- cgit v1.2.1 From 1a056cc77b431b2a013c052c78c0309ee52bc32b Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 21:31:20 +0200 Subject: [icon-info] add caja_icon_theme_can_render() http://git.gnome.org/browse/nautilus/commit/?id=110a0e8f2b9ec96b34e4b76390e3f78adc9cda30 --- libcaja-private/caja-icon-info.c | 21 +++++++++++++++++++++ libcaja-private/caja-icon-info.h | 2 ++ 2 files changed, 23 insertions(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-info.c b/libcaja-private/caja-icon-info.c index e504a557..7873ebfa 100644 --- a/libcaja-private/caja-icon-info.c +++ b/libcaja-private/caja-icon-info.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* caja-icon-info.c * Copyright (C) 2007 Red Hat, Inc., Alexander Larsson * @@ -757,3 +758,23 @@ caja_icon_get_emblem_size_for_icon_size (guint size) return 0; /* no emblems for smaller sizes */ } + +gboolean +caja_icon_theme_can_render (GThemedIcon *icon) +{ + GtkIconTheme *icon_theme; + const gchar * const *names; + gint idx; + + names = g_themed_icon_get_names (icon); + + icon_theme = gtk_icon_theme_get_default (); + + for (idx = 0; names[idx] != NULL; idx++) { + if (gtk_icon_theme_has_icon (icon_theme, names[idx])) { + return TRUE; + } + } + + return FALSE; +} diff --git a/libcaja-private/caja-icon-info.h b/libcaja-private/caja-icon-info.h index 7c2a75d2..d2bbc926 100644 --- a/libcaja-private/caja-icon-info.h +++ b/libcaja-private/caja-icon-info.h @@ -90,6 +90,8 @@ extern "C" { gint caja_get_icon_size_for_stock_size (GtkIconSize size); guint caja_icon_get_emblem_size_for_icon_size (guint size); +gboolean caja_icon_theme_can_render (GThemedIcon *icon); + #ifdef __cplusplus } -- cgit v1.2.1 From 09766159b53c812ddf55485511cdca457d89d80d Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 21:50:34 +0200 Subject: [lc-p] remove unused caja-iso9660.h http://git.gnome.org/browse/nautilus/commit/?id=52a37d6e46fc34cef6061bc91aa02847652f3c9d --- libcaja-private/Makefile.am | 1 - libcaja-private/caja-iso9660.h | 110 ----------------------------------------- 2 files changed, 111 deletions(-) delete mode 100644 libcaja-private/caja-iso9660.h (limited to 'libcaja-private') diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index 9d53c844..5db9c6e1 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -119,7 +119,6 @@ libcaja_private_la_SOURCES = \ caja-icon-names.h \ caja-idle-queue.c \ caja-idle-queue.h \ - caja-iso9660.h \ caja-keep-last-vertical-box.c \ caja-keep-last-vertical-box.h \ caja-lib-self-check-functions.c \ diff --git a/libcaja-private/caja-iso9660.h b/libcaja-private/caja-iso9660.h deleted file mode 100644 index d8352cc2..00000000 --- a/libcaja-private/caja-iso9660.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Header file iso9660.h - assorted structure definitions and typecasts. - * specific to iso9660 filesystem. - - Written by Eric Youngdale (1993). - - Copyright 1993 Yggdrasil Computing, Incorporated - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _ISOFS_FS_H -#define _ISOFS_FS_H - -/* - * The isofs filesystem constants/structures - */ - -#define ISODCL(from, to) (to - from + 1) - -struct iso_volume_descriptor -{ - char type[ISODCL(1,1)]; /* 711 */ - char id[ISODCL(2,6)]; - char version[ISODCL(7,7)]; - char data[ISODCL(8,2048)]; -}; - -/* volume descriptor types */ -#define ISO_VD_PRIMARY 1 -#define ISO_VD_END 255 - -#define ISO_STANDARD_ID "CD001" - -struct iso_primary_descriptor -{ - char type [ISODCL ( 1, 1)]; /* 711 */ - char id [ISODCL ( 2, 6)]; - char version [ISODCL ( 7, 7)]; /* 711 */ - char unused1 [ISODCL ( 8, 8)]; - char system_id [ISODCL ( 9, 40)]; /* achars */ - char volume_id [ISODCL ( 41, 72)]; /* dchars */ - char unused2 [ISODCL ( 73, 80)]; - char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ - char unused3 [ISODCL ( 89, 120)]; - char volume_set_size [ISODCL (121, 124)]; /* 723 */ - char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ - char logical_block_size [ISODCL (129, 132)]; /* 723 */ - char path_table_size [ISODCL (133, 140)]; /* 733 */ - char type_l_path_table [ISODCL (141, 144)]; /* 731 */ - char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ - char type_m_path_table [ISODCL (149, 152)]; /* 732 */ - char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ - char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ - char volume_set_id [ISODCL (191, 318)]; /* dchars */ - char publisher_id [ISODCL (319, 446)]; /* achars */ - char preparer_id [ISODCL (447, 574)]; /* achars */ - char application_id [ISODCL (575, 702)]; /* achars */ - char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ - char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ - char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ - char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ - char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ - char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ - char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ - char file_structure_version [ISODCL (882, 882)]; /* 711 */ - char unused4 [ISODCL (883, 883)]; - char application_data [ISODCL (884, 1395)]; - char unused5 [ISODCL (1396, 2048)]; -}; - -/* We use this to help us look up the parent inode numbers. */ - -struct iso_path_table -{ - unsigned char name_len[2]; /* 721 */ - char extent[4]; /* 731 */ - char parent[2]; /* 721 */ - char name[1]; -}; - -struct iso_directory_record -{ - unsigned char length [ISODCL (1, 1)]; /* 711 */ - char ext_attr_length [ISODCL (2, 2)]; /* 711 */ - char extent [ISODCL (3, 10)]; /* 733 */ - char size [ISODCL (11, 18)]; /* 733 */ - char date [ISODCL (19, 25)]; /* 7 by 711 */ - char flags [ISODCL (26, 26)]; - char file_unit_size [ISODCL (27, 27)]; /* 711 */ - char interleave [ISODCL (28, 28)]; /* 711 */ - char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ - unsigned char name_len [ISODCL (33, 33)]; /* 711 */ - char name [34]; /* Not really, but we need something here */ -}; -#endif - - - -- cgit v1.2.1 From ce96467ba24b0dc13262fb5cb7ae8eb674c2099e Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 08:54:18 +0200 Subject: [lc-p] autogenerate marshallers http://git.gnome.org/browse/nautilus/commit/?id=6509c91b48f52c72c868f2ca7a9b47c46b9e0bc6 --- libcaja-private/Makefile.am | 40 +++++++++++++++++++++++------------ libcaja-private/caja-icon-container.c | 14 ++++++------ libcaja-private/caja-marshal.c | 2 -- libcaja-private/caja-marshal.list | 23 -------------------- 4 files changed, 34 insertions(+), 45 deletions(-) delete mode 100644 libcaja-private/caja-marshal.c delete mode 100644 libcaja-private/caja-marshal.list (limited to 'libcaja-private') diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index 5db9c6e1..cbf91983 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -18,6 +18,11 @@ INCLUDES = \ $(UNIQUE_CFLAGS) \ $(NULL) +BUILT_SOURCES = \ + caja-marshal.c \ + caja-marshal.h \ + $(NULL) + dependency_static_libs = \ $(top_builddir)/cut-n-paste-code/libegg/libegg.la \ $(NULL) @@ -36,11 +41,6 @@ libcaja_private_la_LIBADD = \ $(CORE_LIBS) \ $(NULL) -marshal_sources = \ - caja-marshal.h \ - caja-marshal-guts.c \ - $(NULL) - libcaja_private_la_SOURCES = \ caja-autorun.c \ caja-autorun.h \ @@ -125,8 +125,6 @@ libcaja_private_la_SOURCES = \ caja-lib-self-check-functions.h \ caja-link.c \ caja-link.h \ - caja-marshal.c \ - caja-marshal.h \ caja-merged-directory.c \ caja-merged-directory.h \ caja-metadata.h \ @@ -195,14 +193,29 @@ libcaja_private_la_SOURCES = \ caja-undostack-manager.h \ $(NULL) +nodist_libcaja_private_la_SOURCES =\ + $(BUILT_SOURCES) \ + $(NULL) + $(lib_LTLIBRARIES): $(dependency_static_libs) -caja-marshal.h: caja-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN)$(GLIB_GENMARSHAL) $< --header --prefix=caja_marshal > $@ -caja-marshal-guts.c: caja-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN)$(GLIB_GENMARSHAL) $< --body --prefix=caja_marshal > $@ +caja-marshal.list: $(libcaja_private_la_SOURCES) Makefile.am + $(AM_V_GEN)( cd $(srcdir) && \ + sed -n -e 's/.*caja_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \ + $(libcaja_private_la_SOURCES) ) \ + | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp + @if cmp -s $@.tmp $@; then \ + rm $@.tmp; \ + else \ + mv $@.tmp $@; \ + fi + +%-marshal.h: %-marshal.list Makefile + $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.h -$(libcaja_private_la_OBJECTS): $(marshal_sources) +%-marshal.c: %-marshal.list Makefile + $(AM_V_GEN)echo "#include \"caja-marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) --body --prefix=$(subst -,_,$*)_marshal $< >> $*-marshal.c gsettingsschema_in_files = org.mate.caja.gschema.xml.in org.mate.media-handling.gschema.xml.in gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml) @@ -220,9 +233,10 @@ EXTRA_DIST = \ $(NULL) CLEANFILES = \ - $(marshal_sources) \ + $(BUILT_SOURCES) \ $(schema_DATA) \ $(gsettings_SCHEMAS) \ + caja-marshal.list \ $(NULL) dist-hook: diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index b9a7dfc4..eb1eaedb 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -6346,7 +6346,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, get_icon_uri), NULL, NULL, - eel_marshal_STRING__POINTER, + caja_marshal_STRING__POINTER, G_TYPE_STRING, 1, G_TYPE_POINTER); signals[GET_ICON_DROP_TARGET_URI] @@ -6356,7 +6356,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, get_icon_drop_target_uri), NULL, NULL, - eel_marshal_STRING__POINTER, + caja_marshal_STRING__POINTER, G_TYPE_STRING, 1, G_TYPE_POINTER); signals[MOVE_COPY_ITEMS] @@ -6439,7 +6439,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, get_container_uri), NULL, NULL, - eel_marshal_STRING__VOID, + caja_marshal_STRING__VOID, G_TYPE_STRING, 0); signals[CAN_ACCEPT_ITEM] = g_signal_new ("can_accept_item", @@ -6448,7 +6448,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, can_accept_item), NULL, NULL, - eel_marshal_INT__POINTER_STRING, + caja_marshal_INT__POINTER_STRING, G_TYPE_INT, 2, G_TYPE_POINTER, G_TYPE_STRING); @@ -6459,7 +6459,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, get_stored_icon_position), NULL, NULL, - eel_marshal_BOOLEAN__POINTER_POINTER, + caja_marshal_BOOLEAN__POINTER_POINTER, G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_POINTER); @@ -6470,7 +6470,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, get_stored_layout_timestamp), NULL, NULL, - eel_marshal_BOOLEAN__POINTER_POINTER, + caja_marshal_BOOLEAN__POINTER_POINTER, G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_POINTER); @@ -6481,7 +6481,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_STRUCT_OFFSET (CajaIconContainerClass, store_layout_timestamp), NULL, NULL, - eel_marshal_BOOLEAN__POINTER_POINTER, + caja_marshal_BOOLEAN__POINTER_POINTER, G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_POINTER); diff --git a/libcaja-private/caja-marshal.c b/libcaja-private/caja-marshal.c deleted file mode 100644 index 59c9ddcc..00000000 --- a/libcaja-private/caja-marshal.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "caja-marshal.h" -#include "caja-marshal-guts.c" diff --git a/libcaja-private/caja-marshal.list b/libcaja-private/caja-marshal.list deleted file mode 100644 index 787dcc52..00000000 --- a/libcaja-private/caja-marshal.list +++ /dev/null @@ -1,23 +0,0 @@ -BOOLEAN:POINTER -BOOLEAN:VOID -INT:POINTER,BOOLEAN -INT:POINTER,INT -INT:POINTER,POINTER -OBJECT:BOXED -POINTER:VOID -STRING:VOID -VOID:DOUBLE -VOID:INT,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN -VOID:INT,STRING -VOID:OBJECT,BOOLEAN -VOID:OBJECT,OBJECT -VOID:POINTER,ENUM -VOID:POINTER,POINTER -VOID:POINTER,POINTER -VOID:POINTER,POINTER,POINTER,ENUM,INT,INT -VOID:POINTER,STRING -VOID:POINTER,STRING,ENUM,INT,INT -VOID:STRING,STRING,ENUM,INT,INT -VOID:STRING,ENUM,INT,INT -VOID:STRING,STRING -VOID:POINTER,INT,STRING,STRING,ENUM,INT,INT -- cgit v1.2.1 From a71f882835029bbcbd2f46f54f18407606a558a3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 10:49:31 +0200 Subject: [all] use GtkMessageDialog instead of EelAlertDialog (going away) This covers 4 commits: file-operations: use GtkMessageDialog http://git.gnome.org/browse/nautilus/commit/?id=51ec5861ca0697e802e8c003053211ac12f2fd54 mime-actions: use GtkMessageDialog http://git.gnome.org/browse/nautilus/commit/?id=7a3dcdd4bf667aac271be74988770e18575a7df2 tree-view: don't include eel-alert-dialog.h http://git.gnome.org/browse/nautilus/commit/?id=930af7f3058eed256a42c0c1558c7307bb93f411 [eel] use GtkMessageDialog for stock dialogs http://git.gnome.org/browse/nautilus/commit/?id=82c5b6c0d82ebd8a705d542fcc9aa58e6e9b0da4 --- libcaja-private/caja-file-operations.c | 23 ++++++++------- libcaja-private/caja-mime-actions.c | 53 +++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 34 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index 55140e6b..24bb4a19 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -44,7 +44,6 @@ #include "caja-progress-info.h" -#include #include #include #include @@ -1065,12 +1064,16 @@ do_run_simple_dialog (gpointer _data) int response_id; /* Create the dialog. */ - dialog = eel_alert_dialog_new (*data->parent_window, - 0, - data->message_type, - GTK_BUTTONS_NONE, - data->primary_text, - data->secondary_text); + dialog = gtk_message_dialog_new (*data->parent_window, + 0, + data->message_type, + GTK_BUTTONS_NONE, + NULL); + + g_object_set (dialog, + "text", data->primary_text, + "secondary-text", data->secondary_text, + NULL); for (response_id = 0; data->button_titles[response_id] != NULL; @@ -1085,8 +1088,8 @@ do_run_simple_dialog (gpointer _data) } if (data->details_text) { - eel_alert_dialog_set_details_label (EEL_ALERT_DIALOG (dialog), - data->details_text); + eel_gtk_message_dialog_set_details_label (GTK_MESSAGE_DIALOG (dialog), + data->details_text); } /* Run it. */ @@ -1098,7 +1101,7 @@ do_run_simple_dialog (gpointer _data) result = gtk_dialog_run (GTK_DIALOG (dialog)); } - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (dialog); data->result = result; diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index 501263f0..a4dc8c97 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -1372,26 +1371,29 @@ show_unhandled_type_error (ActivateParametersInstall *parameters) char *mime_type = caja_file_get_mime_type (parameters->file); char *error_message = get_application_no_mime_type_handler_message (parameters->file, parameters->uri); - if (g_content_type_is_unknown (mime_type)) - { - dialog = eel_alert_dialog_new (parameters->parent_window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - 0, - error_message, - _("The file is of an unknown type")); - } - else - { + if (g_content_type_is_unknown (mime_type)) { + dialog = gtk_message_dialog_new (parameters->parent_window, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + 0, + NULL); + g_object_set (dialog, + "text", error_message, + "secondary-text", _("The file is of an unknown type"), + NULL); + } else { char *text; text = g_strdup_printf (_("There is no application installed for %s files"), g_content_type_get_description (mime_type)); - dialog = eel_alert_dialog_new (parameters->parent_window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - 0, - error_message, - text); + dialog = gtk_message_dialog_new (parameters->parent_window, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + 0, + NULL); + g_object_set (dialog, + "text", error_message, + "secondary-text", text, + NULL); g_free (text); } @@ -1734,12 +1736,15 @@ activate_desktop_file (ActivateParameters *parameters, ), display_name); - dialog = eel_alert_dialog_new (parameters->parent_window, - 0, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - primary, - secondary); + dialog = gtk_message_dialog_new (parameters->parent_window, + 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + NULL); + g_object_set (dialog, + "text", primary, + "secondary-text", secondary, + NULL); gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Launch Anyway"), RESPONSE_RUN); if (caja_file_can_set_permissions (file)) -- cgit v1.2.1 From b50a7e051df6589e2d9059ec26329ec7be39a724 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 10:58:49 +0200 Subject: [icon-container] use gdk_window_focus http://git.gnome.org/browse/nautilus/commit/?id=6b06e0e27ca1cf29afd4fac716c58e15928a8ff8 --- libcaja-private/caja-icon-container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index eb1eaedb..b1d648d3 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4930,7 +4930,7 @@ start_stretching (CajaIconContainer *container) toplevel = gtk_widget_get_toplevel (GTK_WIDGET (container)); if (toplevel != NULL && gtk_widget_get_realized (toplevel)) { - eel_gdk_window_focus (gtk_widget_get_window (toplevel), GDK_CURRENT_TIME); + gdk_window_focus (gtk_widget_get_window (toplevel), GDK_CURRENT_TIME); } return TRUE; -- cgit v1.2.1 From 5680dbcc4995bd860e0e7659481e3d2079b09382 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 13:14:25 +0200 Subject: [icon-info] add a method to fetch GIcons for user special dirs http://git.gnome.org/browse/nautilus/commit/?id=1df83c6586560a8ae5efc96037e673e52b4b119b --- libcaja-private/caja-icon-info.c | 27 +++++++++++++++++++++++++++ libcaja-private/caja-icon-info.h | 2 ++ libcaja-private/caja-icon-names.h | 9 +++++++++ 3 files changed, 38 insertions(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-info.c b/libcaja-private/caja-icon-info.c index 7873ebfa..5d783877 100644 --- a/libcaja-private/caja-icon-info.c +++ b/libcaja-private/caja-icon-info.c @@ -21,6 +21,7 @@ #include #include #include "caja-icon-info.h" +#include "caja-icon-names.h" #include "caja-default-file-icon.h" #include #include @@ -778,3 +779,29 @@ caja_icon_theme_can_render (GThemedIcon *icon) return FALSE; } + +GIcon * +caja_user_special_directory_get_gicon (GUserDirectory directory) +{ + + #define ICON_CASE(x) \ + case G_USER_DIRECTORY_ ## x:\ + return g_themed_icon_new (CAJA_ICON_FOLDER_ ## x); + + switch (directory) { + + ICON_CASE (DESKTOP); + ICON_CASE (DOCUMENTS); + ICON_CASE (DOWNLOAD); + ICON_CASE (MUSIC); + ICON_CASE (PICTURES); + ICON_CASE (PUBLIC_SHARE); + ICON_CASE (TEMPLATES); + ICON_CASE (VIDEOS); + + default: + return g_themed_icon_new ("folder"); + } + + #undef ICON_CASE +} diff --git a/libcaja-private/caja-icon-info.h b/libcaja-private/caja-icon-info.h index d2bbc926..d4523d1a 100644 --- a/libcaja-private/caja-icon-info.h +++ b/libcaja-private/caja-icon-info.h @@ -91,6 +91,8 @@ extern "C" { guint caja_icon_get_emblem_size_for_icon_size (guint size); gboolean caja_icon_theme_can_render (GThemedIcon *icon); +GIcon * caja_user_special_directory_get_gicon (GUserDirectory directory); + #ifdef __cplusplus diff --git a/libcaja-private/caja-icon-names.h b/libcaja-private/caja-icon-names.h index d0598749..bb50a772 100644 --- a/libcaja-private/caja-icon-names.h +++ b/libcaja-private/caja-icon-names.h @@ -20,6 +20,15 @@ #define CAJA_ICON_EMBLEM_UNREADABLE "emblem-unreadable" #define CAJA_ICON_EMBLEM_SYMLINK "emblem-symbolic-link" +#define CAJA_ICON_FOLDER_DESKTOP "folder-documents" +#define CAJA_ICON_FOLDER_DOCUMENTS "folder-documents" +#define CAJA_ICON_FOLDER_DOWNLOAD "folder-download" +#define CAJA_ICON_FOLDER_MUSIC "folder-music" +#define CAJA_ICON_FOLDER_PICTURES "folder-pictures" +#define CAJA_ICON_FOLDER_PUBLIC_SHARE "folder-publicshare" +#define CAJA_ICON_FOLDER_TEMPLATES "folder-templates" +#define CAJA_ICON_FOLDER_VIDEOS "folder-videos" + /* Other icons */ #define CAJA_ICON_TEMPLATE "text-x-generic-template" -- cgit v1.2.1 From 938724fe165f8d1be66121b7d22c42ea3e258dbf Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 13:48:55 +0200 Subject: [places-sidebar] redesign the Places sidebar According to http://live.gnome.org/Nautilus/UIRoadmap/Places http://git.gnome.org/browse/nautilus/commit/?id=a59e586adf32eea64c9c4ae08a5482d2a9c37fb1 Small followup commits also included in this commit: icon-names: fix a typo http://git.gnome.org/browse/nautilus/commit/?id=2f847f37f429062d58df3927d10bc52c67a4524f sidebar: fix bookmark renaming http://git.gnome.org/browse/nautilus/commit/?id=1fdfa522da3e7c672fe4202c591a928c8796bb06 sidebar: add myself to the authors (Cosimo Cecchi ) http://git.gnome.org/browse/nautilus/commit/?id=0f7e56b5e0ae5134ed1d8caeadcb3c684ae7f661 sidebar: don't allow selecting headers http://git.gnome.org/browse/nautilus/commit/?id=8277ddc798fc78793364b54444fa53e9a287b5cc sidebar: don't try to add non-existing special dirs http://git.gnome.org/browse/nautilus/commit/?id=0f70ac4bb782b3c3fb0f5e8a24032cb344fdb2cc --- libcaja-private/caja-icon-names.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-names.h b/libcaja-private/caja-icon-names.h index bb50a772..20aee326 100644 --- a/libcaja-private/caja-icon-names.h +++ b/libcaja-private/caja-icon-names.h @@ -20,7 +20,7 @@ #define CAJA_ICON_EMBLEM_UNREADABLE "emblem-unreadable" #define CAJA_ICON_EMBLEM_SYMLINK "emblem-symbolic-link" -#define CAJA_ICON_FOLDER_DESKTOP "folder-documents" +#define CAJA_ICON_FOLDER_DESKTOP "user-desktop" #define CAJA_ICON_FOLDER_DOCUMENTS "folder-documents" #define CAJA_ICON_FOLDER_DOWNLOAD "folder-download" #define CAJA_ICON_FOLDER_MUSIC "folder-music" -- cgit v1.2.1 From 0819a3d1982403935eb70b958ad515494d1b9a0a Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 22:52:00 +0200 Subject: [lc-p/fm] Replace deprecated GDK_DISPLAY with GDK_DISPLAY_XDISPLAY Don't use GDK_DISPLAY () http://git.gnome.org/browse/nautilus/commit/?id=b66ce0fd23500f9727c1aac93366430285575697 --- libcaja-private/caja-autorun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index cf801b08..d78f402d 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -747,7 +747,8 @@ is_shift_pressed (void) ret = FALSE; gdk_error_trap_push (); - status = XkbGetState (GDK_DISPLAY (), XkbUseCoreKbd, &state); + status = XkbGetState (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), + XkbUseCoreKbd, &state); gdk_error_trap_pop (); if (status == Success) -- cgit v1.2.1 From 40cd5a93ced42275631a3d86ad68219aa73cb7a3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 22:56:14 +0200 Subject: [all] Don't use gtk_dialog_set_has_separator() http://git.gnome.org/browse/nautilus/commit/?id=73e2941f9b837d5d0326e6e88caa7a1e3fdcabeb --- libcaja-private/caja-autorun.c | 1 - libcaja-private/caja-file-conflict-dialog.c | 1 - libcaja-private/caja-open-with-dialog.c | 1 - 3 files changed, 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index d78f402d..bfb26968 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -993,7 +993,6 @@ show_dialog: dialog = gtk_dialog_new (); - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); hbox = gtk_hbox_new (FALSE, 12); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c index c1769960..e3419c7c 100644 --- a/libcaja-private/caja-file-conflict-dialog.c +++ b/libcaja-private/caja-file-conflict-dialog.c @@ -657,7 +657,6 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd) gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (dialog)), 14); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_dialog_set_has_separator (dialog, FALSE); gtk_widget_show_all (dialog_area); } diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c index 8f236d5e..dcd601bc 100644 --- a/libcaja-private/caja-open-with-dialog.c +++ b/libcaja-private/caja-open-with-dialog.c @@ -850,7 +850,6 @@ caja_open_with_dialog_init (CajaOpenWithDialog *dialog) dialog->details = g_new0 (CajaOpenWithDialogDetails, 1); gtk_window_set_title (GTK_WINDOW (dialog), _("Open With")); - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); -- cgit v1.2.1 From 42e70735c78d12d88ff9ec2d1c44d3edbadd29b5 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Mon, 5 Nov 2012 13:56:30 +0200 Subject: [editable-label|entry] use GtkEditableClass on GTK2, GtkEditableInterface on GTK3 editable-label: rename GtkEditableClass->GtkEditableInterface http://git.gnome.org/browse/nautilus/commit/?id=a58bbde4ca6b11eeb1bca5fa4e62e60c0b26271b entry: rename GtkEditableClass->GtkEditableInterface http://git.gnome.org/browse/nautilus/commit/?id=aeb53075ed55dc2a2ef3228917ded1b8029bfdff --- libcaja-private/caja-entry.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index 31b590c3..fa3669eb 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -35,6 +35,10 @@ #include #include +#if !GTK_CHECK_VERSION(3, 0, 0) +#define GtkEditableInterface GtkEditableClass +#endif + struct CajaEntryDetails { gboolean user_edit; @@ -51,13 +55,13 @@ enum }; static guint signals[LAST_SIGNAL]; -static void caja_entry_editable_init (GtkEditableClass *iface); +static void caja_entry_editable_init (GtkEditableInterface *iface); G_DEFINE_TYPE_WITH_CODE (CajaEntry, caja_entry, GTK_TYPE_ENTRY, G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, caja_entry_editable_init)); -static GtkEditableClass *parent_editable_interface = NULL; +static GtkEditableInterface *parent_editable_interface = NULL; static void caja_entry_init (CajaEntry *entry) @@ -373,7 +377,7 @@ caja_entry_selection_clear (GtkWidget *widget, } static void -caja_entry_editable_init (GtkEditableClass *iface) +caja_entry_editable_init (GtkEditableInterface *iface) { parent_editable_interface = g_type_interface_peek_parent (iface); -- cgit v1.2.1 From 0d0641f10e84e0de0b39e63789508c260913cc98 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Mon, 5 Nov 2012 14:20:13 +0200 Subject: [lc-p] convert to new GDK_KEY prefix http://git.gnome.org/browse/nautilus/commit/?id=64dcbea2a005e4ed8bb4945d06a943058b8c7ba8 --- libcaja-private/caja-autorun.c | 2 +- libcaja-private/caja-entry.c | 2 +- libcaja-private/caja-icon-container.c | 96 +++++++++++++++++------------------ 3 files changed, 50 insertions(+), 50 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index bfb26968..61adb3e0 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -908,7 +908,7 @@ autorun_always_toggled (GtkToggleButton *togglebutton, AutorunDialogData *data) static gboolean combo_box_enter_ok (GtkWidget *togglebutton, GdkEventKey *event, GtkDialog *dialog) { - if (event->keyval == GDK_KP_Enter || event->keyval == GDK_Return) + if (event->keyval == GDK_KEY_KP_Enter || event->keyval == GDK_KEY_Return) { gtk_dialog_response (dialog, GTK_RESPONSE_OK); return TRUE; diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index fa3669eb..863b1b4f 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -127,7 +127,7 @@ caja_entry_key_press (GtkWidget *widget, GdkEventKey *event) switch (event->keyval) { - case GDK_Tab: + case GDK_KEY_Tab: /* The location bar entry wants TAB to work kind of * like it does in the shell for command completion, * so if we get a tab and there's a selection, we diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index b1d648d3..8a92d3aa 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -5006,17 +5006,17 @@ keyboard_stretching (CajaIconContainer *container, switch (event->keyval) { - case GDK_equal: - case GDK_plus: - case GDK_KP_Add: + case GDK_KEY_equal: + case GDK_KEY_plus: + case GDK_KEY_KP_Add: icon_set_size (container, icon, size + 5, FALSE, FALSE); break; - case GDK_minus: - case GDK_KP_Subtract: + case GDK_KEY_minus: + case GDK_KEY_KP_Subtract: icon_set_size (container, icon, size - 5, FALSE, FALSE); break; - case GDK_0: - case GDK_KP_0: + case GDK_KEY_0: + case GDK_KEY_KP_0: caja_icon_container_move_icon (container, icon, icon->x, icon->y, 1.0, @@ -5633,14 +5633,14 @@ caja_icon_container_search_key_press_event (GtkWidget *widget, g_assert (CAJA_IS_ICON_CONTAINER (container)); /* close window and cancel the search */ - if (event->keyval == GDK_Escape || event->keyval == GDK_Tab) + if (event->keyval == GDK_KEY_Escape || event->keyval == GDK_KEY_Tab) { caja_icon_container_search_dialog_hide (widget, container); return TRUE; } /* close window and activate alternate */ - if (event->keyval == GDK_Return && event->state & GDK_SHIFT_MASK) + if (event->keyval == GDK_KEY_Return && event->state & GDK_SHIFT_MASK) { caja_icon_container_search_dialog_hide (widget, container); @@ -5650,28 +5650,28 @@ caja_icon_container_search_key_press_event (GtkWidget *widget, } /* select previous matching iter */ - if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up) + if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) { caja_icon_container_search_move (widget, container, TRUE); retval = TRUE; } if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) - && (event->keyval == GDK_g || event->keyval == GDK_G)) + && (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G)) { caja_icon_container_search_move (widget, container, TRUE); retval = TRUE; } /* select next matching iter */ - if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down) + if (event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_KP_Down) { caja_icon_container_search_move (widget, container, FALSE); retval = TRUE; } if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) - && (event->keyval == GDK_g || event->keyval == GDK_G)) + && (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G)) { caja_icon_container_search_move (widget, container, FALSE); retval = TRUE; @@ -5880,12 +5880,12 @@ key_press_event (GtkWidget *widget, { switch (event->keyval) { - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: end_renaming_mode (container, TRUE); handled = TRUE; break; - case GDK_Escape: + case GDK_KEY_Escape: end_renaming_mode (container, FALSE); handled = TRUE; break; @@ -5897,18 +5897,18 @@ key_press_event (GtkWidget *widget, { switch (event->keyval) { - case GDK_Home: - case GDK_KP_Home: + case GDK_KEY_Home: + case GDK_KEY_KP_Home: keyboard_home (container, event); handled = TRUE; break; - case GDK_End: - case GDK_KP_End: + case GDK_KEY_End: + case GDK_KEY_KP_End: keyboard_end (container, event); handled = TRUE; break; - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: /* Don't eat Alt-Left, as that is used for history browsing */ if ((event->state & GDK_MOD1_MASK) == 0) { @@ -5916,8 +5916,8 @@ key_press_event (GtkWidget *widget, handled = TRUE; } break; - case GDK_Up: - case GDK_KP_Up: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: /* Don't eat Alt-Up, as that is used for alt-shift-Up */ if ((event->state & GDK_MOD1_MASK) == 0) { @@ -5925,8 +5925,8 @@ key_press_event (GtkWidget *widget, handled = TRUE; } break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: /* Don't eat Alt-Right, as that is used for history browsing */ if ((event->state & GDK_MOD1_MASK) == 0) { @@ -5934,8 +5934,8 @@ key_press_event (GtkWidget *widget, handled = TRUE; } break; - case GDK_Down: - case GDK_KP_Down: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: /* Don't eat Alt-Down, as that is used for Open */ if ((event->state & GDK_MOD1_MASK) == 0) { @@ -5943,20 +5943,20 @@ key_press_event (GtkWidget *widget, handled = TRUE; } break; - case GDK_space: + case GDK_KEY_space: keyboard_space (container, event); handled = TRUE; break; #ifndef TAB_NAVIGATION_DISABLED - case GDK_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_ISO_Left_Tab: select_previous_or_next_icon (container, (event->state & GDK_SHIFT_MASK) == 0, event); handled = TRUE; break; #endif - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: if ((event->state & GDK_SHIFT_MASK) != 0) { activate_selected_items_alternate (container, NULL); @@ -5968,22 +5968,22 @@ key_press_event (GtkWidget *widget, handled = TRUE; break; - case GDK_Escape: + case GDK_KEY_Escape: handled = undo_stretching (container); break; - case GDK_plus: - case GDK_minus: - case GDK_equal: - case GDK_KP_Add: - case GDK_KP_Subtract: - case GDK_0: - case GDK_KP_0: + case GDK_KEY_plus: + case GDK_KEY_minus: + case GDK_KEY_equal: + case GDK_KEY_KP_Add: + case GDK_KEY_KP_Subtract: + case GDK_KEY_0: + case GDK_KEY_KP_0: if (event->state & GDK_CONTROL_MASK) { handled = keyboard_stretching (container, event); } break; - case GDK_F10: + case GDK_KEY_F10: /* handle Ctrl+F10 because we want to display the * background popup even if something is selected. * The other cases are handled by popup_menu(). @@ -5994,7 +5994,7 @@ key_press_event (GtkWidget *widget, "context_click_background"); } break; - case GDK_v: + case GDK_KEY_v: /* Eat Control + v to not enable type ahead */ if ((event->state & GDK_CONTROL_MASK) != 0) { @@ -6015,9 +6015,9 @@ key_press_event (GtkWidget *widget, * start the typeahead find capabilities. * Copied from CajaIconContainer */ if (!handled && - event->keyval != GDK_slash /* don't steal slash key event, used for "go to" */ && - event->keyval != GDK_BackSpace && - event->keyval != GDK_Delete) + event->keyval != GDK_KEY_slash /* don't steal slash key event, used for "go to" */ && + event->keyval != GDK_KEY_BackSpace && + event->keyval != GDK_KEY_Delete) { GdkEvent *new_event; GdkWindow *window; @@ -6717,8 +6717,8 @@ caja_icon_container_class_init (CajaIconContainerClass *class) binding_set = gtk_binding_set_by_class (class); - gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "start_interactive_search", 0); - gtk_binding_entry_add_signal (binding_set, GDK_F, GDK_CONTROL_MASK, "start_interactive_search", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_f, GDK_CONTROL_MASK, "start_interactive_search", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F, GDK_CONTROL_MASK, "start_interactive_search", 0); } static void -- cgit v1.2.1 From c97aca046a4f75e73e5d82a814337eef950efce3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Mon, 5 Nov 2012 14:29:50 +0200 Subject: [autorun] use gdk_error_trap_pop_ignored() for GTK3 http://git.gnome.org/browse/nautilus/commit/?id=8dd87483bd187bfac80a606233b769c230343980 --- libcaja-private/caja-autorun.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 61adb3e0..21f71eb8 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -749,7 +749,11 @@ is_shift_pressed (void) gdk_error_trap_push (); status = XkbGetState (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XkbUseCoreKbd, &state); +#if GTK_CHECK_VERSION(3,0,0) + gdk_error_trap_pop_ignored (); +#else gdk_error_trap_pop (); +#endif if (status == Success) { -- cgit v1.2.1 From 360d966dfa2a9ebe579e77d4f59a1e3b37ead28c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 23:11:40 +0200 Subject: [lc-p] Use gdk_threads_enter/leave in thumbnail_thread_notify_file_changed This was supposed to be a change from the GDK_THREADS_* macros. But, the macros weren't there, so we adapt from: thumbnails: don't use GDK_THREADS_* macros http://git.gnome.org/browse/nautilus/commit/?id=8ee5d37f2b4776730247af75a6ce4cebcba4c550&context=12 --- libcaja-private/caja-thumbnails.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-thumbnails.c b/libcaja-private/caja-thumbnails.c index ef62edba..cbb5f7dc 100644 --- a/libcaja-private/caja-thumbnails.c +++ b/libcaja-private/caja-thumbnails.c @@ -277,6 +277,8 @@ thumbnail_thread_notify_file_changed (gpointer image_uri) { CajaFile *file; + gdk_threads_enter (); + file = caja_file_get_by_uri ((char *) image_uri); #ifdef DEBUG_THUMBNAILS g_message ("(Thumbnail Thread) Notifying file changed file:%p uri: %s\n", file, (char*) image_uri); @@ -292,6 +294,8 @@ thumbnail_thread_notify_file_changed (gpointer image_uri) } g_free (image_uri); + gdk_threads_leave (); + return FALSE; } -- cgit v1.2.1 From df6ac41622e955bfc2e3d3d38624dceaf4436df5 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 15:29:36 +0200 Subject: [build] don't include marshals we don't own http://git.gnome.org/browse/nautilus/commit/?id=8d07a73b28767b7c866fe403e9ac706b8affb8a2 --- libcaja-private/caja-directory.c | 1 - libcaja-private/caja-icon-container.c | 1 - 2 files changed, 2 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-directory.c b/libcaja-private/caja-directory.c index 6479b38a..efcfc5ed 100644 --- a/libcaja-private/caja-directory.c +++ b/libcaja-private/caja-directory.c @@ -32,7 +32,6 @@ #include "caja-search-directory.h" #include "caja-global-preferences.h" #include "caja-lib-self-check-functions.h" -#include "caja-marshal.h" #include "caja-metadata.h" #include "caja-desktop-directory.h" #include "caja-vfs-directory.h" diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 8a92d3aa..f9b01311 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.1 From 2a1ef1efb5434f189e0463c834d5926bd931184e Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 15:32:31 +0200 Subject: [window-info] move include to caja-window-private http://git.gnome.org/browse/nautilus/commit/?id=42cc7bd181d2f57dbc008bea54a40f02be40ce39 --- libcaja-private/caja-window-info.h | 1 - 1 file changed, 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-window-info.h b/libcaja-private/caja-window-info.h index fb39c73f..4bb271b6 100644 --- a/libcaja-private/caja-window-info.h +++ b/libcaja-private/caja-window-info.h @@ -28,7 +28,6 @@ #include #include #include -#include "../src/caja-bookmark-list.h" #ifdef __cplusplus extern "C" { -- cgit v1.2.1 From 662d2326c5ce63c867b3d94fb2bb44d9a244399b Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Fri, 19 Oct 2012 00:01:23 +0200 Subject: [window] add _full() versions of _go_to and _open() methods These also have a callback to get the result of the operation. http://git.gnome.org/browse/nautilus/commit/?id=24515b87a91afd32885e07e32e2b4080584673a4 --- libcaja-private/caja-window-info.h | 4 ++++ libcaja-private/caja-window-slot-info.c | 14 +++++++++----- libcaja-private/caja-window-slot-info.h | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-window-info.h b/libcaja-private/caja-window-info.h index 4bb271b6..7cced147 100644 --- a/libcaja-private/caja-window-info.h +++ b/libcaja-private/caja-window-info.h @@ -88,6 +88,10 @@ extern "C" { typedef struct _CajaWindowInfoIface CajaWindowInfoIface; + typedef void (* CajaWindowGoToCallback) (CajaWindow *window, + GError *error, + gpointer user_data); + struct _CajaWindowInfoIface { GTypeInterface g_iface; diff --git a/libcaja-private/caja-window-slot-info.c b/libcaja-private/caja-window-slot-info.c index f0193980..01a38a80 100644 --- a/libcaja-private/caja-window-slot-info.c +++ b/libcaja-private/caja-window-slot-info.c @@ -108,11 +108,13 @@ caja_window_slot_info_make_hosting_pane_active (CajaWindowSlotInfo *slot) } void -caja_window_slot_info_open_location (CajaWindowSlotInfo *slot, +caja_window_slot_info_open_location_full (CajaWindowSlotInfo *slot, GFile *location, - CajaWindowOpenMode mode, - CajaWindowOpenFlags flags, - GList *selection) + CajaWindowOpenMode mode, + CajaWindowOpenFlags flags, + GList *selection, + CajaWindowGoToCallback callback, + gpointer user_data) { g_assert (CAJA_IS_WINDOW_SLOT_INFO (slot)); @@ -120,7 +122,9 @@ caja_window_slot_info_open_location (CajaWindowSlotInfo *slot, location, mode, flags, - selection); + selection, + callback, + user_data); } char * diff --git a/libcaja-private/caja-window-slot-info.h b/libcaja-private/caja-window-slot-info.h index 2d8b21d2..49804820 100644 --- a/libcaja-private/caja-window-slot-info.h +++ b/libcaja-private/caja-window-slot-info.h @@ -72,18 +72,27 @@ struct _CajaWindowSlotInfoIface GFile *location, CajaWindowOpenMode mode, CajaWindowOpenFlags flags, - GList *selection); + GList *selection, + CajaWindowGoToCallback callback, + gpointer user_data); void (* make_hosting_pane_active) (CajaWindowSlotInfo *slot); }; GType caja_window_slot_info_get_type (void); CajaWindowInfo * caja_window_slot_info_get_window (CajaWindowSlotInfo *slot); -void caja_window_slot_info_open_location (CajaWindowSlotInfo *slot, +#define caja_window_slot_info_open_location(slot, location, mode, flags, selection) \ + caja_window_slot_info_open_location_full(slot, location, mode, \ + flags, selection, NULL, NULL) + +void caja_window_slot_info_open_location_full + (CajaWindowSlotInfo *slot, GFile *location, - CajaWindowOpenMode mode, - CajaWindowOpenFlags flags, - GList *selection); + CajaWindowOpenMode mode, + CajaWindowOpenFlags flags, + GList *selection, + CajaWindowGoToCallback callback, + gpointer user_data); void caja_window_slot_info_set_status (CajaWindowSlotInfo *slot, const char *status); void caja_window_slot_info_make_hosting_pane_active (CajaWindowSlotInfo *slot); -- cgit v1.2.1 From 20ceebe17ffc956f59ce28834d528d436e66f796 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 15 Nov 2012 10:56:33 +0200 Subject: [directory-background] Use weak refs instead of EelBackground destroy signal i.e. don't connect to the destroy signal of EelBackground, in favor of g_object_weak_ref() and g_object_weak_unref() Though Nautilus removed code for setting non-desktop window backgrounds: http://git.gnome.org/browse/nautilus/commit/?id=c9be35b3ee6c468a9a102b317b82b8b639637d0f ..this is a tad similar: directory-background: don't user the 'destroy' signal of EelBackground http://git.gnome.org/browse/nautilus/commit/?id=fbb6b024128e3c35aeb1d74f8e287e8870c9999f&context=12 --- libcaja-private/caja-directory-background.c | 52 +++++++++++++++++------------ 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-directory-background.c b/libcaja-private/caja-directory-background.c index 21aea675..a445aab7 100644 --- a/libcaja-private/caja-directory-background.c +++ b/libcaja-private/caja-directory-background.c @@ -296,11 +296,12 @@ desktop_background_settings_notify_cb (GSettings *settings, gchar *key, gpointer } static void -desktop_background_destroyed_callback (EelBackground *background, void *georgeWBush) +desktop_background_weak_notify (gpointer data, + GObject *object) { g_signal_handlers_disconnect_by_func(mate_background_preferences, G_CALLBACK (desktop_background_settings_notify_cb), - background); + object); } static void @@ -309,10 +310,10 @@ caja_file_background_receive_settings_changes (EelBackground *background) g_signal_connect (mate_background_preferences, "changed", G_CALLBACK (desktop_background_settings_notify_cb), - background); + G_OBJECT (background)); - g_signal_connect (background, "destroy", - G_CALLBACK (desktop_background_destroyed_callback), NULL); + g_object_weak_ref (G_OBJECT (background), + desktop_background_weak_notify, NULL); } /* return true if the background is not in the default state */ @@ -563,9 +564,11 @@ background_reset_callback (EelBackground *background, /* handle the background destroyed signal */ static void -background_destroyed_callback (EelBackground *background, - CajaFile *file) +background_weak_notify (gpointer data, + GObject *background) { + CajaFile *file = CAJA_FILE (data); + g_signal_handlers_disconnect_by_func (file, G_CALLBACK (saved_settings_changed_callback), background); @@ -598,23 +601,26 @@ caja_connect_background_to_file_metadata (GtkWidget *widget, if (old_file != NULL) { g_assert (CAJA_IS_FILE (old_file)); - g_signal_handlers_disconnect_by_func - (background, - G_CALLBACK (background_changed_callback), old_file); - g_signal_handlers_disconnect_by_func - (background, - G_CALLBACK (background_destroyed_callback), old_file); - g_signal_handlers_disconnect_by_func - (background, - G_CALLBACK (background_reset_callback), old_file); - g_signal_handlers_disconnect_by_func - (old_file, - G_CALLBACK (saved_settings_changed_callback), background); + + g_signal_handlers_disconnect_by_func (background, + G_CALLBACK (background_changed_callback), + old_file); + + g_signal_handlers_disconnect_by_func (background, + G_CALLBACK (background_reset_callback), + old_file); + + g_object_weak_unref (G_OBJECT (background), background_weak_notify, old_file); + + g_signal_handlers_disconnect_by_func (old_file, + G_CALLBACK (saved_settings_changed_callback), + background); + caja_file_monitor_remove (old_file, background); + g_signal_handlers_disconnect_by_func (caja_preferences, caja_file_background_theme_changed, background); - } /* Attach the new directory. */ @@ -629,13 +635,15 @@ caja_connect_background_to_file_metadata (GtkWidget *widget, { g_signal_connect_object (background, "settings_changed", G_CALLBACK (background_changed_callback), file, 0); - g_signal_connect_object (background, "destroy", - G_CALLBACK (background_destroyed_callback), file, 0); + g_signal_connect_object (background, "reset", G_CALLBACK (background_reset_callback), file, 0); + g_signal_connect_object (file, "changed", G_CALLBACK (saved_settings_changed_callback), background, 0); + g_object_weak_ref (G_OBJECT (background), background_weak_notify, file); + /* arrange to receive file metadata */ caja_file_monitor_add (file, background, -- cgit v1.2.1 From 4895118afc287dc511792a5f91f109a2e1f868d0 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 31 Oct 2012 04:23:12 +0200 Subject: [lc-p] don't use GtkObject (GTK3) the ::destroy signal of GtkObject has only been moved to GtkWidget in GTK3 (after GtkObject removal): http://developer.gnome.org/gtk3/3.0/ch25s02.html So, we use conditionals in this case, to keep working with GTK2 Original commit: http://git.gnome.org/browse/nautilus/commit/?id=aef4cfcf93ef34a0b2d4c87b40fcec2b7a66dd06 --- libcaja-private/caja-autorun.c | 2 +- libcaja-private/caja-clipboard.c | 4 ++-- libcaja-private/caja-entry.c | 12 ++++-------- libcaja-private/caja-icon-container.c | 16 +++++++++++++--- libcaja-private/caja-mime-actions.c | 6 +++--- libcaja-private/caja-mime-application-chooser.c | 10 ---------- libcaja-private/caja-open-with-dialog.c | 12 +----------- libcaja-private/caja-program-choosing.c | 2 +- 8 files changed, 25 insertions(+), 39 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 21f71eb8..89b8e63d 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -274,7 +274,7 @@ dialog_response_cb (GtkDialog *dialog, } static void -dialog_destroy_cb (GtkObject *object, +dialog_destroy_cb (GtkWidget *object, CajaAutorunComboBoxData *data) { handle_dialog_closure (data); diff --git a/libcaja-private/caja-clipboard.c b/libcaja-private/caja-clipboard.c index b1614509..bc06675a 100644 --- a/libcaja-private/caja-clipboard.c +++ b/libcaja-private/caja-clipboard.c @@ -432,7 +432,7 @@ owner_change_callback (GtkClipboard *clipboard, } static void -target_destroy_callback (GtkObject *object, +target_destroy_callback (GtkWidget *object, gpointer callback_data) { TargetCallbackData *target_data; @@ -440,7 +440,7 @@ target_destroy_callback (GtkObject *object, g_assert (callback_data != NULL); target_data = callback_data; - if (clipboard_items_are_merged_in (GTK_WIDGET(object))) + if (clipboard_items_are_merged_in (object)) { merge_out_clipboard_menu_items (G_OBJECT (object), callback_data); } diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index 863b1b4f..fb9ac38c 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -395,12 +395,10 @@ static void caja_entry_class_init (CajaEntryClass *class) { GtkWidgetClass *widget_class; - GtkObjectClass *object_class; GObjectClass *gobject_class; widget_class = GTK_WIDGET_CLASS (class); gobject_class = G_OBJECT_CLASS (class); - object_class = GTK_OBJECT_CLASS (class); widget_class->button_press_event = caja_entry_button_press; widget_class->button_release_event = caja_entry_button_release; @@ -413,19 +411,17 @@ caja_entry_class_init (CajaEntryClass *class) /* Set up signals */ signals[USER_CHANGED] = g_signal_new ("user_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - user_changed), + G_STRUCT_OFFSET (CajaEntryClass, user_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[SELECTION_CHANGED] = g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - selection_changed), + G_STRUCT_OFFSET (CajaEntryClass, selection_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index f9b01311..0f6898c9 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4379,10 +4379,12 @@ select_previous_or_next_icon (CajaIconContainer *container, } #endif -/* GtkObject methods. */ - static void +#if GTK_CHECK_VERSION(3, 0, 0) +destroy (GtkWidget *object) +#else destroy (GtkObject *object) +#endif { CajaIconContainer *container; @@ -4439,8 +4441,11 @@ destroy (GtkObject *object) } } - +#if GTK_CHECK_VERSION(3, 0, 0) + GTK_WIDGET_CLASS (caja_icon_container_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (caja_icon_container_parent_class)->destroy (object); +#endif } static void @@ -6213,7 +6218,12 @@ caja_icon_container_class_init (CajaIconContainerClass *class) G_OBJECT_CLASS (class)->constructor = caja_icon_container_constructor; G_OBJECT_CLASS (class)->finalize = finalize; + +#if GTK_CHECK_VERSION(3, 0, 0) + GTK_WIDGET_CLASS (class)->destroy = destroy; +#else GTK_OBJECT_CLASS (class)->destroy = destroy; +#endif /* Signals. */ diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index a4dc8c97..794c84b0 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -793,7 +793,7 @@ report_broken_symbolic_link (GtkWindow *parent_window, CajaFile *file) */ response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); if (response == GTK_RESPONSE_YES) { @@ -860,7 +860,7 @@ get_executable_text_file_action (GtkWindow *parent_window, CajaFile *file) g_free (detail); response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); switch (response) { @@ -1223,7 +1223,7 @@ confirm_multiple_windows (GtkWindow *parent_window, g_free (detail); response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); return response == GTK_RESPONSE_YES; } diff --git a/libcaja-private/caja-mime-application-chooser.c b/libcaja-private/caja-mime-application-chooser.c index 3f458dba..32767f38 100644 --- a/libcaja-private/caja-mime-application-chooser.c +++ b/libcaja-private/caja-mime-application-chooser.c @@ -107,23 +107,13 @@ caja_mime_application_chooser_finalize (GObject *object) G_OBJECT_CLASS (caja_mime_application_chooser_parent_class)->finalize (object); } -static void -caja_mime_application_chooser_destroy (GtkObject *object) -{ - GTK_OBJECT_CLASS (caja_mime_application_chooser_parent_class)->destroy (object); -} - static void caja_mime_application_chooser_class_init (CajaMimeApplicationChooserClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = caja_mime_application_chooser_finalize; - - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = caja_mime_application_chooser_destroy; } static void diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c index dcd601bc..93e376c9 100644 --- a/libcaja-private/caja-open-with-dialog.c +++ b/libcaja-private/caja-open-with-dialog.c @@ -120,12 +120,6 @@ caja_open_with_dialog_finalize (GObject *object) G_OBJECT_CLASS (caja_open_with_dialog_parent_class)->finalize (object); } -static void -caja_open_with_dialog_destroy (GtkObject *object) -{ - GTK_OBJECT_CLASS (caja_open_with_dialog_parent_class)->destroy (object); -} - /* An application is valid if: * * 1) The file exists @@ -397,17 +391,13 @@ static void caja_open_with_dialog_class_init (CajaOpenWithDialogClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = caja_open_with_dialog_finalize; - object_class = GTK_OBJECT_CLASS (class); - object_class->destroy = caja_open_with_dialog_destroy; - signals[APPLICATION_SELECTED] = g_signal_new ("application_selected", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CajaOpenWithDialogClass, application_selected), diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c index a31746ec..56d6e8eb 100644 --- a/libcaja-private/caja-program-choosing.c +++ b/libcaja-private/caja-program-choosing.c @@ -98,7 +98,7 @@ application_cannot_open_location (GAppInfo *application, GTK_STOCK_CANCEL, parent_window); response = gtk_dialog_run (message_dialog); - gtk_object_destroy (GTK_OBJECT (message_dialog)); + gtk_widget_destroy (GTK_WIDGET (message_dialog)); if (response == GTK_RESPONSE_YES) { -- cgit v1.2.1 From ae33b1c624c008ca0818ab08735968c8d01fae1c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 3 Nov 2012 19:03:17 +0200 Subject: [lc-p] use eel_canvas_item_destroy instead of gtk_object_destroy() http://git.gnome.org/browse/nautilus/commit/?id=f5192b6990cd9240d126974dd587b7b7525ae714 --- libcaja-private/caja-icon-container.c | 4 ++-- libcaja-private/caja-icon-dnd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 0f6898c9..1ae2cb2a 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -300,7 +300,7 @@ static void icon_free (CajaIcon *icon) { /* Destroy this canvas item; the parent will unref it. */ - gtk_object_destroy (GTK_OBJECT (icon->item)); + eel_canvas_item_destroy (EEL_CANVAS_ITEM (icon->item)); g_free (icon); } @@ -2990,7 +2990,7 @@ stop_rubberbanding (CajaIconContainer *container, /* Destroy this canvas item; the parent will unref it. */ eel_canvas_item_ungrab (band_info->selection_rectangle, time); - gtk_object_destroy (GTK_OBJECT (band_info->selection_rectangle)); + eel_canvas_item_destroy (band_info->selection_rectangle); band_info->selection_rectangle = NULL; /* if only one item has been selected, use it as range diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 2e7dc32a..449ceab8 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -375,7 +375,7 @@ caja_icon_container_dropped_icon_feedback (GtkWidget *widget, { /* FIXME bugzilla.gnome.org 42484: * Is a destroy really sufficient here? Who does the unref? */ - gtk_object_destroy (GTK_OBJECT (dnd_info->shadow)); + eel_canvas_item_destroy (dnd_info->shadow); } /* Build the selection list and the shadow. */ @@ -1514,7 +1514,7 @@ caja_icon_container_free_drag_data (CajaIconContainer *container) if (dnd_info->shadow != NULL) { - gtk_object_destroy (GTK_OBJECT (dnd_info->shadow)); + eel_canvas_item_destroy (dnd_info->shadow); dnd_info->shadow = NULL; } -- cgit v1.2.1 From 079f01d120988b1b6549a0b815cd0fad65bdc424 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Tue, 13 Nov 2012 12:11:05 +0200 Subject: [KeepLastVerticalBox] Don't use eel-gtk-macros --- libcaja-private/caja-keep-last-vertical-box.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-keep-last-vertical-box.c b/libcaja-private/caja-keep-last-vertical-box.c index 51c709ce..212fcc93 100644 --- a/libcaja-private/caja-keep-last-vertical-box.c +++ b/libcaja-private/caja-keep-last-vertical-box.c @@ -26,14 +26,13 @@ #include #include "caja-keep-last-vertical-box.h" -#include - static void caja_keep_last_vertical_box_class_init (CajaKeepLastVerticalBoxClass *class); static void caja_keep_last_vertical_box_init (CajaKeepLastVerticalBox *box); static void caja_keep_last_vertical_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -EEL_CLASS_BOILERPLATE (CajaKeepLastVerticalBox, caja_keep_last_vertical_box, GTK_TYPE_VBOX) +G_DEFINE_TYPE (CajaKeepLastVerticalBox, caja_keep_last_vertical_box, GTK_TYPE_VBOX) +#define parent_class caja_keep_last_vertical_box_parent_class /* Standard class initialization function */ static void @@ -96,10 +95,10 @@ caja_keep_last_vertical_box_size_allocate (GtkWidget *widget, g_return_if_fail (CAJA_IS_KEEP_LAST_VERTICAL_BOX (widget)); g_return_if_fail (allocation != NULL); - EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate, (widget, allocation)); + GTK_WIDGET_CLASS (caja_keep_last_vertical_box_parent_class)->size_allocate (widget, allocation); box = GTK_BOX (widget); - children = gtk_container_get_children (GTK_CONTAINER(widget)); + children = gtk_container_get_children (GTK_CONTAINER (widget)); l = g_list_last (children); if (l != NULL) -- cgit v1.2.1 From 2e0b6b0a2e689d5af0ca719ee0ef29f90c4f2e0c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 16:33:39 +0200 Subject: [icon-dnd] remove commented out obsolete code http://git.gnome.org/browse/nautilus/commit/?id=c5eba3314c99059aa1fff13aedcb1004966fdd55 --- libcaja-private/caja-icon-dnd.c | 63 +---------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 449ceab8..470a767e 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -940,63 +940,6 @@ stop_auto_scroll (CajaIconContainer *container) caja_drag_autoscroll_stop (&container->details->dnd_info->drag_info); } -static gboolean -confirm_switch_to_manual_layout (CajaIconContainer *container) -{ -#if 0 - const char *message; - const char *detail; - GtkDialog *dialog; - int response; - - /* FIXME bugzilla.gnome.org 40915: Use of the word "directory" - * makes this FMIconView specific. Move these messages into - * FMIconView so CajaIconContainer can be used for things - * that are not directories? - */ - if (caja_icon_container_has_stored_icon_positions (container)) - { - if (eel_g_list_exactly_one_item (container->details->dnd_info->drag_info.selection_list)) - { - message = no_translate("Do you want to switch to manual layout and leave this item where you dropped it? " - "This will clobber the stored manual layout."); - detail = no_translate("This folder uses automatic layout."); - } - else - { - message = no_translate("Do you want to switch to manual layout and leave these items where you dropped them? " - "This will clobber the stored manual layout."); - detail = no_translate("This folder uses automatic layout."); - } - } - else - { - if (eel_g_list_exactly_one_item (container->details->dnd_info->drag_info.selection_list)) - { - message = no_translate("Do you want to switch to manual layout and leave this item where you dropped it?"); - detail = no_translate("This folder uses automatic layout."); - } - else - { - message = no_translate("Do you want to switch to manual layout and leave these items where you dropped them?"); - detail = no_translate("This folder uses automatic layout."); - - } - } - - dialog = eel_show_yes_no_dialog (message, detail, _("Switch to Manual Layout?"), - GTK_STOCK_CANCEL, - GTK_WINDOW (gtk_widget_get_toplevel(GTK_WIDGET(container)))); - - response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); - - return response == GTK_RESPONSE_YES; -#else - return FALSE; -#endif -} - static void handle_local_move (CajaIconContainer *container, double world_x, double world_y) @@ -1011,11 +954,7 @@ handle_local_move (CajaIconContainer *container, if (container->details->auto_layout) { - if (!confirm_switch_to_manual_layout (container)) - { - return; - } - caja_icon_container_freeze_icon_positions (container); + return; } time (&now); -- cgit v1.2.1 From 2a4433a562b4a9fde5f81961c67fbee8810d63f0 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 00:05:37 +0200 Subject: [libcaja-private] Port to rendering-cleanup-next http://git.gnome.org/browse/nautilus/commit/?id=910191ea13e5647e1b8c793e7585530c6ae4c9b1 --- libcaja-private/caja-icon-canvas-item.c | 282 ++++++++++++++++++++++++----- libcaja-private/caja-icon-canvas-item.h | 8 +- libcaja-private/caja-icon-container.c | 16 +- libcaja-private/caja-icon-dnd.c | 56 +++++- libcaja-private/caja-tree-view-drag-dest.c | 44 +++-- 5 files changed, 325 insertions(+), 81 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index d6bba70b..e8b1762c 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -215,41 +215,57 @@ G_DEFINE_TYPE_WITH_CODE (CajaIconCanvasItem, caja_icon_canvas_item, EEL_TYPE_CAN /* private */ static void draw_label_text (CajaIconCanvasItem *item, - GdkDrawable *drawable, - gboolean create_mask, - EelIRect icon_rect); +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else + GdkDrawable *drawable, +#endif + gboolean create_mask, + EelIRect icon_rect); static void measure_label_text (CajaIconCanvasItem *item); static void get_icon_canvas_rectangle (CajaIconCanvasItem *item, - EelIRect *rect); -static void emblem_layout_reset (EmblemLayout *layout, - CajaIconCanvasItem *icon_item, - EelIRect icon_rect, - gboolean is_rtl); -static gboolean emblem_layout_next (EmblemLayout *layout, - GdkPixbuf **emblem_pixbuf, - EelIRect *emblem_rect, - gboolean is_rtl); -static void draw_pixbuf (GdkPixbuf *pixbuf, - GdkDrawable *drawable, - int x, - int y); -static PangoLayout *get_label_layout (PangoLayout **layout, - CajaIconCanvasItem *item, - const char *text); + EelIRect *rect); +static void emblem_layout_reset (EmblemLayout *layout, + CajaIconCanvasItem *icon_item, + EelIRect icon_rect, + gboolean is_rtl); +static gboolean emblem_layout_next (EmblemLayout *layout, + GdkPixbuf **emblem_pixbuf, + EelIRect *emblem_rect, + gboolean is_rtl); +static void draw_pixbuf (GdkPixbuf *pixbuf, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else + GdkDrawable *drawable, +#endif + int x, + int y); +static PangoLayout *get_label_layout (PangoLayout **layout, + CajaIconCanvasItem *item, + const char *text); static void draw_label_layout (CajaIconCanvasItem *item, - GdkDrawable *drawable, - PangoLayout *layout, - gboolean highlight, - GdkColor *label_color, - int x, - int y); +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else + GdkDrawable *drawable, +#endif + PangoLayout *layout, + gboolean highlight, + GdkColor *label_color, + int x, + int y); static gboolean hit_test_stretch_handle (CajaIconCanvasItem *item, - EelIRect canvas_rect, - GtkCornerType *corner); + EelIRect canvas_rect, + GtkCornerType *corner); static void draw_embedded_text (CajaIconCanvasItem *icon_item, - GdkDrawable *drawable, - int x, - int y); +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else + GdkDrawable *drawable, +#endif + int x, + int y); static void caja_icon_canvas_item_ensure_bounds_up_to_date (CajaIconCanvasItem *icon_item); @@ -538,12 +554,21 @@ caja_icon_canvas_item_get_property (GObject *object, } } +#if GTK_CHECK_VERSION(3,0,0) +cairo_surface_t * +caja_icon_canvas_item_get_drag_surface (CajaIconCanvasItem *item) +#else GdkPixmap * caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, GdkBitmap **mask, GdkColormap *colormap) +#endif { +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_t *surface; +#else GdkPixmap *pixmap; +#endif EelCanvas *canvas; GdkScreen *screen; int width, height; @@ -560,7 +585,11 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, g_return_val_if_fail (CAJA_IS_ICON_CANVAS_ITEM (item), NULL); canvas = EEL_CANVAS_ITEM (item)->canvas; +#if GTK_CHECK_VERSION(3,0,0) + screen = gtk_widget_get_screen (GTK_WIDGET (canvas)); +#else screen = gdk_colormap_get_screen (colormap); +#endif /* Assume we're updated so canvas item data is right */ @@ -577,10 +606,16 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, width = EEL_CANVAS_ITEM (item)->x2 - EEL_CANVAS_ITEM (item)->x1; height = EEL_CANVAS_ITEM (item)->y2 - EEL_CANVAS_ITEM (item)->y1; +#if GTK_CHECK_VERSION(3,0,0) + surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen), + CAIRO_CONTENT_COLOR_ALPHA, + width, height); +#else pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, gdk_visual_get_depth (gdk_colormap_get_visual (colormap))); gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), colormap); +#endif pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, @@ -616,12 +651,23 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, } /* draw pixbuf to mask and pixmap */ +#if GTK_CHECK_VERSION(3,0,0) + cr = cairo_create (surface); +#else cr = gdk_cairo_create (pixmap); +#endif cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); cairo_paint (cr); + +#if GTK_CHECK_VERSION(3,0,0) + draw_embedded_text (item, cr, + item_offset_x, item_offset_y); + draw_label_text (item, cr, FALSE, icon_rect); +#endif cairo_destroy (cr); +#if !GTK_CHECK_VERSION(3,0,0) *mask = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, 1); @@ -636,10 +682,15 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, draw_label_text (item, GDK_DRAWABLE (pixmap), FALSE, icon_rect); draw_label_text (item, GDK_DRAWABLE (*mask), TRUE, icon_rect); +#endif g_object_unref (pixbuf); +#if GTK_CHECK_VERSION(3,0,0) + return surface; +#else return pixmap; +#endif } void @@ -1016,7 +1067,11 @@ make_round_rect (cairo_t *cr, static void draw_frame (CajaIconCanvasItem *item, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else GdkDrawable *drawable, +#endif guint color, gboolean create_mask, int x, @@ -1025,12 +1080,14 @@ draw_frame (CajaIconCanvasItem *item, int height) { CajaIconContainer *container; - cairo_t *cr; container = CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas); - /* Get a cairo context */ - cr = gdk_cairo_create (drawable); +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else + cairo_t *cr = gdk_cairo_create (drawable); +#endif /* Set the rounded rect clip region. Magic rounding value taken * from old code. @@ -1054,8 +1111,11 @@ draw_frame (CajaIconCanvasItem *item, /* Paint into drawable now that we have set up the color and opacity */ cairo_fill (cr); - /* Clean up now that drawing is complete */ +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); +#else cairo_destroy (cr); +#endif } /* Keep these for a bit while we work on performance of draw_or_measure_label_text. */ @@ -1363,7 +1423,11 @@ measure_label_text (CajaIconCanvasItem *item) static void draw_label_text (CajaIconCanvasItem *item, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else GdkDrawable *drawable, +#endif gboolean create_mask, EelIRect icon_rect) { @@ -1414,7 +1478,11 @@ draw_label_text (CajaIconCanvasItem *item, if (needs_highlight && !details->is_renaming) { draw_frame (item, +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else drawable, +#endif gtk_widget_has_focus (GTK_WIDGET (container)) ? container->details->highlight_color_rgba : container->details->active_color_rgba, create_mask, is_rtl_label_beside ? text_rect.x0 + item->details->text_dx : text_rect.x0, @@ -1427,11 +1495,24 @@ draw_label_text (CajaIconCanvasItem *item, details->is_highlighted_as_keyboard_focus)) { /* clear the underlying icons, where the text or overlaps them. */ +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); + /* FIMXEchpe draw the background here? */ + cairo_set_source_rgb (cr, 1., 1., 1.); + cairo_rectangle (cr, + text_rect.x0, + text_rect.y0, + text_rect.x1 - text_rect.x0, + text_rect.y1 - text_rect.y0); + cairo_fill (cr); + cairo_restore (cr); +#else gdk_window_clear_area (gtk_layout_get_bin_window (&EEL_CANVAS (container)->layout), text_rect.x0, text_rect.y0, text_rect.x1 - text_rect.x0, text_rect.y1 - text_rect.y0); +#endif } if (container->details->label_position == CAJA_ICON_LABEL_POSITION_BESIDE) @@ -1457,7 +1538,11 @@ draw_label_text (CajaIconCanvasItem *item, if (!(prelight_label && item->details->is_prelit)) { draw_frame (item, +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else drawable, +#endif container->details->normal_color_rgba, create_mask, text_rect.x0, @@ -1468,7 +1553,11 @@ draw_label_text (CajaIconCanvasItem *item, else { draw_frame (item, +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else drawable, +#endif container->details->prelight_color_rgba, create_mask, text_rect.x0, @@ -1483,7 +1572,12 @@ draw_label_text (CajaIconCanvasItem *item, &label_color, TRUE, needs_highlight, prelight_label & item->details->is_prelit); - draw_label_layout (item, drawable, + draw_label_layout (item, +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else + drawable, +#endif editable_layout, needs_highlight, label_color, x, @@ -1500,7 +1594,12 @@ draw_label_text (CajaIconCanvasItem *item, &label_color, FALSE, needs_highlight, FALSE); - draw_label_layout (item, drawable, + draw_label_layout (item, +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else + drawable, +#endif additional_layout, needs_highlight, label_color, x, @@ -1510,7 +1609,11 @@ draw_label_text (CajaIconCanvasItem *item, if (!create_mask && item->details->is_highlighted_as_keyboard_focus) { gtk_paint_focus (gtk_widget_get_style (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas)), +#if GTK_CHECK_VERSION(3,0,0) + cr, +#else drawable, +#endif needs_highlight ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, NULL, GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas), @@ -1592,14 +1695,18 @@ get_knob_pixbuf (void) } static void +#if GTK_CHECK_VERSION(3,0,0) +draw_stretch_handles (CajaIconCanvasItem *item, + cairo_t *cr, +#else draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, +#endif const EelIRect *rect) { GtkWidget *widget; GdkPixbuf *knob_pixbuf; int knob_width, knob_height; double dash = { 2.0 }; - cairo_t *cr; if (!item->details->show_stretch_handles) { @@ -1608,7 +1715,11 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, widget = GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas); - cr = gdk_cairo_create (drawable); +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else + cairo_t *cr = gdk_cairo_create (drawable); +#endif knob_pixbuf = get_knob_pixbuf (); knob_width = gdk_pixbuf_get_width (knob_pixbuf); knob_height = gdk_pixbuf_get_height (knob_pixbuf); @@ -1624,13 +1735,22 @@ draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, rect->y1 - rect->y0 - 1); cairo_stroke (cr); - cairo_destroy (cr); +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); /* draw the stretch handles themselves */ + draw_pixbuf (knob_pixbuf, cr, rect->x0, rect->y0); + draw_pixbuf (knob_pixbuf, cr, rect->x0, rect->y1 - knob_height); + draw_pixbuf (knob_pixbuf, cr, rect->x1 - knob_width, rect->y0); + draw_pixbuf (knob_pixbuf, cr, rect->x1 - knob_width, rect->y1 - knob_height); +#else + cairo_destroy (cr); + draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y0); draw_pixbuf (knob_pixbuf, drawable, rect->x0, rect->y1 - knob_height); draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y0); draw_pixbuf (knob_pixbuf, drawable, rect->x1 - knob_width, rect->y1 - knob_height); +#endif g_object_unref (knob_pixbuf); } @@ -1793,15 +1913,25 @@ emblem_layout_next (EmblemLayout *layout, } static void +#if GTK_CHECK_VERSION(3,0,0) +draw_pixbuf (GdkPixbuf *pixbuf, + cairo_t *cr, + int x, int y) +{ + cairo_save (cr); + gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y); + cairo_paint (cr); + cairo_restore (cr); +} +#else draw_pixbuf (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x, int y) { cairo_t *cr = gdk_cairo_create (drawable); - gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y); cairo_paint (cr); - cairo_destroy (cr); } +#endif /* shared code to highlight or dim the passed-in pixbuf */ static GdkPixbuf * @@ -1967,13 +2097,16 @@ map_pixbuf (CajaIconCanvasItem *icon_item) static void draw_embedded_text (CajaIconCanvasItem *item, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else GdkDrawable *drawable, +#endif int x, int y) { PangoLayout *layout; PangoContext *context; PangoFontDescription *desc; - cairo_t *cr; if (item->details->embedded_text == NULL || item->details->embedded_text_rect.width == 0 || @@ -2002,7 +2135,11 @@ draw_embedded_text (CajaIconCanvasItem *item, } } - cr = gdk_cairo_create (drawable); +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else + cairo_t *cr = gdk_cairo_create (drawable); +#endif cairo_rectangle (cr, x + item->details->embedded_text_rect.x, @@ -2017,13 +2154,23 @@ draw_embedded_text (CajaIconCanvasItem *item, y + item->details->embedded_text_rect.y); pango_cairo_show_layout (cr, layout); +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); +#else cairo_destroy (cr); +#endif } /* Draw the icon item for non-anti-aliased mode. */ static void +#if GTK_CHECK_VERSION(3,0,0) +caja_icon_canvas_item_draw (EelCanvasItem *item, + cairo_t *cr, + cairo_region_t *region) +#else caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose) +#endif { CajaIconCanvasItem *icon_item; CajaIconCanvasItemDetails *details; @@ -2032,7 +2179,6 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkPixbuf *emblem_pixbuf, *temp_pixbuf; GdkRectangle pixbuf_rect; gboolean is_rtl; - cairo_t *cr; icon_item = CAJA_ICON_CANVAS_ITEM (item); details = icon_item->details; @@ -2053,16 +2199,28 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, pixbuf_rect.width = gdk_pixbuf_get_width (temp_pixbuf); pixbuf_rect.height = gdk_pixbuf_get_height (temp_pixbuf); - cr = gdk_cairo_create (drawable); +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else + cairo_t *cr = gdk_cairo_create (drawable); gdk_cairo_rectangle (cr, &expose->area); cairo_clip (cr); +#endif gdk_cairo_set_source_pixbuf (cr, temp_pixbuf, pixbuf_rect.x, pixbuf_rect.y); gdk_cairo_rectangle (cr, &pixbuf_rect); cairo_fill (cr); +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); +#else cairo_destroy (cr); +#endif g_object_unref (temp_pixbuf); +#if GTK_CHECK_VERSION(3,0,0) + draw_embedded_text (icon_item, cr, icon_rect.x0, icon_rect.y0); +#else draw_embedded_text (icon_item, drawable, icon_rect.x0, icon_rect.y0); +#endif is_rtl = caja_icon_container_is_layout_rtl (CAJA_ICON_CONTAINER (item->canvas)); @@ -2070,14 +2228,23 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, emblem_layout_reset (&emblem_layout, icon_item, icon_rect, is_rtl); while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect, is_rtl)) { +#if GTK_CHECK_VERSION(3,0,0) + draw_pixbuf (emblem_pixbuf, cr, emblem_rect.x0, emblem_rect.y0); +#else draw_pixbuf (emblem_pixbuf, drawable, emblem_rect.x0, emblem_rect.y0); +#endif } +#if GTK_CHECK_VERSION(3,0,0) /* Draw stretching handles (if necessary). */ - draw_stretch_handles (icon_item, drawable, &icon_rect); + draw_stretch_handles (icon_item, cr, &icon_rect); /* Draw the label text. */ + draw_label_text (icon_item, cr, FALSE, icon_rect); +#else + draw_stretch_handles (icon_item, drawable, &icon_rect); draw_label_text (icon_item, drawable, FALSE, icon_rect); +#endif } #define ZERO_WIDTH_SPACE "\xE2\x80\x8B" @@ -2195,17 +2362,20 @@ get_label_layout (PangoLayout **layout_cache, static void draw_label_layout (CajaIconCanvasItem *item, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr, +#else GdkDrawable *drawable, +#endif PangoLayout *layout, gboolean highlight, GdkColor *label_color, int x, int y) { - if (drawable == NULL) - { - return; - } +#if !GTK_CHECK_VERSION(3,0,0) + g_return_if_fail (drawable != NULL); +#endif if (item->details->is_renaming) { @@ -2215,7 +2385,11 @@ draw_label_layout (CajaIconCanvasItem *item, if (!highlight && (CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas)->details->use_drop_shadows)) { /* draw a drop shadow */ +#if GTK_CHECK_VERSION(3,0,0) + eel_cairo_draw_layout_with_drop_shadow (cr, +#else eel_gdk_draw_layout_with_drop_shadow (drawable, +#endif label_color, >k_widget_get_style (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas))->black, x, y, @@ -2223,12 +2397,20 @@ draw_label_layout (CajaIconCanvasItem *item, } else { +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else cairo_t *cr = gdk_cairo_create (drawable); +#endif gdk_cairo_set_source_color (cr, label_color); cairo_move_to (cr, x, y); pango_cairo_show_layout (cr, layout); +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore (cr); +#else cairo_destroy (cr); +#endif } } diff --git a/libcaja-private/caja-icon-canvas-item.h b/libcaja-private/caja-icon-canvas-item.h index 27d01867..14b93b63 100644 --- a/libcaja-private/caja-icon-canvas-item.h +++ b/libcaja-private/caja-icon-canvas-item.h @@ -74,9 +74,13 @@ extern "C" { /* attributes */ void caja_icon_canvas_item_set_image (CajaIconCanvasItem *item, GdkPixbuf *image); +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_t* caja_icon_canvas_item_get_drag_surface (CajaIconCanvasItem *item); +#else GdkPixmap * caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, - GdkBitmap **mask, - GdkColormap *colormap); + GdkBitmap **mask, + GdkColormap *colormap); +#endif void caja_icon_canvas_item_set_emblems (CajaIconCanvasItem *item, GList *emblem_pixbufs); void caja_icon_canvas_item_set_show_stretch_handles (CajaIconCanvasItem *item, diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 1ae2cb2a..f3e1ccf8 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -5246,7 +5246,7 @@ caja_icon_container_search_position_func (CajaIconContainer *container, cont_window = gtk_widget_get_window (GTK_WIDGET (container)); - screen = gdk_drawable_get_screen (cont_window); + screen = gdk_window_get_screen (cont_window); monitor_num = gdk_screen_get_monitor_at_window (screen, cont_window); gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); @@ -5256,10 +5256,10 @@ caja_icon_container_search_position_func (CajaIconContainer *container, gdk_window_get_origin (cont_window, &cont_x, &cont_y); #if GTK_CHECK_VERSION(3, 0, 0) - cont_width = gdk_window_get_width(GDK_WINDOW(cont_window)); - cont_height = gdk_window_get_height(GDK_WINDOW(cont_window)); + cont_width = gdk_window_get_width (cont_window); + cont_height = gdk_window_get_height (cont_window); #else - gdk_drawable_get_size(cont_window, &cont_width, &cont_height); + gdk_drawable_get_size (cont_window, &cont_width, &cont_height); #endif gtk_widget_size_request (search_dialog, &requisition); @@ -6110,12 +6110,17 @@ popup_menu (GtkWidget *widget) static void draw_canvas_background (EelCanvas *canvas, +#if GTK_CHECK_VERSION(3,0,0) + cairo_t *cr) +#else int x, int y, int width, int height) +#endif { /* Don't chain up to the parent to avoid clearing and redrawing */ } +#if !GTK_CHECK_VERSION(3,0,0) static gboolean expose_event (GtkWidget *widget, GdkEventExpose *event) @@ -6127,6 +6132,7 @@ expose_event (GtkWidget *widget, return GTK_WIDGET_CLASS (caja_icon_container_parent_class)->expose_event (widget, event); } +#endif static AtkObject * get_accessible (GtkWidget *widget) @@ -6585,7 +6591,9 @@ caja_icon_container_class_init (CajaIconContainerClass *class) widget_class->popup_menu = popup_menu; widget_class->get_accessible = get_accessible; widget_class->style_set = style_set; +#if !GTK_CHECK_VERSION(3,0,0) widget_class->expose_event = expose_event; +#endif widget_class->grab_notify = grab_notify_cb; canvas_class = EEL_CANVAS_CLASS (class); diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 470a767e..67e0dd32 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1495,18 +1495,23 @@ drag_begin_callback (GtkWidget *widget, GdkDragContext *context, gpointer data) { +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_t *surface; +#else CajaIconContainer *container; GdkScreen *screen; GdkColormap *colormap; GdkPixmap *pixmap; GdkBitmap *mask; + gboolean use_mask; +#endif double x1, y1, x2, y2, winx, winy; int x_offset, y_offset; int start_x, start_y; - gboolean use_mask; container = CAJA_ICON_CONTAINER (widget); +#if !GTK_CHECK_VERSION(3,0,0) screen = gtk_widget_get_screen (widget); colormap = NULL; if (gdk_screen_is_composited (screen)) @@ -1524,12 +1529,17 @@ drag_begin_callback (GtkWidget *widget, colormap = gtk_widget_get_colormap (widget); use_mask = TRUE; } +#endif start_x = container->details->dnd_info->drag_info.start_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); start_y = container->details->dnd_info->drag_info.start_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); /* create a pixmap and mask to drag with */ +#if GTK_CHECK_VERSION(3,0,0) + surface = caja_icon_canvas_item_get_drag_surface (container->details->drag_icon->item); +#else pixmap = caja_icon_canvas_item_get_image (container->details->drag_icon->item, &mask, colormap); +#endif /* we want to drag semi-transparent pixbufs, but X is too slow dealing with stippled masks, so we had to remove the code; this comment is left as a memorial @@ -1543,6 +1553,11 @@ drag_begin_callback (GtkWidget *widget, x_offset = start_x - winx; y_offset = start_y - winy; +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_set_device_offset (surface, x_offset, y_offset); + gtk_drag_set_icon_surface (context, surface); + cairo_surface_destroy (surface); +#else if (!use_mask && pixmap != NULL) { cairo_t *cr; @@ -1559,6 +1574,7 @@ drag_begin_callback (GtkWidget *widget, colormap, pixmap, (use_mask ? mask : NULL), x_offset, y_offset); +#endif } void @@ -1593,37 +1609,50 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container, } static gboolean +#if GTK_CHECK_VERSION(3,0,0) +drag_highlight_draw (GtkWidget *widget, + cairo_t *cr, + gpointer user_data) +#else drag_highlight_expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) +#endif { gint x, y, width, height; GdkWindow *window; - cairo_t *cr; x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); + window = gtk_widget_get_window (widget); #if GTK_CHECK_VERSION(3, 0, 0) - width = gdk_window_get_width(GDK_WINDOW(gtk_widget_get_window(widget))); - height = gdk_window_get_height(GDK_WINDOW(gtk_widget_get_window(widget))); -#else - gdk_drawable_get_size(gtk_widget_get_window(widget), &width, &height); -#endif + width = gdk_window_get_width (window); + height = gdk_window_get_height (window); - window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); + gtk_paint_shadow (gtk_widget_get_style (widget), + cr, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, + widget, "dnd", + x, y, width, height); +#else + gdk_drawable_get_size(window, &width, &height); gtk_paint_shadow (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "dnd", x, y, width, height); - cr = gdk_cairo_create (window); + cairo_t *cr = gdk_cairo_create (window); +#endif + cairo_set_line_width (cr, 1.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1); cairo_stroke (cr); +#if !GTK_CHECK_VERSION(3,0,0) cairo_destroy (cr); +#endif return FALSE; } @@ -1682,8 +1711,13 @@ start_dnd_highlight (GtkWidget *widget) if (!dnd_info->highlighted) { dnd_info->highlighted = TRUE; +#if GTK_CHECK_VERSION(3,0,0) + g_signal_connect_after (widget, "draw", + G_CALLBACK (drag_highlight_draw), +#else g_signal_connect_after (widget, "expose_event", G_CALLBACK (drag_highlight_expose), +#endif NULL); dnd_highlight_queue_redraw (widget); } @@ -1699,7 +1733,11 @@ stop_dnd_highlight (GtkWidget *widget) if (dnd_info->highlighted) { g_signal_handlers_disconnect_by_func (widget, +#if GTK_CHECK_VERSION(3,0,0) + drag_highlight_draw, +#else drag_highlight_expose, +#endif NULL); dnd_highlight_queue_redraw (widget); dnd_info->highlighted = FALSE; diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c index 1c25c452..d7a8d2b6 100644 --- a/libcaja-private/caja-tree-view-drag-dest.c +++ b/libcaja-private/caja-tree-view-drag-dest.c @@ -186,35 +186,42 @@ remove_expand_timeout (CajaTreeViewDragDest *dest) } static gboolean +#if GTK_CHECK_VERSION(3,0,0) +highlight_draw (GtkWidget *widget, + cairo_t *cr, + gpointer data) +#else highlight_expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) +#endif { GdkWindow *bin_window; int width; int height; - if (gtk_widget_is_drawable (widget)) - { - bin_window = - gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget)); + /* FIXMEchpe: is bin window right here??? */ + bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget)); #if GTK_CHECK_VERSION(3, 0, 0) - width = gdk_window_get_width(GDK_WINDOW(bin_window)); - height = gdk_window_get_height(GDK_WINDOW(bin_window)); + width = gdk_window_get_width(bin_window); + height = gdk_window_get_height(bin_window); #else - gdk_drawable_get_size(bin_window, &width, &height); + gdk_drawable_get_size(bin_window, &width, &height); #endif - - gtk_paint_focus (gtk_widget_get_style (widget), - bin_window, - gtk_widget_get_state (widget), - NULL, - widget, - "treeview-drop-indicator", - 0, 0, width, height); - } + gtk_paint_focus (gtk_widget_get_style (widget), +#if GTK_CHECK_VERSION(3,0,0) + cr, + gtk_widget_get_state (widget), +#else + bin_window, + gtk_widget_get_state (widget), + NULL, +#endif + widget, + "treeview-drop-indicator", + 0, 0, width, height); return FALSE; } @@ -234,8 +241,13 @@ set_widget_highlight (CajaTreeViewDragDest *dest, gboolean highlight) { dest->details->highlight_id = g_signal_connect_object (dest->details->tree_view, +#if GTK_CHECK_VERSION(3,0,0) + "draw", + G_CALLBACK (highlight_draw), +#else "expose_event", G_CALLBACK (highlight_expose), +#endif dest, 0); gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view)); } -- cgit v1.2.1 From e5b2fbf43e1c1ad5552abb004e5ebc4beb17ce2c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 00:14:30 +0200 Subject: [icon-container] use gtk_widget_get_preferred_size() http://git.gnome.org/browse/nautilus/commit/?id=e56241830bfd2ca470ec2b1da53313c2230bc2b9 --- libcaja-private/caja-icon-container.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index f3e1ccf8..583b6c85 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -5258,11 +5258,13 @@ caja_icon_container_search_position_func (CajaIconContainer *container, #if GTK_CHECK_VERSION(3, 0, 0) cont_width = gdk_window_get_width (cont_window); cont_height = gdk_window_get_height (cont_window); + + gtk_widget_get_preferred_size (search_dialog, &requisition, NULL); #else gdk_drawable_get_size (cont_window, &cont_width, &cont_height); -#endif gtk_widget_size_request (search_dialog, &requisition); +#endif if (cont_x + cont_width - requisition.width > gdk_screen_get_width (screen)) { -- cgit v1.2.1 From f4babe394d101d2053b3358fcb6bfb489b1e2d58 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:15:15 +0200 Subject: [icon-canvas-item] set transparent background for highlight http://git.gnome.org/browse/nautilus/commit/?id=c6860491c432e311d585a6d92443ef821afd46d2 --- libcaja-private/caja-icon-canvas-item.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index e8b1762c..eb6f4ffd 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -1497,8 +1497,7 @@ draw_label_text (CajaIconCanvasItem *item, /* clear the underlying icons, where the text or overlaps them. */ #if GTK_CHECK_VERSION(3,0,0) cairo_save (cr); - /* FIMXEchpe draw the background here? */ - cairo_set_source_rgb (cr, 1., 1., 1.); + cairo_set_source_rgba (cr, 0, 0, 0, 0); cairo_rectangle (cr, text_rect.x0, text_rect.y0, -- cgit v1.2.1 From b6b774806a7198d46edd701054cc73989dc3e200 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:51:02 +0200 Subject: [icon-canvas-item] use cairo directly instead of gdk_pixbuf_composite() http://git.gnome.org/browse/nautilus/commit/?id=a136af0a01c160cdfb513c531b910b49a4a62973 --- libcaja-private/caja-icon-canvas-item.c | 45 ++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index eb6f4ffd..9f6992cf 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -568,6 +568,7 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, cairo_surface_t *surface; #else GdkPixmap *pixmap; + GdkPixbuf *pixbuf; #endif EelCanvas *canvas; GdkScreen *screen; @@ -575,7 +576,6 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, int item_offset_x, item_offset_y; EelIRect icon_rect; EelIRect emblem_rect; - GdkPixbuf *pixbuf; GdkPixbuf *emblem_pixbuf; EmblemLayout emblem_layout; double item_x, item_y; @@ -610,12 +610,19 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen), CAIRO_CONTENT_COLOR_ALPHA, width, height); + + cr = cairo_create (surface); + gdk_cairo_set_source_pixbuf (cr, item->details->pixbuf, + item_offset_x, item_offset_y); + cairo_rectangle (cr, item_offset_x, item_offset_y, + gdk_pixbuf_get_width (item->details->pixbuf), + gdk_pixbuf_get_height (item->details->pixbuf)); + cairo_fill (cr); #else pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, gdk_visual_get_depth (gdk_colormap_get_visual (colormap))); gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), colormap); -#endif pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, @@ -629,16 +636,33 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, gdk_pixbuf_get_height (item->details->pixbuf), item_offset_x, item_offset_y, 1.0, 1.0, GDK_INTERP_BILINEAR, 255); +#endif icon_rect.x0 = item_offset_x; icon_rect.y0 = item_offset_y; icon_rect.x1 = item_offset_x + gdk_pixbuf_get_width (item->details->pixbuf); icon_rect.y1 = item_offset_y + gdk_pixbuf_get_height (item->details->pixbuf); - is_rtl = caja_icon_container_is_layout_rtl (CAJA_ICON_CONTAINER (canvas)); emblem_layout_reset (&emblem_layout, item, icon_rect, is_rtl); +#if GTK_CHECK_VERSION(3,0,0) + while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect, is_rtl)) + { + gdk_cairo_set_source_pixbuf (cr, emblem_pixbuf, emblem_rect.x0, emblem_rect.y0); + cairo_rectangle (cr, emblem_rect.x0, emblem_rect.y0, + gdk_pixbuf_get_width (emblem_pixbuf), + gdk_pixbuf_get_height (emblem_pixbuf)); + cairo_fill (cr); + } + + draw_embedded_text (item, cr, + item_offset_x, item_offset_y); + draw_label_text (item, cr, FALSE, icon_rect); + cairo_destroy (cr); + + return surface; +#else while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect, is_rtl)) { gdk_pixbuf_composite (emblem_pixbuf, pixbuf, @@ -651,23 +675,12 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, } /* draw pixbuf to mask and pixmap */ -#if GTK_CHECK_VERSION(3,0,0) - cr = cairo_create (surface); -#else cr = gdk_cairo_create (pixmap); -#endif cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); cairo_paint (cr); - -#if GTK_CHECK_VERSION(3,0,0) - draw_embedded_text (item, cr, - item_offset_x, item_offset_y); - draw_label_text (item, cr, FALSE, icon_rect); -#endif cairo_destroy (cr); -#if !GTK_CHECK_VERSION(3,0,0) *mask = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, 1); @@ -682,13 +695,9 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, draw_label_text (item, GDK_DRAWABLE (pixmap), FALSE, icon_rect); draw_label_text (item, GDK_DRAWABLE (*mask), TRUE, icon_rect); -#endif g_object_unref (pixbuf); -#if GTK_CHECK_VERSION(3,0,0) - return surface; -#else return pixmap; #endif } -- cgit v1.2.1 From 07bbb722c57b1f985a8750db9776099f1fadf7f6 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:53:55 +0200 Subject: [icon-dnd] use negative device offsets to set the drag surface http://git.gnome.org/browse/nautilus/commit/?id=f38bad2536faf497fe56c9a491ab852cb00514c0 --- libcaja-private/caja-icon-dnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 67e0dd32..308715fa 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1554,7 +1554,7 @@ drag_begin_callback (GtkWidget *widget, y_offset = start_y - winy; #if GTK_CHECK_VERSION(3,0,0) - cairo_surface_set_device_offset (surface, x_offset, y_offset); + cairo_surface_set_device_offset (surface, -x_offset, -y_offset); gtk_drag_set_icon_surface (context, surface); cairo_surface_destroy (surface); #else -- cgit v1.2.1 From b1cb355a3a65d11101d55846803cbf0296e22da5 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:57:24 +0200 Subject: [icon-dnd] cleanup useless comment removing old comment, keeping old pixmap/mask code around for GTK2 was: icon-dnd: cleanup useless code http://git.gnome.org/browse/nautilus/commit/?id=098057414b38aeeddd3fcd81942324336628d341 --- libcaja-private/caja-icon-dnd.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 308715fa..5aa48669 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1541,10 +1541,6 @@ drag_begin_callback (GtkWidget *widget, pixmap = caja_icon_canvas_item_get_image (container->details->drag_icon->item, &mask, colormap); #endif - /* we want to drag semi-transparent pixbufs, but X is too slow dealing with - stippled masks, so we had to remove the code; this comment is left as a memorial - to it, with the hope that we get it back someday as X Windows improves */ - /* compute the image's offset */ eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (container->details->drag_icon->item), &x1, &y1, &x2, &y2); -- cgit v1.2.1 From 767734608e245a3a6684e1087fa9e11280296004 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 03:51:08 +0200 Subject: [cell-renderer-text-ellipsized] use new GtkSizeRequest vfunctions This fixes the 'Name' column being too thin in list view. http://git.gnome.org/browse/nautilus/commit/?id=33c9b6d24a60079fe6c4c1be281c76f43def6fee --- .../caja-cell-renderer-text-ellipsized.c | 88 ++++++++++++++-------- 1 file changed, 57 insertions(+), 31 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-cell-renderer-text-ellipsized.c b/libcaja-private/caja-cell-renderer-text-ellipsized.c index 4c3cd443..ad535a5d 100644 --- a/libcaja-private/caja-cell-renderer-text-ellipsized.c +++ b/libcaja-private/caja-cell-renderer-text-ellipsized.c @@ -26,55 +26,81 @@ #include "caja-cell-renderer-text-ellipsized.h" -#define ELLIPSIZE_PROP "ellipsize" - -static void caja_cell_renderer_text_ellipsized_get_size (GtkCellRenderer *cell, - GtkWidget *widget, - GdkRectangle *rectangle, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height); - G_DEFINE_TYPE (CajaCellRendererTextEllipsized, caja_cell_renderer_text_ellipsized, GTK_TYPE_CELL_RENDERER_TEXT); +#if GTK_CHECK_VERSION(3,0,0) static void caja_cell_renderer_text_ellipsized_init (CajaCellRendererTextEllipsized *cell) { - g_object_set (cell, ELLIPSIZE_PROP, PANGO_ELLIPSIZE_END, NULL); + g_object_set (cell, + "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, + NULL); } static void -caja_cell_renderer_text_ellipsized_class_init (CajaCellRendererTextEllipsizedClass *klass) +nautilus_cell_renderer_text_ellipsized_get_preferred_width (GtkCellRenderer *cell, + GtkWidget *widget, + gint *minimum_size, + gint *natural_size) { - GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass); - - cell_class->get_size = caja_cell_renderer_text_ellipsized_get_size; + g_object_set (cell, + "ellipsize", PANGO_ELLIPSIZE_NONE, + "ellipsize-set", FALSE, + NULL); + + GTK_CELL_RENDERER_CLASS + (nautilus_cell_renderer_text_ellipsized_parent_class)->get_preferred_width (cell, widget, + minimum_size, natural_size); + + g_object_set (cell, + "ellipsize", PANGO_ELLIPSIZE_END, + "ellipsize-set", TRUE, + NULL); } - -GtkCellRenderer * -caja_cell_renderer_text_ellipsized_new (void) +#else /* GTK_CHECK_VERSION(3,0,0) */ +static void +caja_cell_renderer_text_ellipsized_init (CajaCellRendererTextEllipsized *cell) { - return g_object_new (CAJA_TYPE_CELL_RENDERER_TEXT_ELLIPSIZED, NULL); + g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); } static void caja_cell_renderer_text_ellipsized_get_size (GtkCellRenderer *cell, - GtkWidget *widget, - GdkRectangle *cell_area, - gint *x_offset, - gint *y_offset, - gint *width, - gint *height) + GtkWidget *widget, + GdkRectangle *cell_area, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height) { - g_object_set (cell, ELLIPSIZE_PROP, PANGO_ELLIPSIZE_NONE, NULL); + g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_NONE, NULL); - (* GTK_CELL_RENDERER_CLASS (caja_cell_renderer_text_ellipsized_parent_class)->get_size) - (cell, widget, cell_area, - x_offset, y_offset, - width, height); + GTK_CELL_RENDERER_CLASS + (caja_cell_renderer_text_ellipsized_parent_class)->get_size (cell, widget, + cell_area, + x_offset, y_offset, + width, height); - g_object_set (cell, ELLIPSIZE_PROP, PANGO_ELLIPSIZE_END, NULL); + g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); } +#endif /* GTK_CHECK_VERSION(3,0,0) */ +static void +caja_cell_renderer_text_ellipsized_class_init (CajaCellRendererTextEllipsizedClass *klass) +{ + GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass); + +#if GTK_CHECK_VERSION(3,0,0) + cell_class->get_preferred_width = caja_cell_renderer_text_ellipsized_get_preferred_width; +#else + cell_class->get_size = caja_cell_renderer_text_ellipsized_get_size; +#endif +} + +GtkCellRenderer * +caja_cell_renderer_text_ellipsized_new (void) +{ + return g_object_new (CAJA_TYPE_CELL_RENDERER_TEXT_ELLIPSIZED, NULL); +} -- cgit v1.2.1 From aa6696e05a7c2614eccde660bf06554735ace3e2 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 7 Nov 2012 01:43:35 +0200 Subject: [horizontal-splitter] remove, and use a regular GtkPaned instead The feature it was bringing in (shrink when the paned handle is double-clicked) is even confusing. http://git.gnome.org/browse/nautilus/commit/?id=1620bd8a4e4ab1760c5c518dd954a4471645ce87 --- libcaja-private/Makefile.am | 2 - libcaja-private/caja-horizontal-splitter.c | 307 ----------------------------- libcaja-private/caja-horizontal-splitter.h | 76 ------- 3 files changed, 385 deletions(-) delete mode 100644 libcaja-private/caja-horizontal-splitter.c delete mode 100644 libcaja-private/caja-horizontal-splitter.h (limited to 'libcaja-private') diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index cbf91983..55cadeee 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -105,8 +105,6 @@ libcaja_private_la_SOURCES = \ caja-file.h \ caja-global-preferences.c \ caja-global-preferences.h \ - caja-horizontal-splitter.c \ - caja-horizontal-splitter.h \ caja-icon-canvas-item.c \ caja-icon-canvas-item.h \ caja-icon-container.c \ diff --git a/libcaja-private/caja-horizontal-splitter.c b/libcaja-private/caja-horizontal-splitter.c deleted file mode 100644 index 0fbaa3c4..00000000 --- a/libcaja-private/caja-horizontal-splitter.c +++ /dev/null @@ -1,307 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* caja-horizontal-splitter.c - A horizontal splitter with a semi gradient look - - Copyright (C) 1999, 2000 Eazel, Inc. - - The Mate Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Mate Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Mate Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. - - Authors: Ramiro Estrugo -*/ - -#include -#include "caja-horizontal-splitter.h" - -#include -#include - -struct CajaHorizontalSplitterDetails -{ - guint32 press_time; - int press_position; - int saved_size; -}; - -#define CLOSED_THRESHOLD 4 -#define NOMINAL_SIZE 148 -#define SPLITTER_CLICK_SLOP 4 -#define SPLITTER_CLICK_TIMEOUT 400 - -static void caja_horizontal_splitter_class_init (CajaHorizontalSplitterClass *horizontal_splitter_class); -static void caja_horizontal_splitter_init (CajaHorizontalSplitter *horizontal_splitter); - -EEL_CLASS_BOILERPLATE (CajaHorizontalSplitter, - caja_horizontal_splitter, - GTK_TYPE_HPANED) - -static void -caja_horizontal_splitter_init (CajaHorizontalSplitter *horizontal_splitter) -{ - horizontal_splitter->details = g_new0 (CajaHorizontalSplitterDetails, 1); -} - -static void -caja_horizontal_splitter_finalize (GObject *object) -{ - CajaHorizontalSplitter *horizontal_splitter; - - horizontal_splitter = CAJA_HORIZONTAL_SPLITTER (object); - - g_free (horizontal_splitter->details); - - EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); -} - -static void -splitter_expand (CajaHorizontalSplitter *splitter, int position) -{ - g_assert (CAJA_IS_HORIZONTAL_SPLITTER (splitter)); - - if (position >= CLOSED_THRESHOLD) - { - return; - } - - position = splitter->details->saved_size; - if (position < CLOSED_THRESHOLD) - { - position = NOMINAL_SIZE; - } - - gtk_paned_set_position (GTK_PANED (splitter), position); -} - -static void -splitter_collapse (CajaHorizontalSplitter *splitter, int position) -{ - g_assert (CAJA_IS_HORIZONTAL_SPLITTER (splitter)); - - splitter->details->saved_size = position; - gtk_paned_set_position (GTK_PANED (splitter), 0); -} - -static void -splitter_toggle (CajaHorizontalSplitter *splitter, int position) -{ - g_assert (CAJA_IS_HORIZONTAL_SPLITTER (splitter)); - - if (gtk_paned_get_position (GTK_PANED (splitter)) >= CLOSED_THRESHOLD) - { - caja_horizontal_splitter_collapse (splitter); - } - else - { - caja_horizontal_splitter_expand (splitter); - } -} - -static void -splitter_hide (CajaHorizontalSplitter *splitter) -{ - GtkPaned *parent; - - parent = GTK_PANED (splitter); - - gtk_widget_hide (gtk_paned_get_child1 (parent)); -} - -static void -splitter_show (CajaHorizontalSplitter *splitter) -{ - GtkPaned *parent; - - parent = GTK_PANED (splitter); - - gtk_widget_show (gtk_paned_get_child1 (parent)); -} - -static gboolean -splitter_is_hidden (CajaHorizontalSplitter *splitter) -{ - GtkPaned *parent; - - parent = GTK_PANED (splitter); - - return gtk_widget_get_visible (gtk_paned_get_child1 (parent)); -} - -void -caja_horizontal_splitter_expand (CajaHorizontalSplitter *splitter) -{ - splitter_expand (splitter, gtk_paned_get_position (GTK_PANED (splitter))); -} - -void -caja_horizontal_splitter_hide (CajaHorizontalSplitter *splitter) -{ - splitter_hide (splitter); -} - -void -caja_horizontal_splitter_show (CajaHorizontalSplitter *splitter) -{ - splitter_show (splitter); -} - -gboolean -caja_horizontal_splitter_is_hidden (CajaHorizontalSplitter *splitter) -{ - return splitter_is_hidden (splitter); -} - -void -caja_horizontal_splitter_collapse (CajaHorizontalSplitter *splitter) -{ - splitter_collapse (splitter, gtk_paned_get_position (GTK_PANED (splitter))); -} - -/* routine to toggle the open/closed state of the splitter */ -void -caja_horizontal_splitter_toggle_position (CajaHorizontalSplitter *splitter) -{ - splitter_toggle (splitter, gtk_paned_get_position (GTK_PANED (splitter))); -} - -/* CajaHorizontalSplitter public methods */ -GtkWidget * -caja_horizontal_splitter_new (void) -{ - return gtk_widget_new (caja_horizontal_splitter_get_type (), NULL); -} - -/* handle mouse downs by remembering the position and the time */ -static gboolean -caja_horizontal_splitter_button_press (GtkWidget *widget, GdkEventButton *event) -{ - gboolean result; - CajaHorizontalSplitter *splitter; - int position; - - splitter = CAJA_HORIZONTAL_SPLITTER (widget); - - position = gtk_paned_get_position (GTK_PANED (widget)); - - result = EEL_CALL_PARENT_WITH_RETURN_VALUE - (GTK_WIDGET_CLASS, button_press_event, (widget, event)); - - if (result) - { - splitter->details->press_time = event->time; - splitter->details->press_position = position; - } - - return result; -} - -/* handle mouse ups by seeing if it was a tap and toggling the open state accordingly */ -static gboolean -caja_horizontal_splitter_button_release (GtkWidget *widget, GdkEventButton *event) -{ - gboolean result; - CajaHorizontalSplitter *splitter; - int position, delta, delta_time; - splitter = CAJA_HORIZONTAL_SPLITTER (widget); - - position = gtk_paned_get_position (GTK_PANED (widget)); - - result = EEL_CALL_PARENT_WITH_RETURN_VALUE - (GTK_WIDGET_CLASS, button_release_event, (widget, event)); - - if (result) - { - delta = abs (position - splitter->details->press_position); - delta_time = event->time - splitter->details->press_time; - if (delta < SPLITTER_CLICK_SLOP && delta_time < SPLITTER_CLICK_TIMEOUT) - { - caja_horizontal_splitter_toggle_position (splitter); - } - } - - return result; -} - -static void -caja_horizontal_splitter_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - gint border_width; - GtkPaned *paned; - GtkAllocation child_allocation; - GtkRequisition child_requisition; - - paned = GTK_PANED (widget); - border_width = gtk_container_get_border_width (GTK_CONTAINER (paned)); - - gtk_widget_set_allocation (widget, allocation); - - if (gtk_paned_get_child2 (paned) != NULL && gtk_widget_get_visible (gtk_paned_get_child2 (paned))) - { - EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate, - (widget, allocation)); - } - else if (gtk_paned_get_child1 (paned) && gtk_widget_get_visible (gtk_paned_get_child1 (paned))) - { - - if (gtk_widget_get_realized (widget)) - { - gdk_window_hide (gtk_paned_get_handle_window (paned)); - } - - gtk_widget_get_child_requisition (gtk_paned_get_child1 (paned), - &child_requisition); - - child_allocation.x = allocation->x + border_width; - child_allocation.y = allocation->y + border_width; - child_allocation.width = MIN (child_requisition.width, - allocation->width - 2 * border_width); - child_allocation.height = MIN (child_requisition.height, - allocation->height - 2 * border_width); - - gtk_widget_size_allocate (gtk_paned_get_child1 (paned), &child_allocation); - } - else if (gtk_widget_get_realized (widget)) - { - gdk_window_hide (gtk_paned_get_handle_window (paned)); - } - -} - -static void -caja_horizontal_splitter_class_init (CajaHorizontalSplitterClass *class) -{ - GtkWidgetClass *widget_class; - - widget_class = GTK_WIDGET_CLASS (class); - - G_OBJECT_CLASS (class)->finalize = caja_horizontal_splitter_finalize; - - widget_class->size_allocate = caja_horizontal_splitter_size_allocate; - widget_class->button_press_event = caja_horizontal_splitter_button_press; - widget_class->button_release_event = caja_horizontal_splitter_button_release; -} - -void -caja_horizontal_splitter_pack2 (CajaHorizontalSplitter *splitter, - GtkWidget *child2) -{ - GtkPaned *paned; - - g_return_if_fail (GTK_IS_WIDGET (child2)); - g_return_if_fail (CAJA_IS_HORIZONTAL_SPLITTER (splitter)); - - paned = GTK_PANED (splitter); - gtk_paned_pack2 (paned, child2, TRUE, FALSE); -} diff --git a/libcaja-private/caja-horizontal-splitter.h b/libcaja-private/caja-horizontal-splitter.h deleted file mode 100644 index b0fdcf4a..00000000 --- a/libcaja-private/caja-horizontal-splitter.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* caja-horizontal-splitter.h - A horizontal splitter with a semi gradient look - - Copyright (C) 1999, 2000 Eazel, Inc. - - The Mate Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Mate Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Mate Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301, USA. - - Authors: Ramiro Estrugo -*/ - -#ifndef CAJA_HORIZONTAL_SPLITTER_H -#define CAJA_HORIZONTAL_SPLITTER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define CAJA_TYPE_HORIZONTAL_SPLITTER caja_horizontal_splitter_get_type() -#define CAJA_HORIZONTAL_SPLITTER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_HORIZONTAL_SPLITTER, CajaHorizontalSplitter)) -#define CAJA_HORIZONTAL_SPLITTER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), CAJA_TYPE_HORIZONTAL_SPLITTER, CajaHorizontalSplitterClass)) -#define CAJA_IS_HORIZONTAL_SPLITTER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAJA_TYPE_HORIZONTAL_SPLITTER)) -#define CAJA_IS_HORIZONTAL_SPLITTER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), CAJA_TYPE_HORIZONTAL_SPLITTER)) -#define CAJA_HORIZONTAL_SPLITTER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_HORIZONTAL_SPLITTER, CajaHorizontalSplitterClass)) - - typedef struct CajaHorizontalSplitterDetails CajaHorizontalSplitterDetails; - - typedef struct - { - GtkHPaned parent_slot; - CajaHorizontalSplitterDetails *details; - } CajaHorizontalSplitter; - - typedef struct - { - GtkHPanedClass parent_slot; - } CajaHorizontalSplitterClass; - - /* CajaHorizontalSplitter public methods */ - GType caja_horizontal_splitter_get_type (void); - GtkWidget *caja_horizontal_splitter_new (void); - - gboolean caja_horizontal_splitter_is_hidden (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_collapse (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_hide (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_show (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_expand (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_toggle_position (CajaHorizontalSplitter *splitter); - void caja_horizontal_splitter_pack2 (CajaHorizontalSplitter *splitter, - GtkWidget *child2); - -#ifdef __cplusplus -} -#endif - -#endif /* CAJA_HORIZONTAL_SPLITTER_H */ -- cgit v1.2.1 From 29bf2205fbea100f3b799560a4d5b4ffece1ac53 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 7 Nov 2012 01:53:16 +0200 Subject: [column-utilities] disable SELinux column if !HAVE_SELINUX http://git.gnome.org/browse/nautilus/commit/?id=b0550951f461c2033f4d1aaa4404078c7a70f220 --- libcaja-private/caja-column-utilities.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-column-utilities.c b/libcaja-private/caja-column-utilities.c index 3b789221..d649f518 100644 --- a/libcaja-private/caja-column-utilities.c +++ b/libcaja-private/caja-column-utilities.c @@ -113,6 +113,7 @@ get_builtin_columns (void) "label", _("MIME Type"), "description", _("The mime type of the file."), NULL)); +#ifdef HAVE_SELINUX columns = g_list_append (columns, g_object_new (CAJA_TYPE_COLUMN, "name", "selinux_context", @@ -120,6 +121,7 @@ get_builtin_columns (void) "label", _("SELinux Context"), "description", _("The SELinux security context of the file."), NULL)); +#endif columns = g_list_append (columns, g_object_new (CAJA_TYPE_COLUMN, "name", "where", -- cgit v1.2.1 From 01a922551d410ecb11e4eb1477cfe3f33bff3491 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 7 Nov 2012 01:54:48 +0200 Subject: [column-utilities] fix a TODO about a missing description string http://git.gnome.org/browse/nautilus/commit/?id=0f8dcf2ac394121c488afdf0fecc2b7afeb673b6 --- libcaja-private/caja-column-utilities.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-column-utilities.c b/libcaja-private/caja-column-utilities.c index d649f518..1ba570df 100644 --- a/libcaja-private/caja-column-utilities.c +++ b/libcaja-private/caja-column-utilities.c @@ -127,8 +127,7 @@ get_builtin_columns (void) "name", "where", "attribute", "where", "label", _("Location"), - /* TODO: Change after string freeze over */ - "description", _("Location"), + "description", _("The location of the file."), NULL)); return columns; -- cgit v1.2.1 From 5ee6f114f83b68d02e7d5b723090f1dfe8c443ca Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 06:40:35 +0200 Subject: [general] use new GtkScrollable interface http://git.gnome.org/browse/nautilus/commit/?id=d811553a4e74106efdf8bf6c91c6d29944ed6df7 canvas: use GTK_LAYOUT casts instead of going through the parent struct http://git.gnome.org/browse/nautilus/commit/?id=2260005986d8c620669e56c4b9f2fba12e8e0625 --- libcaja-private/caja-icon-container.c | 52 +++++++++++++++++------------- libcaja-private/caja-icon-dnd.c | 42 ++++++++++++++++-------- libcaja-private/caja-tree-view-drag-dest.c | 4 +-- 3 files changed, 59 insertions(+), 39 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 583b6c85..e88cac74 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -52,6 +52,12 @@ #include #include +#if !GTK_CHECK_VERSION(3, 0, 0) +#define gtk_scrollable_get_hadjustment gtk_layout_get_hadjustment +#define gtk_scrollable_get_vadjustment gtk_layout_get_vadjustment +#define GTK_SCROLLABLE GTK_LAYOUT +#endif + #define TAB_NAVIGATION_DISABLED /* Interval for updating the rubberband selection, in milliseconds. */ @@ -591,8 +597,8 @@ caja_icon_container_scroll (CajaIconContainer *container, GtkAdjustment *hadj, *vadj; int old_h_value, old_v_value; - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)); /* Store the old ajustment values so we can tell if we * ended up actually scrolling. We may not have in a case @@ -754,8 +760,8 @@ reveal_icon (CajaIconContainer *container, details = container->details; gtk_widget_get_allocation (GTK_WIDGET (container), &allocation); - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)); if (caja_icon_container_is_auto_layout (container)) { @@ -1087,8 +1093,8 @@ canvas_set_scroll_region_include_visible_area (EelCanvas *canvas, width = (allocation.width) / canvas->pixels_per_unit; height = (allocation.height) / canvas->pixels_per_unit; - old_scroll_x = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas)))); - old_scroll_y = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas)))); + old_scroll_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas))); + old_scroll_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas))); x1 = MIN (x1, old_x1 + old_scroll_x); y1 = MIN (y1, old_y1 + old_scroll_y); @@ -1212,8 +1218,8 @@ caja_icon_container_update_scroll_region (CajaIconContainer *container) x1, y1, x2, y2); } - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)); /* Scroll by 1/4 icon each time you click. */ step_increment = caja_get_icon_size_for_zoom_level @@ -2775,14 +2781,14 @@ rubberband_timeout_callback (gpointer data) adj_changed = FALSE; gtk_widget_get_allocation (widget, &allocation); - adj_x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); + adj_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); if (adj_x != band_info->last_adj_x) { band_info->last_adj_x = adj_x; adj_changed = TRUE; } - adj_y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + adj_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); if (adj_y != band_info->last_adj_y) { band_info->last_adj_y = adj_y; @@ -2831,8 +2837,8 @@ rubberband_timeout_callback (gpointer data) /* Remember to convert from widget to scrolled window coords */ eel_canvas_window_to_world (EEL_CANVAS (container), - x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))), - y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))), + x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))), + y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))), &world_x, &world_y); if (world_x < band_info->start_x) @@ -2953,8 +2959,8 @@ start_rubberbanding (CajaIconContainer *container, atk_object_set_name (accessible, "selection"); atk_object_set_description (accessible, _("The selection rectangle")); - band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); band_info->active = TRUE; @@ -4588,11 +4594,11 @@ realize (GtkWidget *widget) setup_label_gcs (container); - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (widget)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget)); g_signal_connect (hadj, "value_changed", G_CALLBACK (handle_hadjustment_changed), widget); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (widget)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget)); g_signal_connect (vadj, "value_changed", G_CALLBACK (handle_vadjustment_changed), widget); @@ -7192,9 +7198,9 @@ caja_icon_container_get_first_visible_icon (CajaIconContainer *container) gboolean better_icon; gboolean compare_lt; - hadj_v = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - vadj_v = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); - h_page_size = gtk_adjustment_get_page_size (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); + hadj_v = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + vadj_v = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); + h_page_size = gtk_adjustment_get_page_size (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); if (caja_icon_container_is_layout_rtl (container)) { @@ -7283,8 +7289,8 @@ caja_icon_container_scroll_to_icon (CajaIconContainer *container, EelIRect bounds; GtkAllocation allocation; - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)); gtk_widget_get_allocation (GTK_WIDGET (container), &allocation); /* We need to force a relayout now if there are updates queued @@ -7616,8 +7622,8 @@ caja_icon_container_update_visible_icons (CajaIconContainer *container) gboolean visible; GtkAllocation allocation; - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container)); + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)); gtk_widget_get_allocation (GTK_WIDGET (container), &allocation); min_x = gtk_adjustment_get_value (hadj); diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 5aa48669..cae6e4ee 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -60,6 +60,12 @@ #include #include +#if !GTK_CHECK_VERSION(3, 0, 0) +#define gtk_scrollable_get_hadjustment gtk_layout_get_hadjustment +#define gtk_scrollable_get_vadjustment gtk_layout_get_vadjustment +#define GTK_SCROLLABLE GTK_LAYOUT +#endif + static const GtkTargetEntry drag_types [] = { { CAJA_ICON_DND_MATE_ICON_LIST_TYPE, 0, CAJA_ICON_DND_MATE_ICON_LIST }, @@ -197,6 +203,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas, EelIRect *widget_rect) { EelDRect window_rect; + GtkAdjustment *hadj, *vadj; + + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)); eel_canvas_world_to_window (canvas, world_rect->x0, world_rect->y0, @@ -204,10 +214,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas, eel_canvas_world_to_window (canvas, world_rect->x1, world_rect->y1, &window_rect.x1, &window_rect.y1); - widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))); - widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))); - widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))); - widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))); + widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (hadj); + widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (vadj); + widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (hadj); + widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (vadj); } static void @@ -216,8 +226,8 @@ canvas_widget_to_world (EelCanvas *canvas, double *world_x, double *world_y) { eel_canvas_window_to_world (canvas, - widget_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))), - widget_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))), + widget_x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas))), + widget_y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas))), world_x, world_y); } @@ -1267,8 +1277,8 @@ caja_icon_container_receive_dropped_icons (CajaIconContainer *container, if (real_action > 0) { eel_canvas_window_to_world (EEL_CANVAS (container), - x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))), - y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))), + x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))), + y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))), &world_x, &world_y); drop_target = caja_icon_container_find_drop_target (container, @@ -1531,8 +1541,10 @@ drag_begin_callback (GtkWidget *widget, } #endif - start_x = container->details->dnd_info->drag_info.start_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - start_y = container->details->dnd_info->drag_info.start_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + start_x = container->details->dnd_info->drag_info.start_x + + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + start_y = container->details->dnd_info->drag_info.start_y + + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); /* create a pixmap and mask to drag with */ #if GTK_CHECK_VERSION(3,0,0) @@ -1593,8 +1605,10 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container, /* Notice that the event is in bin_window coordinates, because of the way the canvas handles events. */ - dnd_info->drag_info.start_x = start_x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - dnd_info->drag_info.start_y = start_y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + dnd_info->drag_info.start_x = start_x - + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + dnd_info->drag_info.start_y = start_y - + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); /* start the drag */ context = gtk_drag_begin (GTK_WIDGET (container), @@ -1618,8 +1632,8 @@ drag_highlight_expose (GtkWidget *widget, gint x, y, width, height; GdkWindow *window; - x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); - y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); + x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget))); + y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget))); window = gtk_widget_get_window (widget); #if GTK_CHECK_VERSION(3, 0, 0) diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c index d7a8d2b6..56e9a1cd 100644 --- a/libcaja-private/caja-tree-view-drag-dest.c +++ b/libcaja-private/caja-tree-view-drag-dest.c @@ -110,9 +110,9 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) window = gtk_tree_view_get_bin_window (tree_view); #if GTK_CHECK_VERSION(3, 0, 0) - vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(tree_view)); + vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view)); #else - vadjustment = gtk_tree_view_get_vadjustment(tree_view); + vadjustment = gtk_tree_view_get_vadjustment (tree_view); #endif gdk_window_get_pointer (window, NULL, &y, NULL); -- cgit v1.2.1 From 743a7522519fb3c3ac69dae3789d4f0873252779 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 08:25:46 +0200 Subject: [icon-container] remove size_request vfunc impl It doesn't seem to do anything useful. http://git.gnome.org/browse/nautilus/commit/?id=1cdd0b41bf9de69a93cb166636d7eccff9f5355f --- libcaja-private/caja-icon-container.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index e88cac74..efda5cab 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4493,15 +4493,6 @@ finalize (GObject *object) /* GtkWidget methods. */ -static void -size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GTK_WIDGET_CLASS (caja_icon_container_parent_class)->size_request (widget, requisition); - requisition->width = 1; - requisition->height = 1; -} - static gboolean clear_size_allocation_count (gpointer data) { @@ -6588,7 +6579,6 @@ caja_icon_container_class_init (CajaIconContainerClass *class) /* GtkWidget class. */ widget_class = GTK_WIDGET_CLASS (class); - widget_class->size_request = size_request; widget_class->size_allocate = size_allocate; widget_class->realize = realize; widget_class->unrealize = unrealize; -- cgit v1.2.1 From 7a42b9b076d6b831c89bd0b9e996368c1c95aef3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 10:30:31 +0200 Subject: [all] use g_list_free() and g_strcmp0 instead of eel functions Was: general: use g_list_free_full() instead of eel functions http://git.gnome.org/browse/nautilus/commit/?id=5e669515fd7f760382e6b7aa1449734a35a2d7f4 . Instead of g_list_free_full(), we use g_list_foreach and g_list_free() to avoid unnecessary glib dependency bump to 2.28 --- libcaja-private/caja-autorun.c | 4 ++-- libcaja-private/caja-bookmark.c | 4 ++-- libcaja-private/caja-clipboard.c | 19 +++++++---------- libcaja-private/caja-customization-data.c | 12 +++++------ libcaja-private/caja-debug-log.c | 4 ++-- libcaja-private/caja-directory-async.c | 22 ++++++++++++------- libcaja-private/caja-directory.c | 19 ++++++++++------- libcaja-private/caja-dnd.c | 7 +++++-- libcaja-private/caja-emblem-utils.c | 4 ++-- libcaja-private/caja-file-changes-queue.c | 16 ++++++++------ libcaja-private/caja-file-dnd.c | 4 ++-- libcaja-private/caja-file-operations.c | 24 ++++++++++++++------- libcaja-private/caja-file-utilities.c | 3 ++- libcaja-private/caja-file.c | 28 ++++++++++++++++--------- libcaja-private/caja-icon-canvas-item.c | 10 +++++---- libcaja-private/caja-icon-container.c | 7 ++++--- libcaja-private/caja-merged-directory.c | 3 ++- libcaja-private/caja-mime-actions.c | 9 +++++--- libcaja-private/caja-mime-application-chooser.c | 8 +++---- libcaja-private/caja-open-with-dialog.c | 4 ++-- libcaja-private/caja-program-choosing.c | 14 +++++++------ libcaja-private/caja-progress-info.c | 10 ++++----- libcaja-private/caja-query.c | 5 ++++- libcaja-private/caja-search-engine-beagle.c | 4 ++-- libcaja-private/caja-search-engine-simple.c | 10 +++++---- libcaja-private/caja-search-engine-tracker.c | 4 ++-- libcaja-private/caja-undostack-manager.c | 25 ++++++++++++++-------- 27 files changed, 166 insertions(+), 117 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 89b8e63d..66534642 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -33,7 +33,6 @@ #include #include -#include #include "caja-icon-info.h" #include "caja-global-preferences.h" @@ -652,7 +651,8 @@ caja_autorun_prepare_combo_box (GtkWidget *combo_box, { g_object_unref (default_app_info); } - eel_g_object_list_free (app_info_list); + g_list_foreach (app_info_list, (GFunc) g_object_unref, NULL); + g_list_free(app_info_list); gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (list_store)); g_object_unref (G_OBJECT (list_store)); diff --git a/libcaja-private/caja-bookmark.c b/libcaja-private/caja-bookmark.c index e20efd96..48952fbb 100644 --- a/libcaja-private/caja-bookmark.c +++ b/libcaja-private/caja-bookmark.c @@ -29,10 +29,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -143,7 +143,7 @@ caja_bookmark_compare_with (gconstpointer a, gconstpointer b) bookmark_a = CAJA_BOOKMARK (a); bookmark_b = CAJA_BOOKMARK (b); - if (eel_strcmp (bookmark_a->details->name, + if (g_strcmp0 (bookmark_a->details->name, bookmark_b->details->name) != 0) { return 1; diff --git a/libcaja-private/caja-clipboard.c b/libcaja-private/caja-clipboard.c index bc06675a..bce5d552 100644 --- a/libcaja-private/caja-clipboard.c +++ b/libcaja-private/caja-clipboard.c @@ -33,7 +33,6 @@ #include #include -#include #include typedef struct _TargetCallbackData TargetCallbackData; @@ -662,31 +661,27 @@ caja_clipboard_clear_if_colliding_uris (GtkWidget *widget, collision = FALSE; data = gtk_clipboard_wait_for_contents (caja_clipboard_get (widget), copied_files_atom); - if (data == NULL) - { + if (data == NULL) { return; } clipboard_item_uris = caja_clipboard_get_uri_list_from_selection_data (data, NULL, copied_files_atom); - for (l = (GList *) item_uris; l; l = l->next) - { + for (l = (GList *) item_uris; l; l = l->next) { if (g_list_find_custom ((GList *) item_uris, l->data, - (GCompareFunc) g_strcmp0)) - { + (GCompareFunc) g_strcmp0)) { collision = TRUE; break; } } - if (collision) - { + if (collision) { gtk_clipboard_clear (caja_clipboard_get (widget)); } - if (clipboard_item_uris) - { - eel_g_list_free_deep (clipboard_item_uris); + if (clipboard_item_uris) { + g_list_foreach (clipboard_item_uris, (GFunc) g_free, NULL); + g_list_free(clipboard_item_uris); } } diff --git a/libcaja-private/caja-customization-data.c b/libcaja-private/caja-customization-data.c index aeeab942..01521d0a 100644 --- a/libcaja-private/caja-customization-data.c +++ b/libcaja-private/caja-customization-data.c @@ -32,10 +32,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -260,7 +258,7 @@ caja_customization_data_get_next_element_for_display (CajaCustomizationData *dat label_out); } - is_reset_image = eel_strcmp(g_file_info_get_name (current_file_info), RESET_IMAGE_NAME) == 0; + is_reset_image = g_strcmp0(g_file_info_get_name (current_file_info), RESET_IMAGE_NAME) == 0; *emblem_name = g_strdup (g_file_info_get_name (current_file_info)); @@ -306,8 +304,10 @@ caja_customization_data_destroy (CajaCustomizationData *data) g_object_unref (data->pattern_frame); } - eel_g_object_list_free (data->public_file_list); - eel_g_object_list_free (data->private_file_list); + g_list_foreach(data->public_file_list, (GFunc) g_object_unref, NULL); + g_list_free(data->public_file_list); + g_list_foreach(data->private_file_list, (GFunc) g_object_unref, NULL); + g_list_free(data->private_file_list); if (data->name_map_hash != NULL) { @@ -427,7 +427,7 @@ format_name_for_display (CajaCustomizationData *data, const char* name) { char *formatted_str, *mapped_name; - if (!eel_strcmp(name, RESET_IMAGE_NAME)) + if (!g_strcmp0(name, RESET_IMAGE_NAME)) { return g_strdup (_("Reset")); } diff --git a/libcaja-private/caja-debug-log.c b/libcaja-private/caja-debug-log.c index 89ff6933..1ccfed0b 100644 --- a/libcaja-private/caja-debug-log.c +++ b/libcaja-private/caja-debug-log.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "caja-debug-log.h" #include "caja-file.h" @@ -309,7 +308,8 @@ caja_debug_log_with_file_list (gboolean is_milestone, const char *domain, GList caja_debug_logv (is_milestone, domain, uris, format, args); va_end (args); - eel_g_list_free_deep (uris); + g_list_foreach (uris, (GFunc) g_free, NULL); + g_list_free(uris); } gboolean diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c index a20d90d7..9694b1b0 100644 --- a/libcaja-private/caja-directory-async.c +++ b/libcaja-private/caja-directory-async.c @@ -34,7 +34,6 @@ #include "caja-link.h" #include "caja-marshal.h" #include -#include #include #include #include @@ -1080,7 +1079,8 @@ dequeue_pending_idle_callback (gpointer callback_data) file->details->got_mime_list = TRUE; file->details->mime_list_is_up_to_date = TRUE; - eel_g_list_free_deep (file->details->mime_list); + g_list_foreach (file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); file->details->mime_list = istr_set_get_as_list (dir_load_state->load_mime_list_hash); @@ -1093,7 +1093,8 @@ dequeue_pending_idle_callback (gpointer callback_data) } drain: - eel_g_object_list_free (pending_file_info); + g_list_foreach (pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(pending_file_info); /* Get the state machine running again. */ caja_directory_async_state_changed (directory); @@ -1181,7 +1182,8 @@ file_list_cancel (CajaDirectory *directory) if (directory->details->pending_file_info != NULL) { - eel_g_object_list_free (directory->details->pending_file_info); + g_list_foreach (directory->details->pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(directory->details->pending_file_info); directory->details->pending_file_info = NULL; } @@ -2786,7 +2788,8 @@ count_more_files_callback (GObject *source_object, state); } - eel_g_object_list_free (files); + g_list_foreach (files, (GFunc) g_object_unref, NULL); + g_list_free(files); if (error) { @@ -3011,7 +3014,8 @@ deep_count_state_free (DeepCountState *state) { g_object_unref (state->deep_count_location); } - eel_g_object_list_free (state->deep_count_subdirectories); + g_list_foreach (state->deep_count_subdirectories, (GFunc) g_object_unref, NULL); + g_list_free(state->deep_count_subdirectories); g_array_free (state->seen_deep_count_inodes, TRUE); g_free (state); } @@ -3319,7 +3323,8 @@ mime_list_done (MimeListState *state, gboolean success) file = state->mime_list_file; file->details->mime_list_is_up_to_date = TRUE; - eel_g_list_free_deep (file->details->mime_list); + g_list_foreach(file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); if (success) { file->details->mime_list_failed = TRUE; @@ -4574,7 +4579,8 @@ get_mount_at (GFile *target) g_object_unref (root); } - eel_g_object_list_free (mounts); + g_list_foreach (mounts, (GFunc) g_object_unref, NULL); + g_list_free(mounts); g_object_unref (monitor); diff --git a/libcaja-private/caja-directory.c b/libcaja-private/caja-directory.c index efcfc5ed..38d73794 100644 --- a/libcaja-private/caja-directory.c +++ b/libcaja-private/caja-directory.c @@ -37,8 +37,8 @@ #include "caja-vfs-directory.h" #include #include -#include #include +#include enum { @@ -175,7 +175,8 @@ caja_directory_finalize (GObject *object) if (directory->details->monitor_list != NULL) { g_warning ("destroying a CajaDirectory while it's being monitored"); - eel_g_list_free_deep (directory->details->monitor_list); + g_list_foreach(directory->details->monitor_list, (GFunc) g_free, NULL); + g_list_free(directory->details->monitor_list); } if (directory->details->monitor != NULL) @@ -212,7 +213,8 @@ caja_directory_finalize (GObject *object) g_assert (directory->details->directory_load_in_progress == NULL); g_assert (directory->details->count_in_progress == NULL); g_assert (directory->details->dequeue_pending_idle_id == 0); - eel_g_object_list_free (directory->details->pending_file_info); + g_list_foreach(directory->details->pending_file_info, (GFunc) g_object_unref, NULL); + g_list_free(directory->details->pending_file_info); EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); } @@ -758,7 +760,7 @@ caja_directory_find_file_by_internal_filename (CajaDirectory *directory, { CajaFile *result; - if (eel_strcmp (internal_filename, ".") == 0) + if (g_strcmp0 (internal_filename, ".") == 0) { result = caja_directory_get_existing_corresponding_file (directory); if (result != NULL) @@ -1092,7 +1094,8 @@ caja_directory_notify_files_added_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_added (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } void @@ -1141,7 +1144,8 @@ caja_directory_notify_files_changed_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_changed (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } void @@ -1202,7 +1206,8 @@ caja_directory_notify_files_removed_by_uri (GList *uris) files = caja_file_list_from_uris (uris); caja_directory_notify_files_changed (files); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); } static void diff --git a/libcaja-private/caja-dnd.c b/libcaja-private/caja-dnd.c index 87617a77..feea5ca8 100644 --- a/libcaja-private/caja-dnd.c +++ b/libcaja-private/caja-dnd.c @@ -129,7 +129,8 @@ caja_drag_uri_array_from_selection_list (const GList *selection_list) uri_list = caja_drag_uri_list_from_selection_list (selection_list); uris = caja_drag_uri_array_from_list (uri_list); - eel_g_list_free_deep (uri_list); + g_list_foreach(uri_list, (GFunc) g_free, NULL); + g_list_free(uri_list); return uris; } @@ -1315,7 +1316,9 @@ slot_proxy_handle_drop (GtkWidget *widget, uri_list, target_uri, gdk_drag_context_get_selected_action (context)); - eel_g_list_free_deep (uri_list); + g_list_foreach(uri_list, (GFunc) g_free, NULL); + g_list_free(uri_list); + } else if (drag_info->info == CAJA_ICON_DND_URI_LIST) { diff --git a/libcaja-private/caja-emblem-utils.c b/libcaja-private/caja-emblem-utils.c index 3c41a016..dd70dbc3 100644 --- a/libcaja-private/caja-emblem-utils.c +++ b/libcaja-private/caja-emblem-utils.c @@ -37,7 +37,6 @@ #include #include -#include #include #include @@ -120,7 +119,8 @@ is_reserved_keyword (const char *keyword) result = g_list_find_custom (available, (char *) icon_name, (GCompareFunc) g_ascii_strcasecmp) != NULL; - eel_g_list_free_deep (available); + g_list_foreach(available, (GFunc) g_free, NULL); + g_list_free(available); g_free (icon_name); return result; } diff --git a/libcaja-private/caja-file-changes-queue.c b/libcaja-private/caja-file-changes-queue.c index b3cd1db0..39cf123e 100644 --- a/libcaja-private/caja-file-changes-queue.c +++ b/libcaja-private/caja-file-changes-queue.c @@ -24,7 +24,6 @@ #include "caja-file-changes-queue.h" #include "caja-directory-notify.h" -#include #ifdef G_THREADS_ENABLED #define MUTEX_LOCK(a) if ((a) != NULL) g_mutex_lock (a) @@ -289,7 +288,8 @@ pairs_list_free (GList *pairs) } /* delete the list and the now empty pair structs */ - eel_g_list_free_deep (pairs); + g_list_foreach(pairs, (GFunc) g_free, NULL); + g_list_free(pairs); } static void @@ -304,7 +304,8 @@ position_set_list_free (GList *list) g_object_unref (item->location); } /* delete the list and the now empty structs */ - eel_g_list_free_deep (list); + g_list_foreach(list, (GFunc) g_free, NULL); + g_list_free(list); } /* go through changes in the change queue, send ones with the same kind @@ -386,7 +387,8 @@ caja_file_changes_consume_changes (gboolean consume_all) { deletions = g_list_reverse (deletions); caja_directory_notify_files_removed (deletions); - eel_g_object_list_free (deletions); + g_list_foreach(deletions, (GFunc) g_object_unref, NULL); + g_list_free(deletions); deletions = NULL; } if (moves != NULL) @@ -400,14 +402,16 @@ caja_file_changes_consume_changes (gboolean consume_all) { additions = g_list_reverse (additions); caja_directory_notify_files_added (additions); - eel_g_object_list_free (additions); + g_list_foreach(additions, (GFunc) g_object_unref, NULL); + g_list_free(additions); additions = NULL; } if (changes != NULL) { changes = g_list_reverse (changes); caja_directory_notify_files_changed (changes); - eel_g_object_list_free (changes); + g_list_foreach(changes, (GFunc) g_object_unref, NULL); + g_list_free(changes); changes = NULL; } if (position_set_requests != NULL) diff --git a/libcaja-private/caja-file-dnd.c b/libcaja-private/caja-file-dnd.c index a44d42f3..2c239643 100644 --- a/libcaja-private/caja-file-dnd.c +++ b/libcaja-private/caja-file-dnd.c @@ -30,7 +30,6 @@ #include "caja-dnd.h" #include "caja-directory.h" #include "caja-file-utilities.h" -#include #include static gboolean @@ -182,5 +181,6 @@ caja_drag_file_receive_dropped_keyword (CajaFile *file, } caja_file_set_keywords (file, keywords); - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); } diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index 24bb4a19..067f52d5 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -1858,7 +1858,8 @@ delete_job_done (gpointer user_data) job = user_data; - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); if (job->done_callback) { debuting_uris = g_hash_table_new_full (g_file_hash, (GEqualFunc)g_file_equal, g_object_unref, NULL); @@ -2187,7 +2188,8 @@ has_trash_files (GMount *mount) } } - eel_g_object_list_free (dirs); + g_list_foreach(dirs, (GFunc) g_object_unref, NULL); + g_list_free(dirs); return res; } @@ -4460,7 +4462,8 @@ copy_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); if (job->destination) { g_object_unref (job->destination); } @@ -4987,7 +4990,8 @@ move_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); g_free (job->icon_positions); @@ -5067,7 +5071,8 @@ move_job (GIOSchedulerJob *io_job, &source_info, &transfer_info); aborted: - eel_g_list_free_deep (fallbacks); + g_list_foreach(fallbacks, (GFunc) g_free, NULL); + g_list_free(fallbacks); g_free (dest_fs_id); g_free (dest_fs_type); @@ -5321,7 +5326,8 @@ link_job_done (gpointer user_data) job->done_callback (job->debuting_files, job->done_callback_data); } - eel_g_object_list_free (job->files); + g_list_foreach(job->files, (GFunc) g_object_unref, NULL); + g_list_free(job->files); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); g_free (job->icon_positions); @@ -5773,7 +5779,8 @@ caja_file_operations_copy_move (const GList *item_uris, done_callback, done_callback_data); } - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); if (dest) { g_object_unref (dest); } @@ -6251,7 +6258,8 @@ empty_trash_job_done (gpointer user_data) job = user_data; - eel_g_object_list_free (job->trash_dirs); + g_list_foreach(job->trash_dirs, (GFunc) g_object_unref, NULL); + g_list_free(job->trash_dirs); if (job->done_callback) { job->done_callback (job->done_callback_data); diff --git a/libcaja-private/caja-file-utilities.c b/libcaja-private/caja-file-utilities.c index 61ad5c47..bfe8321e 100644 --- a/libcaja-private/caja-file-utilities.c +++ b/libcaja-private/caja-file-utilities.c @@ -1428,7 +1428,8 @@ caja_restore_files_from_trash (GList *files, parent_window, NULL, NULL); - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); g_object_unref (original_dir_location); } diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 31863c9c..788eec68 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -816,11 +816,14 @@ finalize (GObject *object) eel_ref_str_unref (file->details->filesystem_id); - eel_g_list_free_deep (file->details->mime_list); - - eel_g_list_free_deep (file->details->pending_extension_emblems); - eel_g_list_free_deep (file->details->extension_emblems); - eel_g_object_list_free (file->details->pending_info_providers); + g_list_foreach(file->details->mime_list, (GFunc) g_free, NULL); + g_list_free(file->details->mime_list); + g_list_foreach(file->details->pending_extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->pending_extension_emblems); + g_list_foreach(file->details->extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->extension_emblems); + g_list_foreach(file->details->pending_info_providers, (GFunc) g_object_unref, NULL); + g_list_free(file->details->pending_info_providers); if (file->details->pending_extension_attributes) { g_hash_table_destroy (file->details->pending_extension_attributes); @@ -2994,7 +2997,8 @@ fill_emblem_cache_if_needed (CajaFile *file) /* Zero-terminate so we can tell where the list ends. */ *scanner = 0; - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); } static int @@ -6601,7 +6605,8 @@ caja_file_get_emblem_icons (CajaFile *file, icons = g_list_prepend (icons, icon); } - eel_g_list_free_deep (keywords); + g_list_foreach(keywords, (GFunc) g_free, NULL); + g_list_free(keywords); return icons; } @@ -6660,7 +6665,8 @@ sort_keyword_list_and_remove_duplicates (GList *keywords) if (strcmp ((const char *) p->data, (const char *) p->next->data) == 0) { duplicate_link = p->next; keywords = g_list_remove_link (keywords, duplicate_link); - eel_g_list_free_deep (duplicate_link); + g_list_foreach(duplicate_link, (GFunc) g_free, NULL); + g_list_free(duplicate_link); } else { p = p->next; } @@ -7554,7 +7560,8 @@ void caja_file_invalidate_extension_info_internal (CajaFile *file) { if (file->details->pending_info_providers) - eel_g_object_list_free (file->details->pending_info_providers); + g_list_foreach(file->details->pending_info_providers, (GFunc) g_object_unref, NULL); + g_list_free(file->details->pending_info_providers); file->details->pending_info_providers = caja_module_get_extensions_for_type (CAJA_TYPE_INFO_PROVIDER); @@ -8376,7 +8383,8 @@ caja_file_invalidate_extension_info (CajaFile *file) void caja_file_info_providers_done (CajaFile *file) { - eel_g_list_free_deep (file->details->extension_emblems); + g_list_foreach(file->details->extension_emblems, (GFunc) g_free, NULL); + g_list_free(file->details->extension_emblems); file->details->extension_emblems = file->details->pending_extension_emblems; file->details->pending_extension_emblems = NULL; diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index 9f6992cf..bcec72a5 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -327,7 +327,8 @@ caja_icon_canvas_item_finalize (GObject *object) g_object_unref (details->text_util); } - eel_gdk_pixbuf_list_free (details->emblem_pixbufs); + g_list_foreach(details->emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(details->emblem_pixbufs); g_free (details->editable_text); g_free (details->additional_text); g_free (details->attach_points); @@ -419,7 +420,7 @@ caja_icon_canvas_item_set_property (GObject *object, { case PROP_EDITABLE_TEXT: - if (eel_strcmp (details->editable_text, + if (g_strcmp0 (details->editable_text, g_value_get_string (value)) == 0) { return; @@ -446,7 +447,7 @@ caja_icon_canvas_item_set_property (GObject *object, break; case PROP_ADDITIONAL_TEXT: - if (eel_strcmp (details->additional_text, + if (g_strcmp0 (details->additional_text, g_value_get_string (value)) == 0) { return; @@ -763,7 +764,8 @@ caja_icon_canvas_item_set_emblems (CajaIconCanvasItem *item, /* Take in the new list of emblems. */ eel_gdk_pixbuf_list_ref (emblem_pixbufs); - eel_gdk_pixbuf_list_free (item->details->emblem_pixbufs); + g_list_foreach(item->details->emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(item->details->emblem_pixbufs); item->details->emblem_pixbufs = g_list_copy (emblem_pixbufs); caja_icon_canvas_item_invalidate_bounds_cache (item); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index efda5cab..6b2f18e8 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -7775,7 +7775,7 @@ caja_icon_container_update_icon (CajaIconContainer *container, * happened to be typing at that moment. */ if (icon == get_icon_being_renamed (container) && - eel_strcmp (editable_text, + g_strcmp0 (editable_text, caja_icon_canvas_item_get_editable_text (icon->item)) != 0) { end_renaming_mode (container, FALSE); @@ -7795,7 +7795,8 @@ caja_icon_container_update_icon (CajaIconContainer *container, /* Let the pixbufs go. */ g_object_unref (pixbuf); - eel_gdk_pixbuf_list_free (emblem_pixbufs); + g_list_foreach(emblem_pixbufs, (GFunc) g_object_unref, NULL); + g_list_free(emblem_pixbufs); g_free (editable_text); g_free (additional_text); @@ -9678,7 +9679,7 @@ caja_icon_container_set_font (CajaIconContainer *container, { g_return_if_fail (CAJA_IS_ICON_CONTAINER (container)); - if (eel_strcmp (container->details->font, font) == 0) + if (g_strcmp0 (container->details->font, font) == 0) { return; } diff --git a/libcaja-private/caja-merged-directory.c b/libcaja-private/caja-merged-directory.c index 0dc1b10c..a3e2a9b2 100644 --- a/libcaja-private/caja-merged-directory.c +++ b/libcaja-private/caja-merged-directory.c @@ -589,7 +589,8 @@ real_directory_notify_files_removed (CajaDirectory *real_directory) caja_directory_notify_files_removed_by_uri (files); } - eel_g_list_free_deep (files); + g_list_foreach(files, (GFunc) g_free, NULL); + g_list_free(files); } static void diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index 794c84b0..4668e0ac 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -230,7 +230,8 @@ static void application_launch_parameters_free (ApplicationLaunchParameters *parameters) { g_object_unref (parameters->application); - eel_g_list_free_deep (parameters->uris); + g_list_foreach(parameters->uris, (GFunc) g_free, NULL); + g_list_free(parameters->uris); g_free (parameters); } @@ -512,7 +513,8 @@ caja_mime_has_any_applications_for_file (CajaFile *file) if (apps) { result = TRUE; - eel_g_object_list_free (apps); + g_list_foreach(apps, (GFunc) g_object_unref, NULL); + g_list_free(apps); } else { @@ -733,7 +735,8 @@ trash_or_delete_files (GtkWindow *parent_window, caja_file_operations_trash_or_delete (locations, parent_window, NULL, NULL); - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); } static void diff --git a/libcaja-private/caja-mime-application-chooser.c b/libcaja-private/caja-mime-application-chooser.c index 32767f38..dd8af544 100644 --- a/libcaja-private/caja-mime-application-chooser.c +++ b/libcaja-private/caja-mime-application-chooser.c @@ -32,8 +32,6 @@ #include "caja-signaller.h" #include "caja-file.h" #include -#include -#include #include #include @@ -565,7 +563,8 @@ refresh_model (CajaMimeApplicationChooser *chooser) g_object_unref (default_app); } - eel_g_object_list_free (applications); + g_list_foreach(applications, (GFunc) g_object_unref, NULL); + g_list_free(applications); } static void @@ -673,8 +672,7 @@ set_uri_and_type_for_multiple_files (CajaMimeApplicationChooser *chooser, char *extension_current; extension_current = get_extension_from_file (CAJA_FILE (iter->data)); - if (eel_strcmp (first_extension, extension_current)) - { + if (g_strcmp0 (first_extension, extension_current)) { same_extension = FALSE; g_free (extension_current); break; diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c index 93e376c9..50ca03ef 100644 --- a/libcaja-private/caja-open-with-dialog.c +++ b/libcaja-private/caja-open-with-dialog.c @@ -29,7 +29,6 @@ #include "caja-open-with-dialog.h" #include "caja-signaller.h" -#include #include #include @@ -291,7 +290,8 @@ add_or_find_application (CajaOpenWithDialog *dialog) if (applications != NULL) { - eel_g_object_list_free (applications); + g_list_foreach(applications, (GFunc) g_object_unref, NULL); + g_list_free(applications); } } diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c index 56d6e8eb..f7b3fa42 100644 --- a/libcaja-private/caja-program-choosing.c +++ b/libcaja-private/caja-program-choosing.c @@ -31,10 +31,8 @@ #include "caja-icon-info.h" #include "caja-recent.h" #include "caja-desktop-icon-file.h" -#include #include #include -#include #include #include #include @@ -165,7 +163,8 @@ caja_launch_application (GAppInfo *application, uris = g_list_reverse (uris); caja_launch_application_by_uri (application, uris, parent_window); - eel_g_list_free_deep (uris); + g_list_foreach(uris, (GFunc) g_free, NULL); + g_list_free(uris); } void @@ -274,7 +273,8 @@ caja_launch_application_by_uri (GAppInfo *application, } } - eel_g_object_list_free (locations); + g_list_foreach(locations, (GFunc) g_object_unref, NULL); + g_list_free(locations); } /** @@ -450,7 +450,8 @@ caja_launch_desktop_file (GdkScreen *screen, " drop them again."), parent_window); - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); g_object_unref (app_info); return; } @@ -502,7 +503,8 @@ caja_launch_desktop_file (GdkScreen *screen, g_free (message); } - eel_g_object_list_free (files); + g_list_foreach(files, (GFunc) g_object_unref, NULL); + g_list_free(files); g_object_unref (context); g_object_unref (app_info); } diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index b547ead8..789b5de0 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -26,9 +26,9 @@ #include #include #include -#include #include #include "caja-progress-info.h" +#include enum { @@ -800,7 +800,7 @@ caja_progress_info_take_status (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->status, status) != 0) + if (g_strcmp0 (info->status, status) != 0) { g_free (info->status); info->status = status; @@ -822,7 +822,7 @@ caja_progress_info_set_status (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->status, status) != 0) + if (g_strcmp0 (info->status, status) != 0) { g_free (info->status); info->status = g_strdup (status); @@ -841,7 +841,7 @@ caja_progress_info_take_details (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->details, details) != 0) + if (g_strcmp0 (info->details, details) != 0) { g_free (info->details); info->details = details; @@ -863,7 +863,7 @@ caja_progress_info_set_details (CajaProgressInfo *info, { G_LOCK (progress_info); - if (eel_strcmp (info->details, details) != 0) + if (g_strcmp0 (info->details, details) != 0) { g_free (info->details); info->details = g_strdup (details); diff --git a/libcaja-private/caja-query.c b/libcaja-private/caja-query.c index 42804eda..9c6044af 100644 --- a/libcaja-private/caja-query.c +++ b/libcaja-private/caja-query.c @@ -118,7 +118,10 @@ caja_query_get_mime_types (CajaQuery *query) void caja_query_set_mime_types (CajaQuery *query, GList *mime_types) { - eel_g_list_free_deep (query->details->mime_types); + g_list_foreach(query->details->mime_types, (GFunc) g_free, NULL); + g_list_free(query->details->mime_types); + g_list_foreach(query->details->mime_types, (GFunc) g_free, NULL); + g_list_free(query->details->mime_types); query->details->mime_types = eel_g_str_list_copy (mime_types); } diff --git a/libcaja-private/caja-search-engine-beagle.c b/libcaja-private/caja-search-engine-beagle.c index 0a2c34ff..6e59b060 100644 --- a/libcaja-private/caja-search-engine-beagle.c +++ b/libcaja-private/caja-search-engine-beagle.c @@ -25,7 +25,6 @@ #include "caja-search-engine-beagle.h" #include -#include #include typedef struct _BeagleHit BeagleHit; @@ -342,7 +341,8 @@ caja_search_engine_beagle_start (CajaSearchEngine *engine) /* These must live during the lifetime of the query */ g_free (text); - eel_g_list_free_deep (mimetypes); + g_list_foreach(mimetypes, (GFunc) g_free, NULL); + g_list_free(mimetypes); } static void diff --git a/libcaja-private/caja-search-engine-simple.c b/libcaja-private/caja-search-engine-simple.c index 5e906334..cf50497f 100644 --- a/libcaja-private/caja-search-engine-simple.c +++ b/libcaja-private/caja-search-engine-simple.c @@ -28,7 +28,6 @@ #include #include -#include #include #define BATCH_SIZE 500 @@ -138,8 +137,10 @@ search_thread_data_free (SearchThreadData *data) g_hash_table_destroy (data->visited); g_object_unref (data->cancellable); g_strfreev (data->words); - eel_g_list_free_deep (data->mime_types); - eel_g_list_free_deep (data->uri_hits); + g_list_foreach(data->mime_types, (GFunc) g_free, NULL); + g_list_free(data->mime_types); + g_list_foreach(data->uri_hits, (GFunc) g_free, NULL); + g_list_free(data->uri_hits); g_free (data); } @@ -181,7 +182,8 @@ search_thread_add_hits_idle (gpointer user_data) hits->uris); } - eel_g_list_free_deep (hits->uris); + g_list_foreach(hits->uris, (GFunc) g_free, NULL); + g_list_free(hits->uris); g_free (hits); return FALSE; diff --git a/libcaja-private/caja-search-engine-tracker.c b/libcaja-private/caja-search-engine-tracker.c index ea56a924..e47af045 100644 --- a/libcaja-private/caja-search-engine-tracker.c +++ b/libcaja-private/caja-search-engine-tracker.c @@ -24,7 +24,6 @@ #include #include "caja-search-engine-tracker.h" #include -#include #include #include @@ -462,7 +461,8 @@ caja_search_engine_tracker_start (CajaSearchEngine *engine) tracker->details->query_pending = TRUE; g_free (search_text); - eel_g_list_free_deep (mimetypes); + g_list_foreach(mimetypes, (GFunc) g_free, NULL); + g_list_free(mimetypes); } static void diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index 465e35e1..0a19934e 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -33,7 +33,6 @@ #include #include #include -#include /* ***************************************************************** Private fields @@ -432,7 +431,8 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_copy (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_CREATEFILEFROMTEMPLATE: puri = get_uri_parent (action->target_uri); @@ -448,14 +448,16 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_duplicate (uris, NULL, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RESTOREFROMTRASH: case CAJA_UNDOSTACK_MOVE: uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_move (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RENAME: new_name = get_uri_basename (action->new_uri); @@ -489,14 +491,16 @@ caja_undostack_manager_redo (CajaUndoStackManager * manager, caja_file_operations_trash_or_delete (uris, NULL, undo_redo_done_delete_callback, action); g_list_free (uri_to_trash); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); } break; case CAJA_UNDOSTACK_CREATELINK: uris = construct_gfile_list (action->sources, action->src_dir); caja_file_operations_link (uris, NULL, action->dest_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_SETPERMISSIONS: file = caja_file_get_by_uri (action->target_uri); @@ -579,7 +583,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, if (priv->confirm_delete) { caja_file_operations_delete (uris, NULL, undo_redo_done_delete_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); } else { /* We skip the confirmation message */ @@ -600,7 +605,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->destinations, action->dest_dir); caja_file_operations_trash_or_delete (uris, NULL, undo_redo_done_delete_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_MOVETOTRASH: files_to_restore = retrieve_files_to_restore (action->trashed); @@ -630,7 +636,8 @@ caja_undostack_manager_undo (CajaUndoStackManager * manager, uris = construct_gfile_list (action->destinations, action->dest_dir); caja_file_operations_move (uris, NULL, action->src_dir, NULL, undo_redo_done_transfer_callback, action); - eel_g_object_list_free (uris); + g_list_foreach(uris, (GFunc) g_object_unref, NULL); + g_list_free(uris); break; case CAJA_UNDOSTACK_RENAME: new_name = get_uri_basename (action->old_uri); -- cgit v1.2.1 From 48cc04df5933644ade234ce16ac8a6ee817bb867 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 10 Nov 2012 11:22:51 +0200 Subject: [eel] remove eel_gdk_pixbuf_list_ref() But unlike upstream commit below, not removing include eel-art-extensions.h from eel-gdk-pixbuf-extensions.h, as we still have functions in the latter using eel_irect_* (from eel-art-extensions), which are still used by the eel-debug-drawing we kept around. http://git.gnome.org/browse/nautilus/commit/?id=7dee3226ad6b3aa1c782cc3d2969e32c5eeae3f3 --- libcaja-private/caja-icon-canvas-item.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index bcec72a5..f36f2ccf 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -763,7 +762,7 @@ caja_icon_canvas_item_set_emblems (CajaIconCanvasItem *item, } /* Take in the new list of emblems. */ - eel_gdk_pixbuf_list_ref (emblem_pixbufs); + eel_g_object_list_ref (emblem_pixbufs); g_list_foreach(item->details->emblem_pixbufs, (GFunc) g_object_unref, NULL); g_list_free(item->details->emblem_pixbufs); item->details->emblem_pixbufs = g_list_copy (emblem_pixbufs); -- cgit v1.2.1