New file, hand-written wrapper for the Wintab library.
2001-10-29 Tor Lillqvist <tml@iki.fi> * gdk/win32/libwntab32x.la: New file, hand-written wrapper for the Wintab library. * gdk/win32/gdkwin32.h * gdk/win32/gdkprivate-win32.h: Reorganise to match corresponding X11 headers better, and to enable gdkwin32.h to be installed and included from applications, but not the *-win32.h headers. * gdk/win32/*.c: Corresponding small changes, simplifications of #includes. * gdk/win32/gdkregion-win32.c: Remove. * gdk/win32/gdkevents-win32.c (print_event): Add GDK_SETTING. * gdk/win32/gdkfont-win32.c * gdk/win32/gdkgeometry-win32.c: Remove unused variables. * gdk/win32/gdkproperty-win32.c (gdk_atom_intern): Don't insert GDK_NONE values into hash table. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * gdk/win32/Makefile.am: Actually enable building the win32 objects here, not just list all files in EXTRA_DIST. Link in the compiled resource file from rc/gdk-win32res.lo. If HAVE_WINTAB, copy the Wintab library into the .libs directory. * gdk/win32/gdkwindow-win32.c (RegisterGdkClass): Don't assume the name of the GDK DLL when fetching the icon. Use the HMODULE saved in gdk_dll_hinstance by DllMain. * gdk/win32/rc/Makefile.am: Build gdk-win32res.lo using the build/win32/lt-compile-resource script. * gdk/win32/rc/gdk.rc.in * gtk/gtk-win32.rc.in: Use the DLL name that libtool would use.
This commit is contained in:
committed by
Tor Lillqvist
parent
47dc8d4dac
commit
a53f14a6e3
@ -28,7 +28,303 @@
|
||||
#define __GDK_PRIVATE_WIN32_H__
|
||||
|
||||
#include <gdk/gdkprivate.h>
|
||||
#include "gdkwin32.h"
|
||||
#include <gdk/win32/gdkwindow-win32.h>
|
||||
#include <gdk/win32/gdkpixmap-win32.h>
|
||||
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Make up for some minor w32api header lossage */
|
||||
|
||||
/* PS_JOIN_MASK is missing */
|
||||
#ifndef PS_JOIN_MASK
|
||||
#define PS_JOIN_MASK (PS_JOIN_BEVEL|PS_JOIN_MITER|PS_JOIN_ROUND)
|
||||
#endif
|
||||
|
||||
/* CLR_INVALID is missing */
|
||||
#ifndef CLR_INVALID
|
||||
#define CLR_INVALID CLR_NONE
|
||||
#endif
|
||||
|
||||
/* Some charsets are missing from MSVC 5 headers */
|
||||
#ifndef JOHAB_CHARSET
|
||||
#define JOHAB_CHARSET 130
|
||||
#endif
|
||||
#ifndef VIETNAMESE_CHARSET
|
||||
#define VIETNAMESE_CHARSET 163
|
||||
#endif
|
||||
|
||||
#ifndef FS_VIETNAMESE
|
||||
#define FS_VIETNAMESE 0x100
|
||||
#endif
|
||||
|
||||
/* Some virtual keycodes are missing */
|
||||
#ifndef VM_OEM_PLUS
|
||||
#define VK_OEM_PLUS 0xBB
|
||||
#endif
|
||||
|
||||
#ifndef VK_OEM_COMMA
|
||||
#define VK_OEM_COMMA 0xBC
|
||||
#endif
|
||||
|
||||
#ifndef VK_OEM_MINUS
|
||||
#define VK_OEM_MINUS 0xBD
|
||||
#endif
|
||||
|
||||
#ifndef VK_OEM_PERIOD
|
||||
#define VK_OEM_PERIOD 0xBE
|
||||
#endif
|
||||
|
||||
#ifndef VK_OEM_1
|
||||
#define VK_OEM_1 0xBA
|
||||
#endif
|
||||
#ifndef VK_OEM_2
|
||||
#define VK_OEM_2 0xBF
|
||||
#endif
|
||||
#ifndef VK_OEM_3
|
||||
#define VK_OEM_3 0xC0
|
||||
#endif
|
||||
#ifndef VK_OEM_4
|
||||
#define VK_OEM_4 0xDB
|
||||
#endif
|
||||
#ifndef VK_OEM_5
|
||||
#define VK_OEM_5 0xDC
|
||||
#endif
|
||||
#ifndef VK_OEM_6
|
||||
#define VK_OEM_6 0xDD
|
||||
#endif
|
||||
#ifndef VK_OEM_7
|
||||
#define VK_OEM_7 0xDE
|
||||
#endif
|
||||
#ifndef VK_OEM_8
|
||||
#define VK_OEM_8 0xDF
|
||||
#endif
|
||||
|
||||
/* Missing messages */
|
||||
#ifndef WM_SYNCPAINT
|
||||
#define WM_SYNCPAINT 0x88
|
||||
#endif
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
#define WM_MOUSEWHEEL 0X20A
|
||||
#endif
|
||||
#ifndef WM_GETOBJECT
|
||||
#define WM_GETOBJECT 0x3D
|
||||
#endif
|
||||
#ifndef WM_NCXBUTTONDOWN
|
||||
#define WM_NCXBUTTONDOWN 0xAB
|
||||
#endif
|
||||
#ifndef WM_NCXBUTTONUP
|
||||
#define WM_NCXBUTTONUP 0xAC
|
||||
#endif
|
||||
#ifndef WM_NCXBUTTONDBLCLK
|
||||
#define WM_NCXBUTTONDBLCLK 0xAD
|
||||
#endif
|
||||
#ifndef WM_MENURBUTTONUP
|
||||
#define WM_MENURBUTTONUP 0x122
|
||||
#endif
|
||||
#ifndef WM_MENUDRAG
|
||||
#define WM_MENUDRAG 0x123
|
||||
#endif
|
||||
#ifndef WM_MENUGETOBJECT
|
||||
#define WM_MENUGETOBJECT 0x124
|
||||
#endif
|
||||
#ifndef WM_UNINITMENUPOPUP
|
||||
#define WM_UNINITMENUPOPUP 0x125
|
||||
#endif
|
||||
#ifndef WM_MENUCOMMAND
|
||||
#define WM_MENUCOMMAND 0x126
|
||||
#endif
|
||||
#ifndef WM_CHANGEUISTATE
|
||||
#define WM_CHANGEUISTATE 0x127
|
||||
#endif
|
||||
#ifndef WM_UPDATEUISTATE
|
||||
#define WM_UPDATEUISTATE 0x128
|
||||
#endif
|
||||
#ifndef WM_QUERYUISTATE
|
||||
#define WM_QUERYUISTATE 0x129
|
||||
#endif
|
||||
#ifndef WM_XBUTTONDOWN
|
||||
#define WM_XBUTTONDOWN 0x20B
|
||||
#endif
|
||||
#ifndef WM_XBUTTONUP
|
||||
#define WM_XBUTTONUP 0x20C
|
||||
#endif
|
||||
#ifndef WM_XBUTTONDBLCLK
|
||||
#define WM_XBUTTONDBLCLK 0x20D
|
||||
#endif
|
||||
#ifndef WM_IME_REQUEST
|
||||
#define WM_IME_REQUEST 0x288
|
||||
#endif
|
||||
#ifndef WM_MOUSEHOVER
|
||||
#define WM_MOUSEHOVER 0x2A1
|
||||
#endif
|
||||
#ifndef WM_MOUSELEAVE
|
||||
#define WM_MOUSELEAVE 0x2A3
|
||||
#endif
|
||||
#ifndef WM_NCMOUSEHOVER
|
||||
#define WM_NCMOUSEHOVER 0x2A0
|
||||
#endif
|
||||
#ifndef WM_NCMOUSELEAVE
|
||||
#define WM_NCMOUSELEAVE 0x2A2
|
||||
#endif
|
||||
#ifndef WM_APPCOMMAND
|
||||
#define WM_APPCOMMAND 0x319
|
||||
#endif
|
||||
#ifndef WM_HANDHELDFIRST
|
||||
#define WM_HANDHELDFIRST 0x358
|
||||
#endif
|
||||
#ifndef WM_HANDHELDLAST
|
||||
#define WM_HANDHELDLAST 0x35F
|
||||
#endif
|
||||
#ifndef WM_AFXFIRST
|
||||
#define WM_AFXFIRST 0x360
|
||||
#endif
|
||||
#ifndef WM_AFXLAST
|
||||
#define WM_AFXLAST 0x37F
|
||||
#endif
|
||||
|
||||
#ifndef CopyCursor
|
||||
#define CopyCursor(pcur) ((HCURSOR)CopyIcon((HICON)(pcur)))
|
||||
#endif
|
||||
|
||||
/* Define corresponding Windows types for some X11 types, just for laziness. */
|
||||
typedef PALETTEENTRY XColor;
|
||||
|
||||
/* Some structs are somewhat useful to emulate internally. */
|
||||
typedef struct {
|
||||
HPALETTE palette; /* Palette handle used when drawing. */
|
||||
guint size; /* Number of entries in the palette. */
|
||||
gboolean stale; /* 1 if palette needs to be realized,
|
||||
* otherwise 0. */
|
||||
gboolean *in_use;
|
||||
gboolean rc_palette; /* If RC_PALETTE is on in the RASTERCAPS */
|
||||
gulong sizepalette; /* SIZEPALETTE if rc_palette */
|
||||
} ColormapStruct, *Colormap;
|
||||
|
||||
typedef struct {
|
||||
gint map_entries;
|
||||
guint visualid;
|
||||
guint bitspixel;
|
||||
} Visual;
|
||||
|
||||
typedef struct {
|
||||
Colormap colormap;
|
||||
unsigned long red_max;
|
||||
unsigned long red_mult;
|
||||
unsigned long green_max;
|
||||
unsigned long green_mult;
|
||||
unsigned long blue_max;
|
||||
unsigned long blue_mult;
|
||||
unsigned long base_pixel;
|
||||
} XStandardColormap;
|
||||
|
||||
#define GDK_TYPE_GC_WIN32 (_gdk_gc_win32_get_type ())
|
||||
#define GDK_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_WIN32, GdkGCWin32))
|
||||
#define GDK_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
|
||||
#define GDK_IS_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_WIN32))
|
||||
#define GDK_IS_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_WIN32))
|
||||
#define GDK_GC_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
|
||||
|
||||
typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;
|
||||
typedef struct _GdkFontPrivateWin32 GdkFontPrivateWin32;
|
||||
typedef struct _GdkImagePrivateWin32 GdkImagePrivateWin32;
|
||||
typedef struct _GdkVisualPrivate GdkVisualPrivate;
|
||||
typedef struct _GdkGCWin32 GdkGCWin32;
|
||||
typedef struct _GdkGCWin32Class GdkGCWin32Class;
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
{
|
||||
GdkCursor cursor;
|
||||
HCURSOR hcursor;
|
||||
};
|
||||
|
||||
struct _GdkWin32SingleFont
|
||||
{
|
||||
HFONT hfont;
|
||||
UINT charset;
|
||||
UINT codepage;
|
||||
FONTSIGNATURE fs;
|
||||
};
|
||||
|
||||
struct _GdkFontPrivateWin32
|
||||
{
|
||||
GdkFontPrivate base;
|
||||
GSList *fonts; /* List of GdkWin32SingleFonts */
|
||||
GSList *names;
|
||||
};
|
||||
|
||||
struct _GdkVisualClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _GdkVisualPrivate
|
||||
{
|
||||
GdkVisual visual;
|
||||
Visual *xvisual;
|
||||
};
|
||||
|
||||
struct _GdkColormapPrivateWin32
|
||||
{
|
||||
Colormap xcolormap;
|
||||
gint private_val;
|
||||
|
||||
GHashTable *hash;
|
||||
GdkColorInfo *info;
|
||||
DWORD last_sync_time;
|
||||
};
|
||||
|
||||
struct _GdkImagePrivateWin32
|
||||
{
|
||||
HBITMAP hbitmap;
|
||||
};
|
||||
|
||||
struct _GdkGCWin32
|
||||
{
|
||||
GdkGC parent_instance;
|
||||
|
||||
/* A Windows Device Context (DC) is not equivalent to an X11
|
||||
* GC. We can use a DC only in the window for which it was
|
||||
* allocated, or (in the case of a memory DC) with the bitmap that
|
||||
* has been selected into it. Thus, we have to release and
|
||||
* reallocate a DC each time the GdkGC is used to paint into a new
|
||||
* window or pixmap. We thus keep all the necessary values in the
|
||||
* GdkGCWin32 object.
|
||||
*/
|
||||
HDC hdc;
|
||||
|
||||
GdkRegion *clip_region;
|
||||
HRGN hcliprgn;
|
||||
|
||||
GdkGCValuesMask values_mask;
|
||||
|
||||
gulong foreground; /* Pixel values from GdkColor, */
|
||||
gulong background; /* not Win32 COLORREFs */
|
||||
|
||||
GdkFont *font;
|
||||
gint rop2;
|
||||
GdkFill fill_style;
|
||||
GdkPixmap *tile;
|
||||
GdkPixmap *stipple;
|
||||
GdkSubwindowMode subwindow_mode;
|
||||
gint graphics_exposures;
|
||||
gint pen_width;
|
||||
DWORD pen_style;
|
||||
HANDLE hwnd; /* If a HDC is allocated, for which window,
|
||||
* or what bitmap is selected into it
|
||||
*/
|
||||
int saved_dc;
|
||||
};
|
||||
|
||||
struct _GdkGCWin32Class
|
||||
{
|
||||
GdkGCClass parent_class;
|
||||
};
|
||||
|
||||
GType _gdk_gc_win32_get_type (void);
|
||||
|
||||
/* Routines from gdkgeometry-win32.c */
|
||||
void
|
||||
@ -106,6 +402,10 @@ gchar *gdk_win32_function_to_string (GdkFunction function);
|
||||
gchar *gdk_win32_join_style_to_string (GdkJoinStyle join_style);
|
||||
gchar *gdk_win32_line_style_to_string (GdkLineStyle line_style);
|
||||
gchar *gdk_win32_message_name (UINT msg);
|
||||
|
||||
#define PING() printf(G_STRLOC),fflush(stdout)
|
||||
#else
|
||||
#define PING()
|
||||
#endif
|
||||
|
||||
gchar *gdk_win32_last_error_string (void);
|
||||
@ -150,7 +450,7 @@ extern DWORD windows_version;
|
||||
|
||||
extern gint gdk_input_ignore_wintab;
|
||||
|
||||
extern GdkAtom _gdk_selection_property;
|
||||
extern GdkAtom _gdk_selection_property;
|
||||
|
||||
#define IMAGE_PRIVATE_DATA(image) ((GdkImagePrivateWin32 *) GDK_IMAGE (image)->windowing_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user