1999-11-11 22:12:27 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
* Copyright (C) 1998-1999 Tor Lillqvist
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1999-11-11 22:12:27 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1999-11-11 22:12:27 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1999-11-11 22:12:27 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-11-11 22:12:27 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
/* Cannot use TrackMouseEvent, as the stupid WM_MOUSELEAVE message
|
|
|
|
* doesn't tell us where the mouse has gone. Thus we cannot use it to
|
|
|
|
* generate a correct GdkNotifyType. Pity, as using TrackMouseEvent
|
|
|
|
* otherwise would make it possible to reliably generate
|
|
|
|
* GDK_LEAVE_NOTIFY events, which would help get rid of those pesky
|
|
|
|
* tooltips sometimes popping up in the wrong place.
|
|
|
|
*/
|
|
|
|
/* define USE_TRACKMOUSEEVENT */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
#include "gdkprivate-win32.h"
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
#include <objbase.h>
|
|
|
|
#include <imm.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_DIMM_H
|
|
|
|
#include <dimm.h>
|
|
|
|
#else
|
|
|
|
#include "surrogate-dimm.h"
|
|
|
|
#endif
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
#include "gdk.h"
|
|
|
|
#include "gdkinternals.h"
|
|
|
|
#include "gdkinput-win32.h"
|
|
|
|
|
|
|
|
#include "gdkkeysyms.h"
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
#define PING() printf("%s: %d\n",__FILE__,__LINE__),fflush(stdout)
|
|
|
|
|
|
|
|
typedef struct _GdkIOClosure GdkIOClosure;
|
|
|
|
typedef struct _GdkEventPrivate GdkEventPrivate;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
/* Following flag is set for events on the event queue during
|
|
|
|
* translation and cleared afterwards.
|
|
|
|
*/
|
|
|
|
GDK_EVENT_PENDING = 1 << 0
|
|
|
|
} GdkEventFlags;
|
|
|
|
|
|
|
|
struct _GdkIOClosure
|
|
|
|
{
|
|
|
|
GdkInputFunction function;
|
|
|
|
GdkInputCondition condition;
|
|
|
|
GdkDestroyNotify notify;
|
|
|
|
gpointer data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkEventPrivate
|
|
|
|
{
|
|
|
|
GdkEvent event;
|
|
|
|
guint flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Private function declarations
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GdkFilterReturn
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_event_apply_filters(MSG *msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkEvent *event,
|
|
|
|
GList *filters);
|
|
|
|
static gboolean gdk_event_translate (GdkEvent *event,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
gboolean *ret_val_flagp,
|
|
|
|
gint *ret_valp);
|
|
|
|
static gboolean gdk_event_prepare (gpointer source_data,
|
|
|
|
GTimeVal *current_time,
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gint *timeout,
|
|
|
|
gpointer user_data);
|
1999-11-11 22:12:27 +00:00
|
|
|
static gboolean gdk_event_check (gpointer source_data,
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
GTimeVal *current_time,
|
|
|
|
gpointer user_data);
|
1999-11-11 22:12:27 +00:00
|
|
|
static gboolean gdk_event_dispatch (gpointer source_data,
|
|
|
|
GTimeVal *current_time,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
/* Private variable declarations
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GdkWindow *p_grab_window = NULL; /* Window that currently
|
|
|
|
* holds the pointer grab
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GdkWindow *k_grab_window = NULL; /* Window the holds the
|
|
|
|
* keyboard grab
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GList *client_filters; /* Filters for client messages */
|
|
|
|
|
|
|
|
static gboolean p_grab_automatic;
|
|
|
|
static GdkEventMask p_grab_mask;
|
|
|
|
static gboolean p_grab_owner_events, k_grab_owner_events;
|
|
|
|
static HCURSOR p_grab_cursor;
|
|
|
|
|
|
|
|
static GSourceFuncs event_funcs = {
|
|
|
|
gdk_event_prepare,
|
|
|
|
gdk_event_check,
|
|
|
|
gdk_event_dispatch,
|
|
|
|
(GDestroyNotify)g_free
|
|
|
|
};
|
|
|
|
|
|
|
|
GPollFD event_poll_fd;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
static GdkWindow *current_window = NULL;
|
|
|
|
static gint current_x, current_y;
|
|
|
|
static gdouble current_x_root, current_y_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
static UINT gdk_ping_msg;
|
2000-07-23 21:43:23 +00:00
|
|
|
static gboolean ignore_wm_char = FALSE;
|
|
|
|
static gboolean is_altgr_key = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
static IActiveIMMApp *active_imm_app = NULL;
|
|
|
|
static IActiveIMMMessagePumpOwner *active_imm_msgpump_owner = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
typedef BOOL (WINAPI *PFN_TrackMouseEvent) (LPTRACKMOUSEEVENT);
|
2000-07-23 21:43:23 +00:00
|
|
|
static PFN_TrackMouseEvent track_mouse_event = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
static gboolean use_ime_composition = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-09-07 19:51:32 +00:00
|
|
|
static LRESULT
|
|
|
|
real_window_procedure (HWND hwnd,
|
|
|
|
UINT message,
|
|
|
|
WPARAM wparam,
|
|
|
|
LPARAM lparam)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-04 06:12:54 +00:00
|
|
|
GdkEventPrivate event;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkEvent *eventp;
|
|
|
|
MSG msg;
|
|
|
|
DWORD pos;
|
|
|
|
LRESULT lres;
|
|
|
|
gint ret_val;
|
|
|
|
gboolean ret_val_flag;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
msg.hwnd = hwnd;
|
1999-11-11 22:12:27 +00:00
|
|
|
msg.message = message;
|
2000-07-23 21:43:23 +00:00
|
|
|
msg.wParam = wparam;
|
|
|
|
msg.lParam = lparam;
|
1999-11-11 22:12:27 +00:00
|
|
|
msg.time = GetTickCount ();
|
|
|
|
pos = GetMessagePos ();
|
|
|
|
msg.pt.x = LOWORD (pos);
|
|
|
|
msg.pt.y = HIWORD (pos);
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
event.flags = GDK_EVENT_PENDING;
|
|
|
|
if (gdk_event_translate (&event.event, &msg, &ret_val_flag, &ret_val))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-04 06:12:54 +00:00
|
|
|
event.flags &= ~GDK_EVENT_PENDING;
|
1999-11-11 22:12:27 +00:00
|
|
|
#if 1
|
2000-07-04 06:12:54 +00:00
|
|
|
if (event.event.any.type == GDK_CONFIGURE)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Compress configure events */
|
2000-01-02 11:03:12 +00:00
|
|
|
GList *list = gdk_queued_events;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
while (list != NULL
|
|
|
|
&& (((GdkEvent *)list->data)->any.type != GDK_CONFIGURE
|
2000-07-04 06:12:54 +00:00
|
|
|
|| ((GdkEvent *)list->data)->any.window != event.event.any.window))
|
1999-11-11 22:12:27 +00:00
|
|
|
list = list->next;
|
|
|
|
if (list != NULL)
|
|
|
|
{
|
2000-01-02 11:03:12 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("... compressing an CONFIGURE event\n"));
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
*((GdkEvent *)list->data) = event.event;
|
|
|
|
gdk_drawable_unref (event.event.any.window);
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Wake up WaitMessage */
|
|
|
|
PostMessage (NULL, gdk_ping_msg, 0, 0);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2000-07-04 06:12:54 +00:00
|
|
|
else if (event.event.any.type == GDK_EXPOSE)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Compress expose events */
|
2000-01-02 11:03:12 +00:00
|
|
|
GList *list = gdk_queued_events;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
while (list != NULL
|
|
|
|
&& (((GdkEvent *)list->data)->any.type != GDK_EXPOSE
|
2000-07-04 06:12:54 +00:00
|
|
|
|| ((GdkEvent *)list->data)->any.window != event.event.any.window))
|
1999-11-11 22:12:27 +00:00
|
|
|
list = list->next;
|
|
|
|
if (list != NULL)
|
|
|
|
{
|
|
|
|
GdkRectangle u;
|
|
|
|
|
2000-01-02 11:03:12 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("... compressing an EXPOSE event\n"));
|
2000-07-04 06:12:54 +00:00
|
|
|
gdk_rectangle_union (&event.event.expose.area,
|
1999-11-11 22:12:27 +00:00
|
|
|
&((GdkEvent *)list->data)->expose.area,
|
|
|
|
&u);
|
|
|
|
((GdkEvent *)list->data)->expose.area = u;
|
2000-07-04 06:12:54 +00:00
|
|
|
gdk_drawable_unref (event.event.any.window);
|
2000-01-02 11:03:12 +00:00
|
|
|
#if 0
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Wake up WaitMessage */
|
|
|
|
PostMessage (NULL, gdk_ping_msg, 0, 0);
|
2000-01-02 11:03:12 +00:00
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
eventp = gdk_event_new ();
|
2000-07-04 06:12:54 +00:00
|
|
|
*((GdkEventPrivate *) eventp) = event;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Philippe Colantoni <colanton@aris.ss.uci.edu> suggests this
|
|
|
|
* in order to handle events while opaque resizing neatly. I
|
|
|
|
* don't want it as default. Set the
|
|
|
|
* GDK_EVENT_FUNC_FROM_WINDOW_PROC env var to get this
|
|
|
|
* behaviour.
|
|
|
|
*/
|
1999-11-17 00:45:37 +00:00
|
|
|
if (gdk_event_func_from_window_proc && gdk_event_func)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_THREADS_ENTER ();
|
|
|
|
|
1999-11-17 00:45:37 +00:00
|
|
|
(*gdk_event_func) (eventp, gdk_event_data);
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_event_free (eventp);
|
|
|
|
|
|
|
|
GDK_THREADS_LEAVE ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdk_event_queue_append (eventp);
|
|
|
|
#if 1
|
|
|
|
/* Wake up WaitMessage */
|
|
|
|
PostMessage (NULL, gdk_ping_msg, 0, 0);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret_val_flag)
|
|
|
|
return ret_val;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret_val_flag)
|
|
|
|
return ret_val;
|
|
|
|
else
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if (active_imm_app == NULL
|
|
|
|
|| (*active_imm_app->lpVtbl->OnDefWindowProc) (active_imm_app, hwnd, message, wparam, lparam, &lres) == S_FALSE)
|
|
|
|
return DefWindowProc (hwnd, message, wparam, lparam);
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
|
|
|
return lres;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-07 19:51:32 +00:00
|
|
|
LRESULT CALLBACK
|
|
|
|
gdk_window_procedure (HWND hwnd,
|
|
|
|
UINT message,
|
|
|
|
WPARAM wparam,
|
|
|
|
LPARAM lparam)
|
|
|
|
{
|
|
|
|
LRESULT retval;
|
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_window_procedure: %#lx %s\n",
|
|
|
|
(gulong) hwnd, gdk_win32_message_name (message)));
|
|
|
|
|
|
|
|
retval = real_window_procedure (hwnd, message, wparam, lparam);
|
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_window_procedure: %#lx returns %ld\n",
|
|
|
|
(gulong) hwnd, retval));
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
void
|
|
|
|
gdk_events_init (void)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
2000-09-07 19:51:32 +00:00
|
|
|
#ifdef USE_TRACKMOUSEEVENT
|
1999-11-11 22:12:27 +00:00
|
|
|
HMODULE user32, imm32;
|
|
|
|
HINSTANCE commctrl32;
|
2000-09-07 19:51:32 +00:00
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
gdk_ping_msg = RegisterWindowMessage ("gdk-ping");
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk-ping = %#.03x\n",
|
|
|
|
gdk_ping_msg));
|
|
|
|
|
|
|
|
g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
event_poll_fd.fd = G_WIN32_MSG_HANDLE;
|
|
|
|
event_poll_fd.events = G_IO_IN;
|
|
|
|
|
|
|
|
g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS);
|
|
|
|
|
|
|
|
hres = CoCreateInstance (&CLSID_CActiveIMM,
|
|
|
|
NULL,
|
|
|
|
CLSCTX_ALL,
|
|
|
|
&IID_IActiveIMMApp,
|
2000-07-23 21:43:23 +00:00
|
|
|
(LPVOID *) &active_imm_app);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (hres == S_OK)
|
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("IActiveIMMApp created %p\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
active_imm_app));
|
|
|
|
(*active_imm_app->lpVtbl->Activate) (active_imm_app, TRUE);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
hres = (*active_imm_app->lpVtbl->QueryInterface) (active_imm_app, &IID_IActiveIMMMessagePumpOwner, &active_imm_msgpump_owner);
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("IActiveIMMMessagePumpOwner created %p\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
active_imm_msgpump_owner));
|
|
|
|
(active_imm_msgpump_owner->lpVtbl->Start) (active_imm_msgpump_owner);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_TRACKMOUSEEVENT
|
|
|
|
user32 = GetModuleHandle ("user32.dll");
|
2000-07-23 21:43:23 +00:00
|
|
|
if ((track_mouse_event = GetProcAddress (user32, "TrackMouseEvent")) == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if ((commctrl32 = LoadLibrary ("commctrl32.dll")) != NULL)
|
2000-07-23 21:43:23 +00:00
|
|
|
track_mouse_event = (PFN_TrackMouseEvent)
|
1999-11-11 22:12:27 +00:00
|
|
|
GetProcAddress (commctrl32, "_TrackMouseEvent");
|
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
if (track_mouse_event != NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("Using TrackMouseEvent to detect leave events\n"));
|
|
|
|
#endif
|
2000-07-25 17:31:05 +00:00
|
|
|
if (IS_WIN_NT () && (windows_version & 0xFF) == 5)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* On Win2k (Beta 3, at least) WM_IME_CHAR doesn't seem to work
|
|
|
|
* correctly for non-Unicode applications. Handle
|
|
|
|
* WM_IME_COMPOSITION with GCS_RESULTSTR instead, fetch the
|
|
|
|
* Unicode char from the IME with ImmGetCompositionStringW().
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
use_ime_composition = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_events_pending
|
|
|
|
*
|
|
|
|
* Returns if events are pending on the queue.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
* Returns TRUE if events are pending
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gdk_events_pending (void)
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
return (gdk_event_queue_find_first() ||
|
|
|
|
PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_event_get_graphics_expose
|
|
|
|
*
|
|
|
|
* Waits for a GraphicsExpose or NoExpose event
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
* For GraphicsExpose events, returns a pointer to the event
|
|
|
|
* converted into a GdkEvent Otherwise, returns NULL.
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------- */
|
|
|
|
|
|
|
|
GdkEvent*
|
|
|
|
gdk_event_get_graphics_expose (GdkWindow *window)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG msg;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkEvent *event;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window != NULL, NULL);
|
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_event_get_graphics_expose\n"));
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
#if 0 /* ??? */
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Some nasty bugs here, just return NULL for now. */
|
|
|
|
return NULL;
|
|
|
|
#else
|
2000-07-23 21:43:23 +00:00
|
|
|
if (PeekMessage (&msg, GDK_WINDOW_HWND (window), WM_PAINT, WM_PAINT, PM_REMOVE))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
event = gdk_event_new ();
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (gdk_event_translate (event, &msg, NULL, NULL))
|
1999-11-11 22:12:27 +00:00
|
|
|
return event;
|
|
|
|
else
|
|
|
|
gdk_event_free (event);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
static char *
|
|
|
|
event_mask_string (GdkEventMask mask)
|
|
|
|
{
|
|
|
|
static char bfr[500];
|
|
|
|
char *p = bfr;
|
|
|
|
|
|
|
|
*p = '\0';
|
|
|
|
#define BIT(x) \
|
|
|
|
if (mask & GDK_##x##_MASK) \
|
|
|
|
p += sprintf (p, "%s" #x, (p > bfr ? " " : ""))
|
|
|
|
BIT(EXPOSURE);
|
|
|
|
BIT(POINTER_MOTION);
|
|
|
|
BIT(POINTER_MOTION_HINT);
|
|
|
|
BIT(BUTTON_MOTION);
|
|
|
|
BIT(BUTTON1_MOTION);
|
|
|
|
BIT(BUTTON2_MOTION);
|
|
|
|
BIT(BUTTON3_MOTION);
|
|
|
|
BIT(BUTTON_PRESS);
|
|
|
|
BIT(BUTTON_RELEASE);
|
|
|
|
BIT(KEY_PRESS);
|
|
|
|
BIT(KEY_RELEASE);
|
|
|
|
BIT(ENTER_NOTIFY);
|
|
|
|
BIT(LEAVE_NOTIFY);
|
|
|
|
BIT(FOCUS_CHANGE);
|
|
|
|
BIT(STRUCTURE);
|
|
|
|
BIT(PROPERTY_CHANGE);
|
|
|
|
BIT(VISIBILITY_NOTIFY);
|
|
|
|
BIT(PROXIMITY_IN);
|
|
|
|
BIT(PROXIMITY_OUT);
|
|
|
|
BIT(SUBSTRUCTURE);
|
|
|
|
BIT(SCROLL);
|
|
|
|
#undef BIT
|
|
|
|
|
|
|
|
return bfr;
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_pointer_grab
|
|
|
|
*
|
|
|
|
* Grabs the pointer to a specific window
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* "window" is the window which will receive the grab
|
|
|
|
* "owner_events" specifies whether events will be reported as is,
|
|
|
|
* or relative to "window"
|
|
|
|
* "event_mask" masks only interesting events
|
|
|
|
* "confine_to" limits the cursor movement to the specified window
|
|
|
|
* "cursor" changes the cursor for the duration of the grab
|
|
|
|
* "time" specifies the time
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
* requires a corresponding call to gdk_pointer_ungrab
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2000-07-06 16:20:45 +00:00
|
|
|
GdkGrabStatus
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_pointer_grab (GdkWindow *window,
|
|
|
|
gboolean owner_events,
|
|
|
|
GdkEventMask event_mask,
|
|
|
|
GdkWindow *confine_to,
|
|
|
|
GdkCursor *cursor,
|
|
|
|
guint32 time)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
HWND hwnd_confined_to;
|
|
|
|
HCURSOR hcursor;
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkCursorPrivate *cursor_private;
|
|
|
|
gint return_val;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window != NULL, 0);
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
|
|
|
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
|
|
|
|
|
|
|
|
cursor_private = (GdkCursorPrivate*) cursor;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!confine_to || GDK_WINDOW_DESTROYED (confine_to))
|
2000-07-23 21:43:23 +00:00
|
|
|
hwnd_confined_to = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
hwnd_confined_to = GDK_WINDOW_HWND (confine_to);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (!cursor)
|
2000-07-23 21:43:23 +00:00
|
|
|
hcursor = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
hcursor = cursor_private->hcursor;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = _gdk_input_grab_pointer (window,
|
|
|
|
owner_events,
|
|
|
|
event_mask,
|
|
|
|
confine_to,
|
|
|
|
time);
|
|
|
|
|
2000-07-06 16:20:45 +00:00
|
|
|
if (return_val == GDK_GRAB_SUCCESS)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_pointer_grab: %#lx %s %#lx %s\n",
|
|
|
|
(gulong) GDK_WINDOW_HWND (window),
|
2000-07-25 17:31:05 +00:00
|
|
|
(owner_events ? "TRUE" : "FALSE"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) hcursor,
|
2000-07-25 17:31:05 +00:00
|
|
|
event_mask_string (event_mask)));
|
|
|
|
p_grab_mask = event_mask;
|
|
|
|
p_grab_owner_events = (owner_events != 0);
|
|
|
|
p_grab_automatic = FALSE;
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
#if 1 /* Menus don't work if we use mouse capture. Pity, because many other
|
1999-11-11 22:12:27 +00:00
|
|
|
* things work better with mouse capture.
|
|
|
|
*/
|
2000-07-25 17:31:05 +00:00
|
|
|
SetCapture (GDK_WINDOW_HWND (window));
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = GDK_GRAB_SUCCESS;
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-06 16:20:45 +00:00
|
|
|
return_val = GDK_GRAB_ALREADY_GRABBED;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-06 16:20:45 +00:00
|
|
|
if (return_val == GDK_GRAB_SUCCESS)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
p_grab_window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
p_grab_cursor = hcursor;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_pointer_ungrab
|
|
|
|
*
|
|
|
|
* Releases any pointer grab
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_pointer_ungrab (guint32 time)
|
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_pointer_ungrab\n"));
|
|
|
|
|
|
|
|
_gdk_input_ungrab_pointer (time);
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
#if 1
|
1999-11-11 22:12:27 +00:00
|
|
|
if (GetCapture () != NULL)
|
|
|
|
ReleaseCapture ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
p_grab_window = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_pointer_is_grabbed
|
|
|
|
*
|
|
|
|
* Tell wether there is an active x pointer grab in effect
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gboolean
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_pointer_is_grabbed (void)
|
|
|
|
{
|
|
|
|
return p_grab_window != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_keyboard_grab
|
|
|
|
*
|
|
|
|
* Grabs the keyboard to a specific window
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* "window" is the window which will receive the grab
|
|
|
|
* "owner_events" specifies whether events will be reported as is,
|
|
|
|
* or relative to "window"
|
|
|
|
* "time" specifies the time
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
* requires a corresponding call to gdk_keyboard_ungrab
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2000-07-06 16:20:45 +00:00
|
|
|
GdkGrabStatus
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_keyboard_grab (GdkWindow *window,
|
|
|
|
gboolean owner_events,
|
|
|
|
guint32 time)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
gint return_val;
|
|
|
|
|
|
|
|
g_return_val_if_fail (window != NULL, 0);
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
|
|
|
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_keyboard_grab %#lx\n",
|
|
|
|
(gulong) GDK_WINDOW_HWND (window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
k_grab_owner_events = owner_events != 0;
|
2000-07-06 16:20:45 +00:00
|
|
|
return_val = GDK_GRAB_SUCCESS;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
2000-07-06 16:20:45 +00:00
|
|
|
return_val = GDK_GRAB_ALREADY_GRABBED;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-06 16:20:45 +00:00
|
|
|
if (return_val == GDK_GRAB_SUCCESS)
|
1999-11-11 22:12:27 +00:00
|
|
|
k_grab_window = window;
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
* gdk_keyboard_ungrab
|
|
|
|
*
|
|
|
|
* Releases any keyboard grab
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
*
|
|
|
|
* Results:
|
|
|
|
*
|
|
|
|
* Side effects:
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_keyboard_ungrab (guint32 time)
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_keyboard_ungrab\n"));
|
|
|
|
|
|
|
|
k_grab_window = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkFilterReturn
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_event_apply_filters (MSG *msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkEvent *event,
|
|
|
|
GList *filters)
|
|
|
|
{
|
|
|
|
GdkEventFilter *filter;
|
|
|
|
GList *tmp_list;
|
|
|
|
GdkFilterReturn result;
|
|
|
|
|
|
|
|
tmp_list = filters;
|
|
|
|
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
filter = (GdkEventFilter *) tmp_list->data;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
result = (*filter->function) (msg, event, filter->data);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (result != GDK_FILTER_CONTINUE)
|
|
|
|
return result;
|
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GDK_FILTER_CONTINUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_add_client_message_filter (GdkAtom message_type,
|
|
|
|
GdkFilterFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GdkClientFilter *filter = g_new (GdkClientFilter, 1);
|
|
|
|
|
|
|
|
filter->type = message_type;
|
|
|
|
filter->function = func;
|
|
|
|
filter->data = data;
|
|
|
|
|
|
|
|
client_filters = g_list_prepend (client_filters, filter);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Thanks to Markus G. Kuhn <mkuhn@acm.org> for the ksysym<->Unicode
|
|
|
|
* mapping functions, from the xterm sources.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
build_key_event_state (GdkEvent *event)
|
|
|
|
{
|
|
|
|
if (GetKeyState (VK_SHIFT) < 0)
|
|
|
|
event->key.state |= GDK_SHIFT_MASK;
|
|
|
|
if (GetKeyState (VK_CAPITAL) & 0x1)
|
|
|
|
event->key.state |= GDK_LOCK_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!is_altgr_key)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if (GetKeyState (VK_CONTROL) < 0)
|
|
|
|
{
|
|
|
|
event->key.state |= GDK_CONTROL_MASK;
|
2000-07-04 06:12:54 +00:00
|
|
|
#if 0
|
1999-11-11 22:12:27 +00:00
|
|
|
if (event->key.keyval < ' ')
|
|
|
|
event->key.keyval += '@';
|
2000-07-04 06:12:54 +00:00
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-04 06:12:54 +00:00
|
|
|
#if 0
|
1999-11-11 22:12:27 +00:00
|
|
|
else if (event->key.keyval < ' ')
|
|
|
|
{
|
|
|
|
event->key.state |= GDK_CONTROL_MASK;
|
|
|
|
event->key.keyval += '@';
|
|
|
|
}
|
2000-07-04 06:12:54 +00:00
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
if (GetKeyState (VK_MENU) < 0)
|
|
|
|
event->key.state |= GDK_MOD1_MASK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
2000-07-23 21:43:23 +00:00
|
|
|
build_pointer_event_state (MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
gint state;
|
|
|
|
|
|
|
|
state = 0;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & MK_CONTROL)
|
1999-11-11 22:12:27 +00:00
|
|
|
state |= GDK_CONTROL_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & MK_LBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
state |= GDK_BUTTON1_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & MK_MBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
state |= GDK_BUTTON2_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & MK_RBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
state |= GDK_BUTTON3_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & MK_SHIFT)
|
1999-11-11 22:12:27 +00:00
|
|
|
state |= GDK_SHIFT_MASK;
|
|
|
|
if (GetKeyState (VK_MENU) < 0)
|
|
|
|
state |= GDK_MOD1_MASK;
|
|
|
|
if (GetKeyState (VK_CAPITAL) & 0x1)
|
|
|
|
state |= GDK_LOCK_MASK;
|
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-07-23 21:43:23 +00:00
|
|
|
build_keypress_event (GdkWindowImplWin32 *impl,
|
1999-11-17 00:45:37 +00:00
|
|
|
GdkEvent *event,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
HIMC himc;
|
2000-07-04 06:12:54 +00:00
|
|
|
gint i, bytecount, ucount, ucleft, len;
|
1999-11-11 22:12:27 +00:00
|
|
|
guchar buf[100], *bp;
|
|
|
|
wchar_t wbuf[100], *wcp;
|
|
|
|
|
|
|
|
event->key.type = GDK_KEY_PRESS;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->key.time = msg->time;
|
2000-07-04 06:12:54 +00:00
|
|
|
event->key.state = 0;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_IME_COMPOSITION)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
himc = ImmGetContext (msg->hwnd);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
bytecount = ImmGetCompositionStringW (himc, GCS_RESULTSTR,
|
1999-11-11 22:12:27 +00:00
|
|
|
wbuf, sizeof (wbuf));
|
|
|
|
ucount = bytecount / 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_CHAR || msg->message == WM_SYSCHAR)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
bytecount = MIN ((msg->lParam & 0xFFFF), sizeof (buf));
|
1999-11-11 22:12:27 +00:00
|
|
|
for (i = 0; i < bytecount; i++)
|
2000-07-23 21:43:23 +00:00
|
|
|
buf[i] = msg->wParam;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else /* WM_IME_CHAR */
|
|
|
|
{
|
|
|
|
event->key.keyval = GDK_VoidSymbol;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam & 0xFF00)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Contrary to some versions of the documentation,
|
|
|
|
* the lead byte is the most significant byte.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
buf[0] = ((msg->wParam >> 8) & 0xFF);
|
|
|
|
buf[1] = (msg->wParam & 0xFF);
|
1999-11-11 22:12:27 +00:00
|
|
|
bytecount = 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
buf[0] = (msg->wParam & 0xFF);
|
1999-11-11 22:12:27 +00:00
|
|
|
bytecount = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert from the window's current code page
|
|
|
|
* to Unicode. Then convert to UTF-8.
|
|
|
|
* We don't handle the surrogate stuff. Should we?
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
ucount = MultiByteToWideChar (impl->charset_info.ciACP,
|
1999-11-11 22:12:27 +00:00
|
|
|
0, buf, bytecount,
|
|
|
|
wbuf, sizeof (wbuf) / sizeof (wbuf[0]));
|
|
|
|
|
|
|
|
}
|
|
|
|
if (ucount == 0)
|
|
|
|
event->key.keyval = GDK_VoidSymbol;
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (msg->message == WM_CHAR || msg->message == WM_SYSCHAR)
|
2000-09-07 19:51:32 +00:00
|
|
|
{
|
|
|
|
if (msg->wParam < ' ')
|
|
|
|
{
|
|
|
|
event->key.keyval = msg->wParam + '@';
|
|
|
|
/* This is needed in case of Alt+nnn or Alt+0nnn (on the numpad)
|
|
|
|
* where nnn<32
|
|
|
|
*/
|
|
|
|
event->key.state |= GDK_CONTROL_MASK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
event->key.keyval = gdk_unicode_to_keyval (wbuf[0]);
|
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
build_key_event_state (event);
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
/* Build UTF-8 string */
|
1999-11-11 22:12:27 +00:00
|
|
|
ucleft = ucount;
|
|
|
|
len = 0;
|
|
|
|
wcp = wbuf;
|
|
|
|
while (ucleft-- > 0)
|
|
|
|
{
|
|
|
|
wchar_t c = *wcp++;
|
|
|
|
|
|
|
|
if (c < 0x80)
|
|
|
|
len += 1;
|
|
|
|
else if (c < 0x800)
|
|
|
|
len += 2;
|
|
|
|
else
|
|
|
|
len += 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
event->key.string = g_malloc (len + 1);
|
|
|
|
event->key.length = len;
|
|
|
|
|
|
|
|
ucleft = ucount;
|
|
|
|
wcp = wbuf;
|
|
|
|
bp = event->key.string;
|
|
|
|
while (ucleft-- > 0)
|
|
|
|
{
|
|
|
|
int first;
|
|
|
|
wchar_t c = *wcp++;
|
|
|
|
|
|
|
|
if (c < 0x80)
|
|
|
|
{
|
|
|
|
first = 0;
|
|
|
|
len = 1;
|
|
|
|
}
|
|
|
|
else if (c < 0x800)
|
|
|
|
{
|
|
|
|
first = 0xc0;
|
|
|
|
len = 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
first = 0xe0;
|
|
|
|
len = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
/* Woo-hoo! */
|
|
|
|
switch (len)
|
|
|
|
{
|
|
|
|
case 3: bp[2] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
|
|
|
case 2: bp[1] = (c & 0x3f) | 0x80; c >>= 6; /* Fall through */
|
|
|
|
case 1: bp[0] = c | first;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
for (i = len - 1; i > 0; --i)
|
|
|
|
{
|
|
|
|
bp[i] = (c & 0x3f) | 0x80;
|
|
|
|
c >>= 6;
|
|
|
|
}
|
|
|
|
bp[0] = c | first;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
bp += len;
|
|
|
|
}
|
|
|
|
*bp = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-07-23 21:43:23 +00:00
|
|
|
build_keyrelease_event (GdkWindowImplWin32 *impl,
|
1999-11-17 00:45:37 +00:00
|
|
|
GdkEvent *event,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
guchar buf;
|
|
|
|
wchar_t wbuf;
|
|
|
|
|
|
|
|
event->key.type = GDK_KEY_RELEASE;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->key.time = msg->time;
|
2000-07-04 06:12:54 +00:00
|
|
|
event->key.state = 0;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_CHAR || msg->message == WM_SYSCHAR)
|
|
|
|
if (msg->wParam < ' ')
|
|
|
|
event->key.keyval = msg->wParam + '@';
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
buf = msg->wParam;
|
|
|
|
MultiByteToWideChar (impl->charset_info.ciACP,
|
1999-11-11 22:12:27 +00:00
|
|
|
0, &buf, 1, &wbuf, 1);
|
|
|
|
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
event->key.keyval = gdk_unicode_to_keyval (wbuf);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
event->key.keyval = GDK_VoidSymbol;
|
|
|
|
build_key_event_state (event);
|
|
|
|
event->key.string = NULL;
|
|
|
|
event->key.length = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_event_state (gint state)
|
|
|
|
{
|
|
|
|
if (state & GDK_SHIFT_MASK)
|
|
|
|
g_print ("SHIFT ");
|
|
|
|
if (state & GDK_LOCK_MASK)
|
|
|
|
g_print ("LOCK ");
|
|
|
|
if (state & GDK_CONTROL_MASK)
|
|
|
|
g_print ("CONTROL ");
|
|
|
|
if (state & GDK_MOD1_MASK)
|
|
|
|
g_print ("MOD1 ");
|
|
|
|
if (state & GDK_BUTTON1_MASK)
|
|
|
|
g_print ("BUTTON1 ");
|
|
|
|
if (state & GDK_BUTTON2_MASK)
|
|
|
|
g_print ("BUTTON2 ");
|
|
|
|
if (state & GDK_BUTTON3_MASK)
|
|
|
|
g_print ("BUTTON3 ");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_event (GdkEvent *event)
|
|
|
|
{
|
|
|
|
gchar *escaped, *kvname;
|
|
|
|
|
|
|
|
switch (event->any.type)
|
|
|
|
{
|
|
|
|
case GDK_NOTHING: g_print ("GDK_NOTHING "); break;
|
|
|
|
case GDK_DELETE: g_print ("GDK_DELETE "); break;
|
|
|
|
case GDK_DESTROY: g_print ("GDK_DESTROY "); break;
|
|
|
|
case GDK_EXPOSE: g_print ("GDK_EXPOSE "); break;
|
|
|
|
case GDK_MOTION_NOTIFY: g_print ("GDK_MOTION_NOTIFY "); break;
|
|
|
|
case GDK_BUTTON_PRESS: g_print ("GDK_BUTTON_PRESS "); break;
|
|
|
|
case GDK_2BUTTON_PRESS: g_print ("GDK_2BUTTON_PRESS "); break;
|
|
|
|
case GDK_3BUTTON_PRESS: g_print ("GDK_3BUTTON_PRESS "); break;
|
|
|
|
case GDK_BUTTON_RELEASE: g_print ("GDK_BUTTON_RELEASE "); break;
|
|
|
|
case GDK_KEY_PRESS: g_print ("GDK_KEY_PRESS "); break;
|
|
|
|
case GDK_KEY_RELEASE: g_print ("GDK_KEY_RELEASE "); break;
|
|
|
|
case GDK_ENTER_NOTIFY: g_print ("GDK_ENTER_NOTIFY "); break;
|
|
|
|
case GDK_LEAVE_NOTIFY: g_print ("GDK_LEAVE_NOTIFY "); break;
|
|
|
|
case GDK_FOCUS_CHANGE: g_print ("GDK_FOCUS_CHANGE "); break;
|
|
|
|
case GDK_CONFIGURE: g_print ("GDK_CONFIGURE "); break;
|
|
|
|
case GDK_MAP: g_print ("GDK_MAP "); break;
|
|
|
|
case GDK_UNMAP: g_print ("GDK_UNMAP "); break;
|
|
|
|
case GDK_PROPERTY_NOTIFY: g_print ("GDK_PROPERTY_NOTIFY "); break;
|
|
|
|
case GDK_SELECTION_CLEAR: g_print ("GDK_SELECTION_CLEAR "); break;
|
|
|
|
case GDK_SELECTION_REQUEST: g_print ("GDK_SELECTION_REQUEST "); break;
|
|
|
|
case GDK_SELECTION_NOTIFY: g_print ("GDK_SELECTION_NOTIFY "); break;
|
|
|
|
case GDK_PROXIMITY_IN: g_print ("GDK_PROXIMITY_IN "); break;
|
|
|
|
case GDK_PROXIMITY_OUT: g_print ("GDK_PROXIMITY_OUT "); break;
|
|
|
|
case GDK_DRAG_ENTER: g_print ("GDK_DRAG_ENTER "); break;
|
|
|
|
case GDK_DRAG_LEAVE: g_print ("GDK_DRAG_LEAVE "); break;
|
|
|
|
case GDK_DRAG_MOTION: g_print ("GDK_DRAG_MOTION "); break;
|
|
|
|
case GDK_DRAG_STATUS: g_print ("GDK_DRAG_STATUS "); break;
|
|
|
|
case GDK_DROP_START: g_print ("GDK_DROP_START "); break;
|
|
|
|
case GDK_DROP_FINISHED: g_print ("GDK_DROP_FINISHED "); break;
|
|
|
|
case GDK_CLIENT_EVENT: g_print ("GDK_CLIENT_EVENT "); break;
|
|
|
|
case GDK_VISIBILITY_NOTIFY: g_print ("GDK_VISIBILITY_NOTIFY "); break;
|
|
|
|
case GDK_NO_EXPOSE: g_print ("GDK_NO_EXPOSE "); break;
|
2000-03-03 23:21:51 +00:00
|
|
|
case GDK_SCROLL: g_print ("GDK_SCROLL "); break;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("%#lx ", (gulong) GDK_WINDOW_HWND (event->any.window));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
switch (event->any.type)
|
|
|
|
{
|
|
|
|
case GDK_EXPOSE:
|
|
|
|
g_print ("%dx%d@+%d+%d %d",
|
|
|
|
event->expose.area.width,
|
|
|
|
event->expose.area.height,
|
|
|
|
event->expose.area.x,
|
|
|
|
event->expose.area.y,
|
|
|
|
event->expose.count);
|
|
|
|
break;
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
g_print ("(%.4g,%.4g) %s",
|
|
|
|
event->motion.x, event->motion.y,
|
|
|
|
event->motion.is_hint ? "HINT " : "");
|
|
|
|
print_event_state (event->motion.state);
|
|
|
|
break;
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
case GDK_3BUTTON_PRESS:
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
g_print ("%d (%.4g,%.4g) ",
|
|
|
|
event->button.button,
|
|
|
|
event->button.x, event->button.y);
|
|
|
|
print_event_state (event->button.state);
|
|
|
|
break;
|
|
|
|
case GDK_KEY_PRESS:
|
|
|
|
case GDK_KEY_RELEASE:
|
|
|
|
if (event->key.length == 0)
|
|
|
|
escaped = g_strdup ("");
|
|
|
|
else
|
|
|
|
escaped = g_strescape (event->key.string, NULL);
|
|
|
|
kvname = gdk_keyval_name (event->key.keyval);
|
|
|
|
g_print ("%s %d:\"%s\" ",
|
|
|
|
(kvname ? kvname : "??"),
|
|
|
|
event->key.length,
|
|
|
|
escaped);
|
|
|
|
g_free (escaped);
|
|
|
|
print_event_state (event->key.state);
|
|
|
|
break;
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
2000-03-03 23:21:51 +00:00
|
|
|
g_print ("%s ",
|
1999-11-11 22:12:27 +00:00
|
|
|
(event->crossing.detail == GDK_NOTIFY_INFERIOR ? "INFERIOR" :
|
|
|
|
(event->crossing.detail == GDK_NOTIFY_ANCESTOR ? "ANCESTOR" :
|
|
|
|
(event->crossing.detail == GDK_NOTIFY_NONLINEAR ? "NONLINEAR" :
|
|
|
|
"???"))));
|
|
|
|
break;
|
2000-03-03 23:21:51 +00:00
|
|
|
case GDK_SCROLL:
|
|
|
|
g_print ("%s ",
|
|
|
|
(event->scroll.direction == GDK_SCROLL_UP ? "UP" :
|
|
|
|
(event->scroll.direction == GDK_SCROLL_DOWN ? "DOWN" :
|
|
|
|
(event->scroll.direction == GDK_SCROLL_LEFT ? "LEFT" :
|
|
|
|
(event->scroll.direction == GDK_SCROLL_RIGHT ? "RIGHT" :
|
|
|
|
"???")))));
|
|
|
|
print_event_state (event->scroll.state);
|
|
|
|
break;
|
2000-09-07 19:51:32 +00:00
|
|
|
default:
|
|
|
|
/* Nothing */
|
|
|
|
break;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
g_print ("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
synthesize_crossing_events (GdkWindow *window,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GdkEvent *event;
|
|
|
|
|
|
|
|
/* If we are not using TrackMouseEvent, generate a leave notify
|
|
|
|
* event if necessary
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
if (track_mouse_event == NULL
|
|
|
|
&& current_window
|
|
|
|
&& (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (current_window)->impl)->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("synthesizing LEAVE_NOTIFY event\n"));
|
|
|
|
|
|
|
|
event = gdk_event_new ();
|
|
|
|
event->crossing.type = GDK_LEAVE_NOTIFY;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.window = current_window;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (event->crossing.window);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.subwindow = NULL;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.time = msg->time;
|
|
|
|
event->crossing.x = current_x;
|
|
|
|
event->crossing.y = current_y;
|
|
|
|
event->crossing.x_root = current_x_root;
|
|
|
|
event->crossing.y_root = current_y_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.mode = GDK_CROSSING_NORMAL;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (IsChild (GDK_WINDOW_HWND (current_window), GDK_WINDOW_HWND (window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_INFERIOR;
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (IsChild (GDK_WINDOW_HWND (window), GDK_WINDOW_HWND (current_window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
|
|
|
else
|
|
|
|
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
|
|
|
|
|
|
|
|
event->crossing.focus = TRUE; /* ??? */
|
|
|
|
event->crossing.state = 0; /* ??? */
|
|
|
|
|
|
|
|
gdk_event_queue_append (event);
|
|
|
|
GDK_NOTE (EVENTS, print_event (event));
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl)->event_mask & GDK_ENTER_NOTIFY_MASK)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("synthesizing ENTER_NOTIFY event\n"));
|
|
|
|
|
|
|
|
event = gdk_event_new ();
|
|
|
|
event->crossing.type = GDK_ENTER_NOTIFY;
|
|
|
|
event->crossing.window = window;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (event->crossing.window);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.subwindow = NULL;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.time = msg->time;
|
|
|
|
event->crossing.x = LOWORD (msg->lParam);
|
|
|
|
event->crossing.y = HIWORD (msg->lParam);
|
|
|
|
event->crossing.x_root = (gfloat) msg->pt.x;
|
|
|
|
event->crossing.y_root = (gfloat) msg->pt.y;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.mode = GDK_CROSSING_NORMAL;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (current_window
|
|
|
|
&& IsChild (GDK_WINDOW_HWND (current_window), GDK_WINDOW_HWND (window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (current_window
|
|
|
|
&& IsChild (GDK_WINDOW_HWND (window), GDK_WINDOW_HWND (current_window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_INFERIOR;
|
|
|
|
else
|
|
|
|
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
|
|
|
|
|
|
|
|
event->crossing.focus = TRUE; /* ??? */
|
|
|
|
event->crossing.state = 0; /* ??? */
|
|
|
|
|
|
|
|
gdk_event_queue_append (event);
|
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, print_event (event));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->extension_events != 0)
|
|
|
|
_gdk_input_enter_event (&event->crossing, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (current_window)
|
|
|
|
gdk_drawable_unref (current_window);
|
|
|
|
current_window = window;
|
|
|
|
gdk_drawable_ref (current_window);
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef USE_TRACKMOUSEEVENT
|
2000-07-23 21:43:23 +00:00
|
|
|
if (track_mouse_event != NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
TRACKMOUSEEVENT tme;
|
|
|
|
|
|
|
|
tme.cbSize = sizeof (TRACKMOUSEEVENT);
|
|
|
|
tme.dwFlags = TME_LEAVE;
|
2000-07-23 21:43:23 +00:00
|
|
|
tme.hwndTrack = GDK_WINDOW_HWND (current_window);
|
1999-11-11 22:12:27 +00:00
|
|
|
tme.dwHoverTime = HOVER_DEFAULT;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
(*track_mouse_event) (&tme);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
translate_mouse_coords (GdkWindow *window1,
|
|
|
|
GdkWindow *window2,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
POINT pt;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
pt.x = LOWORD (msg->lParam);
|
|
|
|
pt.y = HIWORD (msg->lParam);
|
|
|
|
ClientToScreen (GDK_WINDOW_HWND (window1), &pt);
|
|
|
|
ScreenToClient (GDK_WINDOW_HWND (window2), &pt);
|
|
|
|
msg->lParam = MAKELPARAM (pt.x, pt.y);
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("...new coords are (%ld,%ld)\n", pt.x, pt.y));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
propagate (GdkWindow **window,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
GdkWindow *grab_window,
|
|
|
|
gboolean grab_owner_events,
|
|
|
|
gint grab_mask,
|
|
|
|
gboolean (*doesnt_want_it) (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if (grab_window != NULL && !grab_owner_events)
|
|
|
|
{
|
|
|
|
/* Event source is grabbed with owner_events FALSE */
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...grabbed, owner_events FALSE, "));
|
2000-07-23 21:43:23 +00:00
|
|
|
if ((*doesnt_want_it) (grab_mask, msg))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...grabber doesn't want it\n"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("...sending to grabber %#lx\n",
|
|
|
|
(gulong) GDK_WINDOW_HWND (grab_window)));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (*window);
|
1999-11-11 22:12:27 +00:00
|
|
|
*window = grab_window;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (*window);
|
1999-11-11 22:12:27 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (TRUE)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if ((*doesnt_want_it) (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (*window)->impl)->event_mask, msg))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Owner doesn't want it, propagate to parent. */
|
2000-10-09 19:49:42 +00:00
|
|
|
if (GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent) == gdk_parent_root)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* No parent; check if grabbed */
|
|
|
|
if (grab_window != NULL)
|
|
|
|
{
|
|
|
|
/* Event source is grabbed with owner_events TRUE */
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...undelivered, but grabbed\n"));
|
2000-07-23 21:43:23 +00:00
|
|
|
if ((*doesnt_want_it) (grab_mask, msg))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Grabber doesn't want it either */
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...grabber doesn't want it\n"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Grabbed! */
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS,
|
|
|
|
g_print ("...sending to grabber %#lx\n",
|
|
|
|
(gulong) GDK_WINDOW_HWND (grab_window)));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (*window);
|
1999-11-11 22:12:27 +00:00
|
|
|
*window = grab_window;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (*window);
|
1999-11-11 22:12:27 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...undelivered\n"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (*window);
|
2000-07-23 21:43:23 +00:00
|
|
|
*window = GDK_WINDOW (GDK_WINDOW_OBJECT (*window)->parent);
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (*window);
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("...propagating to %#lx\n",
|
|
|
|
(gulong) GDK_WINDOW_HWND (*window)));
|
1999-11-11 22:12:27 +00:00
|
|
|
/* The only branch where we actually continue the loop */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
doesnt_want_key (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
return (((msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP)
|
1999-11-11 22:12:27 +00:00
|
|
|
&& !(mask & GDK_KEY_RELEASE_MASK))
|
|
|
|
||
|
2000-07-23 21:43:23 +00:00
|
|
|
((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
|
1999-11-11 22:12:27 +00:00
|
|
|
&& !(mask & GDK_KEY_PRESS_MASK)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
doesnt_want_char (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
return !(mask & (GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK));
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
doesnt_want_button_press (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
return !(mask & GDK_BUTTON_PRESS_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
doesnt_want_button_release (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
return !(mask & GDK_BUTTON_RELEASE_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
doesnt_want_button_motion (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
return !((mask & GDK_POINTER_MOTION_MASK)
|
2000-07-23 21:43:23 +00:00
|
|
|
|| ((msg->wParam & (MK_LBUTTON|MK_MBUTTON|MK_RBUTTON))
|
1999-11-11 22:12:27 +00:00
|
|
|
&& (mask & GDK_BUTTON_MOTION_MASK))
|
2000-07-23 21:43:23 +00:00
|
|
|
|| ((msg->wParam & MK_LBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
&& (mask & GDK_BUTTON1_MOTION_MASK))
|
2000-07-23 21:43:23 +00:00
|
|
|
|| ((msg->wParam & MK_MBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
&& (mask & GDK_BUTTON2_MOTION_MASK))
|
2000-07-23 21:43:23 +00:00
|
|
|
|| ((msg->wParam & MK_RBUTTON)
|
1999-11-11 22:12:27 +00:00
|
|
|
&& (mask & GDK_BUTTON3_MOTION_MASK)));
|
|
|
|
}
|
|
|
|
|
2000-03-03 23:21:51 +00:00
|
|
|
static gboolean
|
|
|
|
doesnt_want_scroll (gint mask,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg)
|
2000-03-03 23:21:51 +00:00
|
|
|
{
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
#if 0
|
2000-03-03 23:21:51 +00:00
|
|
|
return !(mask & GDK_SCROLL_MASK);
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
#else
|
|
|
|
return !(mask & GDK_BUTTON_PRESS_MASK);
|
|
|
|
#endif
|
2000-03-03 23:21:51 +00:00
|
|
|
}
|
|
|
|
|
2000-07-04 06:12:54 +00:00
|
|
|
static char *
|
|
|
|
decode_key_lparam (LPARAM lParam)
|
|
|
|
{
|
|
|
|
static char buf[100];
|
|
|
|
char *p = buf;
|
|
|
|
|
|
|
|
if (HIWORD (lParam) & KF_UP)
|
|
|
|
p += sprintf (p, "KF_UP ");
|
|
|
|
if (HIWORD (lParam) & KF_REPEAT)
|
|
|
|
p += sprintf (p, "KF_REPEAT ");
|
|
|
|
if (HIWORD (lParam) & KF_ALTDOWN)
|
|
|
|
p += sprintf (p, "KF_ALTDOWN ");
|
|
|
|
if (HIWORD (lParam) & KF_EXTENDED)
|
|
|
|
p += sprintf (p, "KF_EXTENDED ");
|
|
|
|
p += sprintf (p, "sc%d rep%d", LOBYTE (HIWORD (lParam)), LOWORD (lParam));
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
static gboolean
|
|
|
|
gdk_event_translate (GdkEvent *event,
|
2000-07-23 21:43:23 +00:00
|
|
|
MSG *msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
gboolean *ret_val_flagp,
|
|
|
|
gint *ret_valp)
|
|
|
|
{
|
|
|
|
DWORD pidActWin;
|
|
|
|
DWORD pidThis;
|
|
|
|
PAINTSTRUCT paintstruct;
|
|
|
|
HDC hdc;
|
2000-03-03 23:21:51 +00:00
|
|
|
HDC bgdc;
|
|
|
|
HGDIOBJ oldbitmap;
|
1999-11-11 22:12:27 +00:00
|
|
|
HBRUSH hbr;
|
2000-03-03 23:21:51 +00:00
|
|
|
COLORREF bg;
|
1999-11-11 22:12:27 +00:00
|
|
|
RECT rect;
|
|
|
|
POINT pt;
|
2000-07-23 21:43:23 +00:00
|
|
|
MINMAXINFO *mmi;
|
2000-03-03 23:21:51 +00:00
|
|
|
HWND hwnd;
|
2000-07-23 21:43:23 +00:00
|
|
|
HCURSOR hcursor;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
/* Invariant:
|
|
|
|
* window_impl == GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl)
|
|
|
|
*/
|
|
|
|
GdkWindow *window;
|
|
|
|
GdkWindowImplWin32 *window_impl;
|
|
|
|
#define ASSIGN_WINDOW(rhs) \
|
|
|
|
(window = rhs, \
|
2000-07-25 20:38:35 +00:00
|
|
|
window_impl = (window ? GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl) : NULL))
|
2000-07-25 17:31:05 +00:00
|
|
|
|
|
|
|
GdkWindow *orig_window, *new_window;
|
2000-03-03 23:21:51 +00:00
|
|
|
GdkColormapPrivateWin32 *colormap_private;
|
1999-11-17 00:45:37 +00:00
|
|
|
GdkPixmap *pixmap;
|
2000-07-23 21:43:23 +00:00
|
|
|
GdkPixmapImplWin32 *pixmap_impl;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
int button;
|
2000-09-07 19:51:32 +00:00
|
|
|
int i, j;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
gchar buf[256];
|
|
|
|
gboolean return_val;
|
|
|
|
|
|
|
|
return_val = FALSE;
|
|
|
|
|
|
|
|
if (ret_val_flagp)
|
|
|
|
*ret_val_flagp = FALSE;
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
ASSIGN_WINDOW (gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
orig_window = window;
|
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
event->any.window = window;
|
|
|
|
event->any.send_event = FALSE;
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
if (window == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Handle WM_QUIT here ? */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_QUIT)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_QUIT: %d\n", msg->wParam));
|
|
|
|
exit (msg->wParam);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (msg->message == WM_MOVE
|
|
|
|
|| msg->message == WM_SIZE)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* It's quite normal to get these messages before we have
|
|
|
|
* had time to register the window in our lookup table, or
|
|
|
|
* when the window is being destroyed and we already have
|
|
|
|
* removed it. Repost the same message to our queue so that
|
|
|
|
* we will get it later when we are prepared.
|
|
|
|
*/
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE(MISC, g_print("gdk_event_translate: %#lx %s posted.\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->message == WM_MOVE ?
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
"WM_MOVE" : "WM_SIZE"));
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
PostMessage (msg->hwnd, msg->message,
|
|
|
|
msg->wParam, msg->lParam);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-10-09 19:49:42 +00:00
|
|
|
#ifndef WITHOUT_WM_CREATE
|
|
|
|
else if (WM_CREATE == msg->message)
|
|
|
|
{
|
|
|
|
window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCT) msg->lParam)->lpCreateParams);
|
|
|
|
GDK_WINDOW_HWND (window) = msg->hwnd;
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: created %#x\n",
|
|
|
|
(guint) msg->hwnd));
|
|
|
|
# if 0
|
|
|
|
/* This should handle allmost all the other window==NULL cases.
|
|
|
|
* This code is executed while gdk_window_new is in it's
|
|
|
|
* CreateWindowEx call.
|
|
|
|
* Don't insert xid there a second time, if it's done here.
|
|
|
|
*/
|
|
|
|
gdk_drawable_ref (window);
|
|
|
|
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND(window), window);
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: %s for %#x (NULL)\n",
|
|
|
|
gdk_win32_message_name(msg->message),
|
|
|
|
(guint) msg->hwnd));
|
|
|
|
}
|
|
|
|
#endif
|
1999-11-11 22:12:27 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-07-25 20:38:35 +00:00
|
|
|
gdk_drawable_ref (window);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Check for filters for this window */
|
|
|
|
GdkFilterReturn result;
|
2000-05-16 21:27:10 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
result = gdk_event_apply_filters
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg, event, GDK_WINDOW_OBJECT (window)->filters);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (result != GDK_FILTER_CONTINUE)
|
|
|
|
{
|
2000-05-16 21:27:10 +00:00
|
|
|
return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
|
|
|
|
goto done;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == gdk_selection_notify_msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_selection_notify_msg: %#lx\n",
|
|
|
|
(gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->selection.type = GDK_SELECTION_NOTIFY;
|
|
|
|
event->selection.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->selection.selection = msg->wParam;
|
|
|
|
event->selection.target = msg->lParam;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->selection.property = gdk_selection_property;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->selection.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Will pass through switch below without match */
|
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (msg->message == gdk_selection_request_msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_selection_request_msg: %#lx\n",
|
|
|
|
(gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->selection.type = GDK_SELECTION_REQUEST;
|
|
|
|
event->selection.window = window;
|
|
|
|
event->selection.selection = gdk_clipboard_atom;
|
|
|
|
event->selection.target = GDK_TARGET_STRING;
|
|
|
|
event->selection.property = gdk_selection_property;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->selection.requestor = (guint32) msg->hwnd;
|
|
|
|
event->selection.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Again, will pass through switch below without match */
|
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (msg->message == gdk_selection_clear_msg)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("gdk_selection_clear_msg: %#lx\n",
|
|
|
|
(gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->selection.type = GDK_SELECTION_CLEAR;
|
|
|
|
event->selection.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->selection.selection = msg->wParam;
|
|
|
|
event->selection.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Once again, we will pass through switch below without match */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GList *tmp_list;
|
|
|
|
GdkFilterReturn result = GDK_FILTER_CONTINUE;
|
|
|
|
|
|
|
|
tmp_list = client_filters;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
GdkClientFilter *filter = tmp_list->data;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (filter->type == msg->message)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("client filter matched\n"));
|
1999-11-23 22:38:50 +00:00
|
|
|
event->any.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
result = (*filter->function) (msg, event, filter->data);
|
1999-11-11 22:12:27 +00:00
|
|
|
switch (result)
|
|
|
|
{
|
|
|
|
case GDK_FILTER_REMOVE:
|
|
|
|
return_val = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_FILTER_TRANSLATE:
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_FILTER_CONTINUE:
|
|
|
|
return_val = TRUE;
|
|
|
|
event->client.type = GDK_CLIENT_EVENT;
|
|
|
|
event->client.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->client.message_type = msg->message;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->client.data_format = 0;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->client.data.l[0] = msg->wParam;
|
|
|
|
event->client.data.l[1] = msg->lParam;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-05-16 21:27:10 +00:00
|
|
|
goto done;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
switch (msg->message)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
case WM_INPUTLANGCHANGE:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_INPUTLANGCHANGE: %#lx charset %lu locale %lx\n",
|
|
|
|
(gulong) msg->hwnd, (gulong) msg->wParam, msg->lParam));
|
2000-07-25 17:31:05 +00:00
|
|
|
window_impl->input_locale = (HKL) msg->lParam;
|
2000-07-23 21:43:23 +00:00
|
|
|
TranslateCharsetInfo ((DWORD FAR *) msg->wParam,
|
2000-07-25 17:31:05 +00:00
|
|
|
&window_impl->charset_info,
|
1999-11-11 22:12:27 +00:00
|
|
|
TCI_SRCCHARSET);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_SYSKEYUP:
|
|
|
|
case WM_SYSKEYDOWN:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_SYSKEY%s: %#lx %s %#x %s\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->message == WM_SYSKEYUP ? "UP" : "DOWN"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
(GetKeyNameText (msg->lParam, buf,
|
1999-11-11 22:12:27 +00:00
|
|
|
sizeof (buf)) > 0 ?
|
|
|
|
buf : ""),
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam,
|
|
|
|
decode_key_lparam (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* Let the system handle Alt-Tab and Alt-Enter */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam == VK_TAB
|
|
|
|
|| msg->wParam == VK_RETURN
|
|
|
|
|| msg->wParam == VK_F4)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
/* If posted without us having keyboard focus, ignore */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!(msg->lParam & 0x20000000))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
#if 0
|
|
|
|
/* don't generate events for just the Alt key */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam == VK_MENU)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
/* Jump to code in common with WM_KEYUP and WM_KEYDOWN */
|
|
|
|
goto keyup_or_down;
|
|
|
|
|
|
|
|
case WM_KEYUP:
|
|
|
|
case WM_KEYDOWN:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_KEY%s: %#lx %s %#x %s\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->message == WM_KEYUP ? "UP" : "DOWN"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
(GetKeyNameText (msg->lParam, buf,
|
1999-11-11 22:12:27 +00:00
|
|
|
sizeof (buf)) > 0 ?
|
|
|
|
buf : ""),
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam,
|
|
|
|
decode_key_lparam (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
keyup_or_down:
|
2000-07-04 06:12:54 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->key.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
switch (msg->wParam)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
case VK_LBUTTON:
|
|
|
|
event->key.keyval = GDK_Pointer_Button1; break;
|
|
|
|
case VK_RBUTTON:
|
|
|
|
event->key.keyval = GDK_Pointer_Button3; break;
|
|
|
|
case VK_MBUTTON:
|
|
|
|
event->key.keyval = GDK_Pointer_Button2; break;
|
|
|
|
case VK_CANCEL:
|
|
|
|
event->key.keyval = GDK_Cancel; break;
|
|
|
|
case VK_BACK:
|
|
|
|
event->key.keyval = GDK_BackSpace; break;
|
|
|
|
case VK_TAB:
|
|
|
|
event->key.keyval = (GetKeyState(VK_SHIFT) < 0 ?
|
|
|
|
GDK_ISO_Left_Tab : GDK_Tab);
|
|
|
|
break;
|
|
|
|
case VK_CLEAR:
|
|
|
|
event->key.keyval = GDK_Clear; break;
|
|
|
|
case VK_RETURN:
|
|
|
|
event->key.keyval = GDK_Return; break;
|
|
|
|
case VK_SHIFT:
|
2000-03-03 23:21:51 +00:00
|
|
|
/* Don't let Shift auto-repeat */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_KEYDOWN
|
|
|
|
&& (HIWORD (msg->lParam) & KF_REPEAT))
|
|
|
|
ignore_wm_char = FALSE;
|
2000-03-03 23:21:51 +00:00
|
|
|
else
|
|
|
|
event->key.keyval = GDK_Shift_L;
|
|
|
|
break;
|
1999-11-11 22:12:27 +00:00
|
|
|
case VK_CONTROL:
|
2000-03-03 23:21:51 +00:00
|
|
|
/* And not Control either */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_KEYDOWN
|
|
|
|
&& (HIWORD (msg->lParam) & KF_REPEAT))
|
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
else if (HIWORD (msg->lParam) & KF_EXTENDED)
|
1999-11-11 22:12:27 +00:00
|
|
|
event->key.keyval = GDK_Control_R;
|
|
|
|
else
|
|
|
|
event->key.keyval = GDK_Control_L;
|
|
|
|
break;
|
|
|
|
case VK_MENU:
|
2000-03-03 23:21:51 +00:00
|
|
|
/* And not Alt */
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_KEYDOWN
|
|
|
|
&& (HIWORD (msg->lParam) & KF_REPEAT))
|
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
else if (HIWORD (msg->lParam) & KF_EXTENDED)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* AltGr key comes in as Control+Right Alt */
|
|
|
|
if (GetKeyState (VK_CONTROL) < 0)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
is_altgr_key = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
event->key.keyval = GDK_Alt_R;
|
|
|
|
}
|
|
|
|
else
|
2000-07-04 06:12:54 +00:00
|
|
|
{
|
|
|
|
event->key.keyval = GDK_Alt_L;
|
|
|
|
/* This needed in case she types Alt+nnn (on the numpad) */
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
2000-07-04 06:12:54 +00:00
|
|
|
}
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_PAUSE:
|
|
|
|
event->key.keyval = GDK_Pause; break;
|
|
|
|
case VK_CAPITAL:
|
|
|
|
event->key.keyval = GDK_Caps_Lock; break;
|
|
|
|
case VK_ESCAPE:
|
|
|
|
event->key.keyval = GDK_Escape; break;
|
|
|
|
case VK_PRIOR:
|
|
|
|
event->key.keyval = GDK_Prior; break;
|
|
|
|
case VK_NEXT:
|
|
|
|
event->key.keyval = GDK_Next; break;
|
|
|
|
case VK_END:
|
|
|
|
event->key.keyval = GDK_End; break;
|
|
|
|
case VK_HOME:
|
|
|
|
event->key.keyval = GDK_Home; break;
|
|
|
|
case VK_LEFT:
|
|
|
|
event->key.keyval = GDK_Left; break;
|
|
|
|
case VK_UP:
|
|
|
|
event->key.keyval = GDK_Up; break;
|
|
|
|
case VK_RIGHT:
|
|
|
|
event->key.keyval = GDK_Right; break;
|
|
|
|
case VK_DOWN:
|
|
|
|
event->key.keyval = GDK_Down; break;
|
|
|
|
case VK_SELECT:
|
|
|
|
event->key.keyval = GDK_Select; break;
|
|
|
|
case VK_PRINT:
|
|
|
|
event->key.keyval = GDK_Print; break;
|
|
|
|
case VK_EXECUTE:
|
|
|
|
event->key.keyval = GDK_Execute; break;
|
|
|
|
case VK_INSERT:
|
|
|
|
event->key.keyval = GDK_Insert; break;
|
|
|
|
case VK_DELETE:
|
|
|
|
event->key.keyval = GDK_Delete; break;
|
|
|
|
case VK_HELP:
|
|
|
|
event->key.keyval = GDK_Help; break;
|
|
|
|
case VK_NUMPAD0:
|
|
|
|
case VK_NUMPAD1:
|
|
|
|
case VK_NUMPAD2:
|
|
|
|
case VK_NUMPAD3:
|
|
|
|
case VK_NUMPAD4:
|
|
|
|
case VK_NUMPAD5:
|
|
|
|
case VK_NUMPAD6:
|
|
|
|
case VK_NUMPAD7:
|
|
|
|
case VK_NUMPAD8:
|
|
|
|
case VK_NUMPAD9:
|
|
|
|
/* Apparently applications work better if we just pass numpad digits
|
|
|
|
* on as real digits? So wait for the WM_CHAR instead.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_MULTIPLY:
|
|
|
|
event->key.keyval = GDK_KP_Multiply; break;
|
|
|
|
case VK_ADD:
|
|
|
|
/* Pass it on as an ASCII plus in WM_CHAR. */
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_SEPARATOR:
|
|
|
|
event->key.keyval = GDK_KP_Separator; break;
|
|
|
|
case VK_SUBTRACT:
|
|
|
|
/* Pass it on as an ASCII minus in WM_CHAR. */
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_DECIMAL:
|
|
|
|
/* The keypad decimal key should also be passed on as the decimal
|
|
|
|
* sign ('.' or ',' depending on the Windows locale settings,
|
|
|
|
* apparently). So wait for the WM_CHAR here, also.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_DIVIDE:
|
|
|
|
event->key.keyval = GDK_KP_Divide; break;
|
|
|
|
case VK_F1:
|
|
|
|
event->key.keyval = GDK_F1; break;
|
|
|
|
case VK_F2:
|
|
|
|
event->key.keyval = GDK_F2; break;
|
|
|
|
case VK_F3:
|
|
|
|
event->key.keyval = GDK_F3; break;
|
|
|
|
case VK_F4:
|
|
|
|
event->key.keyval = GDK_F4; break;
|
|
|
|
case VK_F5:
|
|
|
|
event->key.keyval = GDK_F5; break;
|
|
|
|
case VK_F6:
|
|
|
|
event->key.keyval = GDK_F6; break;
|
|
|
|
case VK_F7:
|
|
|
|
event->key.keyval = GDK_F7; break;
|
|
|
|
case VK_F8:
|
|
|
|
event->key.keyval = GDK_F8; break;
|
|
|
|
case VK_F9:
|
|
|
|
event->key.keyval = GDK_F9; break;
|
|
|
|
case VK_F10:
|
|
|
|
event->key.keyval = GDK_F10; break;
|
|
|
|
case VK_F11:
|
|
|
|
event->key.keyval = GDK_F11; break;
|
|
|
|
case VK_F12:
|
|
|
|
event->key.keyval = GDK_F12; break;
|
|
|
|
case VK_F13:
|
|
|
|
event->key.keyval = GDK_F13; break;
|
|
|
|
case VK_F14:
|
|
|
|
event->key.keyval = GDK_F14; break;
|
|
|
|
case VK_F15:
|
|
|
|
event->key.keyval = GDK_F15; break;
|
|
|
|
case VK_F16:
|
|
|
|
event->key.keyval = GDK_F16; break;
|
|
|
|
case '0':
|
|
|
|
case '1':
|
|
|
|
case '2':
|
|
|
|
case '3':
|
|
|
|
case '4':
|
|
|
|
case '5':
|
|
|
|
case '6':
|
|
|
|
case '7':
|
|
|
|
case '8':
|
|
|
|
case '9':
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!is_altgr_key && (GetKeyState (VK_CONTROL) < 0
|
1999-11-11 22:12:27 +00:00
|
|
|
|| GetKeyState (VK_MENU) < 0))
|
|
|
|
/* Control- or Alt-digits won't come in as a WM_CHAR,
|
|
|
|
* but beware of AltGr-digits, which are used for instance
|
|
|
|
* on Finnish keyboards.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
event->key.keyval = GDK_0 + (msg->wParam - '0');
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
case VK_OEM_PLUS: /* On my Win98, the '+' key comes in
|
2000-09-07 19:51:32 +00:00
|
|
|
* as VK_OEM_PLUS, etc.
|
1999-11-11 22:12:27 +00:00
|
|
|
*/
|
2000-09-07 19:51:32 +00:00
|
|
|
case VK_OEM_COMMA:
|
|
|
|
case VK_OEM_MINUS:
|
|
|
|
case VK_OEM_PERIOD:
|
|
|
|
case VK_OEM_2:
|
|
|
|
case VK_OEM_4:
|
|
|
|
case VK_OEM_5:
|
|
|
|
case VK_OEM_6:
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!is_altgr_key && (GetKeyState (VK_CONTROL) < 0
|
1999-11-11 22:12:27 +00:00
|
|
|
|| GetKeyState (VK_MENU) < 0))
|
|
|
|
/* Control- or Alt-plus won't come in as WM_CHAR,
|
|
|
|
* but beware of AltGr-plus which is backslash on
|
|
|
|
* Finnish keyboards
|
|
|
|
*/
|
2000-09-07 19:51:32 +00:00
|
|
|
/* All these VK_OEM keycodes happen to be the corresponding ASCII
|
|
|
|
* char + 0x90
|
|
|
|
*/
|
2000-09-07 19:55:36 +00:00
|
|
|
event->key.keyval = msg->wParam - 0x90;
|
2000-09-07 19:51:32 +00:00
|
|
|
else
|
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
break;
|
|
|
|
case VK_OEM_1:
|
|
|
|
if (!is_altgr_key && (GetKeyState (VK_CONTROL) < 0
|
|
|
|
|| GetKeyState (VK_MENU) < 0))
|
|
|
|
/* ;: on US keyboard */
|
|
|
|
event->key.keyval = ';';
|
|
|
|
else
|
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
break;
|
|
|
|
case VK_OEM_3:
|
|
|
|
if (!is_altgr_key && (GetKeyState (VK_CONTROL) < 0
|
|
|
|
|| GetKeyState (VK_MENU) < 0))
|
|
|
|
/* `~ on US keyboard */
|
|
|
|
event->key.keyval = '`';
|
|
|
|
else
|
|
|
|
ignore_wm_char = FALSE;
|
|
|
|
break;
|
|
|
|
case VK_OEM_7:
|
|
|
|
if (!is_altgr_key && (GetKeyState (VK_CONTROL) < 0
|
|
|
|
|| GetKeyState (VK_MENU) < 0))
|
|
|
|
/* '" on US keyboard */
|
|
|
|
event->key.keyval = '\'';
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
default:
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->message == WM_SYSKEYDOWN || msg->message == WM_SYSKEYUP)
|
|
|
|
event->key.keyval = msg->wParam;
|
1999-11-11 22:12:27 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!ignore_wm_char)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!propagate (&window, msg,
|
2000-07-04 06:12:54 +00:00
|
|
|
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
|
|
|
doesnt_want_key))
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
2000-07-04 06:12:54 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
is_altgr_key = FALSE;
|
|
|
|
event->key.type = ((msg->message == WM_KEYDOWN
|
|
|
|
|| msg->message == WM_SYSKEYDOWN) ?
|
1999-11-11 22:12:27 +00:00
|
|
|
GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
2000-07-23 21:43:23 +00:00
|
|
|
event->key.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->key.state = 0;
|
|
|
|
if (GetKeyState (VK_SHIFT) < 0)
|
|
|
|
event->key.state |= GDK_SHIFT_MASK;
|
|
|
|
if (GetKeyState (VK_CAPITAL) & 0x1)
|
|
|
|
event->key.state |= GDK_LOCK_MASK;
|
|
|
|
if (GetKeyState (VK_CONTROL) < 0)
|
|
|
|
event->key.state |= GDK_CONTROL_MASK;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam != VK_MENU && GetKeyState (VK_MENU) < 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
event->key.state |= GDK_MOD1_MASK;
|
|
|
|
event->key.string = NULL;
|
|
|
|
event->key.length = 0;
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_IME_COMPOSITION:
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!use_ime_composition)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
2000-07-23 21:43:23 +00:00
|
|
|
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_IME_COMPOSITION: %#lx %#lx\n",
|
|
|
|
(gulong) msg->hwnd, msg->lParam));
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->lParam & GCS_RESULTSTR)
|
1999-11-11 22:12:27 +00:00
|
|
|
goto wm_char;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_IME_CHAR:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_IME_CHAR: %#lx bytes: %#.04x\n",
|
|
|
|
(gulong) msg->hwnd, msg->wParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
goto wm_char;
|
|
|
|
|
|
|
|
case WM_CHAR:
|
2000-07-04 06:12:54 +00:00
|
|
|
case WM_SYSCHAR:
|
1999-11-11 22:12:27 +00:00
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_%sCHAR: %#lx %#x %s %s\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->message == WM_CHAR ? "" : "SYS"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd, msg->wParam,
|
2000-07-23 21:43:23 +00:00
|
|
|
decode_key_lparam (msg->lParam),
|
|
|
|
(ignore_wm_char ? "ignored" : "")));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (ignore_wm_char)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
ignore_wm_char = FALSE;
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
wm_char:
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!propagate (&window, msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
|
|
|
doesnt_want_char))
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->key.window = window;
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (return_val && (event->key.window == k_grab_window
|
2000-07-25 17:31:05 +00:00
|
|
|
|| (window_impl->event_mask & GDK_KEY_RELEASE_MASK)))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if (window == k_grab_window
|
2000-07-25 17:31:05 +00:00
|
|
|
|| (window_impl->event_mask & GDK_KEY_PRESS_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Append a GDK_KEY_PRESS event to the pushback list
|
|
|
|
* (from which it will be fetched before the release
|
|
|
|
* event).
|
|
|
|
*/
|
|
|
|
GdkEvent *event2 = gdk_event_new ();
|
2000-07-25 17:31:05 +00:00
|
|
|
build_keypress_event (window_impl, event2, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
event2->key.window = window;
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_event_queue_append (event2);
|
|
|
|
GDK_NOTE (EVENTS, print_event (event2));
|
|
|
|
}
|
|
|
|
/* Return the key release event. */
|
2000-07-25 17:31:05 +00:00
|
|
|
build_keyrelease_event (window_impl, event, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else if (return_val
|
2000-07-25 17:31:05 +00:00
|
|
|
&& (window_impl->event_mask & GDK_KEY_PRESS_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* Return just the key press event. */
|
2000-07-25 17:31:05 +00:00
|
|
|
build_keypress_event (window_impl, event, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return_val = FALSE;
|
|
|
|
|
|
|
|
#if 0 /* Don't reset is_AltGr_key here. Othewise we can't type several
|
|
|
|
* AltGr-accessed chars while keeping the AltGr pressed down
|
|
|
|
* all the time.
|
|
|
|
*/
|
|
|
|
is_AltGr_key = FALSE;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_LBUTTONDOWN:
|
|
|
|
button = 1;
|
|
|
|
goto buttondown0;
|
|
|
|
case WM_MBUTTONDOWN:
|
|
|
|
button = 2;
|
|
|
|
goto buttondown0;
|
|
|
|
case WM_RBUTTONDOWN:
|
|
|
|
button = 3;
|
|
|
|
|
|
|
|
buttondown0:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_%cBUTTONDOWN: %#lx (%d,%d)\n",
|
1999-11-11 22:12:27 +00:00
|
|
|
" LMR"[button],
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
|
1999-11-11 22:12:27 +00:00
|
|
|
&& gdk_input_ignore_core)
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (window != current_window)
|
|
|
|
synthesize_crossing_events (window, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->button.type = GDK_BUTTON_PRESS;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!propagate (&window, msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
p_grab_window, p_grab_owner_events, p_grab_mask,
|
|
|
|
doesnt_want_button_press))
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->button.window = window;
|
2000-07-25 17:31:05 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Emulate X11's automatic active grab */
|
|
|
|
if (!p_grab_window)
|
|
|
|
{
|
|
|
|
/* No explicit active grab, let's start one automatically */
|
2000-07-25 17:31:05 +00:00
|
|
|
gint owner_events = window_impl->event_mask
|
1999-11-11 22:12:27 +00:00
|
|
|
& (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);
|
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...automatic grab started\n"));
|
|
|
|
gdk_pointer_grab (window,
|
|
|
|
owner_events,
|
2000-07-25 17:31:05 +00:00
|
|
|
window_impl->event_mask,
|
1999-11-11 22:12:27 +00:00
|
|
|
NULL, NULL, 0);
|
|
|
|
p_grab_automatic = TRUE;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
event->button.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (window != orig_window)
|
2000-07-23 21:43:23 +00:00
|
|
|
translate_mouse_coords (orig_window, window, msg);
|
|
|
|
event->button.x = current_x = (gint16) LOWORD (msg->lParam);
|
|
|
|
event->button.y = current_y = (gint16) HIWORD (msg->lParam);
|
|
|
|
event->button.x_root = msg->pt.x;
|
|
|
|
event->button.y_root = msg->pt.y;
|
|
|
|
event->button.axes = NULL;
|
|
|
|
event->button.state = build_pointer_event_state (msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->button.button = button;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->button.device = gdk_core_pointer;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
1999-11-17 00:45:37 +00:00
|
|
|
gdk_event_button_generate (event);
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_LBUTTONUP:
|
|
|
|
button = 1;
|
|
|
|
goto buttonup0;
|
|
|
|
case WM_MBUTTONUP:
|
|
|
|
button = 2;
|
|
|
|
goto buttonup0;
|
|
|
|
case WM_RBUTTONUP:
|
|
|
|
button = 3;
|
|
|
|
|
|
|
|
buttonup0:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_%cBUTTONUP: %#lx (%d,%d)\n",
|
1999-11-11 22:12:27 +00:00
|
|
|
" LMR"[button],
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
|
1999-11-11 22:12:27 +00:00
|
|
|
&& gdk_input_ignore_core)
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (window != current_window)
|
|
|
|
synthesize_crossing_events (window, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->button.type = GDK_BUTTON_RELEASE;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!propagate (&window, msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
p_grab_window, p_grab_owner_events, p_grab_mask,
|
|
|
|
doesnt_want_button_release))
|
|
|
|
goto maybe_ungrab;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->button.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->button.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (window != orig_window)
|
2000-07-23 21:43:23 +00:00
|
|
|
translate_mouse_coords (orig_window, window, msg);
|
|
|
|
event->button.x = (gint16) LOWORD (msg->lParam);
|
|
|
|
event->button.y = (gint16) HIWORD (msg->lParam);
|
|
|
|
event->button.x_root = msg->pt.x;
|
|
|
|
event->button.y_root = msg->pt.y;
|
|
|
|
event->button.axes = NULL;
|
|
|
|
event->button.state = build_pointer_event_state (msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->button.button = button;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->button.device = gdk_core_pointer;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
maybe_ungrab:
|
|
|
|
if (p_grab_window != NULL
|
|
|
|
&& p_grab_automatic
|
|
|
|
&& (event->button.state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) == 0)
|
|
|
|
gdk_pointer_ungrab (0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_MOUSEMOVE:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_MOUSEMOVE: %#lx %#x (%d,%d)\n",
|
|
|
|
(gulong) msg->hwnd, msg->wParam,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
/* If we haven't moved, don't create any event.
|
|
|
|
* Windows sends WM_MOUSEMOVE messages after button presses
|
|
|
|
* even if the mouse doesn't move. This disturbs gtk.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
if (window == current_window
|
|
|
|
&& LOWORD (msg->lParam) == current_x
|
|
|
|
&& HIWORD (msg->lParam) == current_y)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* HB: only process mouse move messages if we own the active window. */
|
|
|
|
GetWindowThreadProcessId(GetActiveWindow(), &pidActWin);
|
2000-07-23 21:43:23 +00:00
|
|
|
GetWindowThreadProcessId(msg->hwnd, &pidThis);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (pidActWin != pidThis)
|
|
|
|
break;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (window != current_window)
|
|
|
|
synthesize_crossing_events (window, msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
|
1999-11-11 22:12:27 +00:00
|
|
|
&& gdk_input_ignore_core)
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
event->motion.type = GDK_MOTION_NOTIFY;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!propagate (&window, msg,
|
1999-11-11 22:12:27 +00:00
|
|
|
p_grab_window, p_grab_owner_events, p_grab_mask,
|
|
|
|
doesnt_want_button_motion))
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->motion.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->motion.time = msg->time;
|
1999-11-11 22:12:27 +00:00
|
|
|
if (window != orig_window)
|
2000-07-23 21:43:23 +00:00
|
|
|
translate_mouse_coords (orig_window, window, msg);
|
|
|
|
event->motion.x = current_x = (gint16) LOWORD (msg->lParam);
|
|
|
|
event->motion.y = current_y = (gint16) HIWORD (msg->lParam);
|
|
|
|
event->motion.x_root = current_x_root = msg->pt.x;
|
|
|
|
event->motion.y_root = current_y_root = msg->pt.y;
|
|
|
|
event->motion.axes = NULL;
|
|
|
|
event->motion.state = build_pointer_event_state (msg);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->motion.is_hint = FALSE;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->motion.device = gdk_core_pointer;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_NCMOUSEMOVE:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_NCMOUSEMOVE: %#lx x,y: %d %d\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
|
|
|
if (track_mouse_event == NULL
|
|
|
|
&& current_window != NULL
|
|
|
|
&& (GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (current_window)->impl)->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...synthesizing LEAVE_NOTIFY event\n"));
|
|
|
|
|
|
|
|
event->crossing.type = GDK_LEAVE_NOTIFY;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.window = current_window;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.subwindow = NULL;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.time = msg->time;
|
|
|
|
event->crossing.x = current_x;
|
|
|
|
event->crossing.y = current_y;
|
|
|
|
event->crossing.x_root = current_x_root;
|
|
|
|
event->crossing.y_root = current_y_root;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.mode = GDK_CROSSING_NORMAL;
|
|
|
|
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
|
|
|
|
|
|
|
|
event->crossing.focus = TRUE; /* ??? */
|
|
|
|
event->crossing.state = 0; /* ??? */
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (current_window)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_drawable_unref (current_window);
|
|
|
|
current_window = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2000-03-03 23:21:51 +00:00
|
|
|
case WM_MOUSEWHEEL:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_MOUSEWHEEL: %#lx\n", (gulong) msg->hwnd));
|
2000-03-03 23:21:51 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->extension_events != 0
|
2000-03-03 23:21:51 +00:00
|
|
|
&& gdk_input_ignore_core)
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...ignored\n"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
2000-07-23 21:43:23 +00:00
|
|
|
pt.x = LOWORD (msg->lParam);
|
|
|
|
pt.y = HIWORD (msg->lParam);
|
2000-03-03 23:21:51 +00:00
|
|
|
if ((hwnd = WindowFromPoint (pt)) == NULL)
|
|
|
|
break;
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->hwnd = hwnd;
|
2000-07-25 20:38:35 +00:00
|
|
|
if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
|
2000-03-03 23:21:51 +00:00
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
if (new_window != window)
|
2000-03-03 23:21:51 +00:00
|
|
|
{
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (window);
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (new_window);
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (window);
|
2000-03-03 23:21:51 +00:00
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
ScreenToClient (msg->hwnd, &pt);
|
|
|
|
if (!propagate (&window, msg,
|
2000-03-03 23:21:51 +00:00
|
|
|
p_grab_window, p_grab_owner_events, p_grab_mask,
|
|
|
|
doesnt_want_scroll))
|
|
|
|
break;
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (window);
|
|
|
|
|
2000-03-03 23:21:51 +00:00
|
|
|
event->button.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
|
2000-03-03 23:21:51 +00:00
|
|
|
GDK_SCROLL_UP : GDK_SCROLL_DOWN;
|
|
|
|
event->scroll.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->scroll.time = msg->time;
|
2000-03-03 23:21:51 +00:00
|
|
|
event->scroll.x = (gint16) pt.x;
|
|
|
|
event->scroll.y = (gint16) pt.y;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->scroll.x_root = (gint16) LOWORD (msg->lParam);
|
|
|
|
event->scroll.y_root = (gint16) LOWORD (msg->lParam);
|
|
|
|
event->scroll.state = build_pointer_event_state (msg);
|
|
|
|
event->scroll.device = gdk_core_pointer;
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
2000-03-03 23:21:51 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
#ifdef USE_TRACKMOUSEEVENT
|
|
|
|
case WM_MOUSELEAVE:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_MOUSELEAVE: %#lx\n", (gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
event->crossing.type = GDK_LEAVE_NOTIFY;
|
|
|
|
event->crossing.window = window;
|
|
|
|
event->crossing.subwindow = NULL;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->crossing.time = msg->time;
|
|
|
|
event->crossing.x = current_x;
|
|
|
|
event->crossing.y = current_y;
|
|
|
|
event->crossing.x_root = current_xroot;
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.y_root = curYroot;
|
|
|
|
event->crossing.mode = GDK_CROSSING_NORMAL;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (current_window
|
|
|
|
&& IsChild (GDK_WINDOW_HWND (current_window), GDK_WINDOW_HWND (window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_INFERIOR;
|
2000-07-23 21:43:23 +00:00
|
|
|
else if (current_window
|
|
|
|
&& IsChild (GDK_WINDOW_HWND (window), GDK_WINDOW_HWND (current_window)))
|
1999-11-11 22:12:27 +00:00
|
|
|
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
|
|
|
else
|
|
|
|
event->crossing.detail = GDK_NOTIFY_NONLINEAR;
|
|
|
|
|
|
|
|
event->crossing.focus = TRUE; /* ??? */
|
|
|
|
event->crossing.state = 0; /* ??? */
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (current_window)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_drawable_unref (current_window);
|
|
|
|
current_window = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case WM_SETFOCUS:
|
|
|
|
case WM_KILLFOCUS:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_%sFOCUS: %#lx\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->message == WM_SETFOCUS ?
|
1999-11-11 22:12:27 +00:00
|
|
|
"SET" : "KILL"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_FOCUS_CHANGE_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
event->focus_change.type = GDK_FOCUS_CHANGE;
|
|
|
|
event->focus_change.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->focus_change.in = (msg->message == WM_SETFOCUS);
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_ERASEBKGND:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_ERASEBKGND: %#lx dc %#x\n",
|
|
|
|
(gulong) msg->hwnd, msg->wParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_DESTROYED (window))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
colormap_private = (GdkColormapPrivateWin32 *) GDK_DRAWABLE_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl)->colormap;
|
|
|
|
hdc = (HDC) msg->wParam;
|
|
|
|
if (colormap_private && colormap_private->xcolormap->rc_palette)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
int k;
|
|
|
|
|
|
|
|
if (SelectPalette (hdc, colormap_private->xcolormap->palette,
|
|
|
|
FALSE) == NULL)
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("SelectPalette");
|
1999-11-11 22:12:27 +00:00
|
|
|
if ((k = RealizePalette (hdc)) == GDI_ERROR)
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("RealizePalette");
|
1999-11-11 22:12:27 +00:00
|
|
|
#if 0
|
|
|
|
g_print ("WM_ERASEBKGND: selected %#x, realized %d colors\n",
|
|
|
|
colormap_private->xcolormap->palette, k);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
*ret_val_flagp = TRUE;
|
|
|
|
*ret_valp = 1;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->input_only)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
/* If this window should have the same background as the
|
|
|
|
* parent, fetch the parent. (And if the same goes for
|
|
|
|
* the parent, fetch the grandparent, etc.)
|
|
|
|
*/
|
2000-07-25 17:31:05 +00:00
|
|
|
while (window && GDK_WINDOW_OBJECT (window)->bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (window);
|
2000-07-25 17:31:05 +00:00
|
|
|
ASSIGN_WINDOW (GDK_WINDOW (GDK_WINDOW_OBJECT (window)->parent));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_OBJECT (window)->bg_pixmap == NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
bg = gdk_colormap_color (GDK_DRAWABLE_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl)->colormap,
|
|
|
|
GDK_WINDOW_OBJECT (window)->bg_color.pixel);
|
2000-03-03 23:21:51 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
GetClipBox (hdc, &rect);
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("...%ldx%ld@+%ld+%ld BG_PIXEL %.06lx\n",
|
1999-11-11 22:12:27 +00:00
|
|
|
rect.right - rect.left,
|
|
|
|
rect.bottom - rect.top,
|
|
|
|
rect.left, rect.top,
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) bg));
|
1999-11-11 22:12:27 +00:00
|
|
|
hbr = CreateSolidBrush (bg);
|
|
|
|
#if 0
|
|
|
|
g_print ("...CreateSolidBrush (%.08x) = %.08x\n", bg, hbr);
|
|
|
|
#endif
|
|
|
|
if (!FillRect (hdc, &rect, hbr))
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("FillRect");
|
1999-11-11 22:12:27 +00:00
|
|
|
DeleteObject (hbr);
|
|
|
|
}
|
2000-07-25 17:31:05 +00:00
|
|
|
else if (GDK_WINDOW_OBJECT (window)->bg_pixmap != NULL &&
|
|
|
|
GDK_WINDOW_OBJECT (window)->bg_pixmap != GDK_NO_BG)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
pixmap = GDK_WINDOW_OBJECT (window)->bg_pixmap;
|
2000-07-23 21:43:23 +00:00
|
|
|
pixmap_impl = GDK_PIXMAP_IMPL_WIN32 (pixmap);
|
1999-11-11 22:12:27 +00:00
|
|
|
GetClipBox (hdc, &rect);
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (pixmap_impl->width <= 8 && pixmap_impl->height <= 8)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...small pixmap, using brush\n"));
|
2000-07-23 21:43:23 +00:00
|
|
|
hbr = CreatePatternBrush (GDK_PIXMAP_HBITMAP (pixmap));
|
1999-11-11 22:12:27 +00:00
|
|
|
if (!FillRect (hdc, &rect, hbr))
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("FillRect");
|
1999-11-11 22:12:27 +00:00
|
|
|
DeleteObject (hbr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("...blitting pixmap %#lx (%dx%d) "
|
1999-11-11 22:12:27 +00:00
|
|
|
"all over the place,\n"
|
2000-09-07 19:51:32 +00:00
|
|
|
"...clip box = %ldx%ld@+%ld+%ld\n",
|
|
|
|
(gulong) GDK_PIXMAP_HBITMAP (pixmap),
|
2000-07-23 21:43:23 +00:00
|
|
|
pixmap_impl->width, pixmap_impl->height,
|
1999-11-11 22:12:27 +00:00
|
|
|
rect.right - rect.left, rect.bottom - rect.top,
|
|
|
|
rect.left, rect.top));
|
|
|
|
|
|
|
|
if (!(bgdc = CreateCompatibleDC (hdc)))
|
|
|
|
{
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("CreateCompatibleDC");
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!(oldbitmap = SelectObject (bgdc, GDK_PIXMAP_HBITMAP (pixmap))))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("SelectObject");
|
1999-11-11 22:12:27 +00:00
|
|
|
DeleteDC (bgdc);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
i = 0;
|
|
|
|
while (i < rect.right)
|
|
|
|
{
|
|
|
|
j = 0;
|
|
|
|
while (j < rect.bottom)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if (i + pixmap_impl->width >= rect.left
|
|
|
|
&& j + pixmap_impl->height >= rect.top)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
if (!BitBlt (hdc, i, j,
|
2000-07-23 21:43:23 +00:00
|
|
|
pixmap_impl->width, pixmap_impl->height,
|
1999-11-11 22:12:27 +00:00
|
|
|
bgdc, 0, 0, SRCCOPY))
|
|
|
|
{
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("BitBlt");
|
1999-11-11 22:12:27 +00:00
|
|
|
goto loopexit;
|
|
|
|
}
|
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
j += pixmap_impl->height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
i += pixmap_impl->width;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
loopexit:
|
|
|
|
SelectObject (bgdc, oldbitmap);
|
|
|
|
DeleteDC (bgdc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GDK_NOTE (EVENTS, g_print ("...BLACK_BRUSH (?)\n"));
|
|
|
|
hbr = GetStockObject (BLACK_BRUSH);
|
|
|
|
GetClipBox (hdc, &rect);
|
|
|
|
if (!FillRect (hdc, &rect, hbr))
|
Internal GDK error reporting changes: (gdk_win32_gdi_failed) New function
2000-03-07 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkmain-win32.c: Internal GDK error reporting changes:
(gdk_win32_gdi_failed) New function for reporting errors from GDI,
for which it is no use to call GetLastError on Win9x.
(gdk_other_api_failed) New function, for
general error reporting without calling GetLastError.
(gdk_win32_api_failed) OTOH, this function always calls
GetLastError. (gdk_win32_last_error_string) Remove this function,
GLib has the equivalent now.
* gdk/win32/gdkprivate-win32.h: Declare the above, and macros to
call them with function name, file name and line number in the
arguments.
* gdk/win32/*.c: Use the new macros for reporting errors from GDI
functions.
* gtk/gtk.def: Add some missing entry points.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size, which don't exist any longer, as void.
Fixes by Hans Breuer:
* gdk/makefile.msc: Update for debugging.
* gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_dashes): Fake
implementation, just use the PS_DASH, PS_DOT, PS_DASHDOT or
PS_DASHDOTDOT or PS_DASH styles depending on the number of entries
in the dash_list.
* gdk/win32/gdkwin32.h (GDK_FONT_XFONT): New macro, similar as in
the x11 backend.
* gdk/win32/gdkprivate-win32.h (IS_WIN_NT): New macro.
* gtk/testgtk.c: Include config.h, guard inclusion of unistd.h.
2000-03-08 06:18:41 +00:00
|
|
|
WIN32_GDI_FAILED ("FillRect");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_PAINT:
|
2000-07-23 21:43:23 +00:00
|
|
|
if (!GetUpdateRect(msg->hwnd, NULL, FALSE))
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_PAINT: %#lx no update rect\n",
|
|
|
|
(gulong) msg->hwnd));
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
hdc = BeginPaint (msg->hwnd, &paintstruct);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_PAINT: %#lx %ldx%ld@+%ld+%ld %s dc %#lx\n",
|
|
|
|
(gulong) msg->hwnd,
|
1999-11-11 22:12:27 +00:00
|
|
|
paintstruct.rcPaint.right - paintstruct.rcPaint.left,
|
|
|
|
paintstruct.rcPaint.bottom - paintstruct.rcPaint.top,
|
|
|
|
paintstruct.rcPaint.left, paintstruct.rcPaint.top,
|
|
|
|
(paintstruct.fErase ? "erase" : ""),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) hdc));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
EndPaint (msg->hwnd, &paintstruct);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_EXPOSURE_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
if ((paintstruct.rcPaint.right == paintstruct.rcPaint.left)
|
|
|
|
|| (paintstruct.rcPaint.bottom == paintstruct.rcPaint.top))
|
|
|
|
break;
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
event->expose.type = GDK_EXPOSE;
|
|
|
|
event->expose.window = window;
|
|
|
|
event->expose.area.x = paintstruct.rcPaint.left;
|
|
|
|
event->expose.area.y = paintstruct.rcPaint.top;
|
|
|
|
event->expose.area.width = paintstruct.rcPaint.right - paintstruct.rcPaint.left;
|
|
|
|
event->expose.area.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top;
|
|
|
|
event->expose.count = 0;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (return_val)
|
|
|
|
{
|
2000-01-02 11:03:12 +00:00
|
|
|
GList *list = gdk_queued_events;
|
1999-11-11 22:12:27 +00:00
|
|
|
while (list != NULL )
|
|
|
|
{
|
|
|
|
if ((((GdkEvent *)list->data)->any.type == GDK_EXPOSE) &&
|
|
|
|
(((GdkEvent *)list->data)->any.window == window) &&
|
|
|
|
!(((GdkEventPrivate *)list->data)->flags & GDK_EVENT_PENDING))
|
|
|
|
((GdkEvent *)list->data)->expose.count++;
|
|
|
|
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_SETCURSOR:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_SETCURSOR: %#lx %#x %#x\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (LOWORD (msg->lParam) != HTCLIENT)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
2000-07-04 06:12:54 +00:00
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
if (p_grab_window != NULL && p_grab_cursor != NULL)
|
2000-07-23 21:43:23 +00:00
|
|
|
hcursor = p_grab_cursor;
|
2000-07-25 17:31:05 +00:00
|
|
|
else if (!GDK_WINDOW_DESTROYED (window))
|
|
|
|
hcursor = window_impl->hcursor;
|
2000-07-04 06:12:54 +00:00
|
|
|
else
|
2000-07-23 21:43:23 +00:00
|
|
|
hcursor = NULL;
|
2000-07-04 06:12:54 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (hcursor != NULL)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("...SetCursor(%#lx)\n", (gulong) hcursor));
|
2000-07-23 21:43:23 +00:00
|
|
|
SetCursor (hcursor);
|
2000-07-04 06:12:54 +00:00
|
|
|
*ret_val_flagp = TRUE;
|
|
|
|
*ret_valp = TRUE;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_SHOWWINDOW:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_SHOWWINDOW: %#lx %d\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_STRUCTURE_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
event->any.type = (msg->wParam ? GDK_MAP : GDK_UNMAP);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->any.window = window;
|
|
|
|
|
|
|
|
if (event->any.type == GDK_UNMAP
|
|
|
|
&& p_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_pointer_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (event->any.type == GDK_UNMAP
|
|
|
|
&& k_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_keyboard_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_SIZE:
|
|
|
|
GDK_NOTE (EVENTS,
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_SIZE: %#lx %s %dx%d\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->wParam == SIZE_MAXHIDE ? "MAXHIDE" :
|
|
|
|
(msg->wParam == SIZE_MAXIMIZED ? "MAXIMIZED" :
|
|
|
|
(msg->wParam == SIZE_MAXSHOW ? "MAXSHOW" :
|
|
|
|
(msg->wParam == SIZE_MINIMIZED ? "MINIMIZED" :
|
|
|
|
(msg->wParam == SIZE_RESTORED ? "RESTORED" : "?"))))),
|
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_STRUCTURE_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam == SIZE_MINIMIZED)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
event->any.type = GDK_UNMAP;
|
|
|
|
event->any.window = window;
|
|
|
|
|
|
|
|
if (p_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_pointer_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (k_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_keyboard_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-23 21:43:23 +00:00
|
|
|
else if ((msg->wParam == SIZE_RESTORED
|
|
|
|
|| msg->wParam == SIZE_MAXIMIZED)
|
1999-11-11 22:12:27 +00:00
|
|
|
#if 1
|
2000-07-25 17:31:05 +00:00
|
|
|
&& GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
|
1999-11-11 22:12:27 +00:00
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
if (LOWORD (msg->lParam) == 0)
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
event->configure.type = GDK_CONFIGURE;
|
|
|
|
event->configure.window = window;
|
|
|
|
pt.x = 0;
|
|
|
|
pt.y = 0;
|
2000-07-23 21:43:23 +00:00
|
|
|
ClientToScreen (msg->hwnd, &pt);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->configure.x = pt.x;
|
|
|
|
event->configure.y = pt.y;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->configure.width = LOWORD (msg->lParam);
|
|
|
|
event->configure.height = HIWORD (msg->lParam);
|
|
|
|
GDK_WINDOW_OBJECT (window)->x = event->configure.x;
|
|
|
|
GDK_WINDOW_OBJECT (window)->y = event->configure.y;
|
2000-07-25 17:31:05 +00:00
|
|
|
window_impl->width = event->configure.width;
|
|
|
|
window_impl->height = event->configure.height;
|
2000-07-23 21:43:23 +00:00
|
|
|
|
|
|
|
if (GDK_WINDOW_OBJECT (window)->resize_count > 1)
|
|
|
|
GDK_WINDOW_OBJECT (window)->resize_count -= 1;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (return_val
|
2000-07-25 17:31:05 +00:00
|
|
|
&& GDK_WINDOW_OBJECT (window)->extension_events != 0)
|
|
|
|
_gdk_input_configure_event (&event->configure, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_GETMINMAXINFO:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_GETMINMAXINFO: %#lx\n", (gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
mmi = (MINMAXINFO*) msg->lParam;
|
2000-07-25 17:31:05 +00:00
|
|
|
if (window_impl->hint_flags & GDK_HINT_MIN_SIZE)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
mmi->ptMinTrackSize.x = window_impl->hint_min_width;
|
|
|
|
mmi->ptMinTrackSize.y = window_impl->hint_min_height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
2000-07-25 17:31:05 +00:00
|
|
|
if (window_impl->hint_flags & GDK_HINT_MAX_SIZE)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-25 17:31:05 +00:00
|
|
|
mmi->ptMaxTrackSize.x = window_impl->hint_max_width;
|
|
|
|
mmi->ptMaxTrackSize.y = window_impl->hint_max_height;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
mmi->ptMaxSize.x = window_impl->hint_max_width;
|
|
|
|
mmi->ptMaxSize.y = window_impl->hint_max_height;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_MOVE:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %#lx (%d,%d)\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam), HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (!(window_impl->event_mask & GDK_STRUCTURE_MASK))
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
|
2000-07-23 21:43:23 +00:00
|
|
|
&& !IsIconic(msg->hwnd)
|
|
|
|
&& IsWindowVisible(msg->hwnd))
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
event->configure.type = GDK_CONFIGURE;
|
|
|
|
event->configure.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->configure.x = LOWORD (msg->lParam);
|
|
|
|
event->configure.y = HIWORD (msg->lParam);
|
|
|
|
GetClientRect (msg->hwnd, &rect);
|
1999-11-11 22:12:27 +00:00
|
|
|
event->configure.width = rect.right;
|
|
|
|
event->configure.height = rect.bottom;
|
2000-07-23 21:43:23 +00:00
|
|
|
GDK_WINDOW_OBJECT (window)->x = event->configure.x;
|
|
|
|
GDK_WINDOW_OBJECT (window)->y = event->configure.y;
|
2000-07-25 17:31:05 +00:00
|
|
|
window_impl->width = event->configure.width;
|
|
|
|
window_impl->height = event->configure.height;
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_CLOSE:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_CLOSE: %#lx\n", (gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->any.type = GDK_DELETE;
|
|
|
|
event->any.window = window;
|
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* No, don't use delayed rendering after all. It works only if the
|
|
|
|
* delayed SetClipboardData is called from the WindowProc, it
|
|
|
|
* seems. (The #else part below is test code for that. It succeeds
|
|
|
|
* in setting the clipboard data. But if I call SetClipboardData
|
|
|
|
* in gdk_property_change (as a consequence of the
|
|
|
|
* GDK_SELECTION_REQUEST event), it fails. I deduce that this is
|
|
|
|
* because delayed rendering requires that SetClipboardData is
|
|
|
|
* called in the window procedure.)
|
|
|
|
*/
|
|
|
|
case WM_RENDERFORMAT:
|
|
|
|
case WM_RENDERALLFORMATS:
|
|
|
|
flag = FALSE;
|
|
|
|
GDK_NOTE (EVENTS, flag = TRUE);
|
|
|
|
if (flag)
|
2000-09-07 19:51:32 +00:00
|
|
|
g_print ("WM_%s: %#lx %#x (%s)\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
(msg->message == WM_RENDERFORMAT ? "RENDERFORMAT" :
|
1999-11-11 22:12:27 +00:00
|
|
|
"RENDERALLFORMATS"),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam,
|
|
|
|
(msg->wParam == CF_TEXT ? "CF_TEXT" :
|
|
|
|
(msg->wParam == CF_DIB ? "CF_DIB" :
|
|
|
|
(msg->wParam == CF_UNICODETEXT ? "CF_UNICODETEXT" :
|
|
|
|
(GetClipboardFormatName (msg->wParam, buf, sizeof (buf)), buf)))));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
event->selection.type = GDK_SELECTION_REQUEST;
|
|
|
|
event->selection.window = window;
|
|
|
|
event->selection.selection = gdk_clipboard_atom;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (msg->wParam == CF_TEXT)
|
1999-11-11 22:12:27 +00:00
|
|
|
event->selection.target = GDK_TARGET_STRING;
|
|
|
|
else
|
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
GetClipboardFormatName (msg->wParam, buf, sizeof (buf));
|
1999-11-11 22:12:27 +00:00
|
|
|
event->selection.target = gdk_atom_intern (buf, FALSE);
|
|
|
|
}
|
|
|
|
event->selection.property = gdk_selection_property;
|
2000-07-23 21:43:23 +00:00
|
|
|
event->selection.requestor = (guint32) msg->hwnd;
|
|
|
|
event->selection.time = msg->time;
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = !GDK_WINDOW_DESTROYED (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
#else
|
|
|
|
/* Test code, to see if SetClipboardData works when called from
|
|
|
|
* the window procedure.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
HGLOBAL hdata = GlobalAlloc (GMEM_MOVEABLE|GMEM_DDESHARE, 10);
|
|
|
|
char *ptr = GlobalLock (hdata);
|
|
|
|
strcpy (ptr, "Huhhaa");
|
|
|
|
GlobalUnlock (hdata);
|
|
|
|
if (!SetClipboardData (CF_TEXT, hdata))
|
2000-02-13 14:52:47 +00:00
|
|
|
WIN32_API_FAILED ("SetClipboardData");
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
*ret_valp = 0;
|
|
|
|
*ret_val_flagp = TRUE;
|
|
|
|
return_val = FALSE;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
#endif /* No delayed rendering */
|
|
|
|
|
|
|
|
case WM_DESTROY:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WM_DESTROY: %#lx\n", (gulong) msg->hwnd));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
event->any.type = GDK_DESTROY;
|
|
|
|
event->any.window = window;
|
2000-07-23 21:43:23 +00:00
|
|
|
if (window != NULL && window == current_window)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_drawable_unref (current_window);
|
|
|
|
current_window = NULL;
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (p_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_pointer_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (k_grab_window == window)
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_keyboard_ungrab (msg->time);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = window != NULL && !GDK_WINDOW_DESTROYED (window);
|
2000-05-12 22:29:31 +00:00
|
|
|
|
|
|
|
if (window != NULL)
|
|
|
|
gdk_window_destroy_notify (window);
|
|
|
|
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef HAVE_WINTAB
|
|
|
|
/* Handle WINTAB events here, as we know that gdkinput.c will
|
|
|
|
* use the fixed WT_DEFBASE as lcMsgBase, and we thus can use the
|
|
|
|
* constants as case labels.
|
|
|
|
*/
|
|
|
|
case WT_PACKET:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WT_PACKET: %#lx %d %#lx\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam, msg->lParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
goto wintab;
|
|
|
|
|
|
|
|
case WT_CSRCHANGE:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WT_CSRCHANGE: %#lx %d %#lx\n",
|
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam, msg->lParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
goto wintab;
|
|
|
|
|
|
|
|
case WT_PROXIMITY:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("WT_PROXIMITY: %#lx %#x %d %d\n",
|
|
|
|
(gulong) msg->hwnd, msg->wParam,
|
2000-07-23 21:43:23 +00:00
|
|
|
LOWORD (msg->lParam),
|
|
|
|
HIWORD (msg->lParam)));
|
1999-11-11 22:12:27 +00:00
|
|
|
/* Fall through */
|
|
|
|
wintab:
|
1999-11-17 00:45:37 +00:00
|
|
|
event->any.window = window;
|
2000-07-25 17:31:05 +00:00
|
|
|
return_val = _gdk_input_other_event(event, msg, window);
|
1999-11-11 22:12:27 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2000-05-12 22:29:31 +00:00
|
|
|
|
|
|
|
default:
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("%s: %#lx %#x %#lx\n",
|
2000-07-23 21:43:23 +00:00
|
|
|
gdk_win32_message_name (msg->message),
|
2000-09-07 19:51:32 +00:00
|
|
|
(gulong) msg->hwnd,
|
2000-07-23 21:43:23 +00:00
|
|
|
msg->wParam, msg->lParam));
|
1999-11-11 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2000-05-16 21:27:10 +00:00
|
|
|
done:
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
if (return_val)
|
|
|
|
{
|
|
|
|
if (event->any.window)
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (event->any.window);
|
1999-11-11 22:12:27 +00:00
|
|
|
if (((event->any.type == GDK_ENTER_NOTIFY) ||
|
|
|
|
(event->any.type == GDK_LEAVE_NOTIFY)) &&
|
|
|
|
(event->crossing.subwindow != NULL))
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_ref (event->crossing.subwindow);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
GDK_NOTE (EVENTS, print_event (event));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Mark this event as having no resources to be freed */
|
|
|
|
event->any.window = NULL;
|
|
|
|
event->any.type = GDK_NOTHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window)
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gdk_drawable_unref (window);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
1999-11-17 00:45:37 +00:00
|
|
|
void
|
1999-11-11 22:12:27 +00:00
|
|
|
gdk_events_queue (void)
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
|
2000-03-16 21:58:35 +00:00
|
|
|
while (!gdk_event_queue_find_first ()
|
1999-11-11 22:12:27 +00:00
|
|
|
&& PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
|
|
|
|
{
|
2000-09-07 19:51:32 +00:00
|
|
|
GDK_NOTE (EVENTS, g_print ("PeekMessage: %#lx %s\n",
|
|
|
|
(gulong) msg.hwnd, gdk_win32_message_name (msg.message)));
|
1999-11-11 22:12:27 +00:00
|
|
|
|
2000-07-23 21:43:23 +00:00
|
|
|
if (active_imm_msgpump_owner == NULL
|
|
|
|
|| (active_imm_msgpump_owner->lpVtbl->OnTranslateMessage) (active_imm_msgpump_owner, &msg) != S_OK)
|
1999-11-11 22:12:27 +00:00
|
|
|
TranslateMessage (&msg);
|
|
|
|
|
|
|
|
DispatchMessage (&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gdk_event_prepare (gpointer source_data,
|
|
|
|
GTimeVal *current_time,
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
gint *timeout,
|
|
|
|
gpointer user_data)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
gboolean retval;
|
|
|
|
|
|
|
|
GDK_THREADS_ENTER ();
|
|
|
|
|
|
|
|
*timeout = -1;
|
|
|
|
|
|
|
|
retval = (gdk_event_queue_find_first () != NULL)
|
|
|
|
|| PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
|
|
|
|
|
|
|
|
GDK_THREADS_LEAVE ();
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gdk_event_check (gpointer source_data,
|
Large changes to the Win32 backend, partially made necessary by the
2000-05-02 Tor Lillqvist <tml@iki.fi>
Large changes to the Win32 backend, partially made necessary by
the changes to the backend-independent internal
structures. Attempts to implement similar backing store stuff as
on X11. The current (CVS) version of the Win32 backend is *not* as
stable as it was before the no-flicker branch was merged. A
zipfile with that version is available from
http://www.gimp.org/win32/. That should be use by "production"
code until this CVS version is usable. (But note, the Win32
backend has never been claimed to be "production quality".)
* README.win32: Add the above comment about versions.
* gdk/gdkwindow.c: Don't use backing store for now on Win32.
* gdk/gdk.def: Update.
* gdk/gdkfont.h: Declare temporary Win32-only functions. Will
presumably be replaced by some more better mechanism as 1.4 gets
closer to release shape.
* gdk/makefile.{cygwin,msc}: Update.
* gdk/win32/*.c: Correct inclusions of the backend-specific and
internal headers. Change code according to changes in these. Use
gdk_drawable_*, not gdk_window_* where necessary.
* gdk/win32/gdkdnd-win32.c: Use MISC selector for GDK_NOTE, not
our old DND.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_text): Don't try
to interpret single characters as UTF-8. Thanks to Hans Breuer.
Use correct function name in warning messages.
* gdk/win32/gdkevents-win32.c: Use correct parameter lists for the
GSourceFuncs gdk_event_prepare and gdk_event_check.
(gdk_event_get_graphics_expose): Do implement, use
PeekMessage. Thanks to Hans Breuer.
(event_mask_string): Debugging function to print an GdkEventMask.
(gdk_pointer_grab): Use it.
* gdk/win32/gdkfont-win32.c: The Unicode subrange that the
(old) book I used claimed was Hangul actually is CJK Unified
Ideographs Extension A. Also, Hangul Syllables were missing.
Improve logging.
* gdk/win32/gdkgc-win32.c: Largish changes.
* gdk/win32/gdkim-win32.c (gdk_set_locale): Use
g_win32_getlocale() from GLib, and not setlocale() to get current
locale name.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwin32.h: Move stuff from gdkprivate-win32.h to
gdkwin32.h, similarily as in the X11 backend.
* gdk/win32/gdkwindow-win32.c (gdk_propagate_shapes): Bugfix,
assignment was used instead of equals in if test. Thanks to Hans
Breuer.
* gdk/win32/makefile.{cygwin,msc}
* gtk/makefile.{cygwin,msc}: Updates. Better kludge to get the
path to the Win32 headers that works also with the mingw compiler.
* gtk/gtkstyle.c: Include <string.h>.
2000-05-01 22:06:49 +00:00
|
|
|
GTimeVal *current_time,
|
|
|
|
gpointer user_data)
|
1999-11-11 22:12:27 +00:00
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
gboolean retval;
|
|
|
|
|
|
|
|
GDK_THREADS_ENTER ();
|
|
|
|
|
|
|
|
if (event_poll_fd.revents & G_IO_IN)
|
|
|
|
retval = (gdk_event_queue_find_first () != NULL)
|
|
|
|
|| PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
|
|
|
|
else
|
|
|
|
retval = FALSE;
|
|
|
|
|
|
|
|
GDK_THREADS_LEAVE ();
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gdk_event_dispatch (gpointer source_data,
|
|
|
|
GTimeVal *current_time,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GdkEvent *event;
|
|
|
|
|
|
|
|
GDK_THREADS_ENTER ();
|
|
|
|
|
|
|
|
gdk_events_queue();
|
|
|
|
event = gdk_event_unqueue();
|
|
|
|
|
|
|
|
if (event)
|
|
|
|
{
|
1999-11-17 00:45:37 +00:00
|
|
|
if (gdk_event_func)
|
|
|
|
(*gdk_event_func) (event, gdk_event_data);
|
1999-11-11 22:12:27 +00:00
|
|
|
|
|
|
|
gdk_event_free (event);
|
|
|
|
}
|
|
|
|
|
|
|
|
GDK_THREADS_LEAVE ();
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Sends a ClientMessage to all toplevel client windows */
|
|
|
|
gboolean
|
|
|
|
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_event_send_clientmessage_toall (GdkEvent *event)
|
|
|
|
{
|
|
|
|
/* XXX */
|
|
|
|
}
|
|
|
|
|
1999-11-20 01:22:57 +00:00
|
|
|
void
|
|
|
|
gdk_flush (void)
|
|
|
|
{
|
|
|
|
GdiFlush ();
|
|
|
|
}
|
2000-05-12 22:29:31 +00:00
|
|
|
|
|
|
|
#ifdef G_ENABLE_DEBUG
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
gdk_win32_message_name (UINT msg)
|
|
|
|
{
|
|
|
|
static gchar bfr[100];
|
|
|
|
|
|
|
|
switch (msg)
|
|
|
|
{
|
|
|
|
#define CASE(x) case x: return #x
|
|
|
|
CASE (WM_NULL);
|
|
|
|
CASE (WM_CREATE);
|
|
|
|
CASE (WM_DESTROY);
|
|
|
|
CASE (WM_MOVE);
|
|
|
|
CASE (WM_SIZE);
|
|
|
|
CASE (WM_ACTIVATE);
|
|
|
|
CASE (WM_SETFOCUS);
|
|
|
|
CASE (WM_KILLFOCUS);
|
|
|
|
CASE (WM_ENABLE);
|
|
|
|
CASE (WM_SETREDRAW);
|
|
|
|
CASE (WM_SETTEXT);
|
|
|
|
CASE (WM_GETTEXT);
|
|
|
|
CASE (WM_GETTEXTLENGTH);
|
|
|
|
CASE (WM_PAINT);
|
|
|
|
CASE (WM_CLOSE);
|
|
|
|
CASE (WM_QUERYENDSESSION);
|
|
|
|
CASE (WM_QUERYOPEN);
|
|
|
|
CASE (WM_ENDSESSION);
|
|
|
|
CASE (WM_QUIT);
|
|
|
|
CASE (WM_ERASEBKGND);
|
|
|
|
CASE (WM_SYSCOLORCHANGE);
|
|
|
|
CASE (WM_SHOWWINDOW);
|
|
|
|
CASE (WM_WININICHANGE);
|
|
|
|
CASE (WM_DEVMODECHANGE);
|
|
|
|
CASE (WM_ACTIVATEAPP);
|
|
|
|
CASE (WM_FONTCHANGE);
|
|
|
|
CASE (WM_TIMECHANGE);
|
|
|
|
CASE (WM_CANCELMODE);
|
|
|
|
CASE (WM_SETCURSOR);
|
|
|
|
CASE (WM_MOUSEACTIVATE);
|
|
|
|
CASE (WM_CHILDACTIVATE);
|
|
|
|
CASE (WM_QUEUESYNC);
|
|
|
|
CASE (WM_GETMINMAXINFO);
|
|
|
|
CASE (WM_PAINTICON);
|
|
|
|
CASE (WM_ICONERASEBKGND);
|
|
|
|
CASE (WM_NEXTDLGCTL);
|
|
|
|
CASE (WM_SPOOLERSTATUS);
|
|
|
|
CASE (WM_DRAWITEM);
|
|
|
|
CASE (WM_MEASUREITEM);
|
|
|
|
CASE (WM_DELETEITEM);
|
|
|
|
CASE (WM_VKEYTOITEM);
|
|
|
|
CASE (WM_CHARTOITEM);
|
|
|
|
CASE (WM_SETFONT);
|
|
|
|
CASE (WM_GETFONT);
|
|
|
|
CASE (WM_SETHOTKEY);
|
|
|
|
CASE (WM_GETHOTKEY);
|
|
|
|
CASE (WM_QUERYDRAGICON);
|
|
|
|
CASE (WM_COMPAREITEM);
|
|
|
|
CASE (WM_GETOBJECT);
|
|
|
|
CASE (WM_COMPACTING);
|
|
|
|
CASE (WM_WINDOWPOSCHANGING);
|
|
|
|
CASE (WM_WINDOWPOSCHANGED);
|
|
|
|
CASE (WM_POWER);
|
|
|
|
CASE (WM_COPYDATA);
|
|
|
|
CASE (WM_CANCELJOURNAL);
|
|
|
|
CASE (WM_NOTIFY);
|
|
|
|
CASE (WM_INPUTLANGCHANGEREQUEST);
|
|
|
|
CASE (WM_INPUTLANGCHANGE);
|
|
|
|
CASE (WM_TCARD);
|
|
|
|
CASE (WM_HELP);
|
|
|
|
CASE (WM_USERCHANGED);
|
|
|
|
CASE (WM_NOTIFYFORMAT);
|
|
|
|
CASE (WM_CONTEXTMENU);
|
|
|
|
CASE (WM_STYLECHANGING);
|
|
|
|
CASE (WM_STYLECHANGED);
|
|
|
|
CASE (WM_DISPLAYCHANGE);
|
|
|
|
CASE (WM_GETICON);
|
|
|
|
CASE (WM_SETICON);
|
|
|
|
CASE (WM_NCCREATE);
|
|
|
|
CASE (WM_NCDESTROY);
|
|
|
|
CASE (WM_NCCALCSIZE);
|
|
|
|
CASE (WM_NCHITTEST);
|
|
|
|
CASE (WM_NCPAINT);
|
|
|
|
CASE (WM_NCACTIVATE);
|
|
|
|
CASE (WM_GETDLGCODE);
|
|
|
|
CASE (WM_SYNCPAINT);
|
|
|
|
CASE (WM_NCMOUSEMOVE);
|
|
|
|
CASE (WM_NCLBUTTONDOWN);
|
|
|
|
CASE (WM_NCLBUTTONUP);
|
|
|
|
CASE (WM_NCLBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCRBUTTONDOWN);
|
|
|
|
CASE (WM_NCRBUTTONUP);
|
|
|
|
CASE (WM_NCRBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCMBUTTONDOWN);
|
|
|
|
CASE (WM_NCMBUTTONUP);
|
|
|
|
CASE (WM_NCMBUTTONDBLCLK);
|
|
|
|
CASE (WM_NCXBUTTONDOWN);
|
|
|
|
CASE (WM_NCXBUTTONUP);
|
|
|
|
CASE (WM_NCXBUTTONDBLCLK);
|
|
|
|
CASE (WM_KEYDOWN);
|
|
|
|
CASE (WM_KEYUP);
|
|
|
|
CASE (WM_CHAR);
|
|
|
|
CASE (WM_DEADCHAR);
|
|
|
|
CASE (WM_SYSKEYDOWN);
|
|
|
|
CASE (WM_SYSKEYUP);
|
|
|
|
CASE (WM_SYSCHAR);
|
|
|
|
CASE (WM_SYSDEADCHAR);
|
|
|
|
CASE (WM_KEYLAST);
|
|
|
|
CASE (WM_IME_STARTCOMPOSITION);
|
|
|
|
CASE (WM_IME_ENDCOMPOSITION);
|
|
|
|
CASE (WM_IME_COMPOSITION);
|
|
|
|
CASE (WM_INITDIALOG);
|
|
|
|
CASE (WM_COMMAND);
|
|
|
|
CASE (WM_SYSCOMMAND);
|
|
|
|
CASE (WM_TIMER);
|
|
|
|
CASE (WM_HSCROLL);
|
|
|
|
CASE (WM_VSCROLL);
|
|
|
|
CASE (WM_INITMENU);
|
|
|
|
CASE (WM_INITMENUPOPUP);
|
|
|
|
CASE (WM_MENUSELECT);
|
|
|
|
CASE (WM_MENUCHAR);
|
|
|
|
CASE (WM_ENTERIDLE);
|
|
|
|
CASE (WM_MENURBUTTONUP);
|
|
|
|
CASE (WM_MENUDRAG);
|
|
|
|
CASE (WM_MENUGETOBJECT);
|
|
|
|
CASE (WM_UNINITMENUPOPUP);
|
|
|
|
CASE (WM_MENUCOMMAND);
|
|
|
|
CASE (WM_CHANGEUISTATE);
|
|
|
|
CASE (WM_UPDATEUISTATE);
|
|
|
|
CASE (WM_QUERYUISTATE);
|
|
|
|
CASE (WM_CTLCOLORMSGBOX);
|
|
|
|
CASE (WM_CTLCOLOREDIT);
|
|
|
|
CASE (WM_CTLCOLORLISTBOX);
|
|
|
|
CASE (WM_CTLCOLORBTN);
|
|
|
|
CASE (WM_CTLCOLORDLG);
|
|
|
|
CASE (WM_CTLCOLORSCROLLBAR);
|
|
|
|
CASE (WM_CTLCOLORSTATIC);
|
|
|
|
CASE (WM_MOUSEMOVE);
|
|
|
|
CASE (WM_LBUTTONDOWN);
|
|
|
|
CASE (WM_LBUTTONUP);
|
|
|
|
CASE (WM_LBUTTONDBLCLK);
|
|
|
|
CASE (WM_RBUTTONDOWN);
|
|
|
|
CASE (WM_RBUTTONUP);
|
|
|
|
CASE (WM_RBUTTONDBLCLK);
|
|
|
|
CASE (WM_MBUTTONDOWN);
|
|
|
|
CASE (WM_MBUTTONUP);
|
|
|
|
CASE (WM_MBUTTONDBLCLK);
|
|
|
|
CASE (WM_MOUSEWHEEL);
|
|
|
|
CASE (WM_XBUTTONDOWN);
|
|
|
|
CASE (WM_XBUTTONUP);
|
|
|
|
CASE (WM_XBUTTONDBLCLK);
|
|
|
|
CASE (WM_PARENTNOTIFY);
|
|
|
|
CASE (WM_ENTERMENULOOP);
|
|
|
|
CASE (WM_EXITMENULOOP);
|
|
|
|
CASE (WM_NEXTMENU);
|
|
|
|
CASE (WM_SIZING);
|
|
|
|
CASE (WM_CAPTURECHANGED);
|
|
|
|
CASE (WM_MOVING);
|
|
|
|
CASE (WM_POWERBROADCAST);
|
|
|
|
CASE (WM_DEVICECHANGE);
|
|
|
|
CASE (WM_MDICREATE);
|
|
|
|
CASE (WM_MDIDESTROY);
|
|
|
|
CASE (WM_MDIACTIVATE);
|
|
|
|
CASE (WM_MDIRESTORE);
|
|
|
|
CASE (WM_MDINEXT);
|
|
|
|
CASE (WM_MDIMAXIMIZE);
|
|
|
|
CASE (WM_MDITILE);
|
|
|
|
CASE (WM_MDICASCADE);
|
|
|
|
CASE (WM_MDIICONARRANGE);
|
|
|
|
CASE (WM_MDIGETACTIVE);
|
|
|
|
CASE (WM_MDISETMENU);
|
|
|
|
CASE (WM_ENTERSIZEMOVE);
|
|
|
|
CASE (WM_EXITSIZEMOVE);
|
|
|
|
CASE (WM_DROPFILES);
|
|
|
|
CASE (WM_MDIREFRESHMENU);
|
|
|
|
CASE (WM_IME_SETCONTEXT);
|
|
|
|
CASE (WM_IME_NOTIFY);
|
|
|
|
CASE (WM_IME_CONTROL);
|
|
|
|
CASE (WM_IME_COMPOSITIONFULL);
|
|
|
|
CASE (WM_IME_SELECT);
|
|
|
|
CASE (WM_IME_CHAR);
|
|
|
|
CASE (WM_IME_REQUEST);
|
|
|
|
CASE (WM_IME_KEYDOWN);
|
|
|
|
CASE (WM_IME_KEYUP);
|
|
|
|
CASE (WM_MOUSEHOVER);
|
|
|
|
CASE (WM_MOUSELEAVE);
|
|
|
|
CASE (WM_NCMOUSEHOVER);
|
|
|
|
CASE (WM_NCMOUSELEAVE);
|
|
|
|
CASE (WM_CUT);
|
|
|
|
CASE (WM_COPY);
|
|
|
|
CASE (WM_PASTE);
|
|
|
|
CASE (WM_CLEAR);
|
|
|
|
CASE (WM_UNDO);
|
|
|
|
CASE (WM_RENDERFORMAT);
|
|
|
|
CASE (WM_RENDERALLFORMATS);
|
|
|
|
CASE (WM_DESTROYCLIPBOARD);
|
|
|
|
CASE (WM_DRAWCLIPBOARD);
|
|
|
|
CASE (WM_PAINTCLIPBOARD);
|
|
|
|
CASE (WM_VSCROLLCLIPBOARD);
|
|
|
|
CASE (WM_SIZECLIPBOARD);
|
|
|
|
CASE (WM_ASKCBFORMATNAME);
|
|
|
|
CASE (WM_CHANGECBCHAIN);
|
|
|
|
CASE (WM_HSCROLLCLIPBOARD);
|
|
|
|
CASE (WM_QUERYNEWPALETTE);
|
|
|
|
CASE (WM_PALETTEISCHANGING);
|
|
|
|
CASE (WM_PALETTECHANGED);
|
|
|
|
CASE (WM_HOTKEY);
|
|
|
|
CASE (WM_PRINT);
|
|
|
|
CASE (WM_PRINTCLIENT);
|
|
|
|
CASE (WM_APPCOMMAND);
|
|
|
|
CASE (WM_HANDHELDFIRST);
|
|
|
|
CASE (WM_HANDHELDLAST);
|
|
|
|
CASE (WM_AFXFIRST);
|
|
|
|
CASE (WM_AFXLAST);
|
|
|
|
CASE (WM_PENWINFIRST);
|
|
|
|
CASE (WM_PENWINLAST);
|
|
|
|
CASE (WM_APP);
|
|
|
|
#undef CASE
|
|
|
|
default:
|
|
|
|
if (msg >= WM_HANDHELDFIRST && msg <= WM_HANDHELDLAST)
|
|
|
|
sprintf (bfr, "WM_HANDHELDFIRST+%d", msg - WM_HANDHELDFIRST);
|
|
|
|
else if (msg >= WM_AFXFIRST && msg <= WM_AFXLAST)
|
|
|
|
sprintf (bfr, "WM_AFXFIRST+%d", msg - WM_AFXFIRST);
|
|
|
|
else if (msg >= WM_PENWINFIRST && msg <= WM_PENWINLAST)
|
|
|
|
sprintf (bfr, "WM_PENWINFIRST+%d", msg - WM_PENWINFIRST);
|
|
|
|
else if (msg >= WM_USER && msg <= 0x7FFF)
|
|
|
|
sprintf (bfr, "WM_USER+%d", msg - WM_USER);
|
|
|
|
else if (msg >= 0xC000 && msg <= 0xFFFF)
|
|
|
|
sprintf (bfr, "reg-%#x", msg);
|
|
|
|
else
|
|
|
|
sprintf (bfr, "unk-%#x", msg);
|
|
|
|
return bfr;
|
|
|
|
}
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* G_ENABLE_DEBUG */
|