From: John Darrington Date: Tue, 24 Feb 2009 02:15:55 +0000 (+0900) Subject: Remove last vestiges of libglade dependencies X-Git-Tag: v0.7.3~281 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16034f6f464c026cc3864dce79e367bfc4c1382d;p=pspp-builds.git Remove last vestiges of libglade dependencies --- diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 9ae69bf1..69a41a9c 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -20,40 +20,7 @@ src_ui_gui_psppire_LDFLAGS += -rpath $(pkglibdir) endif -# The library libpsppire contains a single function to register our custom widgets with libglade. -# This library is dynamically loaded by libglade. On w32 platforms, dynamic libraries simply -# can't be created unless all of the symbols can be resolved at link time. Thus, all the custom -# widgets have to be available. -# But they can't appear in the library AND the binary, otherwise glib complains about them already -# existing (and its a waste of space). So we have a seperate shared library (statically loaded) -# libpsppwidgets which contains our custom widgets. - -pkglib_LTLIBRARIES = src/ui/gui/libpsppwidgets.la src/ui/gui/libpsppire.la - -src_ui_gui_libpsppwidgets_la_CFLAGS = $(GTK_CFLAGS) -src_ui_gui_libpsppwidgets_la_LDFLAGS = -no-undefined -src_ui_gui_libpsppwidgets_la_LIBADD = $(GTK_LIBS) - -src_ui_gui_libpsppwidgets_la_SOURCES = \ - src/ui/gui/psppire-dialog.c \ - src/ui/gui/psppire-keypad.c \ - src/ui/gui/psppire-selector.c \ - src/ui/gui/psppire-buttonbox.c \ - src/ui/gui/psppire-hbuttonbox.c \ - src/ui/gui/psppire-vbuttonbox.c \ - src/ui/gui/psppire-acr.c - - -src_ui_gui_libpsppire_la_CFLAGS = $(GLADE_CFLAGS) -src_ui_gui_libpsppire_la_LDFLAGS = -no-undefined -src_ui_gui_libpsppire_la_LIBADD = $(GLADE_LIBS) src/ui/gui/libpsppwidgets.la - -src_ui_gui_libpsppire_la_SOURCES = \ - src/ui/gui/glade-register.c - src_ui_gui_psppire_LDADD = \ - -dlopen src/ui/gui/libpsppire.la \ - src/ui/gui/libpsppwidgets.la \ src/ui/gui/sheet/libsheet.la \ lib/gtk-contrib/libgtksheet.a \ src/ui/libuicommon.la \ @@ -80,6 +47,7 @@ nodist_src_ui_gui_psppire_DATA = \ $(top_builddir)/src/ui/gui/recode.ui \ $(top_builddir)/src/ui/gui/regression.ui \ $(top_builddir)/src/ui/gui/syntax-editor.ui \ + $(top_builddir)/src/ui/gui/text-data-import.ui \ $(top_builddir)/src/ui/gui/t-test.ui EXTRA_DIST += \ @@ -119,6 +87,13 @@ dist_src_ui_gui_psppire_DATA = \ src_ui_gui_psppire_SOURCES = \ + src/ui/gui/psppire-dialog.c \ + src/ui/gui/psppire-keypad.c \ + src/ui/gui/psppire-selector.c \ + src/ui/gui/psppire-buttonbox.c \ + src/ui/gui/psppire-hbuttonbox.c \ + src/ui/gui/psppire-vbuttonbox.c \ + src/ui/gui/psppire-acr.c \ src/ui/gui/about.c \ src/ui/gui/about.h \ src/ui/gui/checkbox-treeview.c \ diff --git a/src/ui/gui/glade-register.c b/src/ui/gui/glade-register.c deleted file mode 100644 index 8946b277..00000000 --- a/src/ui/gui/glade-register.c +++ /dev/null @@ -1,75 +0,0 @@ -/* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation - - 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 3 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, see . */ - - -#include - -#include - -#include -#include "psppire-dialog.h" -#include "psppire-selector.h" -#include "psppire-acr.h" -#include "psppire-keypad.h" -#include "psppire-hbuttonbox.h" -#include "psppire-vbuttonbox.h" - -GLADE_MODULE_CHECK_INIT - -/* Glade registration functions for PSPPIRE custom widgets */ - -static GtkWidget * -dialog_find_internal_child (GladeXML *xml, - GtkWidget *parent, - const gchar *childname) -{ - if (!strcmp(childname, "hbox")) - return PSPPIRE_DIALOG (parent)->box; - - return NULL; -} - -void -glade_module_register_widgets (void) -{ - glade_register_widget (PSPPIRE_DIALOG_TYPE, NULL, - glade_standard_build_children, - dialog_find_internal_child); - - - glade_register_widget (PSPPIRE_VBUTTON_BOX_TYPE, NULL, - glade_standard_build_children, - NULL); - - glade_register_widget (PSPPIRE_HBUTTON_BOX_TYPE, NULL, - glade_standard_build_children, - NULL); - - glade_register_widget (PSPPIRE_SELECTOR_TYPE, NULL, - glade_standard_build_children, - NULL); - - glade_register_widget (PSPPIRE_KEYPAD_TYPE, NULL, - glade_standard_build_children, - NULL); - - glade_register_widget (PSPPIRE_ACR_TYPE, NULL, - glade_standard_build_children, - NULL); -} - - - diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index 8b5dbb5a..aa052c07 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -143,9 +143,6 @@ get_widget_assert (gpointer x, const gchar *name) if (GTK_IS_BUILDER (obj)) w = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (obj), name)); - if (GLADE_IS_XML (obj)) - w = glade_xml_get_widget (GLADE_XML (obj), name); - if ( !w ) g_critical ("Widget \"%s\" could not be found\n", name); diff --git a/src/ui/gui/helper.h b/src/ui/gui/helper.h index 3a64413b..e1fc0e82 100644 --- a/src/ui/gui/helper.h +++ b/src/ui/gui/helper.h @@ -24,7 +24,6 @@ #include #include -#include @@ -61,9 +60,6 @@ void reference_manual (GtkMenuItem *, gpointer); struct getl_interface; gboolean execute_syntax (struct getl_interface *sss); -#define XML_NEW(FILE) \ - glade_xml_new (relocate(PKGDATADIR "/" FILE), NULL, NULL) - #define builder_new(NAME) builder_new_real (relocate (PKGDATADIR "/" NAME)) diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 737b965c..e434f0c4 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -44,7 +44,6 @@ #include #include -#include #include "psppire-dict.h" #include "psppire-var-store.h" #include "psppire-data-store.h" @@ -95,8 +94,6 @@ initialize (struct command_line_processor *clp, int argc, char **argv) bindtextdomain (PACKAGE, locale_dir); - glade_init (); - gsl_set_error_handler_off (); fn_init (); outp_init (); diff --git a/src/ui/gui/text-data-import-dialog.c b/src/ui/gui/text-data-import-dialog.c index fa55bba5..6e6999e8 100644 --- a/src/ui/gui/text-data-import-dialog.c +++ b/src/ui/gui/text-data-import-dialog.c @@ -111,7 +111,7 @@ static void destroy_file (struct import_assistant *); /* The main body of the GTK+ assistant and related data. */ struct assistant { - GladeXML *xml; + GtkBuilder *builder; GtkAssistant *assistant; GMainLoop *main_loop; GtkWidget *paste_button; @@ -600,7 +600,7 @@ init_assistant (struct import_assistant *ia, GtkWindow *parent_window) { struct assistant *a = &ia->asst; - a->xml = XML_NEW ("text-data-import.glade"); + a->builder = builder_new ("text-data-import.ui"); a->assistant = GTK_ASSISTANT (gtk_assistant_new ()); g_signal_connect (a->assistant, "prepare", G_CALLBACK (on_prepare), ia); g_signal_connect (a->assistant, "cancel", G_CALLBACK (on_cancel), ia); @@ -632,7 +632,7 @@ destroy_assistant (struct import_assistant *ia) g_object_unref (a->prop_renderer); g_object_unref (a->fixed_renderer); - g_object_unref (a->xml); + g_object_unref (a->builder); } /* Appends a page of the given TYPE, with PAGE as its content, to @@ -744,17 +744,17 @@ static void on_intro_amount_changed (GtkToggleButton *button, static void init_intro_page (struct import_assistant *ia) { - GladeXML *xml = ia->asst.xml; + GtkBuilder *builder = ia->asst.builder; struct intro_page *p = &ia->intro; struct string s; - p->page = add_page_to_assistant (ia, get_widget_assert (xml, "Intro"), + p->page = add_page_to_assistant (ia, get_widget_assert (builder, "Intro"), GTK_ASSISTANT_PAGE_INTRO); - p->all_cases_button = get_widget_assert (xml, "import-all-cases"); - p->n_cases_button = get_widget_assert (xml, "import-n-cases"); - p->n_cases_spin = get_widget_assert (xml, "n-cases-spin"); - p->percent_button = get_widget_assert (xml, "import-percent"); - p->percent_spin = get_widget_assert (xml, "percent-spin"); + p->all_cases_button = get_widget_assert (builder, "import-all-cases"); + p->n_cases_button = get_widget_assert (builder, "import-n-cases"); + p->n_cases_spin = get_widget_assert (builder, "n-cases-spin"); + p->percent_button = get_widget_assert (builder, "import-percent"); + p->percent_spin = get_widget_assert (builder, "percent-spin"); g_signal_connect (p->all_cases_button, "toggled", G_CALLBACK (on_intro_amount_changed), ia); g_signal_connect (p->n_cases_button, "toggled", @@ -792,7 +792,7 @@ init_intro_page (struct import_assistant *ia) } ds_put_cstr (&s, _("You may choose below how much of the file should " "actually be imported.")); - gtk_label_set_text (GTK_LABEL (get_widget_assert (xml, "intro-label")), + gtk_label_set_text (GTK_LABEL (get_widget_assert (builder, "intro-label")), ds_cstr (&s)); ds_destroy (&s); } @@ -837,14 +837,14 @@ static void init_first_line_page (struct import_assistant *ia) { struct first_line_page *p = &ia->first_line; - GladeXML *xml = ia->asst.xml; + GtkBuilder *builder = ia->asst.builder; - p->page = add_page_to_assistant (ia, get_widget_assert (xml, "FirstLine"), + p->page = add_page_to_assistant (ia, get_widget_assert (builder, "FirstLine"), GTK_ASSISTANT_PAGE_CONTENT); - gtk_widget_destroy (get_widget_assert (xml, "first-line")); + gtk_widget_destroy (get_widget_assert (builder, "first-line")); p->tree_view = create_lines_tree_view ( - GTK_CONTAINER (get_widget_assert (xml, "first-line-scroller")), ia); - p->variable_names_cb = get_widget_assert (xml, "variable-names"); + GTK_CONTAINER (get_widget_assert (builder, "first-line-scroller")), ia); + p->variable_names_cb = get_widget_assert (builder, "variable-names"); gtk_tree_selection_set_mode ( gtk_tree_view_get_selection (GTK_TREE_VIEW (p->tree_view)), GTK_SELECTION_BROWSE); @@ -1022,23 +1022,23 @@ static const struct separator separators[] = static void init_separators_page (struct import_assistant *ia) { - GladeXML *xml = ia->asst.xml; + GtkBuilder *builder = ia->asst.builder; struct separators_page *p = &ia->separators; size_t i; choose_likely_separators (ia); - p->page = add_page_to_assistant (ia, get_widget_assert (xml, "Separators"), + p->page = add_page_to_assistant (ia, get_widget_assert (builder, "Separators"), GTK_ASSISTANT_PAGE_CONTENT); - p->custom_cb = get_widget_assert (xml, "custom-cb"); - p->custom_entry = get_widget_assert (xml, "custom-entry"); - p->quote_combo = get_widget_assert (xml, "quote-combo"); + p->custom_cb = get_widget_assert (builder, "custom-cb"); + p->custom_entry = get_widget_assert (builder, "custom-entry"); + p->quote_combo = get_widget_assert (builder, "quote-combo"); p->quote_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (p->quote_combo))); - p->quote_cb = get_widget_assert (xml, "quote-cb"); - p->escape_cb = get_widget_assert (xml, "escape"); + p->quote_cb = get_widget_assert (builder, "quote-cb"); + p->escape_cb = get_widget_assert (builder, "escape"); set_separators (ia); - p->fields_tree_view = GTK_TREE_VIEW (get_widget_assert (xml, "fields")); + p->fields_tree_view = GTK_TREE_VIEW (get_widget_assert (builder, "fields")); g_signal_connect (GTK_COMBO_BOX (p->quote_combo), "changed", G_CALLBACK (on_quote_combo_change), ia); g_signal_connect (p->quote_cb, "toggled", @@ -1048,7 +1048,7 @@ init_separators_page (struct import_assistant *ia) g_signal_connect (p->custom_cb, "toggled", G_CALLBACK (on_separators_custom_cb_toggle), ia); for (i = 0; i < SEPARATOR_CNT; i++) - g_signal_connect (get_widget_assert (xml, separators[i].name), + g_signal_connect (get_widget_assert (builder, separators[i].name), "toggled", G_CALLBACK (on_separator_toggle), ia); g_signal_connect (p->escape_cb, "toggled", G_CALLBACK (on_separator_toggle), ia); @@ -1317,7 +1317,7 @@ revise_fields_preview (struct import_assistant *ia) choose_column_names (ia); ia->separators.fields_tree_view = create_data_tree_view ( true, - GTK_CONTAINER (get_widget_assert (ia->asst.xml, "fields-scroller")), + GTK_CONTAINER (get_widget_assert (ia->asst.builder, "fields-scroller")), ia); pop_watch_cursor (ia); @@ -1358,7 +1358,7 @@ set_separators (struct import_assistant *ia) for (i = 0; i < SEPARATOR_CNT; i++) { const struct separator *s = &separators[i]; - GtkWidget *button = get_widget_assert (ia->asst.xml, s->name); + GtkWidget *button = get_widget_assert (ia->asst.builder, s->name); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), (seps & (1u << i)) != 0); } @@ -1391,7 +1391,7 @@ get_separators (struct import_assistant *ia) for (i = 0; i < SEPARATOR_CNT; i++) { const struct separator *sep = &separators[i]; - GtkWidget *button = get_widget_assert (ia->asst.xml, sep->name); + GtkWidget *button = get_widget_assert (ia->asst.builder, sep->name); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) ds_put_char (&s->separators, sep->c); } @@ -1525,12 +1525,12 @@ static void clear_modified_vars (struct import_assistant *); static void init_formats_page (struct import_assistant *ia) { - GladeXML *xml = ia->asst.xml; + GtkBuilder *builder = ia->asst.builder; struct formats_page *p = &ia->formats; - p->page = add_page_to_assistant (ia, get_widget_assert (xml, "Formats"), + p->page = add_page_to_assistant (ia, get_widget_assert (builder, "Formats"), GTK_ASSISTANT_PAGE_CONFIRM); - p->data_tree_view = GTK_TREE_VIEW (get_widget_assert (xml, "data")); + p->data_tree_view = GTK_TREE_VIEW (get_widget_assert (builder, "data")); p->modified_vars = NULL; p->modified_var_cnt = 0; } @@ -1629,7 +1629,7 @@ prepare_formats_page (struct import_assistant *ia) "may-create-vars", FALSE, (void *) NULL); - vars_scroller = GTK_BIN (get_widget_assert (ia->asst.xml, "vars-scroller")); + vars_scroller = GTK_BIN (get_widget_assert (ia->asst.builder, "vars-scroller")); old_var_sheet = gtk_bin_get_child (vars_scroller); if (old_var_sheet != NULL) gtk_widget_destroy (old_var_sheet); @@ -1639,7 +1639,7 @@ prepare_formats_page (struct import_assistant *ia) gtk_widget_destroy (GTK_WIDGET (ia->formats.data_tree_view)); ia->formats.data_tree_view = create_data_tree_view ( false, - GTK_CONTAINER (get_widget_assert (ia->asst.xml, "data-scroller")), + GTK_CONTAINER (get_widget_assert (ia->asst.builder, "data-scroller")), ia); pop_watch_cursor (ia); diff --git a/src/ui/gui/text-data-import.glade b/src/ui/gui/text-data-import.glade index 6ee9dd52..b638a1c7 100644 --- a/src/ui/gui/text-data-import.glade +++ b/src/ui/gui/text-data-import.glade @@ -1,6 +1,6 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -267,37 +267,39 @@ The selected file contains N lines of text. Only the first M of these will be s 4 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Space - True - 0 - True + + 1 + 3 + 3 + 4 + - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Ta_b + C_ustom True 0 True - 1 - 2 + 3 + 4 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Ban_g (!) + Slas_h (/) True 0 True @@ -305,38 +307,40 @@ The selected file contains N lines of text. Only the first M of these will be s 2 3 + 2 + 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Colon (:) + Semicolo_n (;) True 0 True - 1 - 2 + 1 + 2 + 2 + 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Co_mma (,) + P_ipe (|) True 0 True - 1 - 2 - 1 - 2 + 2 + 3 @@ -357,43 +361,43 @@ The selected file contains N lines of text. Only the first M of these will be s - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - P_ipe (|) + Co_mma (,) True 0 True - 2 - 3 + 1 + 2 + 1 + 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Semicolo_n (;) + _Colon (:) True 0 True - 1 - 2 - 2 - 3 + 1 + 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Slas_h (/) + Ban_g (!) True 0 True @@ -401,37 +405,33 @@ The selected file contains N lines of text. Only the first M of these will be s 2 3 - 2 - 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - C_ustom + Ta_b True 0 True - 3 - 4 + 1 + 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Space + True + 0 + True - - 1 - 3 - 3 - 4 - @@ -468,17 +468,19 @@ The selected file contains N lines of text. Only the first M of these will be s 2 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Quote separator characters with + Doubled quote mark treated as escape 0 True - - GTK_FILL + 2 + 1 + 2 + @@ -486,10 +488,6 @@ The selected file contains N lines of text. Only the first M of these will be s True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False - "' -" -' - True @@ -507,19 +505,17 @@ The selected file contains N lines of text. Only the first M of these will be s - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Doubled quote mark treated as escape + Quote separator characters with 0 True - 2 - 1 - 2 - + + GTK_FILL