summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/Makefile.am55
-rw-r--r--gtk/gtk-win32.rc.in8
-rwxr-xr-xgtk/gtk.def32
-rw-r--r--gtk/gtkfilesel.c3
-rw-r--r--gtk/gtkmain.c73
-rw-r--r--gtk/gtkprivate.h19
-rw-r--r--gtk/gtkrc.c39
-rw-r--r--gtk/makefile.mingw.in16
-rw-r--r--gtk/maketypes.awk2
9 files changed, 157 insertions, 90 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 242fc689a..f80b6e58e 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = @STRIP_BEGIN@ \
-DGTK_VERSION=\"@GTK_VERSION@\" \
-DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \
-DTESTGTK_RCFILE=\"`pwd`/$(srcdir)/testgtkrc\" \
+ -DGTK_COMPILATION \
-I$(top_builddir)/gtk \
-I$(top_srcdir) -I../gdk \
-I$(top_srcdir)/gdk \
@@ -21,6 +22,44 @@ INCLUDES = @STRIP_BEGIN@ \
gtarget=@gdktarget@
+if PLATFORM_WIN32
+no_undefined = -no-undefined
+endif
+
+if OS_WIN32
+gtk_def = gtk.def
+gtk_win32_symbols = -export-symbols $(gtk_def)
+
+gtk_win32res_lo = gtk-win32res.lo
+
+gtk-win32res.lo : gtk-win32.rc
+ $(top_srcdir)/build/win32/lt-compile-resource gtk-win32.rc gtk-win32res.lo
+
+install-libtool-import-lib:
+ $(INSTALL) .libs/libgtk-win32-1.3.dll.a $(DESTDIR)$(libdir)
+uninstall-libtool-import-lib:
+ -rm $(DESTDIR)$(libdir)/libtk-win32-1.3.dll.a
+else
+install-libtool-import-lib:
+uninstall-libtool-import-lib:
+endif
+
+if MS_LIB_AVAILABLE
+noinst_DATA = gtk-win32-1.3.lib
+
+gtk-win32-1.3.lib: libgtk-win32-1.3.la gtk.def
+ lib -name:libgtk-win32-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gtk.def -out:$@
+
+install-ms-lib:
+ $(INSTALL) gtk-win32-1.3.lib $(DESTDIR)$(libdir)
+
+uninstall-ms-lib:
+ -rm $(DESTDIR)$(libdir)/gtk-win32-1.3.lib
+else
+install-ms-lib:
+uninstall-ms-lib:
+endif
+
# libtool stuff: set version and export symbols for resolving
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
@@ -29,6 +68,7 @@ LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-export-dynamic \
-rpath @prefix@/lib \
+ $(no_undefined) \
@LIBTOOL_EXPORT_OPTIONS@ \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la \
$(top_builddir)/gdk/@gdktargetlib@ \
@@ -394,7 +434,6 @@ gtk_extra_sources = @STRIP_BEGIN@ \
gtkmarshal.list \
@STRIP_END@
-
#
# setup GTK+ sources and their dependancies
#
@@ -504,15 +543,25 @@ libgtk_linux_fb_includedir = $(includedir)/gtk-2.0/gtk
libgtk_linux_fb_include_HEADERS = $(gtk_target_headers)
libgtk_linux_fb_1_3_la_SOURCES = $(gtk_target_sources)
endif
-EXTRA_LTLIBRARIES = libgtk-x11-1.3.la libgtk-linux-fb-1.3.la
+if USE_WIN32
+libgtk_win32_includedir = $(includedir)/gtk-2.0/gtk
+libgtk_win32_include_HEADERS = $(gtk_target_headers)
+libgtk_win32_1_3_la_SOURCES = $(gtk_target_sources)
+libgtk_win32_1_3_la_LDFLAGS = $(gtk_win32_symbols) -lwsock32
+libgtk_win32_1_3_la_LIBADD = $(gtk_win32res_lo)
+libgtk_win32_1_3_la_DEPENDENCIES = $(gtk_def) $(gtk_win32res_lo)
+endif
+EXTRA_LTLIBRARIES = libgtk-x11-1.3.la libgtk-linux-fb-1.3.la libgtk-win32-1.3.la
# We create a dummy theme for the default GTK+ theme
-install-data-local:
+install-data-local: install-ms-lib install-libtool-import-lib
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-2.0
echo "# Empty gtkrc for default theme" > $(DESTDIR)$(datadir)/themes/Default/gtk-2.0/gtkrc
rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0/gtkrc
+uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
+
DEPS = @gtktargetlib@ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la $(top_builddir)/gdk/@gdktargetlib@
TEST_DEPS = $(DEPS) gtk.immodules
diff --git a/gtk/gtk-win32.rc.in b/gtk/gtk-win32.rc.in
index 871fe05a5..fda5c6842 100644
--- a/gtk/gtk-win32.rc.in
+++ b/gtk/gtk-win32.rc.in
@@ -13,13 +13,13 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "040904B0"
BEGIN
- VALUE "CompanyName", "The GTK+ developer community"
+ VALUE "CompanyName", "The GTK developer community"
VALUE "FileDescription", "GIMP Toolkit"
VALUE "FileVersion", "@GTK_VERSION@.BUILDNUMBER"
- VALUE "InternalName", "gtk-win32-@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@"
+ VALUE "InternalName", "libgtk-win32-@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@-@LT_CURRENT_MINUS_AGE@"
VALUE "LegalCopyright", "Copyright © 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald. Modified by the GTK+ Team and others 1997-2000."
- VALUE "OriginalFilename", "gtk-win32-@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.dll"
- VALUE "ProductName", "GTK+"
+ VALUE "OriginalFilename", "libgtk-win32-@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@-@LT_CURRENT_MINUS_AGE@.dll"
+ VALUE "ProductName", "GTK"
VALUE "ProductVersion", "@GTK_VERSION@"
END
END
diff --git a/gtk/gtk.def b/gtk/gtk.def
index 13202007a..259e0e17a 100755
--- a/gtk/gtk.def
+++ b/gtk/gtk.def
@@ -4,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UPDATE_TYPE
GTK_TYPE_VISIBILITY
GTK_TYPE_WIDGET_FLAGS
+ GTK_TYPE_WIDGET_HELP_TYPE
GTK_TYPE_WINDOW_POSITION
GTK_TYPE_WINDOW_TYPE
GTK_TYPE_WRAP_MODE
@@ -214,7 +221,6 @@ EXPORTS
gtk_cell_renderer_text_get_type
gtk_cell_renderer_text_new
gtk_cell_renderer_text_set_fixed_height_from_font
- gtk_cell_renderer_toggle_get_active
gtk_cell_renderer_toggle_get_radio
gtk_cell_renderer_toggle_get_type
gtk_cell_renderer_toggle_new
@@ -1095,10 +1101,10 @@ EXPORTS
gtk_pixmap_new
gtk_pixmap_set
gtk_pixmap_set_build_insensitive
- gtk_plug_construct
- gtk_plug_get_id
- gtk_plug_get_type
- gtk_plug_new
+; gtk_plug_construct
+; gtk_plug_get_id
+; gtk_plug_get_type
+; gtk_plug_new
gtk_preview_draw_row
gtk_preview_get_cmap
gtk_preview_get_info
@@ -1290,11 +1296,11 @@ EXPORTS
gtk_size_group_new
gtk_size_group_remove_widget
gtk_size_group_set_mode
- gtk_socket_add_id
- gtk_socket_get_id
- gtk_socket_get_type
- gtk_socket_new
- gtk_socket_steal
+; gtk_socket_add_id
+; gtk_socket_get_id
+; gtk_socket_get_type
+; gtk_socket_new
+; gtk_socket_steal
gtk_spin_button_configure
gtk_spin_button_get_adjustment
gtk_spin_button_get_digits
@@ -1859,6 +1865,7 @@ EXPORTS
gtk_tree_view_column_get_min_width
gtk_tree_view_column_get_reorderable
gtk_tree_view_column_get_sizing
+ gtk_tree_view_column_get_sizing
gtk_tree_view_column_get_sort_column_id
gtk_tree_view_column_get_sort_indicator
gtk_tree_view_column_get_sort_order
@@ -2168,6 +2175,3 @@ EXPORTS
gtk_window_stick
gtk_window_unmaximize
gtk_window_unstick
-
-
-
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index fa330d0cc..902272b14 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -44,6 +44,9 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
+#ifdef HAVE_WINSOCK_H
+#include <winsock.h> /* For gethostname */
+#endif
#include "fnmatch.h"
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 450f3741a..2b46a4027 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -39,6 +39,11 @@
#ifdef G_OS_UNIX
#include <unistd.h>
#endif
+#ifdef G_OS_WIN32
+#define STRICT
+#include <windows.h>
+#undef STRICT
+#endif
#include <pango/pango-utils.h> /* For pango_split_file_list */
@@ -224,6 +229,56 @@ check_setugid (void)
return TRUE;
}
+#ifdef G_OS_WIN32
+
+G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
+
+const gchar *
+_gtk_get_libdir (void)
+{
+ static char *gtk_libdir = NULL;
+ if (gtk_libdir == NULL)
+ gtk_libdir = g_win32_get_package_installation_subdirectory
+ (GETTEXT_PACKAGE, dll_name, "lib");
+
+ return gtk_libdir;
+}
+
+const gchar *
+_gtk_get_localedir (void)
+{
+ static char *gtk_localedir = NULL;
+ if (gtk_localedir == NULL)
+ gtk_localedir = g_win32_get_package_installation_subdirectory
+ (GETTEXT_PACKAGE, dll_name, "lib\\locale");
+
+ return gtk_localedir;
+}
+
+const gchar *
+_gtk_get_sysconfdir (void)
+{
+ static char *gtk_sysconfdir = NULL;
+ if (gtk_sysconfdir == NULL)
+ gtk_sysconfdir = g_win32_get_package_installation_subdirectory
+ (GETTEXT_PACKAGE, dll_name, "etc");
+
+ return gtk_sysconfdir;
+}
+
+const gchar *
+_gtk_get_data_prefix (void)
+{
+ static char *gtk_data_prefix = NULL;
+ if (gtk_data_prefix == NULL)
+ gtk_data_prefix = g_win32_get_package_installation_directory
+ (GETTEXT_PACKAGE, dll_name);
+
+ return gtk_data_prefix;
+}
+
+#endif /* G_OS_WIN32 */
+
static gchar **
get_module_path (void)
{
@@ -236,13 +291,8 @@ get_module_path (void)
if (exe_prefix)
default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", "modules", NULL);
else
- {
-#ifndef G_OS_WIN32
- default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", "modules", NULL);
-#else
- default_dir = g_build_filename (get_gtk_win32_directory (""), "modules", NULL);
-#endif
- }
+ default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", "modules", NULL);
+
module_path = g_strconcat (module_path_env ? module_path_env : "",
module_path_env ? G_SEARCHPATH_SEPARATOR_S : "",
default_dir, NULL);
@@ -548,19 +598,10 @@ gtk_init_check (int *argc,
}
#ifdef ENABLE_NLS
-# ifndef G_OS_WIN32
bindtextdomain (GETTEXT_PACKAGE, GTK_LOCALEDIR);
# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
# endif
-# else /* !G_OS_WIN32 */
- {
- bindtextdomain (GETTEXT_PACKAGE,
- g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE,
- g_strdup_printf ("gtk-win32-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION),
- "locale"));
- }
-#endif
#endif
{
diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h
index 66943590c..0de6707cf 100644
--- a/gtk/gtkprivate.h
+++ b/gtk/gtkprivate.h
@@ -74,9 +74,26 @@ typedef enum
#define GTK_PRIVATE_SET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) |= (PRIVATE_ ## flag)); }G_STMT_END
#define GTK_PRIVATE_UNSET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) &= ~(PRIVATE_ ## flag)); }G_STMT_END
+#ifdef G_OS_WIN32
+
+const gchar *_gtk_get_libdir ();
+const gchar *_gtk_get_sysconfdir ();
+const gchar *_gtk_get_localedir ();
+const gchar *_gtk_get_data_prefix ();
+
+#undef GTK_LIBDIR
+#define GTK_LIBDIR _gtk_get_libdir ()
+#undef GTK_LOCALEDIR
+#define GTK_LOCALEDIR _gtk_get_localedir ()
+#undef GTK_SYSCONFDIR
+#define GTK_SYSCONFDIR _gtk_get_sysconfdir ()
+#undef GTK_DATA_PREFIX
+#define GTK_DATA_PREFIX _gtk_get_data_prefix ()
+
+#endif /* G_OS_WIN32 */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
-
#endif /* __GTK_PRIVATE_H__ */
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index b8d27f29f..204eb8214 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -295,39 +295,16 @@ static GSList *rc_dir_stack = NULL;
/* RC file handling */
-#ifdef G_OS_WIN32
-gchar *
-get_gtk_win32_directory (gchar *subdir)
-{
- static gchar *gtk_dll = NULL;
-
- if (!gtk_dll)
- gtk_dll = g_strdup_printf ("gtk-win32-%d.%d.dll", GTK_MAJOR_VERSION, GTK_MINOR_VERSION);
-
- if (subdir && strlen(subdir) > 0)
- return g_win32_get_package_installation_subdirectory (GETTEXT_PACKAGE,
- gtk_dll,
- subdir);
- else
- return g_win32_get_package_installation_directory (GETTEXT_PACKAGE,
- gtk_dll);
-}
-#endif /* G_OS_WIN32 */
-
static gchar *
gtk_rc_make_default_dir (const gchar *type)
{
gchar *var, *path;
-#ifndef G_OS_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_build_filename (var, "lib", "gtk-2.0", type, GTK_BINARY_VERSION, NULL);
else
path = g_build_filename (GTK_LIBDIR, "gtk-2.0,", type, GTK_BINARY_VERSION, NULL);
-#else
- path = g_build_filename (get_gtk_win32_directory (""), type, NULL);
-#endif
return path;
}
@@ -358,11 +335,7 @@ gtk_rc_get_im_module_file (void)
if (im_module_file)
result = g_strdup (im_module_file);
else
-#ifndef G_OS_WIN32
result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
-#else
- result = g_build_filename (get_gtk_win32_directory ("gtk-2.0"), "gtk.immodules", NULL);
-#endif
}
return result;
@@ -373,15 +346,11 @@ gtk_rc_get_theme_dir(void)
{
gchar *var, *path;
-#ifndef G_OS_WIN32
var = getenv("GTK_DATA_PREFIX");
if (var)
path = g_build_filename (var, "share", "themes", NULL);
else
path = g_build_filename (GTK_DATA_PREFIX, "share", "themes", NULL);
-#else
- path = g_build_filename (get_gtk_win32_directory (""), "themes", NULL);
-#endif
return path;
}
@@ -403,15 +372,11 @@ gtk_rc_append_default_module_path(void)
if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
return;
-#ifndef G_OS_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_build_filename (var, "lib", "gtk-2.0", GTK_VERSION, "engines", NULL);
else
path = g_build_filename (GTK_LIBDIR, "gtk-2.0", GTK_VERSION, "engines", NULL);
-#else
- path = g_build_filename (get_gtk_win32_directory ("gtk-2.0"), GTK_VERSION, "engines", NULL);
-#endif
module_path[n++] = path;
var = g_get_home_dir ();
@@ -452,11 +417,7 @@ gtk_rc_add_initial_default_files (void)
}
else
{
-#ifndef G_OS_WIN32
str = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtkrc", NULL);
-#else
- str = g_build_filename (get_gtk_win32_directory (""), "gtkrc", NULL);
-#endif
gtk_rc_add_default_file (str);
g_free (str);
diff --git a/gtk/makefile.mingw.in b/gtk/makefile.mingw.in
index 6501bee21..c2770cdd8 100644
--- a/gtk/makefile.mingw.in
+++ b/gtk/makefile.mingw.in
@@ -1,15 +1,13 @@
+####
+#### Out of order! Use autoconfiscation.
+####
+
## Makefile for building the GTK DLL with gcc on Win32
## Use: make -f makefile.mingw
## There is no install target, you have to decide where and
## how to install for yourself.
-# This is the location of pthreads for Win32,
-# see http://sourceware.cygnus.com/pthreads-win32/
-PTHREADS = ../../pthreads-snap-1999-05-30
-PTHREAD_LIB = -L $(PTHREADS) -lpthread
-PTHREAD_INC = -I $(PTHREADS)
-
OPTIMIZE = -g
TOP = ../..
@@ -459,12 +457,6 @@ testtextbuffer.exe : testtextbuffer.o
testtextbuffer.o : testtextbuffer.c
$(CC) $(CFLAGS) -UGTK_COMPILATION -c -DG_LOG_DOMAIN=\"testtextbuffer\" testtextbuffer.c
-testthreads.exe : testthreads.o
- $(CC) $(CFLAGS) -o $@ testthreads.o $(GTK_LIBS) $(GDK_LIBS) $(GLIB_LIBS) $(PTHREAD_LIB) $(LDFLAGS)
-
-testthreads.o : testthreads.c
- $(CC) $(CFLAGS) -I$(PTHREAD_INC) -UGTK_COMPILATION -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
-
simple.exe : simple.o
$(CC) $(CFLAGS) -o $@ simple.o $(GTK_LIBS) $(GDK_LIBS) $(GLIB_LIBS) $(LDFLAGS)
diff --git a/gtk/maketypes.awk b/gtk/maketypes.awk
index 8826c40ae..2a88f4549 100644
--- a/gtk/maketypes.awk
+++ b/gtk/maketypes.awk
@@ -83,7 +83,7 @@ function generate (generate_what)
}
if (gen_vars)
{
- printf ("GtkType %s = 0;\n", type_macro);
+ printf ("GTKTYPEBUILTINS_VAR GtkType %s = 0;\n", type_macro);
}
}