summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-16 05:08:48 -0800
committerStefano Karapetsas <[email protected]>2012-11-16 05:08:48 -0800
commitdc66bc40724191f0068869773576dc4edf042c6f (patch)
tree74b9684feea188736b21f2c829f29befaaf2e9da /test
parent935e1fed604f48e68d125d205c890a59f46f8f21 (diff)
parent1466df20591105550738a1d0784a623af9909abf (diff)
downloadcaja-dc66bc40724191f0068869773576dc4edf042c6f.tar.bz2
caja-dc66bc40724191f0068869773576dc4edf042c6f.tar.xz
Merge pull request #42 from jasmineaura/develop
Bring Caja up to speed, stage1
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
-rw-r--r--test/test-eel-image-scrolled.c187
-rw-r--r--test/test-eel-image-table.c16
3 files changed, 7 insertions, 198 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 9e3d2099..92b9fda0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -21,7 +21,6 @@ noinst_PROGRAMS =\
test-caja-copy \
test-eel-background \
test-eel-editable-label \
- test-eel-image-scrolled \
test-eel-image-table \
test-eel-labeled-image \
test-eel-pixbuf-scale \
@@ -36,7 +35,6 @@ test_caja_search_engine_SOURCES = test-caja-search-engine.c
test_caja_directory_async_SOURCES = test-caja-directory-async.c
test_eel_background_SOURCES = test-eel-background.c
-test_eel_image_scrolled_SOURCES = test-eel-image-scrolled.c test.c test.h
test_eel_image_table_SOURCES = test-eel-image-table.c test.c
test_eel_labeled_image_SOURCES = test-eel-labeled-image.c test.c test.h
test_eel_pixbuf_scale_SOURCES = test-eel-pixbuf-scale.c test.c test.h
diff --git a/test/test-eel-image-scrolled.c b/test/test-eel-image-scrolled.c
deleted file mode 100644
index c89cfe9f..00000000
--- a/test/test-eel-image-scrolled.c
+++ /dev/null
@@ -1,187 +0,0 @@
-#include "test.h"
-
-#if 0
-typedef struct
-{
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *entry;
- GtkWidget *hbox;
- GtkWidget *smooth_toggle;
- GtkWidget *frame;
- GtkWidget *label;
-} Window;
-
-#if 0
-static void
-toggle_smooth_callback (GtkWidget *widget, gpointer callback_data)
-{
- Window *window;
- EelLabel *label;
-
- window = (Window *) callback_data;
-
- if (!EEL_IS_LABEL (window->label)) {
- return;
- }
-
- label = GTK_LABEL (window->label);
-
- gtk_label_set_is_smooth (label, !gtk_label_get_is_smooth (label));
-}
-#endif
-
-static Window *
-window_new (const char *title, guint border_width)
-{
- Window *window;
- GtkWidget *main_vbox;
-
- window = g_new0 (Window, 1);
-
- window->window = test_window_new (title, border_width);
-
- main_vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (window->window), main_vbox);
-
- window->vbox = gtk_vbox_new (FALSE, 0);
- window->entry = gtk_entry_new ();
- window->hbox = gtk_hbox_new (FALSE, 0);
-// window->smooth_toggle = gtk_check_button_new_with_label ("Smooth");
-
- gtk_box_pack_start (GTK_BOX (main_vbox), window->vbox, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (main_vbox), window->hbox, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (main_vbox), window->entry, FALSE, FALSE, 0);
-
-// gtk_box_pack_start (GTK_BOX (window->hbox), window->smooth_toggle, FALSE, FALSE, 0);
-
- gtk_widget_show (main_vbox);
- gtk_widget_show (window->vbox);
- gtk_widget_show (window->hbox);
- gtk_widget_show (window->entry);
-
- return window;
-}
-
-static Window *
-label_window_new (const char *title,
- guint border_width,
- const char *file_name,
- const char *tile_file_name)
-{
- Window *window;
-
- window = window_new (title, border_width);
-
- window->frame = gtk_frame_new ("Foo");
- window->label = gtk_label_new (file_name);
-
- if (tile_file_name != NULL) {
- gtk_label_set_tile_pixbuf_from_file_name (GTK_LABEL (window->label),
- tile_file_name);
- }
-
- gtk_container_add (GTK_CONTAINER (window->frame), window->label);
-
- gtk_box_pack_start (GTK_BOX (window->vbox), window->frame, TRUE, TRUE, 0);
-
- gtk_widget_show (window->label);
- gtk_widget_show (window->frame);
-
- return window;
-}
-#endif
-
-static const char text[] =
-"The Eel shell is under development; it's not "
-"ready for daily use. Some features are not yet done, "
-"partly done, or unstable. The program doesn't look "
-"or act exactly the way it will in version 1.0."
-"\n\n"
-"If you do decide to test this version of Eel, "
-"beware. The program could do something "
-"unpredictable and may even delete or overwrite "
-"files on your computer."
-"\n\n"
-"For more information, visit http://eel.eazel.com.";
-
-static GtkWidget *
-label_window_new (void)
-{
- GtkWidget *window;
- GtkWidget *label;
- EelBackground *background;
-
- window = test_window_new ("Scrolled Label Test", 10);
-
- background = eel_get_widget_background (GTK_WIDGET (window));
- eel_background_set_color (background, "white");
-
- /* Label */
- label = gtk_label_new (text);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-
- gtk_container_add (GTK_CONTAINER (window), label);
-
- gtk_widget_show (label);
-
- return window;
-}
-
-static GtkWidget *
-label_window_new_scrolled (void)
-{
- GtkWidget *window;
- GtkWidget *scrolled;
- GtkWidget *viewport;
- GtkWidget *label;
- EelBackground *background;
-
- window = test_window_new ("Scrolled Label Test", 10);
-
- /* Scrolled window */
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (window), scrolled);
-
- /* Viewport */
- viewport = gtk_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_OUT);
- gtk_container_add (GTK_CONTAINER (scrolled), viewport);
-
- background = eel_get_widget_background (GTK_WIDGET (viewport));
- eel_background_set_color (background, "white");
-
- /* Label */
- label = gtk_label_new (text);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-
- gtk_container_add (GTK_CONTAINER (viewport), label);
-
- gtk_widget_show (label);
- gtk_widget_show (viewport);
- gtk_widget_show (scrolled);
-
- return window;
-}
-
-int
-main (int argc, char* argv[])
-{
- GtkWidget *label_window;
- GtkWidget *scrolled_label_window;
-
- test_init (&argc, &argv);
-
- label_window = label_window_new ();
- scrolled_label_window = label_window_new_scrolled ();
-
- gtk_widget_show (scrolled_label_window);
- gtk_widget_show (label_window);
-
- gtk_main ();
-
- return 0;
-}
diff --git a/test/test-eel-image-table.c b/test/test-eel-image-table.c
index d60aa91b..9677537a 100644
--- a/test/test-eel-image-table.c
+++ b/test/test-eel-image-table.c
@@ -63,7 +63,7 @@ labeled_image_new (const char *text,
{
GtkWidget *image;
GdkPixbuf *pixbuf = NULL;
-
+
if (icon_name) {
float sizes[] = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0 };
@@ -194,7 +194,7 @@ image_table_size_allocate (GtkWidget *image_table,
gtk_widget_get_allocation (GTK_WIDGET (image_table), &w_allocation);
if (0) gtk_widget_size_allocate (GTK_WIDGET (image_table),
&w_allocation);
-
+
g_print ("%s(%d)\n", G_STRFUNC, recursion_count);
recursion_count--;
@@ -264,8 +264,6 @@ image_table_new_scrolled (void)
G_CALLBACK (image_table_child_clicked_callback),
NULL);
- eel_gtk_widget_set_background_color (viewport, BG_COLOR_SPEC);
-
for (i = 0; i < 100; i++) {
char *text;
GtkWidget *image;
@@ -283,11 +281,11 @@ image_table_new_scrolled (void)
gtk_widget_show (viewport);
gtk_widget_show (scrolled);
gtk_widget_show (image_table);
-
+
return window;
}
-int
+int
main (int argc, char* argv[])
{
GtkWidget *window = NULL;
@@ -295,10 +293,10 @@ main (int argc, char* argv[])
test_init (&argc, &argv);
window = image_table_new_scrolled ();
-
+
gtk_widget_show (window);
-
+
gtk_main ();
-
+
return 0;
}