This might seem like a large patch, but it isn't that bad, and nothing

should break on Unix/X11.

Win32 merge and general portability stuff:

* acconfig.h,configure.in: Check for <sys/time.h>.

* gdk/win32: New directory (actually, been there for a while).

* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.

* gtk/{gtk.def,makefile.msc}: New files.

* gtk/Makefile.am: Add above new files.

* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.

* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.

* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().

* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.

* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.

* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).

* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>.  Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.

* gtk/gtkmain.h: Mark variables for export/import on Win32.

* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.

* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.

* gtk/gtkselection.c: No chunks on Win32.

* gtk/gtksocket.c: Not implemented on Win32.

* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.

* gtk/makeenums.h: Include gdkprivate.h after gdk.h.

* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
This commit is contained in:
Tor Lillqvist 1999-03-15 00:03:37 +00:00
parent 044fd2db47
commit c65508d272
37 changed files with 2869 additions and 175 deletions

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -1,3 +1,65 @@
1999-03-15 Tor Lillqvist <tml@iki.fi>
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-13 Raja R Harinath <harinath@cs.umn.edu>
* configure.in (gdk_wc): Move widechar tests from `glib' to here,

View File

@ -29,6 +29,7 @@
#undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H
#undef HAVE_SYS_TIME_H
#undef HAVE_XCONVERTCASE
#undef WITH_SYMBOL_UNDERSCORE

175
config.h.win32 Executable file
View File

@ -0,0 +1,175 @@
/* config.h.win32. Handcrafted for Microsoft C */
#ifndef _MSC_VER
#error Unrecognized Win32 compiler, edit config.h.win32 by hand
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
#define alloca _alloca
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to empty, or __inline if that's what your compiler wants. */
#define inline __inline
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE*/
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Other stuff */
/* #undef ENABLE_NLS */
#define GTK_COMPILED_WITH_DEBUGGING "minimum"
/* #undef HAVE_CATGETS */
/* #undef HAVE_DIRENT_H */
/* #undef HAVE_GETTEXT */
/* #undef HAVE_IPC_H */
/* #undef HAVE_LC_MESSAGES */
/* #undef HAVE_PWD_H */
/* #undef HAVE_SHM_H */
/* #undef HAVE_STPCPY */
/* #undef HAVE_XSHM_H */
#define HAVE_SHAPE_EXT 1
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_TIME_H */
/* #undef HAVE_XCONVERTCASE */
/* #undef NO_FD_SET */
/* #undef XINPUT_NONE */
/* #undef XINPUT_GXI */
/* #undef XINPUT_XFREE */
#define XINPUT_WIN32 1
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if you have the __argz_count function. */
/* #undef HAVE___ARGZ_COUNT */
/* Define if you have the __argz_next function. */
/* #undef HAVE___ARGZ_NEXT */
/* Define if you have the __argz_stringify function. */
/* #undef HAVE___ARGZ_STRINGIFY */
/* Define if you have the broken_wctype function. */
/* #undef HAVE_BROKEN_WCTYPE */
/* Define if you have the dcgettext function. */
/* #undef HAVE_DCGETTEXT */
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the munmap function. */
/* #undef HAVE_MUNMAP */
/* Define if you have the putenv function. */
#define HAVE_PUTENV 1
#define putenv _putenv
/* Define if you have the setenv function. */
/* #undef HAVE_SETENV */
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
/* Define if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
#define strcasecmp stricmp
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the <argz.h> header file. */
/* #undef HAVE_ARGZ_H */
/* Define if you have the <dirent.h> header file. */
/* #undef HAVE_DIRENT_H */
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */
/* Define if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
/* Define if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1
/* Define if you have the i library (-li). */
/* #undef HAVE_LIBI */
/* Define if you have the intl library (-lintl). */
/* #undef HAVE_LIBINTL */
/* define if compiled symbols have a leading underscore */
/* #undef WITH_SYMBOL_UNDERSCORE */

View File

@ -271,6 +271,7 @@ AC_SUBST(GLIB_DEPLIBS)
AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
# Find the X11 include and library directories
AC_PATH_X

View File

@ -24,12 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include <stdio.h>
#if !defined (X_DISPLAY_MISSING)
#include <X11/Xlib.h>
#endif
#include "gdk.h"
#include "gdkprivate.h"
@ -37,41 +32,15 @@ guint gdk_debug_flags = 0;
HWND gdk_root_window;
HWND gdk_leader_window;
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
#if !defined(X_DISPLAY_MISSING)
gchar *gdk_display_name = NULL;
gint gdk_use_xshm = TRUE;
Atom gdk_wm_delete_window;
Atom gdk_wm_take_focus;
Atom gdk_wm_protocols;
Atom gdk_wm_window_protocols[2];
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
{0,0}, {0,0}, NULL};
GdkDndGlobals gdk_dnd = {None,None,None,
None,None,None,
None,
&gdk_dnd_cursorinfo,
NULL,
0,
FALSE, FALSE, FALSE,
None,
{0,0},
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
#elif defined (WINDOWS_DISPLAY)
HDC gdk_DC;
HINSTANCE gdk_DLLInstance;
HINSTANCE gdk_ProgInstance;
UINT gdk_selection_notify_msg;
UINT gdk_selection_request_msg;
UINT gdk_selection_clear_msg;
GdkAtom gdk_clipboard_atom;
GdkAtom gdk_win32_dropfiles_atom;
GdkAtom gdk_ole2_dnd_atom;
#endif /* WINDOWS_DISPLAY */
Atom gdk_selection_property;
gchar *gdk_progclass = NULL;
gint gdk_error_code;

View File

@ -24,12 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include <stdio.h>
#if !defined (X_DISPLAY_MISSING)
#include <X11/Xlib.h>
#endif
#include "gdk.h"
#include "gdkprivate.h"
@ -37,41 +32,15 @@ guint gdk_debug_flags = 0;
HWND gdk_root_window;
HWND gdk_leader_window;
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
#if !defined(X_DISPLAY_MISSING)
gchar *gdk_display_name = NULL;
gint gdk_use_xshm = TRUE;
Atom gdk_wm_delete_window;
Atom gdk_wm_take_focus;
Atom gdk_wm_protocols;
Atom gdk_wm_window_protocols[2];
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
{0,0}, {0,0}, NULL};
GdkDndGlobals gdk_dnd = {None,None,None,
None,None,None,
None,
&gdk_dnd_cursorinfo,
NULL,
0,
FALSE, FALSE, FALSE,
None,
{0,0},
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
#elif defined (WINDOWS_DISPLAY)
HDC gdk_DC;
HINSTANCE gdk_DLLInstance;
HINSTANCE gdk_ProgInstance;
UINT gdk_selection_notify_msg;
UINT gdk_selection_request_msg;
UINT gdk_selection_clear_msg;
GdkAtom gdk_clipboard_atom;
GdkAtom gdk_win32_dropfiles_atom;
GdkAtom gdk_ole2_dnd_atom;
#endif /* WINDOWS_DISPLAY */
Atom gdk_selection_property;
gchar *gdk_progclass = NULL;
gint gdk_error_code;

View File

@ -2679,9 +2679,9 @@ gdk_rgb_select_conv (GdkImage *image)
gboolean mask_rgb, mask_bgr;
depth = image_info->visual->depth;
#if !defined (X_DISPLAY_MISSING)
#if GDK_WINDOWING == GDK_WINDOWING_X11
bpp = ((GdkImagePrivate *)image)->ximage->bits_per_pixel;
#elif defined (WINDOWS_DISPLAY)
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
bpp = ((GdkVisualPrivate *) gdk_visual_get_system())->xvisual->bitspixel;
#endif
byte_order = image->byte_order;

View File

@ -33,7 +33,7 @@
#include <glib.h>
#ifdef NATIVE_WIN32
#ifdef COMPILING_GDK
#ifdef GDK_COMPILATION
#define GDKVAR __declspec(dllexport)
#else
#define GDKVAR extern __declspec(dllimport)
@ -42,6 +42,28 @@
#define GDKVAR extern
#endif
/* The system specific file gdkconfig.h contains such configuration
* settings that are needed not only when compiling GDK (or GTK)
* itself, but also occasionally when compiling programs that use GDK
* (or GTK). One such setting is what windowing API backend is in use.
*/
#include <gdkconfig.h>
/* Windowing API alternatives. Note that these macros indicate just
* what windowing system is in use, not what operating system. It is
* possible to built GDK for X11 in a Win32 environment, for instance.
*
* gdkconfig.h defines GDK_WINDOWING as one of the following. In
* addition to the original X11 only the Win32 implementation exists
* yet.
*/
#define GDK_WINDOWING_X11 1 /* X11 */
#define GDK_WINDOWING_WIN32 2 /* Win32 GDI */
#define GDK_WINDOWING_BEOS 3 /* BeOS */
#define GDK_WINDOWING_MACOS 4 /* MacOS */
#define GDK_WINDOWING_GGI 5 /* Linux GGI */
/* some common magic values */
#define GDK_NONE 0L
#define GDK_CURRENT_TIME 0L
#define GDK_PARENT_RELATIVE 1L

97
gdk/win32/makefile.msc Normal file
View File

@ -0,0 +1,97 @@
## Makefile for building the GDK DLL with Microsoft C
## Use: nmake -f makefile.msc
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
BIN = C:\bin
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
WTKIT = ..\..\wtkit125
# Full optimization:
OPTIMIZE = -Ox
# Debugging:
#OPTIMIZE = -Zi
################################################################
# Nothing much configurable below
# cl -? described the options
CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -nologo
LDFLAGS = /link /machine:ix86 # /debug /debugtype:cv
INSTALL = copy
TOUCH = copy makefile.msc+nul
GLIB_VER=1.2
GTK_VER=1.3
GLIB = ..\..\glib-$(GLIB_VER)
CFLAGS = -I. -I.. -I$(WTKIT)\include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" # -DMULTIPLE_WINDOW_CLASSES
all: \
..\config.h \
gdk-$(GTK_VER).dll
$(TOUCH) all
install : all
$(INSTALL) gdk-$(GTK_VER).dll $(BIN)
$(TOUCH) install
gdk_OBJECTS = \
gdk.obj \
gdkcc.obj \
gdkcolor.obj \
gdkcursor.obj \
gdkdnd.obj \
gdkdraw.obj \
gdkevents.obj \
gdkfont.obj \
gdkgc.obj \
gdkglobals.obj \
gdkim.obj \
gdkimage.obj \
gdkinput.obj \
gdkpixmap.obj \
gdkproperty.obj \
gdkrgb.obj \
gdkrectangle.obj\
gdkregion.obj \
gdkselection.obj\
gdkvisual.obj \
gdkwindow.obj \
gdkxid.obj
..\config.h : ..\config.h.win32
copy ..\config.h.win32 ..\config.h
gdk.res : rc\gdk.rc
rc -r -fo gdk.res rc\gdk.rc
gdk-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def gdk.res
$(CC) $(CFLAGS) -LD -Fegdk-$(GTK_VER).dll $(gdk_OBJECTS) $(GLIB)\glib-$(GLIB_VER).lib gdi32.lib user32.lib shell32.lib ole32.lib uuid.lib $(WTKIT)\lib\i386\wntab32x.lib $(LDFLAGS) gdk.res /def:gdk.def
.c.obj :
$(CC) $(CFLAGS) -GD -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
testgdk.exe : testgdk.obj gdk-$(GTK_VER).dll
$(CC) $(CFLAGS) testgdk.obj gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
testgdk.obj : testgdk.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgdk\" testgdk.c
clean:
del *.exe
del *.obj
del *.dll
del *.lib
del *.exp
del *.err
del *.map
del *.sym
del *.lk1
del *.mk1
del *.res
del *.pdb
del *.ilk

View File

@ -360,7 +360,9 @@ EXTRA_DIST = \
circles.xbm \
gtkrc.ja \
gtkrc.ko \
gtkrc.ru
gtkrc.ru \
gtk.def \
makefile.msc
INCLUDES = \
-DGTK_DISABLE_COMPAT_H \

View File

@ -36,6 +36,8 @@
#endif
#include "fnmatch.h"
/* We need glib.h for G_DIR_SEPARATOR, WIN32 and NATIVE_WIN32 */
#include <glib.h>
#include <ctype.h>
@ -49,7 +51,6 @@
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
extern int errno;
#endif
@ -66,7 +67,11 @@ fnmatch (pattern, string, flags)
register char c;
/* Note that this evalutes C many times. */
#ifndef WIN32
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
#else
#define FOLD(c) (tolower (c))
#endif
while ((c = *p++) != '\0')
{
@ -77,13 +82,13 @@ fnmatch (pattern, string, flags)
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
else if ((flags & FNM_FILE_NAME) && *n == G_DIR_SEPARATOR)
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == G_DIR_SEPARATOR)))
return FNM_NOMATCH;
break;
#ifndef NATIVE_WIN32
case '\\':
if (!(flags & FNM_NOESCAPE))
{
@ -93,14 +98,14 @@ fnmatch (pattern, string, flags)
if (FOLD (*n) != c)
return FNM_NOMATCH;
break;
#endif
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == G_DIR_SEPARATOR)))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
if (((flags & FNM_FILE_NAME) && *n == '/') ||
if (((flags & FNM_FILE_NAME) && *n == G_DIR_SEPARATOR) ||
(c == '?' && *n == '\0'))
return FNM_NOMATCH;
@ -108,7 +113,11 @@ fnmatch (pattern, string, flags)
return 0;
{
#ifndef NATIVE_WIN32
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
#else
char c1 = c;
#endif
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
@ -126,7 +135,7 @@ fnmatch (pattern, string, flags)
return FNM_NOMATCH;
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == G_DIR_SEPARATOR)))
return FNM_NOMATCH;
not = (*p == '!' || *p == '^');
@ -137,10 +146,10 @@ fnmatch (pattern, string, flags)
for (;;)
{
register char cstart = c, cend = c;
#ifndef NATIVE_WIN32
if (!(flags & FNM_NOESCAPE) && c == '\\')
cstart = cend = *p++;
#endif
cstart = cend = FOLD (cstart);
if (c == '\0')
@ -150,15 +159,17 @@ fnmatch (pattern, string, flags)
c = *p++;
c = FOLD (c);
if ((flags & FNM_FILE_NAME) && c == '/')
if ((flags & FNM_FILE_NAME) && c == G_DIR_SEPARATOR)
/* [/] can never match. */
return FNM_NOMATCH;
if (c == '-' && *p != ']')
{
cend = *p++;
#ifndef NATIVE_WIN32
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
#endif
if (cend == '\0')
return FNM_NOMATCH;
cend = FOLD (cend);
@ -185,9 +196,11 @@ fnmatch (pattern, string, flags)
return FNM_NOMATCH;
c = *p++;
#ifndef NATIVE_WIN32
if (!(flags & FNM_NOESCAPE) && c == '\\')
/* XXX 1003.2d11 is unclear if this is right. */
++p;
#endif
}
if (not)
return FNM_NOMATCH;
@ -205,7 +218,7 @@ fnmatch (pattern, string, flags)
if (*n == '\0')
return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
if ((flags & FNM_LEADING_DIR) && *n == G_DIR_SEPARATOR)
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;

1293
gtk/gtk.def Executable file

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <time.h>

View File

@ -2048,10 +2048,19 @@ gtk_drag_source_handle_event (GtkWidget *widget,
cursor = gtk_drag_get_cursor (event->dnd.context->action);
if (info->cursor != cursor)
{
#if GDK_WINDOWING == GDK_WINDOWING_X11
XChangeActivePointerGrab (GDK_WINDOW_XDISPLAY (widget->window),
PointerMotionMask | PointerMotionHintMask | ButtonReleaseMask,
((GdkCursorPrivate *)cursor)->xcursor,
event->dnd.time);
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
gdk_pointer_grab (widget->window, FALSE,
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_RELEASE_MASK,
NULL,
info->cursor, event->dnd.time);
#endif
info->cursor = cursor;
}
@ -2302,8 +2311,8 @@ gtk_drag_source_event_cb (GtkWidget *widget,
break;
}
if (MAX (abs (site->x - event->motion.x),
abs (site->y - event->motion.y)) > 3)
if (MAX (ABS (site->x - event->motion.x),
ABS (site->y - event->motion.y)) > 3)
{
GtkDragSourceInfo *info;
GdkDragContext *context;

View File

@ -45,18 +45,6 @@
#include <pwd.h>
#endif
#ifdef WIN32
#define STRICT
#include <windows.h>
#ifdef _MSC_VER
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
#endif
#define mkdir(path,mode) mkdir(path)
#endif
#endif
#include "fnmatch.h"
#include "gdk/gdkkeysyms.h"
@ -79,6 +67,19 @@
#include "gtkdialog.h"
#include "gtkintl.h"
#ifdef WIN32
#define STRICT
#include <windows.h>
#ifdef _MSC_VER
#include <direct.h>
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
#endif
#define mkdir(path,mode) mkdir(path)
#endif
#endif
#define DIR_LIST_WIDTH 180
#define DIR_LIST_HEIGHT 180
#define FILE_LIST_WIDTH 180

View File

@ -27,6 +27,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gtkitemfactory.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkoptionmenu.h"
@ -41,9 +43,18 @@
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#ifdef _MSC_VER
#include <io.h> /* For _open and _close */
#ifndef S_ISREG
#define S_ISREG(mode) ((mode)&_S_IFREG)
#endif
#endif
/* --- defines --- */
@ -265,12 +276,12 @@ gtk_item_factory_callback_marshal (GtkWidget *widget,
if (data->callback_type == 1)
{
GtkItemFactoryCallback1 func1 = data->func;
GtkItemFactoryCallback1 func1 = (GtkItemFactoryCallback1) data->func;
func1 (data->func_data, data->callback_action, widget);
}
else if (data->callback_type == 2)
{
GtkItemFactoryCallback2 func2 = data->func;
GtkItemFactoryCallback2 func2 = (GtkItemFactoryCallback2) data->func;
func2 (widget, data->func_data, data->callback_action);
}
}

View File

@ -28,10 +28,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdk/gdkx.h"
#include "gtklayout.h"
#include "gtksignal.h"
#include "gtkprivate.h"
#include "gdk/gdkx.h"
typedef struct _GtkLayoutAdjData GtkLayoutAdjData;
typedef struct _GtkLayoutChild GtkLayoutChild;
@ -868,6 +869,8 @@ gtk_layout_expose_area (GtkLayout *layout,
}
}
#if GDK_WINDOWING == GDK_WINDOWING_X11
/* This function is used to find events to process while scrolling
*/
@ -884,6 +887,8 @@ gtk_layout_expose_predicate (Display *display,
return False;
}
#endif /* X11 */
/* This is the main routine to do the scrolling. Scrolling is
* done by "Guffaw" scrolling, as in the Mozilla XFE, with
* a few modifications.
@ -915,8 +920,9 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
GtkLayout *layout)
{
GtkWidget *widget;
#if GDK_WINDOWING == GDK_WINDOWING_X11
XEvent xevent;
#endif
gint dx, dy;
widget = GTK_WIDGET (layout);
@ -1049,6 +1055,8 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
*/
gdk_flush();
#if GDK_WINDOWING == GDK_WINDOWING_X11
while (XCheckIfEvent(GDK_WINDOW_XDISPLAY (layout->bin_window),
&xevent,
gtk_layout_expose_predicate,
@ -1082,6 +1090,9 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
}
}
}
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
/* XXX Not implemented */
#endif
}
/* The main event filter. Actually, we probably don't really need
@ -1099,6 +1110,8 @@ gtk_layout_filter (GdkXEvent *gdk_xevent,
GdkEvent *event,
gpointer data)
{
#if GDK_WINDOWING == GDK_WINDOWING_X11
XEvent *xevent;
GtkLayout *layout;
@ -1131,6 +1144,9 @@ gtk_layout_filter (GdkXEvent *gdk_xevent,
}
break;
}
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
/* XXX Not implemented */
#endif
return GDK_FILTER_CONTINUE;
}
@ -1144,6 +1160,7 @@ gtk_layout_main_filter (GdkXEvent *gdk_xevent,
GdkEvent *event,
gpointer data)
{
#if GDK_WINDOWING == GDK_WINDOWING_X11
XEvent *xevent;
GtkLayout *layout;
@ -1169,7 +1186,9 @@ gtk_layout_main_filter (GdkXEvent *gdk_xevent,
return GDK_FILTER_REMOVE;
}
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
/* XXX Not implemented */
#endif
return GDK_FILTER_CONTINUE;
}

View File

@ -24,7 +24,13 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdk/gdkx.h" /* For GDK_WINDOWING */
#if GDK_WINDOWING == GDK_WINDOWING_X11
#include <X11/Xlocale.h> /* so we get the right setlocale */
#else
#include <locale.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -233,7 +239,7 @@ gtk_init_check (int *argc,
gchar **modules, **as;
#ifndef __EMX__
modules = g_strsplit (env_string, ":", -1);
modules = g_strsplit (env_string, G_SEARCHPATH_SEPARATOR_S, -1);
#else
modules = g_strsplit (env_string, ";", -1);
#endif
@ -354,14 +360,11 @@ gtk_init_check (int *argc,
module_name = slist->data;
slist->data = NULL;
#ifndef __EMX__
if (!(module_name[0] == '/' ||
(module_name[0] == 'l' &&
module_name[1] == 'i' &&
module_name[2] == 'b')))
if (!g_path_is_absolute (module_name))
{
gchar *old = module_name;
module_name = g_strconcat ("lib", module_name, ".so", NULL);
module_name = g_module_build_path (NULL, module_name);
g_free (old);
}
#else

View File

@ -56,11 +56,21 @@ typedef gint (*GtkKeySnoopFunc) (GtkWidget *grab_widget,
/* Gtk version.
*/
extern const guint gtk_major_version;
extern const guint gtk_minor_version;
extern const guint gtk_micro_version;
extern const guint gtk_binary_age;
extern const guint gtk_interface_age;
#ifdef NATIVE_WIN32
#ifdef GTK_COMPILATION
#define GTKMAIN_C_VAR __declspec(dllexport)
#else
#define GTKMAIN_C_VAR __declspec(dllimport) extern
#endif
#else
#define GTKMAIN_C_VAR extern
#endif
GTKMAIN_C_VAR const guint gtk_major_version;
GTKMAIN_C_VAR const guint gtk_minor_version;
GTKMAIN_C_VAR const guint gtk_micro_version;
GTKMAIN_C_VAR const guint gtk_binary_age;
GTKMAIN_C_VAR const guint gtk_interface_age;
gchar* gtk_check_version (guint required_major,
guint required_minor,
guint required_micro);

View File

@ -271,9 +271,13 @@ gtk_plug_key_press_event (GtkWidget *widget,
gtk_window_set_focus (GTK_WINDOW (widget), NULL);
gdk_error_trap_push ();
#if GDK_WINDOWING == GDK_WINDOWING_X11
XSetInputFocus (GDK_DISPLAY (),
GDK_WINDOW_XWINDOW (plug->socket_window),
RevertToParent, event->time);
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
SetFocus (GDK_WINDOW_XWINDOW (plug->socket_window));
#endif
gdk_flush ();
gdk_error_trap_pop ();
@ -292,6 +296,7 @@ gtk_plug_key_press_event (GtkWidget *widget,
static void
gtk_plug_forward_key_press (GtkPlug *plug, GdkEventKey *event)
{
#if GDK_WINDOWING == GDK_WINDOWING_X11
XEvent xevent;
xevent.xkey.type = KeyPress;
@ -316,6 +321,147 @@ gtk_plug_forward_key_press (GtkPlug *plug, GdkEventKey *event)
False, NoEventMask, &xevent);
gdk_flush ();
gdk_error_trap_pop ();
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
/* This is pretty bogus, and not tested at all. */
WPARAM wParam;
LPARAM lParam;
gboolean no_WM_CHAR = TRUE;
lParam = 0;
switch (event->keyval)
{
case GDK_Cancel:
wParam = VK_CANCEL; break;
case GDK_BackSpace:
wParam = VK_BACK; break;
case GDK_Tab:
wParam = VK_TAB; break;
case GDK_Clear:
wParam = VK_CLEAR; break;
case GDK_Return:
wParam = VK_RETURN; break;
case GDK_Shift_L:
wParam = VK_SHIFT; break;
case GDK_Control_L:
wParam = VK_CONTROL; break;
case GDK_Control_R:
wParam = VK_CONTROL; lParam |= 0x01000000; break;
case GDK_Alt_L:
wParam = VK_MENU; break;
case GDK_Alt_R:
wParam = VK_MENU; lParam |= 0x01000000; break;
case GDK_Pause:
wParam = VK_PAUSE; break;
case GDK_Caps_Lock:
wParam = VK_CAPITAL; break;
case GDK_Escape:
wParam = VK_ESCAPE; break;
case GDK_Prior:
wParam = VK_PRIOR; break;
case GDK_Next:
wParam = VK_NEXT; break;
case GDK_End:
wParam = VK_END; break;
case GDK_Home:
wParam = VK_HOME; break;
case GDK_Left:
wParam = VK_LEFT; break;
case GDK_Up:
wParam = VK_UP; break;
case GDK_Right:
wParam = VK_RIGHT; break;
case GDK_Down:
wParam = VK_DOWN; break;
case GDK_Select:
wParam = VK_SELECT; break;
case GDK_Print:
wParam = VK_PRINT; break;
case GDK_Execute:
wParam = VK_EXECUTE; break;
case GDK_Insert:
wParam = VK_INSERT; break;
case GDK_Delete:
wParam = VK_DELETE; break;
case GDK_Help:
wParam = VK_HELP; break;
case GDK_KP_0:
wParam = VK_NUMPAD0; break;
case GDK_KP_1:
wParam = VK_NUMPAD1; break;
case GDK_KP_2:
wParam = VK_NUMPAD2; break;
case GDK_KP_3:
wParam = VK_NUMPAD3; break;
case GDK_KP_4:
wParam = VK_NUMPAD4; break;
case GDK_KP_5:
wParam = VK_NUMPAD5; break;
case GDK_KP_6:
wParam = VK_NUMPAD6; break;
case GDK_KP_7:
wParam = VK_NUMPAD7; break;
case GDK_KP_8:
wParam = VK_NUMPAD8; break;
case GDK_KP_9:
wParam = VK_NUMPAD9; break;
case GDK_KP_Multiply:
wParam = VK_MULTIPLY; break;
case GDK_KP_Add:
wParam = VK_ADD; break;
case GDK_KP_Separator:
wParam = VK_SEPARATOR; break;
case GDK_KP_Subtract:
wParam = VK_SUBTRACT; break;
case GDK_KP_Decimal:
wParam = VK_DECIMAL; break;
case GDK_KP_Divide:
wParam = VK_DIVIDE; break;
case GDK_F1:
wParam = VK_F1; break;
case GDK_F2:
wParam = VK_F2; break;
case GDK_F3:
wParam = VK_F3; break;
case GDK_F4:
wParam = VK_F4; break;
case GDK_F5:
wParam = VK_F5; break;
case GDK_F6:
wParam = VK_F6; break;
case GDK_F7:
wParam = VK_F7; break;
case GDK_F8:
wParam = VK_F8; break;
case GDK_F9:
wParam = VK_F9; break;
case GDK_F10:
wParam = VK_F10; break;
case GDK_F11:
wParam = VK_F11; break;
case GDK_F12:
wParam = VK_F12; break;
case GDK_F13:
wParam = VK_F13; break;
case GDK_F14:
wParam = VK_F14; break;
case GDK_F15:
wParam = VK_F15; break;
case GDK_F16:
wParam = VK_F16; break;
default:
wParam = event->keyval;
no_WM_CHAR = FALSE;
break;
}
PostMessage (GDK_WINDOW_XWINDOW (plug->socket_window),
WM_KEYDOWN, wParam, lParam);
if (!no_WM_CHAR)
PostMessage (GDK_WINDOW_XWINDOW (plug->socket_window),
WM_CHAR, wParam, lParam);
PostMessage (GDK_WINDOW_XWINDOW (plug->socket_window),
WM_KEYUP, wParam, lParam);
#endif
}
/* Copied from Window, Ughh */
@ -422,6 +568,7 @@ gtk_plug_set_focus (GtkWindow *window,
if (focus && !GTK_WIDGET_HAS_FOCUS(window))
{
#if GDK_WINDOWING == GDK_WINDOWING_X11
XEvent xevent;
xevent.xfocus.type = FocusIn;
@ -436,5 +583,8 @@ gtk_plug_set_focus (GtkWindow *window,
False, NoEventMask, &xevent);
gdk_flush ();
gdk_error_trap_pop ();
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
/* XXX Not implemented */
#endif
}
}

View File

@ -24,11 +24,14 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include <math.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include "gdk/gdkx.h"
#include "gdk/gdkrgb.h"
#include "gtkpreview.h"

View File

@ -999,6 +999,8 @@ gtk_range_motion_notify (GtkWidget *widget,
if (event->is_hint || (event->window != range->slider))
gdk_window_get_pointer (range->slider, &x, &y, &mods);
else
mods = event->state;
switch (range->button)
{

View File

@ -24,16 +24,32 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gdk/gdkx.h"
#if GDK_WINDOWING == GDK_WINDOWING_X11
#include <X11/Xlocale.h> /* so we get the right setlocale */
#else
#include <locale.h>
#endif
#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
#include <io.h>
#endif
#include "gtkrc.h"
#include "gtkbindings.h"
#include "gtkthemes.h"
@ -113,7 +129,7 @@ static void gtk_rc_add_initial_default_files (void);
static const GScannerConfig gtk_rc_scanner_config =
{
(
" \t\n"
" \t\r\n"
) /* cset_skip_characters */,
(
G_CSET_a_2_z
@ -210,16 +226,49 @@ static GtkImageLoader image_loader = NULL;
/* RC file handling */
#ifdef NATIVE_WIN32
static gchar *
get_gtk_sysconf_directory ()
{
static gchar gtk_sysconf_dir[200];
gchar win_dir[100];
GetWindowsDirectory (win_dir, sizeof (win_dir));
sprintf (gtk_sysconf_dir, "%s\\gtk", win_dir);
return gtk_sysconf_dir;
}
static gchar *
get_themes_directory ()
{
/* We really should fetch this from the Registry. The GIMP
* installation program stores the Themes installation
* directory in HKLM\Software\GNU\GTk+\Themes\InstallDirectory.
* Later.
*/
static gchar themes_dir[200];
sprintf (themes_dir, "%s\\themes", get_gtk_sysconf_directory ());
return themes_dir;
}
#endif
gchar *
gtk_rc_get_theme_dir(void)
{
gchar *var, *path;
#ifndef NATIVE_WIN32
var = getenv("GTK_DATA_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/share/themes");
else
path = g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/themes");
#else
path = g_strdup (get_themes_directory ());
#endif
return path;
}
@ -229,11 +278,15 @@ gtk_rc_get_module_dir(void)
{
gchar *var, *path;
#ifndef NATIVE_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
else
path = g_strdup_printf("%s%s", GTK_EXE_PREFIX, "/lib/gtk/themes/engines");
#else
path = g_strdup_printf ("%s%s", get_themes_directory (), "\\engines");
#endif
return path;
}
@ -244,18 +297,24 @@ gtk_rc_append_default_pixmap_path(void)
gchar *var, *path;
gint n;
#ifndef NATIVE_WIN32
var = getenv("GTK_DATA_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/share/gtk/themes");
else
path = g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/gtk/themes");
#else
path = g_strdup (get_themes_directory ());
#endif
for (n = 0; pixmap_path[n]; n++) ;
if (n >= GTK_RC_MAX_PIXMAP_PATHS - 1)
return;
pixmap_path[n++] = g_strdup(path);
{
g_free (path);
return;
}
pixmap_path[n++] = path;
pixmap_path[n] = NULL;
g_free(path);
}
static void
@ -280,20 +339,28 @@ gtk_rc_append_default_module_path(void)
if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
return;
#ifndef NATIVE_WIN32
var = getenv("GTK_EXE_PREFIX");
if (var)
path = g_strdup_printf("%s%s", var, "/lib/gtk/themes/engines");
else
path = g_strdup_printf("%s%s", GTK_EXE_PREFIX, "/lib/gtk/themes/engines");
module_path[n++] = g_strdup(path);
g_free(path);
#else
path = g_strdup_printf ("%s%s", get_themes_directory (), "\\engines");
#endif
module_path[n++] = path;
var = getenv("HOME");
var = g_get_home_dir ();
if (var)
path = g_strdup_printf("%s%s", var, ".gtk/lib/themes/engines");
module_path[n++] = g_strdup(path);
{
#ifndef NATIVE_WIN32
path = g_strdup_printf ("%s%s", var, "/.gtk/lib/themes/engines");
#else
path = g_strdup_printf ("%s%s", var, "\\_gtk\\themes\\engines");
#endif
module_path[n++] = path;
}
module_path[n] = NULL;
g_free(path);
}
static void
@ -310,10 +377,10 @@ gtk_rc_add_initial_default_files (void)
gtk_rc_default_files[0] = NULL;
init = TRUE;
var = getenv("GTK_RC_FILES");
var = g_getenv("GTK_RC_FILES");
if (var)
{
files = g_strsplit (var, ":", 128);
files = g_strsplit (var, G_SEARCHPATH_SEPARATOR_S, 128);
i=0;
while (files[i])
{
@ -324,13 +391,21 @@ gtk_rc_add_initial_default_files (void)
}
else
{
str = g_strdup_printf ("%s%s", GTK_SYSCONFDIR, "/gtk/gtkrc");
#ifndef NATIVE_WIN32
str = g_strdup (GTK_SYSCONFDIR G_DIR_SEPARATOR_S "gtk" G_DIR_SEPARATOR_S "gtkrc");
#else
str = g_strdup_printf ("%s\\gtkrc", get_gtk_sysconf_directory ());
#endif
gtk_rc_add_default_file (str);
g_free (str);
str = g_strdup_printf ("%s%s", g_get_home_dir (), "/.gtkrc");
gtk_rc_add_default_file (str);
g_free (str);
var = g_get_home_dir ();
if (var)
{
str = g_strdup_printf ("%s" G_DIR_SEPARATOR_S ".gtkrc", var);
gtk_rc_add_default_file (str);
g_free (str);
}
}
}
@ -492,7 +567,7 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
{
/* Get the absolute pathname */
if (rc_file->name[0] == '/')
if (g_path_is_absolute (rc_file->name))
rc_file->canonical_name = rc_file->name;
else
{
@ -503,7 +578,7 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
str = g_string_new (cwd);
g_free (cwd);
g_string_append_c (str, '/');
g_string_append_c (str, G_DIR_SEPARATOR);
g_string_append (str, rc_file->name);
rc_file->canonical_name = str->str;
@ -526,7 +601,7 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
gchar *dir;
dir = g_strdup(rc_file->canonical_name);
for (i = strlen(dir) - 1; (i >= 0) && (dir[i] != '/'); i--)
for (i = strlen(dir) - 1; (i >= 0) && (dir[i] != G_DIR_SEPARATOR); i--)
dir[i] = 0;
gtk_rc_append_pixmap_path(dir);
g_free(dir);
@ -1513,7 +1588,8 @@ gtk_rc_find_pixmap_in_path (GScanner *scanner,
for (i = 0; (i < GTK_RC_MAX_PIXMAP_PATHS) && (pixmap_path[i] != NULL); i++)
{
buf = g_strdup_printf ("%s%c%s", pixmap_path[i], '/', pixmap_file);
buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s",
pixmap_path[i], pixmap_file);
fd = open (buf, O_RDONLY);
if (fd >= 0)
@ -1544,7 +1620,8 @@ gtk_rc_find_module_in_path (const gchar *module_file)
for (i = 0; (i < GTK_RC_MAX_MODULE_PATHS) && (module_path[i] != NULL); i++)
{
buf = g_strdup_printf ("%s%c%s", module_path[i], '/', module_file);
buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s",
module_path[i], module_file);
fd = open (buf, O_RDONLY);
if (fd >= 0)
@ -1908,7 +1985,7 @@ gtk_rc_parse_pixmap_path_string (gchar *pix_path)
for (end_offset = 0; end_offset <= path_len; end_offset++)
{
if ((buf[end_offset] == ':') ||
if ((buf[end_offset] == G_SEARCHPATH_SEPARATOR) ||
(end_offset == path_len))
{
buf[end_offset] = '\0';
@ -1964,7 +2041,7 @@ gtk_rc_parse_module_path_string (gchar *mod_path)
for (end_offset = 0; end_offset <= path_len; end_offset++)
{
if ((buf[end_offset] == ':') ||
if ((buf[end_offset] == G_SEARCHPATH_SEPARATOR) ||
(end_offset == path_len))
{
buf[end_offset] = '\0';

View File

@ -63,8 +63,12 @@
/* Maximum size of a sent chunk, in bytes. Also the default size of
our buffers */
#if GDK_WINDOWING == GDK_WINDOWING_WIN32
/* No chunks on Win32 */
#define GTK_SELECTION_MAX_SIZE G_MAXINT
#else
#define GTK_SELECTION_MAX_SIZE 4000
#endif
enum {
INCR,
MULTIPLE,

View File

@ -32,6 +32,8 @@
#include "gtksocket.h"
#include "gtkdnd.h"
#if GDK_WINDOWING == GDK_WINDOWING_X11
/* Forward declararations */
static void gtk_socket_class_init (GtkSocketClass *klass);
@ -745,3 +747,20 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
return return_val;
}
#elif GDK_WINDOWING == GDK_WINDOWING_WIN32
GtkWidget*
gtk_socket_new ()
{
g_error ("GtkSocket not implemented");
return NULL;
}
void
gtk_socket_steal (GtkSocket *socket, guint32 id)
{
g_error ("GtkSocket not implemented");
}
#endif /* GDK_WINDOWING */

View File

@ -78,13 +78,14 @@ gtk_theme_engine_get (gchar *name)
if (!result)
{
gchar fullname[1024];
gchar *fullname;
gchar *engine_path;
GModule *library;
#ifndef __EMX__
g_snprintf (fullname, 1024, "lib%s.so", name);
fullname = g_module_build_path (NULL, name);
#else
fullname = g_malloc (13);
gen_8_3_dll_name(name, fullname);
#endif
engine_path = gtk_rc_find_module_in_path (fullname);
@ -102,8 +103,10 @@ gtk_theme_engine_get (gchar *name)
g_warning (_("Unable to locate loadable module in module_path: \"%s\","),
fullname);
g_free (fullname);
return NULL;
}
g_free (fullname);
/* load the lib */

View File

@ -1,5 +1,5 @@
#include <gdk/gdkprivate.h>
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gtk/gtk.h>
#include <gtk/gtkprivate.h>
#include <gtk/gtkdebug.h>

398
gtk/makefile.msc Executable file
View File

@ -0,0 +1,398 @@
## Makefile for building the gtk DLL with Microsoft C
## Use: nmake -f makefile.msc
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
BIN = C:\bin
# This is the location of pthreads for Win32,
# see http://sourceware.cygnus.com/pthreads-win32/
PTHREAD_LIB = ..\..\lib\pthread.lib
PTHREAD_INC = ..\..\include
# Full optimization:
OPTIMIZE = -Ox
# Debugging:
#OPTIMIZE = -Zi
################################################################
# Nothing much configurable below
# cl -? described the options
# Some files use near as an identifier
CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -DHAVE_CONFIG_H -nologo -Dnear=xxnear
# Perl and awk are needed to generate some source files.
# These generated source files are distribuyted with the Win32 GTk+ source
# distributions, so don't worry if you don't have perl and awk.
PERL = perl
AWK = awk
# MEMCHECKLIB = mcw50.lib
LDFLAGS = /link /machine:ix86 # /debug /debugtype:cv
INSTALL = copy
TOUCH = copy makefile.msc+nul
GLIB_VER=1.2
GTK_VER=1.3
GDK = ..\gdk
GLIB = ..\..\glib-$(GLIB_VER)
CFLAGS = -I. -I.. -I../gdk -I$(GLIB) -I$(GLIB)\gmodule -DGTK_DISABLE_COMPAT_H
all : \
..\config.h \
gtkfeatures.h \
generated \
gtk-$(GTK_VER).dll\
testdnd.exe \
testgtk.exe \
testinput.exe \
testrgb.exe \
testselection.exe \
testthreads.exe \
simple.exe
install : all
$(INSTALL) gtk-$(GTK_VER).dll $(BIN)
$(TOUCH) install
gtk_OBJECTS = \
fnmatch.obj \
gtkaccelgroup.obj \
gtkaccellabel.obj \
gtkadjustment.obj \
gtkalignment.obj \
gtkarg.obj \
gtkarrow.obj \
gtkaspectframe.obj \
gtkbbox.obj \
gtkbin.obj \
gtkbindings.obj \
gtkbox.obj \
gtkbutton.obj \
gtkcalendar.obj \
gtkcheckbutton.obj \
gtkcheckmenuitem.obj \
gtkclist.obj \
gtkcolorsel.obj \
gtkcombo.obj \
gtkcontainer.obj \
gtkctree.obj \
gtkcurve.obj \
gtkdata.obj \
gtkdialog.obj \
gtkdnd.obj \
gtkdrawingarea.obj \
gtkeditable.obj \
gtkentry.obj \
gtkeventbox.obj \
gtkfilesel.obj \
gtkfixed.obj \
gtkfontsel.obj \
gtkframe.obj \
gtkgamma.obj \
gtkgc.obj \
gtkhandlebox.obj \
gtkhbbox.obj \
gtkhbox.obj \
gtkhpaned.obj \
gtkhruler.obj \
gtkhscale.obj \
gtkhscrollbar.obj \
gtkhseparator.obj \
gtkimage.obj \
gtkinputdialog.obj \
gtkinvisible.obj \
gtkitem.obj \
gtkitemfactory.obj \
gtklabel.obj \
gtklayout.obj \
gtklist.obj \
gtklistitem.obj \
gtkmain.obj \
gtkmarshal.obj \
gtkmenu.obj \
gtkmenubar.obj \
gtkmenufactory.obj \
gtkmenuitem.obj \
gtkmenushell.obj \
gtkmisc.obj \
gtknotebook.obj \
gtkobject.obj \
gtkoptionmenu.obj \
gtkpacker.obj \
gtkpaned.obj \
gtkpixmap.obj \
gtkplug.obj \
gtkpreview.obj \
gtkprogress.obj \
gtkprogressbar.obj \
gtkradiobutton.obj \
gtkradiomenuitem.obj \
gtkrange.obj \
gtkrc.obj \
gtkruler.obj \
gtkscale.obj \
gtkscrollbar.obj \
gtkscrolledwindow.obj \
gtkselection.obj \
gtkseparator.obj \
gtksignal.obj \
gtksocket.obj \
gtkspinbutton.obj \
gtkstatusbar.obj \
gtkstyle.obj \
gtktable.obj \
gtktearoffmenuitem.obj \
gtktext.obj \
gtkthemes.obj \
gtktipsquery.obj \
gtktogglebutton.obj \
gtktoolbar.obj \
gtktooltips.obj \
gtktree.obj \
gtktreeitem.obj \
gtktypeutils.obj\
gtkvbbox.obj \
gtkvbox.obj \
gtkviewport.obj \
gtkvpaned.obj \
gtkvruler.obj \
gtkvscale.obj \
gtkvscrollbar.obj \
gtkvseparator.obj \
gtkwidget.obj \
gtkwindow.obj
# Source headers which are non-autogenerated headers
source_headers = \
gtk.h \
gtkaccelgroup.h \
gtkaccellabel.h \
gtkadjustment.h \
gtkalignment.h \
gtkarg.h \
gtkarrow.h \
gtkaspectframe.h \
gtkbin.h \
gtkbindings.h \
gtkbbox.h \
gtkbox.h \
gtkbutton.h \
gtkcalendar.h \
gtkcheckbutton.h \
gtkcheckmenuitem.h \
gtkclist.h \
gtkcolorsel.h \
gtkcombo.h \
gtkcompat.h \
gtkcontainer.h \
gtkctree.h \
gtkcurve.h \
gtkdata.h \
gtkdebug.h \
gtkdialog.h \
gtkdnd.h \
gtkdrawingarea.h \
gtkeditable.h \
gtkentry.h \
gtkenums.h \
gtkeventbox.h \
gtkfilesel.h \
gtkfixed.h \
gtkfontsel.h \
gtkframe.h \
gtkgamma.h \
gtkgc.h \
gtkhandlebox.h \
gtkhbbox.h \
gtkhbox.h \
gtkhpaned.h \
gtkhruler.h \
gtkhscale.h \
gtkhscrollbar.h \
gtkhseparator.h \
gtkimage.h \
gtkinputdialog.h \
gtkintl.h \
gtkinvisible.h \
gtkitem.h \
gtkitemfactory.h \
gtklabel.h \
gtklayout.h \
gtklist.h \
gtklistitem.h \
gtkmain.h \
gtkmenu.h \
gtkmenubar.h \
gtkmenufactory.h \
gtkmenuitem.h \
gtkmenushell.h \
gtkmisc.h \
gtknotebook.h \
gtkobject.h \
gtkoptionmenu.h \
gtkpacker.h \
gtkpaned.h \
gtkpixmap.h \
gtkplug.h \
gtkpreview.h \
gtkprivate.h \
gtkprogress.h \
gtkprogressbar.h \
gtkradiobutton.h \
gtkradiomenuitem.h \
gtkrange.h \
gtkrc.h \
gtkruler.h \
gtkscale.h \
gtkscrollbar.h \
gtkscrolledwindow.h \
gtkselection.h \
gtkseparator.h \
gtksignal.h \
gtksocket.h \
gtkspinbutton.h \
gtkstyle.h \
gtkstatusbar.h \
gtktable.h \
gtktearoffmenuitem.h \
gtktext.h \
gtkthemes.h \
gtktipsquery.h \
gtktogglebutton.h \
gtktoolbar.h \
gtktooltips.h \
gtktree.h \
gtktreeitem.h \
gtktypeutils.h \
gtkvbbox.h \
gtkvbox.h \
gtkviewport.h \
gtkvpaned.h \
gtkvruler.h \
gtkvscale.h \
gtkvscrollbar.h \
gtkvseparator.h \
gtkwidget.h \
gtkwindow.h
# More headers to use when autogenerating.
gdk_headers = \
..\gdk\gdktypes.h \
..\gdk\gdkrgb.h
..\config.h : ..\config.h.win32
copy ..\config.h.win32 ..\config.h
gtkfeatures.h : gtkfeatures.h.win32
copy gtkfeatures.h.win32 gtkfeatures.h
#
# Generated source files:
#
generated : gtk.defs gtktypebuiltins.h gtktypebuiltins_vars.c gtktypebuiltins_ids.c gtktypebuiltins_evals.c gtkmarshal.h gtkmarshal.c
$(TOUCH) generated
gtk.defs : makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
$(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) >gd.tmp
copy gd.tmp+gtk-boxed.defs gtk.defs
@erase gd.tmp
# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
gtktypebuiltins.h: gtk.defs maketypes.awk
$(AWK) -f maketypes.awk gtk.defs macros >gtktypebuiltins.h
# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
gtktypebuiltins_vars.c: gtk.defs maketypes.awk
$(AWK) -f maketypes.awk gtk.defs variables >gtktypebuiltins_vars.c
# generate type entries for type-id registration
gtktypebuiltins_ids.c: gtk.defs maketypes.awk
$(AWK) -f maketypes.awk gtk.defs entries >gtktypebuiltins_ids.c
# generate enum value arrays
gtktypebuiltins_evals.c: makeenums.pl gtk.defs
$(PERL) makeenums.pl arrays $(source_headers) $(gdk_headers) >gtktypebuiltins_evals.c
gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
$(PERL) genmarshal.pl
del gtkmarshal.c
rename s-gmc gtkmarshal.c
del gtkmarshal.h
rename s-gmh gtkmarshal.h
#
# Linking:
#
gtk-$(GTK_VER).dll : $(gtk_OBJECTS) gtk.def
$(CC) $(CFLAGS) -LD -Fegtk-$(GTK_VER).dll $(gtk_OBJECTS) $(MEMCHECKLIB) $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib gdi32.lib user32.lib $(LDFLAGS) /def:gtk.def
# General rule for compiling the objects into the DLL
.c.obj :
$(CC) $(CFLAGS) -GD -c -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" $<
#
# Test programs:
#
testdnd.exe : testdnd.obj
$(CC) $(CFLAGS) testdnd.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
# Must have separate rules for these objects that don't go in the DLL
testdnd.obj : testdnd.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testdnd\" testdnd.c
testgtk.exe : testgtk.obj
$(CC) $(CFLAGS) testgtk.obj $(MEMCHECKLIB) gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
testgtk.obj : testgtk.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgtk\" testgtk.c
testinput.exe : testinput.obj
$(CC) $(CFLAGS) testinput.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
testinput.obj : testinput.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testinput\" testinput.c
testrgb.exe : testrgb.obj
$(CC) $(CFLAGS) testrgb.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
testrgb.obj : testrgb.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testrgb\" testrgb.c
testselection.exe : testselection.obj
$(CC) $(CFLAGS) testselection.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
testselection.obj : testselection.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testselection\" testselection.c
testthreads.exe : testthreads.obj
$(CC) $(CFLAGS) testthreads.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS)
testthreads.obj : testthreads.c
$(CC) $(CFLAGS) -I$(PTHREAD_INC) -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
simple.exe : simple.obj
$(CC) $(CFLAGS) simple.obj gtk-$(GTK_VER).lib $(GDK)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
simple.obj : simple.c
$(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"simple\" simple.c
# The clean target doesn't remove the generated sources
clean:
del *.exe
del *.obj
del *.dll
del *.lib
del *.exp
del *.err
del *.map
del *.sym
del *.lk1
del *.mk1
del *.pdb
del *.ilk

View File

@ -20,7 +20,20 @@ BEGIN {
}
if (gen_macros)
printf ("/* type macros, generated by maketypes.awk */\n\n");
{
printf ("/* type macros, generated by maketypes.awk */\n");
printf ("\n");
printf ("#ifdef NATIVE_WIN32\n");
printf ("# ifdef GTK_COMPILATION\n");
printf ("# define GTKTYPEBUILTINS_VAR __declspec(dllexport)\n");
printf ("# else\n");
printf ("# define GTKTYPEBUILTINS_VAR extern __declspec(dllimport)\n");
printf ("# endif\n");
printf ("#else\n");
printf ("# define GTKTYPEBUILTINS_VAR extern\n");
printf ("#endif\n");
printf ("\n");
}
else if (gen_entries)
printf ("/* type entries, generated by maketypes.awk */\n\n");
else if (gen_vars)
@ -56,7 +69,7 @@ function generate (generate_1)
{
if (gen_macros)
{
printf ("extern GtkType %s;\n", type_macro);
printf ("GTKTYPEBUILTINS_VAR GtkType %s;\n", type_macro);
}
if (gen_entries)
{

View File

@ -17,6 +17,10 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib.h>
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
@ -28,10 +32,10 @@
/* Note: these #includes differ slightly from the testrgb.c file included
in the GdkRgb release. */
/* For gettimeofday */
#include <sys/time.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include "gtk.h"
@ -44,24 +48,12 @@ quit_func (GtkWidget *widget, gpointer dummy)
#define WIDTH 320
#define HEIGHT 200
gdouble
get_time (void)
{
struct timeval tv;
struct timezone tz;
gettimeofday (&tv, &tz);
return tv.tv_sec + 1e-6 * tv.tv_usec;
}
#define NUM_ITERS 100
static void
testrgb_rgb_test (GtkWidget *drawing_area)
{
guchar buf[WIDTH * HEIGHT * 6];
guchar *buf;
gint i, j;
gint offset;
guchar val;
@ -69,6 +61,9 @@ testrgb_rgb_test (GtkWidget *drawing_area)
gint x, y;
gboolean dither;
int dith_max;
GTimer *timer;
buf = g_malloc (WIDTH * HEIGHT * 6);
val = 0;
for (j = 0; j < WIDTH * HEIGHT * 6; j++)
@ -94,9 +89,10 @@ testrgb_rgb_test (GtkWidget *drawing_area)
else
dith_max = 1;
timer = g_timer_new ();
for (dither = 0; dither < dith_max; dither++)
{
start_time = get_time ();
start_time = g_timer_elapsed (timer, NULL);
for (i = 0; i < NUM_ITERS; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 3)) & -4;
@ -107,7 +103,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
GDK_RGB_DITHER_NONE,
buf + offset, WIDTH * 3);
}
total_time = get_time () - start_time;
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("Color test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
dither ? " (dithered)" : "",
total_time,
@ -117,7 +113,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
for (dither = 0; dither < dith_max; dither++)
{
start_time = get_time ();
start_time = g_timer_elapsed (timer, NULL);
for (i = 0; i < NUM_ITERS; i++)
{
offset = (rand () % (WIDTH * HEIGHT)) & -4;
@ -128,7 +124,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
GDK_RGB_DITHER_NONE,
buf + offset, WIDTH);
}
total_time = get_time () - start_time;
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("Grayscale test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
dither ? " (dithered)" : "",
total_time,

View File

@ -17,6 +17,10 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib.h>
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
@ -28,10 +32,10 @@
/* Note: these #includes differ slightly from the testrgb.c file included
in the GdkRgb release. */
/* For gettimeofday */
#include <sys/time.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include "gtk.h"
@ -44,24 +48,12 @@ quit_func (GtkWidget *widget, gpointer dummy)
#define WIDTH 320
#define HEIGHT 200
gdouble
get_time (void)
{
struct timeval tv;
struct timezone tz;
gettimeofday (&tv, &tz);
return tv.tv_sec + 1e-6 * tv.tv_usec;
}
#define NUM_ITERS 100
static void
testrgb_rgb_test (GtkWidget *drawing_area)
{
guchar buf[WIDTH * HEIGHT * 6];
guchar *buf;
gint i, j;
gint offset;
guchar val;
@ -69,6 +61,9 @@ testrgb_rgb_test (GtkWidget *drawing_area)
gint x, y;
gboolean dither;
int dith_max;
GTimer *timer;
buf = g_malloc (WIDTH * HEIGHT * 6);
val = 0;
for (j = 0; j < WIDTH * HEIGHT * 6; j++)
@ -94,9 +89,10 @@ testrgb_rgb_test (GtkWidget *drawing_area)
else
dith_max = 1;
timer = g_timer_new ();
for (dither = 0; dither < dith_max; dither++)
{
start_time = get_time ();
start_time = g_timer_elapsed (timer, NULL);
for (i = 0; i < NUM_ITERS; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 3)) & -4;
@ -107,7 +103,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
GDK_RGB_DITHER_NONE,
buf + offset, WIDTH * 3);
}
total_time = get_time () - start_time;
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("Color test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
dither ? " (dithered)" : "",
total_time,
@ -117,7 +113,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
for (dither = 0; dither < dith_max; dither++)
{
start_time = get_time ();
start_time = g_timer_elapsed (timer, NULL);
for (i = 0; i < NUM_ITERS; i++)
{
offset = (rand () % (WIDTH * HEIGHT)) & -4;
@ -128,7 +124,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
GDK_RGB_DITHER_NONE,
buf + offset, WIDTH);
}
total_time = get_time () - start_time;
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("Grayscale test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
dither ? " (dithered)" : "",
total_time,