Commit 22a0c3a5 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

gdk/gdk.def Update.

2000-11-11  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdk.def
	* gtk/gtk.def: Update.

	* gdk/win32/*.c: Add last argument to g_type_register_static()
	calls.

	* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.

	* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
	generated by older wheel mouse drivers. Get the correct y
	coordinate from WM_MOUSEWHEEL messages.

	* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
	gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
	gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
	Debugging functions.

	* gdk/win32/gdkprivate-win32.h: Declare them.

	* gdk/win32/gdkinput-win32.h: Add declaration for
	gdk_input_window_destroy().

	* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.

	* gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
parent 4a08e76b
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk/gdk.def
* gtk/gtk.def: Update.
* gdk/win32/*.c: Add last argument to g_type_register_static()
calls.
* gdk/win32/gdkwindow-win32.c: Silence gcc -Wall.
* gdk/win32/gdkevents-win32.c: Handle MSH_MOUSEWHEEL messages
generated by older wheel mouse drivers. Get the correct y
coordinate from WM_MOUSEWHEEL messages.
* gdk/win32/gdkgc-win32.c (gdk_win32_cap_style_to_string,
gdk_win32_fill_style_to_string, gdk_win32_function_to_string,
gdk_win32_join_style_to_string, gdk_win32_line_style_to_string):
Debugging functions.
* gdk/win32/gdkprivate-win32.h: Declare them.
* gdk/win32/gdkinput-win32.h: Add declaration for
gdk_input_window_destroy().
* gtk/makefile.mingw.in: Pass -DGTK_VERSION. Add gtktreemodel.o.
Fri Nov 10 19:06:41 2000 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_insert_value): New
......
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
* io-tiff.c (gdk_pixbuf__tiff_image_begin_load): Use
g_file_open_tmp() (just added to GLib) instead of mkstemp() (or
mktemp() and open()).
......
......@@ -37,6 +37,7 @@ EXPORTS
gdk_pixbuf_new_from_file
gdk_pixbuf_new_from_inline
gdk_pixbuf_new_from_xpm_data
gdk_pixbuf_new_subpixbuf
gdk_pixbuf_postinit
gdk_pixbuf_preinit
gdk_pixbuf_ref
......
......@@ -92,6 +92,7 @@ EXPORTS
gdk_draw_text
gdk_draw_text_wc
gdk_drawable_get_colormap
gdk_drawable_get_image
gdk_drawable_get_size
gdk_drawable_get_type
gdk_drawable_get_visual
......@@ -157,6 +158,8 @@ EXPORTS
gdk_gc_set_foreground
gdk_gc_set_function
gdk_gc_set_line_attributes
gdk_gc_set_rgb_bg_color
gdk_gc_set_rgb_fg_color
gdk_gc_set_stipple
gdk_gc_set_subwindow
gdk_gc_set_tile
......
......@@ -75,7 +75,7 @@ gdk_colormap_get_type (void)
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkColormap",
&object_info);
&object_info, 0);
}
return object_type;
......
......@@ -130,7 +130,7 @@ gdk_drag_context_get_type (void)
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDragContext",
&object_info);
&object_info, 0);
}
return object_type;
......@@ -1231,12 +1231,13 @@ gdk_drop_finish (GdkDragContext *context,
GDK_NOTE (DND, g_print ("gdk_drop_finish\n"));
}
#ifdef OLE2_DND
static GdkFilterReturn
gdk_destroy_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer data)
{
#ifdef OLE2_DND
MSG *msg = (MSG *) xev;
if (msg->message == WM_DESTROY)
......@@ -1250,9 +1251,9 @@ gdk_destroy_filter (GdkXEvent *xev,
RevokeDragDrop (msg->hwnd);
CoLockObjectExternal (idtp, FALSE, TRUE);
}
#endif
return GDK_FILTER_CONTINUE;
}
#endif
void
gdk_window_register_dnd (GdkWindow *window)
......
......@@ -139,7 +139,7 @@ gdk_drawable_impl_win32_get_type (void)
object_type = g_type_register_static (GDK_TYPE_DRAWABLE,
"GdkDrawableImplWin32",
&object_info);
&object_info, 0);
}
return object_type;
......@@ -223,8 +223,7 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable,
GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc);
const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND;
HDC hdc;
HGDIOBJ oldpen, oldbrush;
HBRUSH hbr = NULL;
HGDIOBJ old_pen_or_brush;
POINT pts[4];
gboolean ok = TRUE;
......@@ -291,25 +290,18 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable,
if (ok && !FillPath (hdc))
WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
WIN32_GDI_FAILED ("DeleteObject");
}
else
{
if (filled)
oldpen = SelectObject (hdc, GetStockObject (NULL_PEN));
old_pen_or_brush = SelectObject (hdc, GetStockObject (NULL_PEN));
else
oldbrush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH));
old_pen_or_brush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH));
if (!Rectangle (hdc, x, y, x+width+1, y+height+1))
WIN32_GDI_FAILED ("Rectangle");
if (filled)
SelectObject (hdc, oldpen);
else
SelectObject (hdc, oldbrush);
SelectObject (hdc, old_pen_or_brush);
}
gdk_win32_hdc_release (drawable, gc, mask);
......@@ -397,7 +389,6 @@ gdk_win32_draw_polygon (GdkDrawable *drawable,
GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc);
const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND;
HDC hdc;
HBRUSH hbr = NULL;
POINT *pts;
gboolean ok = TRUE;
int i;
......@@ -445,10 +436,6 @@ gdk_win32_draw_polygon (GdkDrawable *drawable,
if (ok && !FillPath (hdc))
WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
WIN32_GDI_FAILED ("DeleteObject");
}
else
{
......@@ -778,7 +765,6 @@ gdk_win32_draw_segments (GdkDrawable *drawable,
GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc);
const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND;
HDC hdc;
HBRUSH hbr = NULL;
gboolean ok = TRUE;
int i;
......@@ -813,10 +799,6 @@ gdk_win32_draw_segments (GdkDrawable *drawable,
if (ok && !FillPath (hdc))
WIN32_GDI_FAILED ("FillPath"), ok = FALSE;
if (hbr != NULL)
if (!DeleteObject (hbr))
WIN32_GDI_FAILED ("DeleteObject");
}
else
{
......
......@@ -136,6 +136,7 @@ static GdkWindow *current_window = NULL;
static gint current_x, current_y;
static gdouble current_x_root, current_y_root;
static UINT gdk_ping_msg;
static UINT msh_mousewheel_msg;
static gboolean ignore_wm_char = FALSE;
static gboolean is_altgr_key = FALSE;
......@@ -296,8 +297,15 @@ gdk_events_init (void)
#endif
gdk_ping_msg = RegisterWindowMessage ("gdk-ping");
GDK_NOTE (EVENTS, g_print ("gdk-ping = %#.03x\n",
gdk_ping_msg));
GDK_NOTE (EVENTS, g_print ("gdk-ping = %#x\n", gdk_ping_msg));
/* This is the string MSH_MOUSEWHEEL from zmouse.h,
* http://www.microsoft.com/mouse/intellimouse/sdk/zmouse.h
* This message is used by mouse drivers than cannot generate WM_MOUSEWHEEL
* or on Win95.
*/
msh_mousewheel_msg = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL = %#x\n", msh_mousewheel_msg));
g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
......@@ -1454,7 +1462,7 @@ gdk_event_translate (GdkEvent *event,
return_val = !GDK_WINDOW_DESTROYED (window);
/* Will pass through switch below without match */
goto done;
}
else if (msg->message == gdk_selection_request_msg)
{
......@@ -1471,7 +1479,7 @@ gdk_event_translate (GdkEvent *event,
return_val = !GDK_WINDOW_DESTROYED (window);
/* Again, will pass through switch below without match */
goto done;
}
else if (msg->message == gdk_selection_clear_msg)
{
......@@ -1485,7 +1493,64 @@ gdk_event_translate (GdkEvent *event,
return_val = !GDK_WINDOW_DESTROYED (window);
/* Once again, we will pass through switch below without match */
goto done;
}
else if (msg->message == msh_mousewheel_msg)
{
GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL: %#lx %d\n",
(gulong) msg->hwnd, msg->wParam));
event->scroll.type = GDK_SCROLL;
/* MSG_MOUSEWHEEL is delivered to the foreground window. Work
* around that. Also, the position is in screen coordinates, not
* client coordinates as with the button messages.
*/
pt.x = LOWORD (msg->lParam);
pt.y = HIWORD (msg->lParam);
if ((hwnd = WindowFromPoint (pt)) == NULL)
goto done;
msg->hwnd = hwnd;
if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
goto done;
if (new_window != window)
{
gdk_drawable_unref (window);
ASSIGN_WINDOW (new_window);
gdk_drawable_ref (window);
}
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
&& gdk_input_ignore_core)
{
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
goto done;
}
if (!propagate (&window, msg,
p_grab_window, p_grab_owner_events, p_grab_mask,
doesnt_want_scroll))
goto done;
ASSIGN_WINDOW (window);
ScreenToClient (msg->hwnd, &pt);
event->button.window = window;
event->scroll.direction = ((int) msg->wParam > 0) ?
GDK_SCROLL_UP : GDK_SCROLL_DOWN;
event->scroll.window = window;
event->scroll.time = msg->time;
event->scroll.x = (gint16) pt.x;
event->scroll.y = (gint16) pt.y;
event->scroll.x_root = (gint16) LOWORD (msg->lParam);
event->scroll.y_root = (gint16) HIWORD (msg->lParam);
event->scroll.state = 0; /* No state information with MSH_MOUSEWHEEL */
event->scroll.device = gdk_core_pointer;
return_val = !GDK_WINDOW_DESTROYED (window);
goto done;
}
else
{
......@@ -2139,42 +2204,47 @@ gdk_event_translate (GdkEvent *event,
break;
case WM_MOUSEWHEEL:
GDK_NOTE (EVENTS, g_print ("WM_MOUSEWHEEL: %#lx\n", (gulong) msg->hwnd));
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
&& gdk_input_ignore_core)
{
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
break;
}
GDK_NOTE (EVENTS, g_print ("WM_MOUSEWHEEL: %#lx %d\n",
(gulong) msg->hwnd, HIWORD (msg->wParam)));
event->scroll.type = GDK_SCROLL;
/* WM_MOUSEWHEEL seems to be delivered to top-level windows
* only, for some reason. Work around that. Also, the position
* is in screen coordinates, not client coordinates as with the
* button messages. I love the consistency of Windows.
/* WM_MOUSEWHEEL is delivered to the focus window Work around
* that. Also, the position is in screen coordinates, not client
* coordinates as with the button messages. I love the
* consistency of Windows.
*/
pt.x = LOWORD (msg->lParam);
pt.y = HIWORD (msg->lParam);
if ((hwnd = WindowFromPoint (pt)) == NULL)
break;
msg->hwnd = hwnd;
if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
break;
if (new_window != window)
{
gdk_drawable_unref (window);
ASSIGN_WINDOW (new_window);
gdk_drawable_ref (window);
}
ScreenToClient (msg->hwnd, &pt);
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
&& gdk_input_ignore_core)
{
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
break;
}
if (!propagate (&window, msg,
p_grab_window, p_grab_owner_events, p_grab_mask,
doesnt_want_scroll))
break;
ASSIGN_WINDOW (window);
ScreenToClient (msg->hwnd, &pt);
event->button.window = window;
event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
GDK_SCROLL_UP : GDK_SCROLL_DOWN;
......@@ -2183,7 +2253,7 @@ gdk_event_translate (GdkEvent *event,
event->scroll.x = (gint16) pt.x;
event->scroll.y = (gint16) pt.y;
event->scroll.x_root = (gint16) LOWORD (msg->lParam);
event->scroll.y_root = (gint16) LOWORD (msg->lParam);
event->scroll.y_root = (gint16) HIWORD (msg->lParam);
event->scroll.state = build_pointer_event_state (msg);
event->scroll.device = gdk_core_pointer;
return_val = !GDK_WINDOW_DESTROYED (window);
......@@ -2204,7 +2274,7 @@ gdk_event_translate (GdkEvent *event,
event->crossing.x = current_x;
event->crossing.y = current_y;
event->crossing.x_root = current_xroot;
event->crossing.y_root = curYroot;
event->crossing.y_root = current_yroot;
event->crossing.mode = GDK_CROSSING_NORMAL;
if (current_window
&& IsChild (GDK_WINDOW_HWND (current_window), GDK_WINDOW_HWND (window)))
......
......@@ -72,7 +72,7 @@ gdk_gc_win32_get_type (void)
object_type = g_type_register_static (GDK_TYPE_GC,
"GdkGCWin32",
&object_info);
&object_info, 0);
}
return object_type;
......@@ -1454,3 +1454,101 @@ BitmapToRegion (HBITMAP hBmp)
return hRgn;
}
#ifdef G_ENABLE_DEBUG
gchar *
gdk_win32_cap_style_to_string (GdkCapStyle cap_style)
{
switch (cap_style)
{
#define CASE(x) case x: return #x + strlen ("GDK_CAP_")
CASE (GDK_CAP_NOT_LAST);
CASE (GDK_CAP_BUTT);
CASE (GDK_CAP_ROUND);
CASE (GDK_CAP_PROJECTING);
#undef CASE
default: return ("illegal GdkCapStyle value");
}
/* NOTREACHED */
return NULL;
}
gchar *
gdk_win32_fill_style_to_string (GdkFill fill)
{
switch (fill)
{
#define CASE(x) case x: return #x + strlen ("GDK_")
CASE (GDK_SOLID);
CASE (GDK_TILED);
CASE (GDK_STIPPLED);
CASE (GDK_OPAQUE_STIPPLED);
#undef CASE
default: return ("illegal GdkFill value");
}
/* NOTREACHED */
return NULL;
}
gchar *
gdk_win32_function_to_string (GdkFunction function)
{
switch (function)
{
#define CASE(x) case x: return #x + strlen ("GDK_")
CASE (GDK_COPY);
CASE (GDK_INVERT);
CASE (GDK_XOR);
CASE (GDK_CLEAR);
CASE (GDK_AND);
CASE (GDK_AND_REVERSE);
CASE (GDK_AND_INVERT);
CASE (GDK_NOOP);
CASE (GDK_OR);
CASE (GDK_EQUIV);
CASE (GDK_OR_REVERSE);
CASE (GDK_COPY_INVERT);
CASE (GDK_OR_INVERT);
CASE (GDK_NAND);