1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-07-07 20:07:07 +00:00
nautilus/test/test-nautilus-wrap-table.c
Alexander Larsson cf740f7f9b Require trunk eel. Drop libgnome* and librsvg deps.
2008-10-07  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Require trunk eel.
	Drop libgnome* and librsvg deps.
	
        * libnautilus-private/nautilus-customization-data.c:
        (nautilus_customization_data_get_next_element_for_display):
        * libnautilus-private/nautilus-icon-canvas-item.c:
        (real_map_pixbuf):
        * src/nautilus-property-browser.c:
        (make_drag_image):
	Use librsvg indirectly via gdk-pixbuf loader.
	
        * libnautilus-private/nautilus-thumbnails.c:
	Use thumbnail factory from gnome-desktop.
	
        * libnautilus-private/nautilus-undo.c:
        (nautilus_undo_get_undo_manager):
	Kill references to gnome canvas.
	
        * libnautilus-private/nautilus-vfs-file.c:
	Don't include removed eel-mount-operation.h header

        * src/file-manager/fm-properties-window.c:
        (update_preview_callback):
	Use thumbnail utils from gnome-desktop.

        * src/Makefile.am:
        * src/nautilus-bookmarks-window.c:
        * src/nautilus-bookmarks-window.glade: Removed.
        * src/nautilus-bookmarks-window.ui: Added.
        * src/nautilus-file-management-properties.c:
        * src/nautilus-file-management-properties.glade: Removed.
        * src/nautilus-file-management-properties.ui: Added.
	Switch from libglade to gtkbuilder.

        * libnautilus-private/nautilus-file-operations.c:
        * src/nautilus-emblem-sidebar.c:
        * src/nautilus-navigation-window.h:
        * test/test-nautilus-wrap-table.c:
        * test/test.c:
        * test/test.h:
	Drop old unused libgnome/librsvg includes



svn path=/trunk/; revision=14704
2008-10-07 19:49:14 +00:00

97 lines
2.4 KiB
C

#include "test.h"
#include <eel/eel-wrap-table.h>
#include <eel/eel-labeled-image.h>
#include <eel/eel-vfs-extensions.h>
#include <libnautilus-private/nautilus-customization-data.h>
#include <libnautilus-private/nautilus-icon-info.h>
int
main (int argc, char* argv[])
{
NautilusCustomizationData *customization_data;
GtkWidget *window;
GtkWidget *emblems_table, *button, *scroller;
char *emblem_name, *stripped_name;
GdkPixbuf *pixbuf;
char *label;
test_init (&argc, &argv);
window = test_window_new ("Wrap Table Test", 10);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
/* The emblems wrapped table */
emblems_table = eel_wrap_table_new (TRUE);
gtk_widget_show (emblems_table);
gtk_container_set_border_width (GTK_CONTAINER (emblems_table), 8);
scroller = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
/* Viewport */
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroller),
emblems_table);
gtk_container_add (GTK_CONTAINER (window), scroller);
gtk_widget_show (scroller);
#if 0
/* Get rid of default lowered shadow appearance.
* This must be done after the widget is realized, due to
* an apparent bug in gtk_viewport_set_shadow_type.
*/
g_signal_connect (GTK_BIN (scroller->child),
"realize",
remove_default_viewport_shadow,
NULL);
#endif
/* Use nautilus_customization to make the emblem widgets */
customization_data = nautilus_customization_data_new ("emblems", TRUE,
NAUTILUS_ICON_SIZE_SMALL,
NAUTILUS_ICON_SIZE_SMALL);
while (nautilus_customization_data_get_next_element_for_display (customization_data,
&emblem_name,
&pixbuf,
&label)) {
stripped_name = eel_filename_strip_extension (emblem_name);
g_free (emblem_name);
if (strcmp (stripped_name, "erase") == 0) {
g_object_unref (pixbuf);
g_free (label);
g_free (stripped_name);
continue;
}
button = eel_labeled_image_check_button_new (label, pixbuf);
g_free (label);
g_object_unref (pixbuf);
/* Attach parameters and signal handler. */
g_object_set_data_full (G_OBJECT (button),
"nautilus_property_name",
stripped_name,
(GDestroyNotify) g_free);
gtk_container_add (GTK_CONTAINER (emblems_table), button);
}
gtk_widget_show_all (emblems_table);
gtk_widget_show (window);
gtk_main ();
return 0;
}