Commit 0b45fe74 authored by Ivan Wong's avatar Ivan Wong Committed by David Hoover
Browse files

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)
parent 66f3e73c
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)
2004-10-28 Tristan Van Berkom <tristan.van.berkom@gmail.com>
* src/glade-editor.[ch]: Implemented glade_editor_query_popup(), also obsoleted
......
......@@ -17,3 +17,5 @@
#undef CATALOGS_DIR
#undef MODULES_DIR
#undef GETTEXT_PACKAGE
@BOTTOM@
#include "config.h.win"
......@@ -39,4 +39,13 @@ if test -z "$gnome_autogen" ; then
exit 1
fi
GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen
automake_version=
case `uname` in
CYGWIN*)
# automake 1.4 of cygwin does not define EGREP in libtool.m4, and
# fails to do the file magic test when -rpath is given
automake_version=1.7
;;
esac
REQUIRED_AUTOMAKE_VERSION="$automake_version" GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen
#ifndef CONFIG_H__
#define CONFIG_H__
#define PIXMAPS_DIR "./pixmaps"
#define CATALOGS_DIR "./catalog"
#define WIDGETS_DIR "./widgets"
#define MODULES_DIR "./modules"
#define GLADE_ICONDIR "."
#ifdef WIN32
#undef GLADE_DATA_DIR
#undef PIXMAPS_DIR
#undef WIDGETS_DIR
#undef CATALOGS_DIR
#undef MODULES_DIR
#undef GLADE_LOCALEDIR
#undef GLADE_ICONDIR
#define GLADE_DATA_DIR g_glade_data_dir
#define PIXMAPS_DIR g_pixmaps_dir
#define WIDGETS_DIR g_widgets_dir
#define CATALOGS_DIR g_catalogs_dir
#define MODULES_DIR g_modules_dir
#define GLADE_LOCALEDIR g_glade_localedir
#define GLADE_ICONDIR g_glade_icondir
extern char* g_glade_data_dir;
extern char* g_pixmaps_dir;
extern char* g_widgets_dir;
extern char* g_catalogs_dir;
extern char* g_modules_dir;
extern char* g_glade_localedir;
extern char* g_glade_icondir;
#endif
......@@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
AC_INIT(src/glade-widget.c)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(glade, 2.90.0)
AM_MAINTAINER_MODE
......@@ -9,10 +10,12 @@ AM_CONFIG_HEADER(config.h)
AC_PROG_INTLTOOL([0.29])
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(DLLTOOL, dlltool)
AC_ISC_POSIX
AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
......@@ -90,6 +93,13 @@ AC_SUBST(widgetsdir)
AC_SUBST(catalogsdir)
AC_SUBST(modulesdir)
case $host_os in
*mingw* | pw32* | cygwin*)
win32=yes
;;
esac
AM_CONDITIONAL(WITH_WIN32, test x"$win32" = "xyes")
AC_OUTPUT([
Makefile
pixmaps/Makefile
......
......@@ -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
#
......
......@@ -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;
}
......
......@@ -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"));
......
......@@ -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);
......
......@@ -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);
}
......
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
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment