X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire.c;h=af61eeefc188f70cb79507a55e3972fd9cbdb371;hb=71ca6750d4f402feb0f3c630ba8d12eb73ef2216;hp=7d9cdf52981c2c424de41ffafd26e4041c08c7b8;hpb=258cbd9cdf386687122b0854274923acafc786d4;p=pspp diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 7d9cdf5298..af61eeefc1 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -145,31 +145,7 @@ struct icon_size size_t n_sizes; /* The number of items in the array below. */ const GtkIconSize *usage; /* An array determining for what the icon set is used */ }; - -static const GtkIconSize menus[] = {GTK_ICON_SIZE_MENU}; -static const GtkIconSize large_toolbar[] = {GTK_ICON_SIZE_LARGE_TOOLBAR}; -static const GtkIconSize small_toolbar[] = {GTK_ICON_SIZE_SMALL_TOOLBAR}; - - -/* We currently have three icon sets viz: 16x16, 24x24 and 32x32 - We use the 16x16 for menus, the 32x32 for the large_toolbars and - the 24x24 for small_toolbars. - - The order of this array is pertinent. The icons in the sets occuring - earlier in the array will be used a the wildcard (default) icon size, - if such an icon exists. -*/ -static const struct icon_size sizemap[] = - { - {24, sizeof (small_toolbar) / sizeof (GtkIconSize), small_toolbar}, - {16, sizeof (menus) / sizeof (GtkIconSize), menus}, - {32, sizeof (large_toolbar) / sizeof (GtkIconSize), large_toolbar} - }; - - - - static void handle_msg (const struct msg *m_, void *lexer_) { @@ -195,28 +171,30 @@ psppire_set_lexer (struct lexer *lexer) } -void +GtkWindow * psppire_preload_file (const gchar *file) { const gchar *local_encoding = "UTF-8"; - + struct file_handle *fh = fh_create_file (NULL, file, local_encoding, fh_default_properties ()); const char *filename = fh_get_file_name (fh); - + int retval = any_reader_detect (fh, NULL); - + + GtkWindow *w = NULL; /* Check to see if the file is a .sav or a .por file. If not assume that it is a syntax file */ if (retval == 1) - open_data_window (NULL, filename, NULL, NULL); + w = open_data_window (NULL, filename, NULL, NULL); else if (retval == 0) { create_data_window (); - open_syntax_window (filename, NULL); + w = open_syntax_window (filename, NULL); } fh_unref (fh); + return w; }