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

@ -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;
}