diff options
-rw-r--r-- | siv.c | 49 | ||||
-rw-r--r-- | siv.glade | 9 | ||||
-rw-r--r-- | window.c | 8 | ||||
-rw-r--r-- | window.h | 7 |
4 files changed, 43 insertions, 30 deletions
@@ -23,13 +23,19 @@ #include <string.h> #include <math.h> #include "window.h" +#include "metadata.h" #define _(a) a +typedef struct App +{ + +}; + static void -sorry (GtkWidget *parent_window, - const gchar *format, - ...) +warning (GtkWidget *parent_window, + const gchar *format, + ...) { va_list args; char *message; @@ -87,19 +93,6 @@ static void disable_g_slice (void) { - /* Disable gslice, since it - * - * - confuses valgrind - * - caches too much memory - * - hides memory access bugs - * - is not faster than malloc - * - * Note that g_slice_set_config() is broken in some versions of - * GLib (and 'declared internal' according to Tim), so we use the - * environment variable instead. - */ - if (!getenv ("G_SLICE")) - putenv ("G_SLICE=always_malloc"); } typedef struct @@ -116,7 +109,7 @@ load_file (gpointer data) if (!window_load_file (open_data->window, open_data->filename, &err)) { - sorry (NULL, "Could not open %s: %s\n", open_data->filename, err->message); + warning (NULL, "Could not open %s: %s\n", open_data->filename, err->message); } g_free (open_data); @@ -131,7 +124,19 @@ main (int argc, Window *window; const char *filename; - disable_g_slice(); + /* Disable gslice, since it + * + * - confuses valgrind + * - caches too much memory + * - hides memory access bugs + * - is not faster than malloc + * + * Note that g_slice_set_config() is broken in some versions of + * GLib (and 'declared internal' according to Tim), so we use the + * environment variable instead. + */ + if (!getenv ("G_SLICE")) + putenv ("G_SLICE=always_malloc"); filename = process_options (argc, argv); @@ -139,10 +144,10 @@ main (int argc, if (!g_file_test (GLADE_FILE, G_FILE_TEST_EXISTS)) { - sorry (NULL, - APPLICATION_NAME " was not compiled or installed correctly.\n" - "\n" - "Running \"make install\" may solve this problem.\n"); + warning (NULL, + APPLICATION_NAME " was not compiled or installed correctly.\n" + "\n" + "Running \"make install\" may solve this problem.\n"); return FALSE; } @@ -4,7 +4,6 @@ <glade-interface> <widget class="GtkWindow" id="main_window"> - <property name="visible">True</property> <property name="title" translatable="yes">window1</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_NONE</property> @@ -74,9 +73,9 @@ </child> <child> - <widget class="GtkImageMenuItem" id="menu_quit"> + <widget class="GtkImageMenuItem" id="menu_close"> <property name="visible">True</property> - <property name="label">gtk-quit</property> + <property name="label">gtk-close</property> <property name="use_stock">True</property> <signal name="activate" handler="on_quit1_activate" last_modification_time="Sat, 08 Mar 2008 14:22:13 GMT"/> </widget> @@ -131,7 +130,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_White Background</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> </widget> </child> @@ -140,7 +139,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Checkerboard Background</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">menu_white</property> <signal name="activate" handler="on_check_pattern_activate" last_modification_time="Sat, 08 Mar 2008 14:28:25 GMT"/> </widget> @@ -340,7 +340,7 @@ connect_signals (Window *window) { "menu_zoom_normal", "activate", G_CALLBACK (on_zoom_normal) }, { "menu_rotate_left", "activate", G_CALLBACK (on_rotate_left) }, { "menu_rotate_right", "activate", G_CALLBACK (on_rotate_right) }, - { "menu_quit", "activate", G_CALLBACK (gtk_main_quit) }, + { "menu_close", "activate", G_CALLBACK (gtk_main_quit) }, { "menu_smooth_image", "toggled", G_CALLBACK (on_various) }, { "menu_white", "activate", G_CALLBACK (on_various) }, @@ -403,3 +403,9 @@ window_new () return window; } + +void +window_show (Window *window) +{ + gtk_widget_show (GET_WIDGET (window, "main_window")); +} @@ -22,5 +22,8 @@ struct Window -Window *window_new (void); -gboolean window_load_file (Window *window, const char *file, GError **err); +Window * window_new (void); +gboolean window_load_file (Window *window, + const char *file, + GError **err); +void window_show (Window *window); |