summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Wong <email@ivanwong.info>2004-11-03 05:30:27 +0000
committerDavid Hoover <dhoover@src.gnome.org>2004-11-03 05:30:27 +0000
commit0b45fe74db1505b464b1756cb2fa85a448150544 (patch)
treedcde3e3ce6181da8753bd90ebb5677cedbaa5195 /src
parent66f3e73c715e5fa86a978eb51581c37d855cca85 (diff)
downloadglade-0b45fe74db1505b464b1756cb2fa85a448150544.tar.gz
Win32 related fixes (bug 154927)
2004-11-02 Ivan Wong <email@ivanwong.info> * acconfig.h, autogen.sh, config.h.win, configure.in, src/Makefile.am, src/glade-catalog.c, src/glade-palette.c, src/glade-project-window.c, src/glade-widget-class.c, src/glade_plugin.def, src/main.c: Win32 related fixes (bug 154927)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am13
-rw-r--r--src/glade-catalog.c3
-rw-r--r--src/glade-palette.c5
-rw-r--r--src/glade-project-window.c10
-rw-r--r--src/glade-widget-class.c2
-rw-r--r--src/glade_plugin.def47
-rw-r--r--src/main.c41
7 files changed, 88 insertions, 33 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bcc72916..11534bb4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,6 +12,13 @@ EXTRA_DIST = \
libgladegtk_la_SOURCES = glade-gtk.c
libgladegtk_la_LDFLAGS = -module -avoid-version
+if WITH_WIN32
+ glade_3_LDFLAGS = glade_plugin.def
+ libgladegtk_la_LDFLAGS += -no-undefined -L./ -Wl,$(bin_PROGRAMS).a $(GLADE_LIBS)
+ libgladegtk_la_DEPENDENCIES = $(bin_PROGRAMS).a
+ CLEANFILES = $(bin_PROGRAMS).a $(CLEANFILES)
+endif
+
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
@@ -25,7 +32,7 @@ INCLUDES = \
-DMODULES_DIR=\""@modulesdir@"\" \
-DG_LOG_DOMAIN=\"Glade\"
-CFLAGS = -g -Wall
+AM_CFLAGS = -g -Wall
glade_3_LDADD = \
$(GLADE_LIBS)
@@ -33,7 +40,7 @@ glade_3_LDADD = \
BUILT_SOURCES = \
glade-marshallers.c \
glade-marshallers.h
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES) $(CLEANFILES)
glade_3_SOURCES = \
main.c \
@@ -98,6 +105,8 @@ noinst_HEADERS = \
glade-id-allocator.h \
glade-marshallers.h
+$(bin_PROGRAMS).a: $(bin_PROGRAMS)
+ $(DLLTOOL) -D $(bin_PROGRAMS) -d glade_plugin.def -l $(bin_PROGRAMS).a
#
# Marshaller generation
#
diff --git a/src/glade-catalog.c b/src/glade-catalog.c
index 24dc13f7..2cb0a167 100644
--- a/src/glade-catalog.c
+++ b/src/glade-catalog.c
@@ -174,7 +174,7 @@ lblError:
GList *
glade_catalog_load_all (void)
{
- static const char * const filename = CATALOGS_DIR G_DIR_SEPARATOR_S "glade-palette.xml";
+ gchar *filename = g_build_filename (CATALOGS_DIR, "glade-palette.xml", NULL);
GladeXmlContext *context;
GladeXmlNode *root;
GladeXmlNode *xml_catalogs;
@@ -212,6 +212,7 @@ glade_catalog_load_all (void)
}
glade_xml_context_free (context);
+ g_free (filename);
return catalogs;
}
diff --git a/src/glade-palette.c b/src/glade-palette.c
index f7fa051e..db9184e2 100644
--- a/src/glade-palette.c
+++ b/src/glade-palette.c
@@ -140,6 +140,7 @@ glade_palette_selector_new (GladePalette *palette)
{
GtkWidget *hbox;
GtkWidget *image;
+ gchar *filename;
hbox = gtk_hbox_new (FALSE, 0);
@@ -147,7 +148,9 @@ glade_palette_selector_new (GladePalette *palette)
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (palette->selector), FALSE);
palette->widgets_button_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (palette->selector));
gtk_button_set_relief (GTK_BUTTON (palette->selector), GTK_RELIEF_NONE);
- image = gtk_image_new_from_file (PIXMAPS_DIR "/selector.png");
+ filename = g_build_filename (PIXMAPS_DIR, "selector.png", NULL);
+ image = gtk_image_new_from_file (filename);
+ g_free (filename);
gtk_container_add (GTK_CONTAINER (palette->selector), image);
glade_util_widget_set_tooltip (palette->selector, _("Selector"));
diff --git a/src/glade-project-window.c b/src/glade-project-window.c
index cab23141..554672ac 100644
--- a/src/glade-project-window.c
+++ b/src/glade-project-window.c
@@ -924,6 +924,7 @@ static void gpw_about_cb (void)
GtkWidget *glade_image;
GtkWidget *version;
GtkWidget *description;
+ gchar *filename;
gpw = glade_project_window_get ();
about_dialog = gtk_dialog_new_with_buttons (_("About Glade"), GTK_WINDOW (gpw->window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -934,7 +935,9 @@ static void gpw_about_cb (void)
vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_dialog)->vbox), vbox, TRUE, TRUE, 0);
- glade_image = gtk_image_new_from_file (GLADE_ICONDIR "/glade-3.png");
+ filename = g_build_filename (GLADE_ICONDIR, "glade-3.png", NULL);
+ glade_image = gtk_image_new_from_file (filename);
+ g_free (filename);
gtk_box_pack_start (GTK_BOX (vbox), glade_image, TRUE, TRUE, 0);
version = gtk_label_new (_("<span size=\"xx-large\"><b>Glade 3.0.0</b></span>"));
@@ -1208,11 +1211,14 @@ glade_project_window_create (GladeProjectWindow *gpw)
GtkWidget *toolbar;
GtkWidget *project_view;
GtkWidget *statusbar;
+ gchar *filename;
app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_move (GTK_WINDOW (app), 0, 0);
gtk_window_set_default_size (GTK_WINDOW (app), 280, 220);
- gtk_window_set_default_icon_from_file (GLADE_ICONDIR"/glade-3.png", NULL);
+ filename = g_build_filename (GLADE_ICONDIR, "glade-3.png", NULL);
+ gtk_window_set_default_icon_from_file (filename, NULL);
+ g_free (filename);
gpw->window = app;
vbox = gtk_vbox_new (FALSE, 0);
diff --git a/src/glade-widget-class.c b/src/glade-widget-class.c
index 9c4880b3..7fad2a95 100644
--- a/src/glade-widget-class.c
+++ b/src/glade-widget-class.c
@@ -271,7 +271,7 @@ glade_widget_class_create_icon (GladeWidgetClass *class)
if (class->generic_name)
{
- icon_path = g_strdup_printf (PIXMAPS_DIR "/%s.png", class->generic_name);
+ icon_path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.png", PIXMAPS_DIR, class->generic_name);
icon = gtk_image_new_from_file (icon_path);
g_free (icon_path);
}
diff --git a/src/glade_plugin.def b/src/glade_plugin.def
index 7ed0e264..4f59989d 100644
--- a/src/glade_plugin.def
+++ b/src/glade_plugin.def
@@ -1,24 +1,27 @@
-LIBRARY glade_plugin
DESCRIPTION "Implements the core glade functions needed by plugins"
EXPORTS
- glade_placeholder_get_type @1
- glade_placeholder_new @2
- glade_setup_log_handlers @3
- glade_widget_class_get_by_name @4
- glade_widget_class_dump_param_specs @5
- glade_project_window_new @6
- glade_project_window_show_all @7
- glade_project_new @8
- glade_project_open @9
- glade_project_remove_widget @10
- glade_register_transformations @11
- glade_cursor_init @12
- glade_catalog_load_all @13
- glade_widget_new_for_internal_child @14
- glade_widget_get_property @15
- glade_widget_get_type @16
- glade_project_window_new_project @17
- glade_project_window_open_project @18
- glade_property_set @19
- glade_project_get_tooltips @20
- glade_widget_get_project @21
+ glade_catalog_load_all
+ glade_command_create
+ glade_cursor_init
+ glade_placeholder_get_type
+ glade_placeholder_new
+ glade_project_get_tooltips
+ glade_project_new
+ glade_project_open
+ glade_project_remove_widget
+ glade_project_selection_get
+ glade_project_window_get
+ glade_project_window_get_active_project
+ glade_project_window_new
+ glade_project_window_new_project
+ glade_project_window_open_project
+ glade_project_window_show_all
+ glade_property_set
+ glade_register_transformations
+ glade_setup_log_handlers
+ glade_widget_class_dump_param_specs
+ glade_widget_class_get_by_name
+ glade_widget_get_project
+ glade_widget_get_property
+ glade_widget_get_type
+ glade_widget_new_for_internal_child
diff --git a/src/main.c b/src/main.c
index de75414a..280b430c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -35,7 +35,7 @@
#include <locale.h>
#include <gmodule.h>
-#ifdef G_OS_UNIX
+#ifdef HAVE_LIBPOPT
#include <popt.h>
#endif
@@ -45,7 +45,7 @@
static gchar *widget_name = NULL;
-#ifdef G_OS_UNIX
+#ifdef HAVE_LIBPOPT
static struct poptOption options[] = {
{
"dump",
@@ -123,13 +123,36 @@ glade_init (void)
return TRUE;
}
+#ifdef G_OS_WIN32
+char* g_glade_data_dir;
+char* g_pixmaps_dir;
+char* g_widgets_dir;
+char* g_catalogs_dir;
+char* g_modules_dir;
+char* g_glade_localedir;
+char* g_glade_icondir;
+#endif
+
int
main (int argc, char *argv[])
{
GList *files = NULL;
-#ifdef G_OS_UNIX
+#ifdef HAVE_LIBPOPT
poptContext popt_context;
#endif
+#ifdef G_OS_WIN32
+ gchar *prefix;
+
+ prefix = g_win32_get_package_installation_directory (NULL, NULL);
+ g_glade_data_dir = g_build_filename (prefix, "share", "glade", NULL);
+ g_pixmaps_dir = g_build_filename (prefix, "lib", PACKAGE "-" VERSION, "pixmaps", NULL);
+ g_widgets_dir = g_build_filename (prefix, "lib", PACKAGE "-" VERSION, "widgets", NULL);
+ g_catalogs_dir = g_build_filename (prefix, "lib", PACKAGE "-" VERSION, "catalogs", NULL);
+ g_modules_dir = g_build_filename (prefix, "lib", "glade", NULL);
+ g_glade_localedir = g_build_filename (prefix, "lib", "locale", NULL);
+ g_glade_icondir = g_build_filename (prefix, "share", "pixmaps", NULL);
+ g_free (prefix);
+#endif
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
@@ -140,7 +163,7 @@ main (int argc, char *argv[])
g_set_application_name (_("Glade-3 GUI Builder"));
-#ifdef G_OS_UNIX
+#ifdef HAVE_LIBPOPT
popt_context = poptGetContext ("Glade3", argc, (const char **) argv, options, 0);
files = parse_command_line (popt_context);
poptFreeContext (popt_context);
@@ -174,6 +197,16 @@ main (int argc, char *argv[])
gtk_main ();
+#ifdef G_OS_WIN32
+ g_free (g_glade_data_dir);
+ g_free (g_pixmaps_dir);
+ g_free (g_widgets_dir);
+ g_free (g_catalogs_dir);
+ g_free (g_modules_dir);
+ g_free (g_glade_localedir);
+ g_free (g_glade_icondir);
+#endif
+
return 0;
}