diff -Naurp gtk+-1.2.10/gdk/Makefile.in gtk+-1.2.10-cygwin/gdk/Makefile.in --- gtk+-1.2.10/gdk/Makefile.in Mon Apr 2 04:14:11 2001 +++ gtk+-1.2.10-cygwin/gdk/Makefile.in Thu Jan 3 10:21:50 2002 @@ -190,7 +190,7 @@ PROGRAMS = $(bin_PROGRAMS) gxid_OBJECTS = gxid.o gxid_DEPENDENCIES = gxid_LDFLAGS = -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ $(DLL_CFLAGS) COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -234,6 +234,9 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIE if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \ + echo "install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll"; \ + install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll; \ else :; fi; \ done @@ -241,6 +244,8 @@ uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \ + rm -f $(DESTDIR)$(bindir)/$$dll; \ done .c.o: @@ -281,8 +286,10 @@ distclean-libtool: maintainer-clean-libtool: +libgdk.la: DLL_CFLAGS = -DGDK_BUILD_DLL libgdk.la: $(libgdk_la_OBJECTS) $(libgdk_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libgdk_la_LDFLAGS) $(libgdk_la_OBJECTS) $(libgdk_la_LIBADD) $(LIBS) + cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ $$(glib-config --libs glib gmodule gthread) -L/usr/X11R6/lib -lXext -lX11 mostlyclean-binPROGRAMS: diff -Naurp gtk+-1.2.10/gdk/gdk.h gtk+-1.2.10-cygwin/gdk/gdk.h --- gtk+-1.2.10/gdk/gdk.h Tue Feb 13 01:37:08 2001 +++ gtk+-1.2.10-cygwin/gdk/gdk.h Thu Jan 3 09:51:08 2002 @@ -27,6 +27,13 @@ #ifndef __GDK_H__ #define __GDK_H__ +#ifndef GDK_IMPORT +#if (defined(_WIN32) || defined(__CYGWIN__)) && !(defined(GDK_BUILD_DLL) || defined(GDK_STATIC)) +#define GDK_IMPORT __declspec(dllimport) +#else +#define GDK_IMPORT +#endif +#endif #include @@ -35,6 +42,8 @@ extern "C" { #endif /* __cplusplus */ + + /* Initialization, exit and events */ #define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) @@ -981,7 +990,7 @@ gboolean gdk_keyval_is_lower (guint k /* Threading */ -extern GMutex *gdk_threads_mutex; +extern GDK_IMPORT GMutex *gdk_threads_mutex; void gdk_threads_enter (void); void gdk_threads_leave (void); diff -Naurp gtk+-1.2.10/gdk/gdkinput.h gtk+-1.2.10-cygwin/gdk/gdkinput.h --- gtk+-1.2.10/gdk/gdkinput.h Wed Feb 24 07:33:02 1999 +++ gtk+-1.2.10-cygwin/gdk/gdkinput.h Thu Jan 3 09:51:08 2002 @@ -31,6 +31,15 @@ #include #endif +#ifndef GDK_IMPORT +#if (defined(_WIN32) || defined(__CYGWIN__)) && !(defined(GDK_BUILD_DLL) || defined(GDK_STATIC)) +#define GDK_IMPORT __declspec(dllimport) +#else +#define GDK_IMPORT +#endif +#endif + + typedef struct _GdkAxisInfo GdkAxisInfo; typedef struct _GdkInputVTable GdkInputVTable; typedef struct _GdkDevicePrivate GdkDevicePrivate; @@ -147,11 +156,11 @@ struct _GdkInputWindow /* Global data */ -extern GdkInputVTable gdk_input_vtable; +extern GDK_IMPORT GdkInputVTable gdk_input_vtable; /* information about network port and host for gxid daemon */ -extern gchar *gdk_input_gxid_host; -extern gint gdk_input_gxid_port; -extern gint gdk_input_ignore_core; +extern GDK_IMPORT gchar *gdk_input_gxid_host; +extern GDK_IMPORT gint gdk_input_gxid_port; +extern GDK_IMPORT gint gdk_input_ignore_core; /* Function declarations */ diff -Naurp gtk+-1.2.10/gdk/gdkprivate.h gtk+-1.2.10-cygwin/gdk/gdkprivate.h --- gtk+-1.2.10/gdk/gdkprivate.h Mon Apr 2 03:06:12 2001 +++ gtk+-1.2.10-cygwin/gdk/gdkprivate.h Thu Jan 3 09:51:08 2002 @@ -32,6 +32,14 @@ #include #include +#ifndef GDK_IMPORT +#if (defined(_WIN32) || defined(__CYGWIN__)) && !(defined(GDK_BUILD_DLL) || defined(GDK_STATIC)) +#define GDK_IMPORT __declspec(dllimport) +#else +#define GDK_IMPORT +#endif +#endif + #define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid)) #define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid)) #define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid)) @@ -266,32 +274,32 @@ void gdk_dnd_display_drag_cursor(gint x, Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, GList *excludes, gboolean excl_child); Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child); -extern gint gdk_debug_level; -extern gint gdk_show_events; -extern gint gdk_use_xshm; -extern gint gdk_stack_trace; -extern gchar *gdk_display_name; -extern Display *gdk_display; -extern gint gdk_screen; -extern Window gdk_root_window; -extern Window gdk_leader_window; -extern GdkWindowPrivate gdk_root_parent; -extern Atom gdk_wm_delete_window; -extern Atom gdk_wm_take_focus; -extern Atom gdk_wm_protocols; -extern Atom gdk_wm_window_protocols[]; -extern Atom gdk_selection_property; -extern GdkDndGlobals gdk_dnd; -extern GdkWindow *selection_owner[]; -extern gchar *gdk_progclass; -extern gint gdk_error_code; -extern gint gdk_error_warnings; -extern gint gdk_null_window_warnings; -extern GList *gdk_default_filters; -extern const int gdk_nevent_masks; -extern const int gdk_event_mask_table[]; +extern GDK_IMPORT gint gdk_debug_level; +extern GDK_IMPORT gint gdk_show_events; +extern GDK_IMPORT gint gdk_use_xshm; +extern GDK_IMPORT gint gdk_stack_trace; +extern GDK_IMPORT gchar *gdk_display_name; +extern GDK_IMPORT Display *gdk_display; +extern GDK_IMPORT gint gdk_screen; +extern GDK_IMPORT Window gdk_root_window; +extern GDK_IMPORT Window gdk_leader_window; +extern GDK_IMPORT GdkWindowPrivate gdk_root_parent; +extern GDK_IMPORT Atom gdk_wm_delete_window; +extern GDK_IMPORT Atom gdk_wm_take_focus; +extern GDK_IMPORT Atom gdk_wm_protocols; +extern GDK_IMPORT Atom gdk_wm_window_protocols[]; +extern GDK_IMPORT Atom gdk_selection_property; +extern GDK_IMPORT GdkDndGlobals gdk_dnd; +extern GDK_IMPORT GdkWindow *selection_owner[]; +extern GDK_IMPORT gchar *gdk_progclass; +extern GDK_IMPORT gint gdk_error_code; +extern GDK_IMPORT gint gdk_error_warnings; +extern GDK_IMPORT gint gdk_null_window_warnings; +extern GDK_IMPORT GList *gdk_default_filters; +extern GDK_IMPORT const int gdk_nevent_masks; +extern GDK_IMPORT const int gdk_event_mask_table[]; -extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the +extern GDK_IMPORT GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the * x pointer grab */ @@ -301,8 +309,8 @@ gint gdk_im_open (void); void gdk_im_close (void); void gdk_ic_cleanup (void); -extern GdkICPrivate *gdk_xim_ic; /* currently using IC */ -extern GdkWindow *gdk_xim_window; /* currently using Window */ +extern GDK_IMPORT GdkICPrivate *gdk_xim_ic; /* currently using IC */ +extern GDK_IMPORT GdkWindow *gdk_xim_window; /* currently using Window */ #endif /* USE_XIM */ /* Debugging support */ @@ -319,7 +327,7 @@ extern GdkWindow *gdk_xim_window; #endif /* G_ENABLE_DEBUG */ -extern guint gdk_debug_flags; +extern GDK_IMPORT guint gdk_debug_flags; gboolean _gdk_font_wc_to_glyphs (GdkFont *font, diff -Naurp gtk+-1.2.10/gtk/Makefile.in gtk+-1.2.10-cygwin/gtk/Makefile.in --- gtk+-1.2.10/gtk/Makefile.in Mon Apr 2 04:14:13 2001 +++ gtk+-1.2.10-cygwin/gtk/Makefile.in Thu Jan 3 10:34:31 2002 @@ -272,7 +272,7 @@ testdnd_LDFLAGS = simple_SOURCES = simple.c simple_OBJECTS = simple.o simple_LDFLAGS = -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ $(DLL_CFLAGS) COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -320,6 +320,9 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIE if test -f $$p; then \ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \ + echo "install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll"; \ + install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll; \ else :; fi; \ done @@ -327,6 +330,8 @@ uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \ + rm -f $(DESTDIR)$(bindir)/$$dll; \ done .c.o: @@ -367,8 +372,10 @@ distclean-libtool: maintainer-clean-libtool: +libgtk.la: DLL_CFLAGS = -DGTK_BUILD_DLL libgtk.la: $(libgtk_la_OBJECTS) $(libgtk_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libgtk_la_LDFLAGS) $(libgtk_la_OBJECTS) $(libgtk_la_LIBADD) $(LIBS) + cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -L../../gdk/.libs -lgdk $$(glib-config --libs glib gmodule gthread) -lintl $(X_LIBS) -lXext -lX11 mostlyclean-noinstPROGRAMS: @@ -1525,12 +1532,12 @@ files: test: testgtk builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \ cd $$builddir; cd $(srcdir); \ - $(SHELL) $$top_builddir/libtool --mode=execute $$builddir/testgtk + PATH=$(top_builddir)/gdk/.libs:$(top_builddir)/gtk/.libs:$$PATH $(SHELL) $$top_builddir/libtool --mode=execute $$builddir/testgtk test-debug: testgtk builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \ cd $$builddir; cd $(srcdir); \ - $(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk + PATH=$(top_builddir)/gdk/.libs:$(top_builddir)/gtk/.libs:$$PATH $(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Naurp gtk+-1.2.10/gtk/gtkdebug.h gtk+-1.2.10-cygwin/gtk/gtkdebug.h --- gtk+-1.2.10/gtk/gtkdebug.h Wed Feb 24 07:34:15 1999 +++ gtk+-1.2.10-cygwin/gtk/gtkdebug.h Thu Jan 3 09:51:08 2002 @@ -27,6 +27,14 @@ #ifndef __GTK_DEBUG_H__ #define __GTK_DEBUG_H__ +#ifndef GTK_IMPORT +#if (defined(_WIN32) || defined(__CYGWIN__)) && !(defined(GTK_BUILD_DLL) || defined(GTK_STATIC)) +#define GTK_IMPORT __declspec(dllimport) +#else +#define GTK_IMPORT +#endif +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -51,7 +59,7 @@ typedef enum { #endif /* G_ENABLE_DEBUG */ -extern guint gtk_debug_flags; +extern GTK_IMPORT guint gtk_debug_flags; #ifdef __cplusplus } diff -Naurp gtk+-1.2.10/gtk/gtkfilesel.c gtk+-1.2.10-cygwin/gtk/gtkfilesel.c --- gtk+-1.2.10/gtk/gtkfilesel.c Fri Feb 16 04:36:19 2001 +++ gtk+-1.2.10-cygwin/gtk/gtkfilesel.c Thu Jan 3 09:51:08 2002 @@ -2004,7 +2004,6 @@ open_new_dir(gchar* dir_name, struct sta cmpl_errno = errno; return NULL; } - while((dirent_ptr = readdir(directory)) != NULL) { int entry_len = strlen(dirent_ptr->d_name); @@ -2027,6 +2026,18 @@ open_new_dir(gchar* dir_name, struct sta rewinddir(directory); +#ifdef __CYGWIN__ + /* + * this hack prevents "//" being used for "/" when reading + * directory. Cygwin does not accept // as a synonym for "/" + */ + if (strcmp(dir_name, ("/")) == 0) + { + path_buf[0] = '\0'; + path_buf_len = 0; + } +#endif /* __CYGWIN__ */ + for(i = 0; i < entry_count; i += 1) { dirent_ptr = readdir(directory); @@ -2128,7 +2139,6 @@ open_dir(gchar* dir_name, CompletionStat gboolean stat_subdirs; CompletionDirSent *sent; GList* cdsl; - if (!check_dir (dir_name, &sbuf, &stat_subdirs)) return NULL; @@ -2145,7 +2155,6 @@ open_dir(gchar* dir_name, CompletionStat cdsl = cdsl->next; } - sent = open_new_dir(dir_name, &sbuf, stat_subdirs); if (sent) { @@ -2180,6 +2189,14 @@ correct_dir_fullname(CompletionDir* cmpl { gint length = strlen(cmpl_dir->fullname); struct stat sbuf; + + #ifdef __CYGWIN__ + if (strcmp(cmpl_dir->fullname, "/") == 0) + { + return TRUE; + } + else + #endif /* __CYGWIN__ */ if (strcmp(cmpl_dir->fullname + length - 2, "/.") == 0) { diff -Naurp gtk+-1.2.10/gtk/gtkmain.c gtk+-1.2.10-cygwin/gtk/gtkmain.c --- gtk+-1.2.10/gtk/gtkmain.c Tue Feb 27 18:29:58 2001 +++ gtk+-1.2.10-cygwin/gtk/gtkmain.c Thu Jan 3 09:51:08 2002 @@ -383,6 +383,7 @@ gtk_init_check (int *argc, module_name = slist->data; slist->data = NULL; +#ifndef __CYGWIN__ if (!(module_name[0] == '/' || (module_name[0] == 'l' && module_name[1] == 'i' && @@ -393,6 +394,21 @@ gtk_init_check (int *argc, module_name = g_strconcat ("lib", module_name, ".so", NULL); g_free (old); } +#else + if (!(module_name[0] == '/' || + (module_name[0] == 'c' && + module_name[1] == 'y' && + module_name[2] == 'g') || + (module_name[0] == 'l' && + module_name[1] == 'i' && + module_name[2] == 'b'))) + { + gchar *old = module_name; + module_name = g_strconcat ("cyg", module_name, ".dll", NULL); + g_free (old); + } + +#endif if (g_module_supported ()) { module = g_module_open (module_name, G_MODULE_BIND_LAZY); diff -Naurp gtk+-1.2.10/gtk/gtkthemes.c gtk+-1.2.10-cygwin/gtk/gtkthemes.c --- gtk+-1.2.10/gtk/gtkthemes.c Fri Jan 21 23:22:50 2000 +++ gtk+-1.2.10-cygwin/gtk/gtkthemes.c Thu Jan 3 09:51:08 2002 @@ -71,8 +71,18 @@ gtk_theme_engine_get (const gchar *name) gchar *engine_path; GModule *library; +#ifdef __CYGWIN__ + g_snprintf (fullname, 1024, "cyg%s.dll", name); + engine_path = gtk_rc_find_module_in_path (fullname); + if (!engine_path) + { + g_snprintf (fullname, 1024, "lib%s.dll", name); + engine_path = gtk_rc_find_module_in_path (fullname); + } +#else g_snprintf (fullname, 1024, "lib%s.so", name); engine_path = gtk_rc_find_module_in_path (fullname); +#endif if (!engine_path) { diff -Naurp gtk+-1.2.10/gtk-config.in gtk+-1.2.10-cygwin/gtk-config.in --- gtk+-1.2.10/gtk-config.in Sat Oct 21 19:20:40 2000 +++ gtk+-1.2.10-cygwin/gtk-config.in Thu Jan 3 09:58:13 2002 @@ -107,6 +107,6 @@ if test "$echo_libs" = "yes"; then fi done - echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm + echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ fi diff -Naurp gtk+-1.2.10/mkdll.sh gtk+-1.2.10-cygwin/mkdll.sh --- gtk+-1.2.10/mkdll.sh Thu Jan 1 00:00:00 1970 +++ gtk+-1.2.10-cygwin/mkdll.sh Thu Jan 3 09:52:56 2002 @@ -0,0 +1,59 @@ +#!/bin/sh + +# script to generate dll from libtool-generated static archive (.la file) +# invoke in .libs directory with: +# mkdll.sh +# eg: +# mkdll.sh libtest.la -L/usr/local/lib -llocal + +# defaults to using gcc for libraries written in C. +# set the CC env var to use a different compiler driver: eg +# export CC=g++ +# for C++ libraries + +# defaults to using /usr/local as the installation PREFIX +# override this by setting the PREFIX env var: eg +# export PREFIX=/opt/gnome + +archive=$1 +module=$(echo $(basename $archive) | sed -e 's,^lib\(.*\).la$,\1,') + +shift +dependency_libs="$@" + +test -n "$CC" || CC=gcc +test -n "$PREFIX" || prefix=/usr/local + +# get the static library name +old_lib=$(sed -ne '/^old_library=/ s,^old_library='\''\(.*\)'\''.*$,\1,p' $archive) + +# update the archive with the dll and import lib name. +if sed -e 's,^dlname='\'\'',dlname='\'cyg${module}.dll\'',;s,^library_names='\'\'',library_names='\'lib${module}.dll.a\'',' $archive > ${archive}.tmp +then cat ${archive}.tmp > ${archive} +fi +rm -f ${archive}.tmp + +# update the install archive if it exists +if [ -f ${archive}i ] ; then + if sed -e 's,^dlname='\'\'',dlname='\'../bin/cyg${module}.dll\'',;s,^library_names='\'\'',library_names='\'lib${module}.dll.a\'',' ${archive}i > ${archive}i.tmp + then cat ${archive}i.tmp > ${archive}i + fi + rm -f ${archive}i.tmp +fi + +# update the archive with the install dir if not already set +libdir=${prefix}/lib +if sed -e '/^libdir=/ s,='\'\'',='\'$libdir\'',' $archive > ${archive}.tmp +then cat ${archive}.tmp > $archive +fi +rm -f ${archive}.tmp + + +# report the link command to stdout +eval echo $CC -shared -o cyg${module}.dll -Wl,--out-implib=lib${module}.dll.a \ +-Wl,--export-all-symbols -Wl,--whole-archive $old_lib -Wl,--no-whole-archive ${dependency_libs} + +# do the link command +eval $CC -shared -o cyg${module}.dll -Wl,--out-implib=lib${module}.dll.a -Wl,--export-all-symbols \ +-Wl,--whole-archive $old_lib -Wl,--no-whole-archive ${dependency_libs} + diff -Naurp gtk+-1.2.10/po/gtk+.pot gtk+-1.2.10-cygwin/po/gtk+.pot --- gtk+-1.2.10/po/gtk+.pot Wed Mar 28 22:12:02 2001 +++ gtk+-1.2.10-cygwin/po/gtk+.pot Thu Jan 3 10:19:22 2002 @@ -6,13 +6,13 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-03-28 16:12-0500\n" +"POT-Creation-Date: 2002-01-03 10:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" #: gtk/gtkcolorsel.c:221 msgid "Hue:" @@ -457,7 +457,7 @@ msgstr "" msgid "Unable to locate image file in pixmap_path: \"%s\"" msgstr "" -#: gtk/gtkthemes.c:79 +#: gtk/gtkthemes.c:89 #, c-format msgid "Unable to locate loadable module in module_path: \"%s\"," msgstr ""