mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Further hacking. Now actually compiles. Haven't tried yet whether
actually does anything useful... Time for bed.
This commit is contained in:
parent
b6524a84f5
commit
8e06c4d7f4
@ -3,8 +3,6 @@ EXPORTS
|
||||
gdk_atom_name
|
||||
gdk_beep
|
||||
gdk_bitmap_create_from_data
|
||||
gdk_bitmap_ref
|
||||
gdk_bitmap_unref
|
||||
gdk_char_height
|
||||
gdk_char_measure
|
||||
gdk_char_width
|
||||
@ -55,7 +53,6 @@ EXPORTS
|
||||
gdk_draw_indexed_image
|
||||
gdk_draw_line
|
||||
gdk_draw_lines
|
||||
gdk_draw_pixmap
|
||||
gdk_draw_point
|
||||
gdk_draw_points
|
||||
gdk_draw_polygon
|
||||
@ -103,7 +100,6 @@ EXPORTS
|
||||
gdk_free_compound_text
|
||||
gdk_free_text_list
|
||||
gdk_gc_copy
|
||||
gdk_gc_destroy
|
||||
gdk_gc_get_values
|
||||
gdk_gc_new
|
||||
gdk_gc_new_with_values
|
||||
@ -142,7 +138,6 @@ EXPORTS
|
||||
gdk_im_ready
|
||||
gdk_im_set_best_style
|
||||
gdk_image_bitmap_new
|
||||
gdk_image_destroy
|
||||
gdk_image_get
|
||||
gdk_image_get_pixel
|
||||
gdk_image_new
|
||||
@ -184,8 +179,6 @@ EXPORTS
|
||||
gdk_pixmap_create_on_shared_image
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_new
|
||||
gdk_pixmap_ref
|
||||
gdk_pixmap_unref
|
||||
gdk_pointer_grab
|
||||
gdk_pointer_is_grabbed
|
||||
gdk_pointer_ungrab
|
||||
@ -212,18 +205,6 @@ EXPORTS
|
||||
gdk_regions_subtract
|
||||
gdk_regions_union
|
||||
gdk_regions_xor
|
||||
gdk_rgb_cmap_free
|
||||
gdk_rgb_cmap_new
|
||||
gdk_rgb_ditherable
|
||||
gdk_rgb_gc_set_background
|
||||
gdk_rgb_gc_set_foreground
|
||||
gdk_rgb_get_cmap
|
||||
gdk_rgb_get_visual
|
||||
gdk_rgb_init
|
||||
gdk_rgb_set_install
|
||||
gdk_rgb_set_min_colors
|
||||
gdk_rgb_set_verbose
|
||||
gdk_rgb_xpixel_from_rgb
|
||||
gdk_root_parent
|
||||
gdk_screen_height
|
||||
gdk_screen_height_mm
|
||||
@ -291,7 +272,6 @@ EXPORTS
|
||||
gdk_window_move_resize
|
||||
gdk_window_new
|
||||
gdk_window_raise
|
||||
gdk_window_ref
|
||||
gdk_window_register_dnd
|
||||
gdk_window_remove_filter
|
||||
gdk_window_reparent
|
||||
@ -316,7 +296,6 @@ EXPORTS
|
||||
gdk_window_set_user_data
|
||||
gdk_window_shape_combine_mask
|
||||
gdk_window_show
|
||||
gdk_window_unref
|
||||
gdk_window_withdraw
|
||||
gdk_xid_table_insert
|
||||
gdk_xid_table_lookup
|
||||
|
@ -178,8 +178,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
|
||||
if (source_image->depth != 1 || mask_image->depth != 1)
|
||||
{
|
||||
gdk_image_destroy (source_image);
|
||||
gdk_image_destroy (mask_image);
|
||||
gdk_image_unref (source_image);
|
||||
gdk_image_unref (mask_image);
|
||||
g_return_val_if_fail (source_image->depth == 1 && mask_image->depth == 1,
|
||||
NULL);
|
||||
}
|
||||
@ -243,8 +243,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
g_free (XORmask);
|
||||
g_free (ANDmask);
|
||||
|
||||
gdk_image_destroy (source_image);
|
||||
gdk_image_destroy (mask_image);
|
||||
gdk_image_unref (source_image);
|
||||
gdk_image_unref (mask_image);
|
||||
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->xcursor = xcursor;
|
||||
|
@ -741,7 +741,7 @@ gdk_dnd_init (void)
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dnd_exit (void)
|
||||
gdk_win32_dnd_exit (void)
|
||||
{
|
||||
#ifdef OLE2_DND
|
||||
OleUninitialize ();
|
||||
|
@ -69,8 +69,6 @@
|
||||
typedef struct _GdkIOClosure GdkIOClosure;
|
||||
typedef struct _GdkEventPrivate GdkEventPrivate;
|
||||
|
||||
gint gdk_event_func_from_window_proc = FALSE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* Following flag is set for events on the event queue during
|
||||
@ -669,54 +667,6 @@ gdk_io_invoke (GIOChannel *source,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_input_add_full (gint source,
|
||||
GdkInputCondition condition,
|
||||
GdkInputFunction function,
|
||||
gpointer data,
|
||||
GdkDestroyNotify destroy)
|
||||
{
|
||||
guint result;
|
||||
GdkIOClosure *closure = g_new (GdkIOClosure, 1);
|
||||
GIOChannel *channel;
|
||||
GIOCondition cond = 0;
|
||||
|
||||
closure->function = function;
|
||||
closure->condition = condition;
|
||||
closure->notify = destroy;
|
||||
closure->data = data;
|
||||
|
||||
if (condition & GDK_INPUT_READ)
|
||||
cond |= (G_IO_IN | G_IO_PRI);
|
||||
if (condition & GDK_INPUT_WRITE)
|
||||
cond |= G_IO_OUT;
|
||||
if (condition & GDK_INPUT_EXCEPTION)
|
||||
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
|
||||
|
||||
channel = g_io_channel_unix_new (source);
|
||||
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
|
||||
gdk_io_invoke,
|
||||
closure, gdk_io_destroy);
|
||||
g_io_channel_unref (channel);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_input_add (gint source,
|
||||
GdkInputCondition condition,
|
||||
GdkInputFunction function,
|
||||
gpointer data)
|
||||
{
|
||||
return gdk_input_add_full (source, condition, function, data, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_input_remove (gint tag)
|
||||
{
|
||||
g_source_remove (tag);
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
gdk_event_apply_filters (MSG *xevent,
|
||||
GdkEvent *event,
|
||||
@ -4660,3 +4610,8 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
|
||||
/* XXX */
|
||||
}
|
||||
|
||||
void
|
||||
gdk_flush (void)
|
||||
{
|
||||
GdiFlush ();
|
||||
}
|
||||
|
@ -917,6 +917,16 @@ _gdk_font_destroy (GdkFont *font)
|
||||
g_free (font);
|
||||
}
|
||||
|
||||
gint
|
||||
_gdk_font_strlen (GdkFont *font,
|
||||
const gchar *str)
|
||||
{
|
||||
g_return_val_if_fail (font != NULL, -1);
|
||||
g_return_val_if_fail (str != NULL, -1);
|
||||
|
||||
return strlen (str);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_font_id (const GdkFont *font)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
if (values_mask & GDK_GC_TILE)
|
||||
{
|
||||
data->tile = values->tile;
|
||||
gdk_pixmap_ref (data->tile);
|
||||
gdk_drawable_ref (data->tile);
|
||||
GDK_NOTE (MISC, g_print (" tile=%#x", GDK_DRAWABLE_XID (data->tile)));
|
||||
}
|
||||
else
|
||||
@ -164,7 +164,7 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
||||
if (values_mask & GDK_GC_STIPPLE)
|
||||
{
|
||||
data->stipple = values->stipple;
|
||||
gdk_pixmap_ref (data->stipple);
|
||||
gdk_drawable_ref (data->stipple);
|
||||
GDK_NOTE (MISC, g_print (" stipple=%#x", GDK_DRAWABLE_XID (data->stipple)));
|
||||
}
|
||||
else
|
||||
@ -288,10 +288,10 @@ gdk_win32_gc_destroy (GdkGC *gc)
|
||||
gdk_font_unref (data->font);
|
||||
|
||||
if (data->values_mask & GDK_GC_TILE)
|
||||
gdk_pixmap_unref (data->tile);
|
||||
gdk_drawable_unref (data->tile);
|
||||
|
||||
if (data->values_mask & GDK_GC_STIPPLE)
|
||||
gdk_pixmap_unref (data->stipple);
|
||||
gdk_drawable_unref (data->stipple);
|
||||
|
||||
if (data->values_mask & GDK_GC_CLIP_MASK)
|
||||
DeleteObject (data->clip_region);
|
||||
@ -506,13 +506,13 @@ gdk_win32_gc_set_values (GdkGC *gc,
|
||||
if (values_mask & GDK_GC_TILE)
|
||||
{
|
||||
if (data->tile != NULL)
|
||||
gdk_pixmap_unref (data->tile);
|
||||
gdk_drawable_unref (data->tile);
|
||||
data->tile = values->tile;
|
||||
if (data->tile != NULL)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("tile = %#x ",
|
||||
GDK_DRAWABLE_XID (values->tile)));
|
||||
gdk_pixmap_ref (data->tile);
|
||||
gdk_drawable_ref (data->tile);
|
||||
data->values_mask |= GDK_GC_TILE;
|
||||
}
|
||||
else
|
||||
@ -525,13 +525,13 @@ gdk_win32_gc_set_values (GdkGC *gc,
|
||||
if (values_mask & GDK_GC_STIPPLE)
|
||||
{
|
||||
if (data->stipple != NULL)
|
||||
gdk_pixmap_unref (data->stipple);
|
||||
gdk_drawable_unref (data->stipple);
|
||||
data->stipple = values->stipple;
|
||||
if (data->stipple != NULL)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("stipple = %#x ",
|
||||
GDK_DRAWABLE_XID (values->stipple)));
|
||||
gdk_pixmap_ref (data->stipple);
|
||||
gdk_drawable_ref (data->stipple);
|
||||
data->values_mask |= GDK_GC_STIPPLE;
|
||||
}
|
||||
else
|
||||
@ -741,18 +741,18 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
|
||||
if (dst_data->font)
|
||||
gdk_font_unref (dst_data->font);
|
||||
if (dst_data->tile)
|
||||
gdk_pixmap_unref (dst_data->tile);
|
||||
gdk_drawable_unref (dst_data->tile);
|
||||
if (dst_data->stipple)
|
||||
gdk_pixmap_unref (dst_data->stipple);
|
||||
gdk_drawable_unref (dst_data->stipple);
|
||||
|
||||
*dst_data = *src_data;
|
||||
|
||||
if (dst_data->font)
|
||||
gdk_font_ref (dst_data->font);
|
||||
if (dst_data->tile)
|
||||
gdk_pixmap_ref (dst_data->tile);
|
||||
gdk_drawable_ref (dst_data->tile);
|
||||
if (dst_data->stipple)
|
||||
gdk_pixmap_ref (dst_data->stipple);
|
||||
gdk_drawable_ref (dst_data->stipple);
|
||||
}
|
||||
|
||||
HDC
|
||||
|
@ -25,12 +25,10 @@
|
||||
*/
|
||||
|
||||
#include "gdktypes.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
|
||||
guint gdk_debug_flags = 0;
|
||||
HWND gdk_root_window = NULL;
|
||||
HWND gdk_leader_window;
|
||||
GDKVAR GdkWindowPrivate *gdk_root_parent = NULL;
|
||||
gint gdk_event_func_from_window_proc = FALSE;
|
||||
HDC gdk_DC;
|
||||
HINSTANCE gdk_DLLInstance;
|
||||
HINSTANCE gdk_ProgInstance;
|
||||
@ -40,12 +38,7 @@ UINT gdk_selection_clear_msg;
|
||||
GdkAtom gdk_clipboard_atom;
|
||||
GdkAtom gdk_win32_dropfiles_atom;
|
||||
GdkAtom gdk_ole2_dnd_atom;
|
||||
Atom gdk_selection_property;
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
ATOM gdk_selection_property;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
|
||||
GMutex *gdk_threads_mutex = NULL;
|
||||
|
||||
DWORD windows_version = 0;
|
||||
|
@ -29,17 +29,24 @@
|
||||
#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
|
||||
#include "gdkimage.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
static void gdk_win32_image_destroy (GdkImage *image);
|
||||
static void gdk_image_put (GdkImage *image,
|
||||
GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
static GdkImageClass image_class = {
|
||||
gdk_win32_image_destroy,
|
||||
gdk_image_put
|
||||
};
|
||||
|
||||
static void gdk_image_put_normal (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
static GList *image_list = NULL;
|
||||
|
||||
void
|
||||
@ -50,7 +57,7 @@ gdk_image_exit (void)
|
||||
while (image_list)
|
||||
{
|
||||
image = image_list->data;
|
||||
gdk_image_destroy (image);
|
||||
gdk_win32_image_destroy (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +69,7 @@ gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint w, gint h)
|
||||
{
|
||||
Visual *xvisual;
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
GdkImagePrivateWin32 *private;
|
||||
struct {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
union {
|
||||
@ -74,9 +81,11 @@ gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint w, gint h)
|
||||
int bpl = (w-1)/8 + 1;
|
||||
int bpl32 = ((w-1)/32 + 1)*4;
|
||||
|
||||
private = g_new(GdkImagePrivate, 1);
|
||||
private = g_new (GdkImagePrivateWin32, 1);
|
||||
image = (GdkImage *) private;
|
||||
private->image_put = gdk_image_put_normal;
|
||||
private->base.ref_count = 1;
|
||||
private->base.klass = &image_class;
|
||||
|
||||
image->type = GDK_IMAGE_SHARED;
|
||||
image->visual = visual;
|
||||
image->width = w;
|
||||
@ -140,7 +149,7 @@ gdk_image_new_with_depth (GdkImageType type,
|
||||
gint depth)
|
||||
{
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
GdkImagePrivateWin32 *private;
|
||||
Visual *xvisual;
|
||||
struct {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
@ -162,10 +171,11 @@ gdk_image_new_with_depth (GdkImageType type,
|
||||
(type == GDK_IMAGE_SHARED_PIXMAP ? "shared_pixmap" :
|
||||
"???"))));
|
||||
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
image = (GdkImage*) private;
|
||||
private = g_new (GdkImagePrivateWin32, 1);
|
||||
image = (GdkImage *) private;
|
||||
|
||||
private->image_put = NULL;
|
||||
private->base.ref_count = 1;
|
||||
private->base.klass = &image_class;
|
||||
|
||||
image->type = type;
|
||||
image->visual = visual;
|
||||
@ -175,8 +185,6 @@ gdk_image_new_with_depth (GdkImageType type,
|
||||
|
||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||
|
||||
private->image_put = gdk_image_put_normal;
|
||||
|
||||
bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
|
||||
bmi.bmiHeader.biWidth = width;
|
||||
bmi.bmiHeader.biHeight = -height;
|
||||
@ -300,7 +308,7 @@ gdk_image_get (GdkWindow *window,
|
||||
gint height)
|
||||
{
|
||||
GdkImage *image;
|
||||
GdkImagePrivate *private;
|
||||
GdkImagePrivateWin32 *private;
|
||||
HDC hdc, memdc;
|
||||
struct {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
@ -323,10 +331,11 @@ gdk_image_get (GdkWindow *window,
|
||||
GDK_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n",
|
||||
GDK_DRAWABLE_XID (window), width, height, x, y));
|
||||
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
private = g_new (GdkImagePrivateWin32, 1);
|
||||
image = (GdkImage*) private;
|
||||
|
||||
private->image_put = gdk_image_put_normal;
|
||||
private->base.ref_count = 1;
|
||||
private->base.klass = &image_class;
|
||||
|
||||
image->type = GDK_IMAGE_SHARED;
|
||||
image->visual = gdk_window_get_visual (window);
|
||||
@ -540,12 +549,9 @@ gdk_image_get_pixel (GdkImage *image,
|
||||
gint y)
|
||||
{
|
||||
guint32 pixel;
|
||||
GdkImagePrivate *private;
|
||||
|
||||
g_return_val_if_fail (image != NULL, 0);
|
||||
|
||||
private = (GdkImagePrivate *) image;
|
||||
|
||||
g_return_val_if_fail (x >= 0 && x < image->width
|
||||
&& y >= 0 && y < image->height, 0);
|
||||
|
||||
@ -585,12 +591,8 @@ gdk_image_put_pixel (GdkImage *image,
|
||||
gint y,
|
||||
guint32 pixel)
|
||||
{
|
||||
GdkImagePrivate *private;
|
||||
|
||||
g_return_if_fail (image != NULL);
|
||||
|
||||
private = (GdkImagePrivate *) image;
|
||||
|
||||
g_return_if_fail (x >= 0 && x < image->width && y >= 0 && y < image->height);
|
||||
|
||||
if (image->depth == 1)
|
||||
@ -617,16 +619,16 @@ gdk_image_put_pixel (GdkImage *image,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_image_destroy (GdkImage *image)
|
||||
static void
|
||||
gdk_win32_image_destroy (GdkImage *image)
|
||||
{
|
||||
GdkImagePrivate *private;
|
||||
GdkImagePrivateWin32 *private;
|
||||
|
||||
g_return_if_fail (image != NULL);
|
||||
|
||||
private = (GdkImagePrivate*) image;
|
||||
private = (GdkImagePrivateWin32 *) image;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_image_destroy: %#x%s\n",
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_image_destroy: %#x%s\n",
|
||||
private->ximage,
|
||||
(image->type == GDK_IMAGE_SHARED_PIXMAP ?
|
||||
" (shared pixmap)" : "")));
|
||||
@ -641,7 +643,7 @@ gdk_image_destroy (GdkImage *image)
|
||||
|
||||
case GDK_IMAGE_SHARED:
|
||||
if (!DeleteObject (private->ximage))
|
||||
g_warning ("gdk_image_destroy: DeleteObject failed");
|
||||
g_warning ("gdk_win32_image_destroy: DeleteObject failed");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -652,21 +654,21 @@ gdk_image_destroy (GdkImage *image)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_image_put_normal (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
gdk_image_put (GdkImage *image,
|
||||
GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkDrawablePrivate *drawable_private;
|
||||
GdkImagePrivate *image_private;
|
||||
GdkImagePrivateWin32 *image_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
HDC hdc;
|
||||
GdkColormapPrivate *colormap_private;
|
||||
GdkColormapPrivateWin32 *colormap_private;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (image != NULL);
|
||||
@ -674,14 +676,14 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (drawable))
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
drawable_private = (GdkDrawablePrivate*) drawable;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
image_private = (GdkImagePrivateWin32 *) image;
|
||||
drawable_private = (GdkDrawablePrivate *) drawable;
|
||||
gc_private = (GdkGCPrivate *) gc;
|
||||
|
||||
/* The image can in fact be "shared", so don't test */
|
||||
|
||||
hdc = gdk_gc_predraw (drawable_private, gc_private);
|
||||
colormap_private = (GdkColormapPrivate *) drawable_private->colormap;
|
||||
hdc = gdk_gc_predraw (drawable, gc_private);
|
||||
colormap_private = (GdkColormapPrivateWin32 *) drawable_private->colormap;
|
||||
if (colormap_private && colormap_private->xcolormap->rc_palette)
|
||||
{
|
||||
DIBSECTION ds;
|
||||
@ -702,7 +704,7 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
||||
if (GetObject (image_private->ximage, sizeof (DIBSECTION),
|
||||
&ds) != sizeof (DIBSECTION))
|
||||
{
|
||||
g_warning ("gdk_image_put_normal: GetObject failed");
|
||||
g_warning ("gdk_image_put: GetObject failed");
|
||||
}
|
||||
#if 0
|
||||
g_print("xdest = %d, ydest = %d, xsrc = %d, ysrc = %d, width = %d, height = %d\n",
|
||||
@ -734,26 +736,27 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
||||
|
||||
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
|
||||
{
|
||||
g_warning ("gdk_image_put_normal: CreateCompatibleDC failed");
|
||||
gdk_gc_postdraw (drawable_private, gc_private);
|
||||
g_warning ("gdk_image_put: CreateCompatibleDC failed");
|
||||
gdk_gc_postdraw (drawable, gc_private);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((oldbitmap = SelectObject (memdc, image_private->ximage)) == NULL)
|
||||
{
|
||||
g_warning ("gdk_image_put_normal: SelectObject #1 failed");
|
||||
gdk_gc_postdraw (drawable_private, gc_private);
|
||||
g_warning ("gdk_image_put: SelectObject #1 failed");
|
||||
gdk_gc_postdraw (drawable, gc_private);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!BitBlt (hdc, xdest, ydest, width, height,
|
||||
memdc, xsrc, ysrc, SRCCOPY))
|
||||
g_warning ("gdk_image_put_normal: BitBlt failed");
|
||||
g_warning ("gdk_image_put: BitBlt failed");
|
||||
|
||||
if (SelectObject (memdc, oldbitmap) == NULL)
|
||||
g_warning ("gdk_image_put_normal: SelectObject #2 failed");
|
||||
|
||||
if (!DeleteDC (memdc))
|
||||
g_warning ("gdk_image_put_normal: DeleteDC failed");
|
||||
g_warning ("gdk_image_put: DeleteDC failed");
|
||||
}
|
||||
gdk_gc_postdraw (drawable_private, gc_private);
|
||||
gdk_gc_postdraw (drawable, gc_private);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "gdk.h"
|
||||
#include "gdkinput.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
#include <wintab.h>
|
||||
@ -78,8 +78,8 @@ struct _GdkDevicePrivate {
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#ifndef G_PI
|
||||
#define G_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* If USE_SYSCONTEXT is on, we open the Wintab device (hmm, what if
|
||||
@ -94,7 +94,7 @@ struct _GdkDevicePrivate {
|
||||
#define DEBUG_WINTAB 1
|
||||
#endif
|
||||
|
||||
#define TWOPI (2.*M_PI)
|
||||
#define TWOPI (2.*G_PI)
|
||||
|
||||
#define PING() g_print("%s: %d\n",__FILE__,__LINE__)
|
||||
|
||||
@ -289,7 +289,6 @@ gdk_input_init (void)
|
||||
guint32 deviceid_counter = 0;
|
||||
#ifdef HAVE_WINTAB
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GdkDrawablePrivate *window_private;
|
||||
GdkWindowAttr wa;
|
||||
WORD specversion;
|
||||
LOGCONTEXT defcontext;
|
||||
@ -341,7 +340,6 @@ gdk_input_init (void)
|
||||
return;
|
||||
}
|
||||
gdk_window_ref (wintab_window);
|
||||
window_private = (GdkDrawablePrivate *) wintab_window;
|
||||
|
||||
for (devix = 0; devix < ndevices; devix++)
|
||||
{
|
||||
@ -420,7 +418,7 @@ gdk_input_init (void)
|
||||
print_lc(&lc)));
|
||||
#endif
|
||||
hctx = g_new (HCTX, 1);
|
||||
if ((*hctx = WTOpen (window_private->xwindow, &lc, TRUE)) == NULL)
|
||||
if ((*hctx = WTOpen (GDK_DRAWABLE_XID (wintab_window), &lc, TRUE)) == NULL)
|
||||
{
|
||||
g_warning ("gdk_input_init: WTOpen failed");
|
||||
return;
|
||||
@ -991,7 +989,6 @@ gdk_input_win32_other_event (GdkEvent *event,
|
||||
GdkWindow *current_window;
|
||||
GdkInputWindow *input_window;
|
||||
GdkWindow *window;
|
||||
GdkWindowPrivate *window_private;
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GdkEventMask masktest;
|
||||
POINT pt;
|
||||
@ -1009,12 +1006,10 @@ gdk_input_win32_other_event (GdkEvent *event,
|
||||
#if USE_SYSCONTEXT
|
||||
window = gdk_window_at_pointer (&x, &y);
|
||||
if (window == NULL)
|
||||
window = (GdkWindow *) gdk_root_parent;
|
||||
window = gdk_parent_root;
|
||||
|
||||
gdk_window_ref (window);
|
||||
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n",
|
||||
GDK_DRAWABLE_XID (window), x, y));
|
||||
@ -1039,7 +1034,7 @@ gdk_input_win32_other_event (GdkEvent *event,
|
||||
switch (xevent->message)
|
||||
{
|
||||
case WT_PACKET:
|
||||
if (window_private == gdk_root_parent)
|
||||
if (window == gdk_parent_root)
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print ("...is root\n"));
|
||||
return FALSE;
|
||||
@ -1102,21 +1097,20 @@ gdk_input_win32_other_event (GdkEvent *event,
|
||||
* propagate if necessary.
|
||||
*/
|
||||
dijkstra:
|
||||
if (!window_private->extension_events_selected
|
||||
|| !(window_private->extension_events & masktest))
|
||||
if (!GDK_WINDOW_WIN32DATA (window)->extension_events_selected
|
||||
|| !(GDK_WINDOW_WIN32DATA (window)->extension_events & masktest))
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print ("...not selected\n"));
|
||||
|
||||
if (window_private->parent == (GdkWindow *) gdk_root_parent)
|
||||
if (((GdkWindowPrivate *) window)->parent == gdk_parent_root)
|
||||
return FALSE;
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
|
||||
gdk_window_unref (window);
|
||||
window = window_private->parent;
|
||||
window = ((GdkWindowPrivate *) window)->parent;
|
||||
gdk_window_ref (window);
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
|
||||
x = pt.x;
|
||||
y = pt.y;
|
||||
@ -1263,9 +1257,7 @@ static gint
|
||||
gdk_input_win32_enable_window (GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
|
||||
|
||||
window_private->extension_events_selected = TRUE;
|
||||
GDK_WINDOW_WIN32DATA (window)->extension_events_selected = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1273,9 +1265,7 @@ static gint
|
||||
gdk_input_win32_disable_window (GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
|
||||
|
||||
window_private->extension_events_selected = FALSE;
|
||||
GDK_WINDOW_WIN32DATA (window)->extension_events_selected = FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1483,23 +1473,19 @@ gdk_input_window_find (GdkWindow *window)
|
||||
static GdkInputWindow *
|
||||
gdk_input_window_find_within (GdkWindow *window)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GdkWindowPrivate *window_private;
|
||||
GdkWindowPrivate *tmp_private;
|
||||
GList *list;
|
||||
GdkWindow *tmpw;
|
||||
GdkInputWindow *candidate = NULL;
|
||||
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
|
||||
for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next)
|
||||
for (list = gdk_input_windows; list != NULL; list = list->next)
|
||||
{
|
||||
(GdkWindowPrivate *) tmp_private =
|
||||
(GdkWindowPrivate *) (((GdkInputWindow *)(tmp_list->data))->window);
|
||||
if (tmp_private == window_private
|
||||
|| IsChild (window_private->xwindow, tmp_private->xwindow))
|
||||
tmpw = ((GdkInputWindow *) (tmp_list->data))->window;
|
||||
if (tmpw == window
|
||||
|| IsChild (GDK_DRAWABLE_XID (window), GDK_DRAWABLE_XID (tmpw)))
|
||||
{
|
||||
if (candidate)
|
||||
return NULL; /* Multiple hits */
|
||||
candidate = (GdkInputWindow *)(tmp_list->data);
|
||||
candidate = (GdkInputWindow *) (list->data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,36 +34,28 @@
|
||||
#include <io.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkinputprivate.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#include <objbase.h>
|
||||
|
||||
static void gdkx_XConvertCase (KeySym symbol,
|
||||
KeySym *lower,
|
||||
KeySym *upper);
|
||||
static void gdk_exit_func (void);
|
||||
static gboolean gdk_synchronize = FALSE;
|
||||
|
||||
GdkArgDesc _gdk_windowing_args[] = {
|
||||
{ "sync", GDK_ARG_BOOL, &gdk_synchronize, (GdkArgFunc) NULL},
|
||||
{ "no-wintab", GDK_ARG_BOOL, &gdk_input_ignore_wintab,
|
||||
(GdkArgFunc) NULL},
|
||||
{ "ignore-wintab", GDK_ARG_BOOL, &gdk_input_ignore_wintab,
|
||||
(GdkArgFunc) NULL},
|
||||
{ "event-func-from-window-proc",
|
||||
GDK_ARG_BOOL, &gdk_event_func_from_window_proc,
|
||||
(GdkArgFunc) NULL},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Private variable declarations
|
||||
*/
|
||||
static int gdk_initialized = 0; /* 1 if the library is initialized,
|
||||
* 0 otherwise.
|
||||
*/
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const GDebugKey gdk_debug_keys[] = {
|
||||
{"events", GDK_DEBUG_EVENTS},
|
||||
{"misc", GDK_DEBUG_MISC},
|
||||
{"dnd", GDK_DEBUG_DND},
|
||||
{"color-context", GDK_DEBUG_COLOR_CONTEXT},
|
||||
{"xim", GDK_DEBUG_XIM},
|
||||
{"selection", GDK_DEBUG_SELECTION}
|
||||
};
|
||||
|
||||
static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
int __stdcall
|
||||
DllMain(HINSTANCE hinstDLL,
|
||||
@ -75,163 +67,21 @@ DllMain(HINSTANCE hinstDLL,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
* gdk_init
|
||||
*
|
||||
* Initialize the library for use.
|
||||
*
|
||||
* Arguments:
|
||||
* "argc" is the number of arguments.
|
||||
* "argv" is an array of strings.
|
||||
*
|
||||
* Results:
|
||||
* "argc" and "argv" are modified to reflect any arguments
|
||||
* which were not handled. (Such arguments should either
|
||||
* be handled by the application or dismissed).
|
||||
*
|
||||
* Side effects:
|
||||
* The library is initialized.
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
gboolean
|
||||
gdk_init_check (int *argc,
|
||||
char ***argv)
|
||||
_gdk_windowing_init_check (int argc,
|
||||
char **argv)
|
||||
{
|
||||
gint i, j, k;
|
||||
|
||||
if (gdk_initialized)
|
||||
return TRUE;
|
||||
|
||||
if (g_thread_supported ())
|
||||
gdk_threads_mutex = g_mutex_new ();
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *debug_string = getenv("GDK_DEBUG");
|
||||
if (debug_string != NULL)
|
||||
gdk_debug_flags = g_parse_debug_string (debug_string,
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
gdk_ndebug_keys);
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
|
||||
gdk_input_ignore_wintab = TRUE;
|
||||
|
||||
if (getenv ("GDK_EVENT_FUNC_FROM_WINDOW_PROC") != NULL)
|
||||
gdk_event_func_from_window_proc = TRUE;
|
||||
|
||||
if (argc && argv)
|
||||
{
|
||||
if (*argc > 0)
|
||||
{
|
||||
gchar *d;
|
||||
|
||||
d = strrchr((*argv)[0], G_DIR_SEPARATOR);
|
||||
if (d != NULL)
|
||||
g_set_prgname (d + 1);
|
||||
else
|
||||
g_set_prgname ((*argv)[0]);
|
||||
}
|
||||
|
||||
for (i = 1; i < *argc;)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if ((strcmp ("--gdk-debug", (*argv)[i]) == 0) ||
|
||||
(strncmp ("--gdk-debug=", (*argv)[i], 12) == 0))
|
||||
{
|
||||
gchar *equal_pos = strchr ((*argv)[i], '=');
|
||||
|
||||
if (equal_pos != NULL)
|
||||
{
|
||||
gdk_debug_flags |= g_parse_debug_string (equal_pos+1,
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
gdk_ndebug_keys);
|
||||
}
|
||||
else if ((i + 1) < *argc && (*argv)[i + 1])
|
||||
{
|
||||
gdk_debug_flags |= g_parse_debug_string ((*argv)[i+1],
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
gdk_ndebug_keys);
|
||||
(*argv)[i] = NULL;
|
||||
i += 1;
|
||||
}
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
else if ((strcmp ("--gdk-no-debug", (*argv)[i]) == 0) ||
|
||||
(strncmp ("--gdk-no-debug=", (*argv)[i], 15) == 0))
|
||||
{
|
||||
gchar *equal_pos = strchr ((*argv)[i], '=');
|
||||
if (gdk_synchronize)
|
||||
GdiSetBatchLimit (1);
|
||||
|
||||
if (equal_pos != NULL)
|
||||
{
|
||||
gdk_debug_flags &= ~g_parse_debug_string (equal_pos+1,
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
gdk_ndebug_keys);
|
||||
}
|
||||
else if ((i + 1) < *argc && (*argv)[i + 1])
|
||||
{
|
||||
gdk_debug_flags &= ~g_parse_debug_string ((*argv)[i+1],
|
||||
(GDebugKey *) gdk_debug_keys,
|
||||
gdk_ndebug_keys);
|
||||
(*argv)[i] = NULL;
|
||||
i += 1;
|
||||
}
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
else
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
if (strcmp ("--sync", (*argv)[i]) == 0)
|
||||
{
|
||||
(*argv)[i] = NULL;
|
||||
GdiSetBatchLimit (1);
|
||||
}
|
||||
else if (strcmp ("--name", (*argv)[i]) == 0)
|
||||
{
|
||||
if ((i + 1) < *argc && (*argv)[i + 1])
|
||||
{
|
||||
(*argv)[i++] = NULL;
|
||||
g_set_prgname ((*argv)[i]);
|
||||
(*argv)[i] = NULL;
|
||||
}
|
||||
}
|
||||
else if (strcmp ("--gdk-no-wintab", (*argv)[i]) == 0
|
||||
|| strcmp ("--gdk-ignore-wintab", (*argv)[i]) == 0)
|
||||
{
|
||||
(*argv)[i] = NULL;
|
||||
gdk_input_ignore_wintab = TRUE;
|
||||
}
|
||||
else if (strcmp ("--gdk-event-func-from-window-proc", (*argv)[i]) == 0)
|
||||
{
|
||||
(*argv)[i] = NULL;
|
||||
gdk_event_func_from_window_proc = TRUE;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
for (i = 1; i < *argc; i++)
|
||||
{
|
||||
for (k = i; k < *argc; k++)
|
||||
if ((*argv)[k] != NULL)
|
||||
break;
|
||||
|
||||
if (k > i)
|
||||
{
|
||||
k -= i;
|
||||
for (j = i + k; j < *argc; j++)
|
||||
(*argv)[j-k] = (*argv)[j];
|
||||
*argc -= k;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_prgname ("<unknown>");
|
||||
}
|
||||
|
||||
gdk_ProgInstance = GetModuleHandle (NULL);
|
||||
gdk_DC = CreateDC ("DISPLAY", NULL, NULL, NULL);
|
||||
gdk_root_window = GetDesktopWindow ();
|
||||
@ -248,61 +98,11 @@ gdk_init_check (int *argc,
|
||||
gdk_win32_dropfiles_atom = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
||||
gdk_ole2_dnd_atom = gdk_atom_intern ("OLE2_DND", FALSE);
|
||||
|
||||
gdk_progclass = g_basename (g_get_prgname ());
|
||||
gdk_progclass[0] = toupper (gdk_progclass[0]);
|
||||
|
||||
g_atexit (gdk_exit_func);
|
||||
|
||||
gdk_events_init ();
|
||||
gdk_visual_init ();
|
||||
gdk_window_init ();
|
||||
gdk_image_init ();
|
||||
gdk_input_init ();
|
||||
gdk_selection_init ();
|
||||
gdk_dnd_init ();
|
||||
|
||||
gdk_initialized = 1;
|
||||
gdk_win32_selection_init ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_init (int *argc, char ***argv)
|
||||
{
|
||||
if (!gdk_init_check (argc, argv))
|
||||
{
|
||||
g_warning ("cannot initialize GDK");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
* gdk_exit
|
||||
*
|
||||
* Restores the library to an un-itialized state and exits
|
||||
* the program using the "exit" system call.
|
||||
*
|
||||
* Arguments:
|
||||
* "errorcode" is the error value to pass to "exit".
|
||||
*
|
||||
* Results:
|
||||
* Allocated structures are freed and the program exits
|
||||
* cleanly.
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
gdk_exit (gint errorcode)
|
||||
{
|
||||
/* de-initialisation is done by the gdk_exit_func(),
|
||||
no need to do this here (Alex J.) */
|
||||
exit (errorcode);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_set_use_xshm (gint use_xshm)
|
||||
{
|
||||
@ -333,11 +133,7 @@ gdk_get_use_xshm (void)
|
||||
gint
|
||||
gdk_screen_width (void)
|
||||
{
|
||||
gint return_val;
|
||||
|
||||
return_val = gdk_root_parent->drawable.width;
|
||||
|
||||
return return_val;
|
||||
return ((GdkWindowPrivate *) gdk_parent_root)->drawable.width;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -358,11 +154,7 @@ gdk_screen_width (void)
|
||||
gint
|
||||
gdk_screen_height (void)
|
||||
{
|
||||
gint return_val;
|
||||
|
||||
return_val = gdk_root_parent->drawable.height;
|
||||
|
||||
return return_val;
|
||||
return ((GdkWindowPrivate *) gdk_parent_root)->drawable.height;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -383,14 +175,7 @@ gdk_screen_height (void)
|
||||
gint
|
||||
gdk_screen_width_mm (void)
|
||||
{
|
||||
HDC hdc;
|
||||
gint return_val;
|
||||
|
||||
hdc = GetDC (NULL);
|
||||
return_val = GetDeviceCaps (hdc, HORZSIZE);
|
||||
ReleaseDC (NULL, hdc);
|
||||
|
||||
return return_val;
|
||||
return GetDeviceCaps (gdk_DC, HORZSIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -411,14 +196,7 @@ gdk_screen_width_mm (void)
|
||||
gint
|
||||
gdk_screen_height_mm (void)
|
||||
{
|
||||
HDC hdc;
|
||||
gint return_val;
|
||||
|
||||
hdc = GetDC (NULL);
|
||||
return_val = GetDeviceCaps (hdc, VERTSIZE);
|
||||
ReleaseDC (NULL, hdc);
|
||||
|
||||
return return_val;
|
||||
return GetDeviceCaps (gdk_DC, VERTSIZE);
|
||||
}
|
||||
|
||||
void
|
||||
@ -433,245 +211,25 @@ gdk_key_repeat_restore (void)
|
||||
/* XXX */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
* gdk_flush
|
||||
*
|
||||
* Flushes the Xlib output buffer and then waits
|
||||
* until all requests have been received and processed
|
||||
* by the X server. The only real use for this function
|
||||
* is in dealing with XShm.
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
* Results:
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
gdk_flush (void)
|
||||
{
|
||||
GdiFlush ();
|
||||
}
|
||||
|
||||
void
|
||||
gdk_beep (void)
|
||||
{
|
||||
Beep(1000, 50);
|
||||
}
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
* gdk_exit_func
|
||||
*
|
||||
* This is the "atexit" function that makes sure the
|
||||
* library gets a chance to cleanup.
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
* Results:
|
||||
*
|
||||
* Side effects:
|
||||
* The library is un-initialized and the program exits.
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
gdk_exit_func (void)
|
||||
void
|
||||
gdk_windowing_exit (void)
|
||||
{
|
||||
static gboolean in_gdk_exit_func = FALSE;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_exit_func\n"));
|
||||
/* This is to avoid an infinite loop if a program segfaults in
|
||||
an atexit() handler (and yes, it does happen, especially if a program
|
||||
has trounced over memory too badly for even g_message to work) */
|
||||
if (in_gdk_exit_func == TRUE)
|
||||
return;
|
||||
in_gdk_exit_func = TRUE;
|
||||
|
||||
if (gdk_initialized)
|
||||
{
|
||||
gdk_image_exit ();
|
||||
gdk_input_exit ();
|
||||
gdk_key_repeat_restore ();
|
||||
gdk_dnd_exit ();
|
||||
|
||||
CoUninitialize ();
|
||||
|
||||
DeleteDC (gdk_DC);
|
||||
gdk_DC = NULL;
|
||||
gdk_initialized = 0;
|
||||
}
|
||||
gdk_win32_dnd_exit ();
|
||||
CoUninitialize ();
|
||||
DeleteDC (gdk_DC);
|
||||
gdk_DC = NULL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gdk_get_display(void)
|
||||
{
|
||||
return "local:";
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gdk_error_trap_push:
|
||||
* Push an error trap. X errors will be trapped until
|
||||
* the corresponding gdk_error_pop(), which will return
|
||||
* the error code, if any.
|
||||
* arguments:
|
||||
*
|
||||
* results:
|
||||
*************************************************************/
|
||||
|
||||
void
|
||||
gdk_error_trap_push (void)
|
||||
{
|
||||
/* ??? */
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gdk_error_trap_pop:
|
||||
* Pop an error trap added with gdk_error_push()
|
||||
* arguments:
|
||||
*
|
||||
* results:
|
||||
* 0, if no error occured, otherwise the error code.
|
||||
*************************************************************/
|
||||
|
||||
gint
|
||||
gdk_error_trap_pop (void)
|
||||
{
|
||||
/* ??? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gdkx_XConvertCase (KeySym symbol,
|
||||
KeySym *lower,
|
||||
KeySym *upper)
|
||||
{
|
||||
register KeySym sym = symbol;
|
||||
|
||||
g_return_if_fail (lower != NULL);
|
||||
g_return_if_fail (upper != NULL);
|
||||
|
||||
*lower = sym;
|
||||
*upper = sym;
|
||||
|
||||
switch (sym >> 8)
|
||||
{
|
||||
#if defined (GDK_A) && defined (GDK_Ooblique)
|
||||
case 0: /* Latin 1 */
|
||||
if ((sym >= GDK_A) && (sym <= GDK_Z))
|
||||
*lower += (GDK_a - GDK_A);
|
||||
else if ((sym >= GDK_a) && (sym <= GDK_z))
|
||||
*upper -= (GDK_a - GDK_A);
|
||||
else if ((sym >= GDK_Agrave) && (sym <= GDK_Odiaeresis))
|
||||
*lower += (GDK_agrave - GDK_Agrave);
|
||||
else if ((sym >= GDK_agrave) && (sym <= GDK_odiaeresis))
|
||||
*upper -= (GDK_agrave - GDK_Agrave);
|
||||
else if ((sym >= GDK_Ooblique) && (sym <= GDK_Thorn))
|
||||
*lower += (GDK_oslash - GDK_Ooblique);
|
||||
else if ((sym >= GDK_oslash) && (sym <= GDK_thorn))
|
||||
*upper -= (GDK_oslash - GDK_Ooblique);
|
||||
break;
|
||||
#endif /* LATIN1 */
|
||||
|
||||
#if defined (GDK_Aogonek) && defined (GDK_tcedilla)
|
||||
case 1: /* Latin 2 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym == GDK_Aogonek)
|
||||
*lower = GDK_aogonek;
|
||||
else if (sym >= GDK_Lstroke && sym <= GDK_Sacute)
|
||||
*lower += (GDK_lstroke - GDK_Lstroke);
|
||||
else if (sym >= GDK_Scaron && sym <= GDK_Zacute)
|
||||
*lower += (GDK_scaron - GDK_Scaron);
|
||||
else if (sym >= GDK_Zcaron && sym <= GDK_Zabovedot)
|
||||
*lower += (GDK_zcaron - GDK_Zcaron);
|
||||
else if (sym == GDK_aogonek)
|
||||
*upper = GDK_Aogonek;
|
||||
else if (sym >= GDK_lstroke && sym <= GDK_sacute)
|
||||
*upper -= (GDK_lstroke - GDK_Lstroke);
|
||||
else if (sym >= GDK_scaron && sym <= GDK_zacute)
|
||||
*upper -= (GDK_scaron - GDK_Scaron);
|
||||
else if (sym >= GDK_zcaron && sym <= GDK_zabovedot)
|
||||
*upper -= (GDK_zcaron - GDK_Zcaron);
|
||||
else if (sym >= GDK_Racute && sym <= GDK_Tcedilla)
|
||||
*lower += (GDK_racute - GDK_Racute);
|
||||
else if (sym >= GDK_racute && sym <= GDK_tcedilla)
|
||||
*upper -= (GDK_racute - GDK_Racute);
|
||||
break;
|
||||
#endif /* LATIN2 */
|
||||
|
||||
#if defined (GDK_Hstroke) && defined (GDK_Cabovedot)
|
||||
case 2: /* Latin 3 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= GDK_Hstroke && sym <= GDK_Hcircumflex)
|
||||
*lower += (GDK_hstroke - GDK_Hstroke);
|
||||
else if (sym >= GDK_Gbreve && sym <= GDK_Jcircumflex)
|
||||
*lower += (GDK_gbreve - GDK_Gbreve);
|
||||
else if (sym >= GDK_hstroke && sym <= GDK_hcircumflex)
|
||||
*upper -= (GDK_hstroke - GDK_Hstroke);
|
||||
else if (sym >= GDK_gbreve && sym <= GDK_jcircumflex)
|
||||
*upper -= (GDK_gbreve - GDK_Gbreve);
|
||||
else if (sym >= GDK_Cabovedot && sym <= GDK_Scircumflex)
|
||||
*lower += (GDK_cabovedot - GDK_Cabovedot);
|
||||
else if (sym >= GDK_cabovedot && sym <= GDK_scircumflex)
|
||||
*upper -= (GDK_cabovedot - GDK_Cabovedot);
|
||||
break;
|
||||
#endif /* LATIN3 */
|
||||
|
||||
#if defined (GDK_Rcedilla) && defined (GDK_Amacron)
|
||||
case 3: /* Latin 4 */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= GDK_Rcedilla && sym <= GDK_Tslash)
|
||||
*lower += (GDK_rcedilla - GDK_Rcedilla);
|
||||
else if (sym >= GDK_rcedilla && sym <= GDK_tslash)
|
||||
*upper -= (GDK_rcedilla - GDK_Rcedilla);
|
||||
else if (sym == GDK_ENG)
|
||||
*lower = GDK_eng;
|
||||
else if (sym == GDK_eng)
|
||||
*upper = GDK_ENG;
|
||||
else if (sym >= GDK_Amacron && sym <= GDK_Umacron)
|
||||
*lower += (GDK_amacron - GDK_Amacron);
|
||||
else if (sym >= GDK_amacron && sym <= GDK_umacron)
|
||||
*upper -= (GDK_amacron - GDK_Amacron);
|
||||
break;
|
||||
#endif /* LATIN4 */
|
||||
|
||||
#if defined (GDK_Serbian_DJE) && defined (GDK_Cyrillic_yu)
|
||||
case 6: /* Cyrillic */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= GDK_Serbian_DJE && sym <= GDK_Serbian_DZE)
|
||||
*lower -= (GDK_Serbian_DJE - GDK_Serbian_dje);
|
||||
else if (sym >= GDK_Serbian_dje && sym <= GDK_Serbian_dze)
|
||||
*upper += (GDK_Serbian_DJE - GDK_Serbian_dje);
|
||||
else if (sym >= GDK_Cyrillic_YU && sym <= GDK_Cyrillic_HARDSIGN)
|
||||
*lower -= (GDK_Cyrillic_YU - GDK_Cyrillic_yu);
|
||||
else if (sym >= GDK_Cyrillic_yu && sym <= GDK_Cyrillic_hardsign)
|
||||
*upper += (GDK_Cyrillic_YU - GDK_Cyrillic_yu);
|
||||
break;
|
||||
#endif /* CYRILLIC */
|
||||
|
||||
#if defined (GDK_Greek_ALPHAaccent) && defined (GDK_Greek_finalsmallsigma)
|
||||
case 7: /* Greek */
|
||||
/* Assume the KeySym is a legal value (ignore discontinuities) */
|
||||
if (sym >= GDK_Greek_ALPHAaccent && sym <= GDK_Greek_OMEGAaccent)
|
||||
*lower += (GDK_Greek_alphaaccent - GDK_Greek_ALPHAaccent);
|
||||
else if (sym >= GDK_Greek_alphaaccent && sym <= GDK_Greek_omegaaccent &&
|
||||
sym != GDK_Greek_iotaaccentdieresis &&
|
||||
sym != GDK_Greek_upsilonaccentdieresis)
|
||||
*upper -= (GDK_Greek_alphaaccent - GDK_Greek_ALPHAaccent);
|
||||
else if (sym >= GDK_Greek_ALPHA && sym <= GDK_Greek_OMEGA)
|
||||
*lower += (GDK_Greek_alpha - GDK_Greek_ALPHA);
|
||||
else if (sym >= GDK_Greek_alpha && sym <= GDK_Greek_omega &&
|
||||
sym != GDK_Greek_finalsmallsigma)
|
||||
*upper -= (GDK_Greek_alpha - GDK_Greek_ALPHA);
|
||||
break;
|
||||
#endif /* GREEK */
|
||||
}
|
||||
return "Win32";
|
||||
}
|
||||
|
||||
static struct gdk_key {
|
||||
@ -2044,72 +1602,3 @@ gdk_keyval_from_name (const gchar *keyval_name)
|
||||
else
|
||||
return GDK_VoidSymbol;
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_keyval_to_upper (guint keyval)
|
||||
{
|
||||
if (keyval)
|
||||
{
|
||||
KeySym lower_val = 0;
|
||||
KeySym upper_val = 0;
|
||||
|
||||
gdkx_XConvertCase (keyval, &lower_val, &upper_val);
|
||||
return upper_val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
guint
|
||||
gdk_keyval_to_lower (guint keyval)
|
||||
{
|
||||
if (keyval)
|
||||
{
|
||||
KeySym lower_val = 0;
|
||||
KeySym upper_val = 0;
|
||||
|
||||
gdkx_XConvertCase (keyval, &lower_val, &upper_val);
|
||||
return lower_val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keyval_is_upper (guint keyval)
|
||||
{
|
||||
if (keyval)
|
||||
{
|
||||
KeySym lower_val = 0;
|
||||
KeySym upper_val = 0;
|
||||
|
||||
gdkx_XConvertCase (keyval, &lower_val, &upper_val);
|
||||
return upper_val == keyval;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_keyval_is_lower (guint keyval)
|
||||
{
|
||||
if (keyval)
|
||||
{
|
||||
KeySym lower_val = 0;
|
||||
KeySym upper_val = 0;
|
||||
|
||||
gdkx_XConvertCase (keyval, &lower_val, &upper_val);
|
||||
return lower_val == keyval;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gdk_threads_enter ()
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
}
|
||||
|
||||
void
|
||||
gdk_threads_leave ()
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gdkpixmap.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -49,6 +49,49 @@ typedef struct
|
||||
gulong pixels[1];
|
||||
} _GdkPixmapInfo;
|
||||
|
||||
static void
|
||||
gdk_win32_pixmap_destroy (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_pixmap_destroy: %#x\n",
|
||||
GDK_DRAWABLE_XID (pixmap)));
|
||||
|
||||
if (!DeleteObject (GDK_DRAWABLE_XID (pixmap)))
|
||||
g_warning ("gdk_win32_pixmap_destroy: DeleteObject failed");
|
||||
|
||||
gdk_xid_table_remove (GDK_DRAWABLE_XID (pixmap));
|
||||
|
||||
g_free (GDK_DRAWABLE_WIN32DATA (pixmap));
|
||||
}
|
||||
|
||||
static GdkDrawable *
|
||||
gdk_win32_pixmap_alloc (void)
|
||||
{
|
||||
GdkDrawable *drawable;
|
||||
GdkDrawablePrivate *private;
|
||||
|
||||
static GdkDrawableClass klass;
|
||||
static gboolean initialized = FALSE;
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = TRUE;
|
||||
|
||||
klass = _gdk_win32_drawable_class;
|
||||
klass.destroy = gdk_win32_pixmap_destroy;
|
||||
}
|
||||
|
||||
drawable = gdk_drawable_alloc ();
|
||||
private = (GdkDrawablePrivate *) drawable;
|
||||
|
||||
private->klass = &klass;
|
||||
private->klass_data = g_new (GdkDrawableWin32Data, 1);
|
||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
||||
|
||||
return drawable;
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_new (GdkWindow *window,
|
||||
gint width,
|
||||
@ -57,7 +100,6 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GdkDrawablePrivate *private;
|
||||
GdkWindowPrivate *window_private;
|
||||
struct {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
union {
|
||||
@ -77,11 +119,10 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) gdk_root_parent;
|
||||
window = gdk_parent_root;
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (window))
|
||||
return NULL;
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
if (depth == -1)
|
||||
depth = gdk_drawable_get_visual (window)->depth;
|
||||
@ -89,10 +130,8 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n",
|
||||
width, height, depth));
|
||||
|
||||
private = g_new0 (GdkDrawablePrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
|
||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
||||
pixmap = gdk_win32_pixmap_alloc ();
|
||||
private = (GdkDrawablePrivate *) pixmap;
|
||||
|
||||
visual = gdk_drawable_get_visual (window);
|
||||
|
||||
@ -139,7 +178,7 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
private->colormap = window_private->drawable.colormap;
|
||||
private->colormap = ((GdkWindowPrivate *) window)->drawable.colormap;
|
||||
if (private->colormap == NULL)
|
||||
private->colormap = gdk_colormap_get_system ();
|
||||
|
||||
@ -164,25 +203,23 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if ((private->xwindow =
|
||||
if ((GDK_DRAWABLE_WIN32DATA (pixmap)->xid =
|
||||
CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
||||
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
|
||||
{
|
||||
g_warning ("gdk_pixmap_new: CreateDIBSection failed: %d", GetLastError ());
|
||||
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
|
||||
g_free (private);
|
||||
g_free (pixmap);
|
||||
return NULL;
|
||||
}
|
||||
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("... = %#x\n", private->xwindow));
|
||||
GDK_NOTE (MISC, g_print ("... = %#x\n", GDK_DRAWABLE_XID (pixmap)));
|
||||
|
||||
private->width = width;
|
||||
private->height = height;
|
||||
private->ref_count = 1;
|
||||
private->destroyed = 0;
|
||||
|
||||
gdk_xid_table_insert (&private->xwindow, pixmap);
|
||||
gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
@ -196,13 +233,10 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
|
||||
gint depth)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GdkImagePrivate *image_private;
|
||||
GdkDrawablePrivate *private;
|
||||
GdkWindowPrivate *window_private;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
|
||||
if (depth == 1)
|
||||
*image_return = gdk_image_bitmap_new (GDK_IMAGE_SHARED_PIXMAP, visual, width, height);
|
||||
@ -214,24 +248,20 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
|
||||
|
||||
g_return_val_if_fail (*image_return != NULL, NULL);
|
||||
|
||||
image_private = (GdkImagePrivate *) *image_return;
|
||||
pixmap = gdk_win32_pixmap_alloc ();
|
||||
private = (GdkDrawablePrivate *) pixmap;
|
||||
|
||||
private = g_new0 (GdkDrawablePrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
|
||||
private->xwindow = image_private->ximage;
|
||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
||||
private->colormap = window_private->drawable.colormap;
|
||||
GDK_DRAWABLE_WIN32DATA (pixmap)->xid =
|
||||
((GdkImagePrivateWin32 *) *image_return)->ximage;
|
||||
private->colormap = ((GdkWindowPrivate *) window)->drawable.colormap;
|
||||
private->width = width;
|
||||
private->height = height;
|
||||
private->ref_count = 1;
|
||||
private->destroyed = 0;
|
||||
|
||||
gdk_xid_table_insert (&private->xwindow, pixmap);
|
||||
gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_pixmap_create_on_shared_image: %dx%dx%d = %#x\n",
|
||||
width, height, depth, private->xwindow));
|
||||
width, height, depth, GDK_DRAWABLE_XID (pixmap)));
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
@ -287,19 +317,16 @@ gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) gdk_root_parent;
|
||||
window = gdk_parent_root;
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (window))
|
||||
return NULL;
|
||||
|
||||
private = g_new0 (GdkDrawablePrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
pixmap = gdk_win32_pixmap_alloc ();
|
||||
private = (GdkDrawablePrivate *) pixmap;
|
||||
|
||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
||||
private->width = width;
|
||||
private->height = height;
|
||||
private->ref_count = 1;
|
||||
private->destroyed = FALSE;
|
||||
|
||||
bpl = ((width - 1) / 8 + 1);
|
||||
aligned_bpl = ((bpl - 1) / 2 + 1) * 2;
|
||||
@ -307,15 +334,16 @@ gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
for (i = 0; i < height; i++)
|
||||
for (j = 0; j < bpl; j++)
|
||||
bits[i*aligned_bpl + j] = mirror[(guchar) data[i*bpl + j]];
|
||||
private->xwindow = CreateBitmap (width, height, 1, 1, bits);
|
||||
GDK_DRAWABLE_WIN32DATA (pixmap)->xid =
|
||||
CreateBitmap (width, height, 1, 1, bits);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_bitmap_create_from_data: %dx%d = %#x\n",
|
||||
width, height, private->xwindow));
|
||||
width, height, GDK_DRAWABLE_XID (pixmap)));
|
||||
|
||||
g_free (bits);
|
||||
|
||||
private->colormap = NULL;
|
||||
gdk_xid_table_insert (&private->xwindow, pixmap);
|
||||
gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
@ -341,8 +369,8 @@ gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
GdkGC *gc = gdk_gc_new (result);
|
||||
gdk_gc_set_foreground (gc, fg);
|
||||
gdk_gc_set_background (gc, bg);
|
||||
gdk_draw_pixmap (result, gc, source, 0, 0, 0, 0, width, height);
|
||||
gdk_pixmap_unref (source);
|
||||
gdk_draw_drawable (result, gc, source, 0, 0, 0, 0, width, height);
|
||||
gdk_drawable_unref (source);
|
||||
gdk_gc_unref (gc);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_pixmap_create_from_data: %dx%dx%d = %#x\n",
|
||||
@ -616,12 +644,12 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
g_warning ("Creating pixmap from xpm with NULL window and colormap");
|
||||
|
||||
if (window == NULL)
|
||||
window = (GdkWindow *) gdk_root_parent;
|
||||
window = gdk_parent_root;
|
||||
|
||||
if (colormap == NULL)
|
||||
{
|
||||
colormap = gdk_window_get_colormap (window);
|
||||
visual = gdk_window_get_visual (window);
|
||||
colormap = gdk_drawable_get_colormap (window);
|
||||
visual = gdk_drawable_get_visual (window);
|
||||
}
|
||||
else
|
||||
visual = ((GdkColormapPrivate *)colormap)->visual;
|
||||
@ -761,7 +789,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
error:
|
||||
|
||||
if (mask)
|
||||
gdk_gc_destroy (gc);
|
||||
gdk_gc_unref (gc);
|
||||
|
||||
if (image != NULL)
|
||||
{
|
||||
@ -774,8 +802,8 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
gc = gdk_gc_new (pixmap);
|
||||
gdk_gc_set_foreground (gc, transparent_color);
|
||||
gdk_draw_image (pixmap, gc, image, 0, 0, 0, 0, image->width, image->height);
|
||||
gdk_gc_destroy (gc);
|
||||
gdk_image_destroy (image);
|
||||
gdk_gc_unref (gc);
|
||||
gdk_image_unref (image);
|
||||
}
|
||||
else if (color_info)
|
||||
gdk_xpm_destroy_notify (color_info);
|
||||
@ -859,7 +887,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
const gchar *filename)
|
||||
{
|
||||
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
|
||||
transparent_color, filename);
|
||||
transparent_color, filename);
|
||||
}
|
||||
|
||||
struct mem_handle
|
||||
@ -917,7 +945,6 @@ gdk_pixmap_foreign_new (guint32 anid)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GdkDrawablePrivate *private;
|
||||
GdkWindowPrivate *window_private;
|
||||
HBITMAP xpixmap;
|
||||
SIZE size;
|
||||
unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
|
||||
@ -928,8 +955,6 @@ gdk_pixmap_foreign_new (guint32 anid)
|
||||
|
||||
/* set the pixmap to the passed in value */
|
||||
xpixmap = (HBITMAP) anid;
|
||||
/* get the root window */
|
||||
window_private = gdk_root_parent;
|
||||
|
||||
/* get information about the BITMAP to fill in the structure for
|
||||
the gdk window */
|
||||
@ -938,65 +963,15 @@ gdk_pixmap_foreign_new (guint32 anid)
|
||||
h_ret = size.cy;
|
||||
|
||||
/* allocate a new gdk pixmap */
|
||||
private = g_new (GdkDrawablePrivate, 1);
|
||||
pixmap = (GdkPixmap *)private;
|
||||
pixmap = gdk_win32_pixmap_alloc ();
|
||||
private = (GdkDrawablePrivate *) pixmap;
|
||||
|
||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
||||
private->xwindow = xpixmap;
|
||||
GDK_DRAWABLE_WIN32DATA (pixmap)->xid = xpixmap;
|
||||
private->colormap = NULL;
|
||||
private->width = w_ret;
|
||||
private->height = h_ret;
|
||||
private->ref_count = 1;
|
||||
private->destroyed = 0;
|
||||
|
||||
gdk_xid_table_insert(&private->xwindow, pixmap);
|
||||
gdk_xid_table_insert(&GDK_DRAWABLE_XID (pixmap), pixmap);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_ref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
|
||||
g_return_val_if_fail (pixmap != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXMAP (private), NULL);
|
||||
|
||||
private->ref_count += 1;
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pixmap_unref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkDrawablePrivate *private = (GdkDrawablePrivate *)pixmap;
|
||||
g_return_if_fail (pixmap != NULL);
|
||||
g_return_if_fail (GDK_IS_PIXMAP (private));
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
private->ref_count -= 1;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_pixmap_unref: %#x %d%s\n",
|
||||
private->xwindow, private->ref_count,
|
||||
(private->ref_count == 0 ? " freeing" : "")));
|
||||
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
if (!DeleteObject (private->xwindow))
|
||||
g_warning ("gdk_pixmap_unref: DeleteObject failed");
|
||||
gdk_xid_table_remove (private->xwindow);
|
||||
g_dataset_destroy (private);
|
||||
g_free (private);
|
||||
}
|
||||
}
|
||||
|
||||
GdkBitmap *
|
||||
gdk_bitmap_ref (GdkBitmap *bitmap)
|
||||
{
|
||||
return (GdkBitmap *)gdk_pixmap_ref ((GdkPixmap *)bitmap);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_bitmap_unref (GdkBitmap *bitmap)
|
||||
{
|
||||
gdk_pixmap_unref ((GdkPixmap *)bitmap);
|
||||
}
|
||||
|
@ -261,8 +261,8 @@ struct _GdkRegionPrivate
|
||||
HRGN xregion;
|
||||
};
|
||||
|
||||
void gdk_selection_init (void);
|
||||
void gdk_dnd_exit (void);
|
||||
void gdk_win32_selection_init (void);
|
||||
void gdk_win32_dnd_exit (void);
|
||||
|
||||
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
|
||||
GdkVisual* gdk_visual_lookup (Visual *xvisual);
|
||||
@ -309,6 +309,7 @@ char *gdk_color_to_string (const GdkColor *);
|
||||
|
||||
extern LRESULT CALLBACK gdk_WindowProc (HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
extern GdkDrawableClass _gdk_win32_drawable_class;
|
||||
extern HWND gdk_root_window;
|
||||
GDKVAR ATOM gdk_selection_property;
|
||||
GDKVAR gchar *gdk_progclass;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkselection.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
@ -119,6 +119,12 @@ gdk_property_get (GdkWindow *window,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
{
|
||||
g_return_val_if_fail (window != NULL, FALSE);
|
||||
g_return_val_if_fail (!GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (window))
|
||||
return FALSE;
|
||||
|
||||
g_warning ("gdk_property_get: Not implemented");
|
||||
|
||||
return FALSE;
|
||||
@ -138,10 +144,13 @@ gdk_property_change (GdkWindow *window,
|
||||
gchar *prop_name, *type_name;
|
||||
guchar *ptr;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (!GDK_IS_WINDOW (window));
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (window))
|
||||
return;
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(prop_name = gdk_atom_name (property),
|
||||
type_name = gdk_atom_name (type),
|
||||
g_print ("gdk_property_change: %#x %#x (%s) %#x (%s) %s %d*%d bytes %.10s\n",
|
||||
@ -166,8 +175,8 @@ gdk_property_change (GdkWindow *window,
|
||||
if (*ptr++ == '\n')
|
||||
length++;
|
||||
#if 1
|
||||
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
GDK_NOTE (MISC, g_print ("...OpenClipboard(%#x)\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
if (!OpenClipboard (GDK_DRAWABLE_XID (window)))
|
||||
{
|
||||
g_warning ("gdk_property_change: OpenClipboard failed");
|
||||
@ -176,7 +185,7 @@ gdk_property_change (GdkWindow *window,
|
||||
#endif
|
||||
hdata = GlobalAlloc (GMEM_MOVEABLE|GMEM_DDESHARE, length + 1);
|
||||
ptr = GlobalLock (hdata);
|
||||
GDK_NOTE (SELECTION, g_print ("...hdata=%#x, ptr=%#x\n", hdata, ptr));
|
||||
GDK_NOTE (MISC, g_print ("...hdata=%#x, ptr=%#x\n", hdata, ptr));
|
||||
|
||||
for (i = 0; i < nelements; i++)
|
||||
{
|
||||
@ -186,13 +195,13 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
*ptr++ = '\0';
|
||||
GlobalUnlock (hdata);
|
||||
GDK_NOTE (SELECTION, g_print ("...SetClipboardData(CF_TEXT, %#x)\n",
|
||||
hdata));
|
||||
GDK_NOTE (MISC, g_print ("...SetClipboardData(CF_TEXT, %#x)\n",
|
||||
hdata));
|
||||
if (!SetClipboardData(CF_TEXT, hdata))
|
||||
g_warning ("gdk_property_change: SetClipboardData failed: %d",
|
||||
GetLastError ());
|
||||
#if 1
|
||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
||||
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||
if (!CloseClipboard ())
|
||||
{
|
||||
g_warning ("gdk_property_change: CloseClipboard failed");
|
||||
@ -211,10 +220,10 @@ gdk_property_delete (GdkWindow *window,
|
||||
gchar *prop_name, *type_name;
|
||||
extern void gdk_selection_property_delete (GdkWindow *);
|
||||
|
||||
if (GDK_DRAWABLE_DESTROYED (window))
|
||||
return;
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (!GDK_IS_WINDOW (window));
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(prop_name = gdk_atom_name (property),
|
||||
g_print ("gdk_property_delete: %#x %#x (%s)\n",
|
||||
(window ? GDK_DRAWABLE_XID (window) : 0),
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
|
||||
|
||||
GdkRegion*
|
||||
@ -274,9 +274,10 @@ gdk_region_union_with_rect (GdkRegion *region,
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_intersect (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
static GdkRegion *
|
||||
gdk_regions_op (GdkRegion *source1,
|
||||
GdkRegion *source2,
|
||||
guint op)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
@ -292,76 +293,34 @@ gdk_regions_intersect (GdkRegion *source1,
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
||||
RGN_AND);
|
||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion, op);
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_union (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
GdkRegion*
|
||||
gdk_regions_intersect (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
return gdk_regions_op (source1, source2, RGN_AND);
|
||||
}
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
||||
RGN_OR);
|
||||
return res;
|
||||
GdkRegion*
|
||||
gdk_regions_union (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
return gdk_regions_op (source1, source2, RGN_OR);
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_subtract (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
||||
RGN_DIFF);
|
||||
return res;
|
||||
return gdk_regions_op (source1, source2, RGN_DIFF);
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_xor (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
||||
RGN_XOR);
|
||||
return res;
|
||||
return gdk_regions_op (source1, source2, RGN_XOR);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdkx.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
/* We emulate the GDK_SELECTION window properties by storing
|
||||
* it's data in a per-window hashtable.
|
||||
@ -45,7 +45,7 @@ typedef struct {
|
||||
static GHashTable *sel_prop_table = NULL;
|
||||
|
||||
void
|
||||
gdk_selection_init (void)
|
||||
gdk_win32_selection_init (void)
|
||||
{
|
||||
if (sel_prop_table == NULL)
|
||||
sel_prop_table = g_hash_table_new (g_int_hash, g_int_equal);
|
||||
@ -83,7 +83,7 @@ gdk_selection_owner_set (GdkWindow *owner,
|
||||
gchar *sel_name;
|
||||
HWND xwindow;
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_set: %#x %#x (%s)\n",
|
||||
(owner ? GDK_DRAWABLE_XID (owner) : 0),
|
||||
@ -98,13 +98,13 @@ gdk_selection_owner_set (GdkWindow *owner,
|
||||
else
|
||||
xwindow = NULL;
|
||||
|
||||
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n", xwindow));
|
||||
GDK_NOTE (MISC, g_print ("...OpenClipboard(%#x)\n", xwindow));
|
||||
if (!OpenClipboard (xwindow))
|
||||
{
|
||||
g_warning ("gdk_selection_owner_set: OpenClipboard failed");
|
||||
return FALSE;
|
||||
}
|
||||
GDK_NOTE (SELECTION, g_print ("...EmptyClipboard()\n"));
|
||||
GDK_NOTE (MISC, g_print ("...EmptyClipboard()\n"));
|
||||
if (!EmptyClipboard ())
|
||||
{
|
||||
g_warning ("gdk_selection_owner_set: EmptyClipboard failed");
|
||||
@ -116,7 +116,7 @@ gdk_selection_owner_set (GdkWindow *owner,
|
||||
if (xwindow != NULL)
|
||||
SetClipboardData (CF_TEXT, NULL);
|
||||
#endif
|
||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
||||
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||
if (!CloseClipboard ())
|
||||
{
|
||||
g_warning ("gdk_selection_owner_set: CloseClipboard failed");
|
||||
@ -154,7 +154,7 @@ gdk_selection_owner_get (GdkAtom selection)
|
||||
|
||||
#endif
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_get: %#x (%s) = %#x\n",
|
||||
selection, sel_name,
|
||||
@ -180,7 +180,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
if (GDK_DRAWABLE_DESTROYED (requestor))
|
||||
return;
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
g_print ("gdk_selection_convert: %#x %#x (%s) %#x (%s)\n",
|
||||
@ -194,7 +194,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
* contents of the clipboard. Get the clipboard data,
|
||||
* and store it for later.
|
||||
*/
|
||||
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
|
||||
GDK_NOTE (MISC, g_print ("...OpenClipboard(%#x)\n",
|
||||
GDK_DRAWABLE_XID (requestor)));
|
||||
if (!OpenClipboard (GDK_DRAWABLE_XID (requestor)))
|
||||
{
|
||||
@ -202,15 +202,15 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
return;
|
||||
}
|
||||
|
||||
GDK_NOTE (SELECTION, g_print ("...GetClipboardData(CF_TEXT)\n"));
|
||||
GDK_NOTE (MISC, g_print ("...GetClipboardData(CF_TEXT)\n"));
|
||||
if ((hdata = GetClipboardData (CF_TEXT)) != NULL)
|
||||
{
|
||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (SELECTION, g_print ("...got data: %d bytes: %.10s\n",
|
||||
length, ptr));
|
||||
GDK_NOTE (MISC, g_print ("...got data: %d bytes: %.10s\n",
|
||||
length, ptr));
|
||||
|
||||
slength = 0;
|
||||
p = ptr;
|
||||
@ -240,7 +240,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
GlobalUnlock (hdata);
|
||||
}
|
||||
}
|
||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
||||
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||
CloseClipboard ();
|
||||
|
||||
|
||||
@ -257,11 +257,13 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
*/
|
||||
GdkSelProp *prop;
|
||||
|
||||
prop = g_hash_table_lookup (sel_prop_table, &gdk_root_parent->drawable.xwindow);
|
||||
prop = g_hash_table_lookup (sel_prop_table,
|
||||
&GDK_DRAWABLE_XID (gdk_parent_root));
|
||||
|
||||
if (prop != NULL)
|
||||
{
|
||||
g_hash_table_remove (sel_prop_table, &gdk_root_parent->drawable.xwindow);
|
||||
g_hash_table_remove (sel_prop_table,
|
||||
&GDK_DRAWABLE_XID (gdk_parent_root));
|
||||
gdk_sel_prop_store (requestor, prop->type, prop->format,
|
||||
prop->data, prop->length);
|
||||
g_free (prop);
|
||||
@ -288,8 +290,8 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
if (GDK_DRAWABLE_DESTROYED (requestor))
|
||||
return 0;
|
||||
|
||||
GDK_NOTE (SELECTION, g_print ("gdk_selection_property_get: %#x\n",
|
||||
GDK_DRAWABLE_XID (requestor)));
|
||||
GDK_NOTE (MISC, g_print ("gdk_selection_property_get: %#x\n",
|
||||
GDK_DRAWABLE_XID (requestor)));
|
||||
|
||||
prop = g_hash_table_lookup (sel_prop_table, &GDK_DRAWABLE_XID (requestor));
|
||||
|
||||
@ -333,7 +335,7 @@ gdk_selection_send_notify (guint32 requestor,
|
||||
{
|
||||
gchar *sel_name, *tgt_name, *prop_name;
|
||||
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
prop_name = gdk_atom_name (property),
|
||||
@ -370,7 +372,7 @@ gdk_text_property_to_text_list (GdkAtom encoding,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
GDK_NOTE (SELECTION,
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_text_property_to_text_list not implemented\n"));
|
||||
|
||||
return 0;
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkvisual.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
|
||||
static void gdk_visual_decompose_mask (gulong mask,
|
||||
gint *shift,
|
||||
|
@ -29,18 +29,18 @@
|
||||
#include <stdio.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
|
||||
static guint gdk_xid_hash (XID *xid);
|
||||
static gint gdk_xid_compare (XID *a,
|
||||
XID *b);
|
||||
static guint gdk_xid_hash (HANDLE *xid);
|
||||
static gint gdk_xid_compare (HANDLE *a,
|
||||
HANDLE *b);
|
||||
|
||||
|
||||
static GHashTable *xid_ht = NULL;
|
||||
|
||||
|
||||
void
|
||||
gdk_xid_table_insert (XID *xid,
|
||||
gdk_xid_table_insert (HANDLE *xid,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (xid != NULL);
|
||||
@ -53,7 +53,7 @@ gdk_xid_table_insert (XID *xid,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_xid_table_remove (XID xid)
|
||||
gdk_xid_table_remove (HANDLE xid)
|
||||
{
|
||||
if (!xid_ht)
|
||||
xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
|
||||
@ -63,7 +63,7 @@ gdk_xid_table_remove (XID xid)
|
||||
}
|
||||
|
||||
gpointer
|
||||
gdk_xid_table_lookup (XID xid)
|
||||
gdk_xid_table_lookup (HANDLE xid)
|
||||
{
|
||||
gpointer data = NULL;
|
||||
|
||||
@ -75,14 +75,14 @@ gdk_xid_table_lookup (XID xid)
|
||||
|
||||
|
||||
static guint
|
||||
gdk_xid_hash (XID *xid)
|
||||
gdk_xid_hash (HANDLE *xid)
|
||||
{
|
||||
return (guint) *xid;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_xid_compare (XID *a,
|
||||
XID *b)
|
||||
gdk_xid_compare (HANDLE *a,
|
||||
HANDLE *b)
|
||||
{
|
||||
return (*a == *b);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,5 @@
|
||||
## Makefile for building the GDK DLL with egcs on cygwin
|
||||
## Use: make -f makefile.cygwin install
|
||||
|
||||
# Change this to wherever you want to install the DLL. This directory
|
||||
# should be in your PATH.
|
||||
BIN = /bin
|
||||
## Makefile for building the machine dependent part of GDK with gcc on cygwin
|
||||
## Use: make -f makefile.cygwin
|
||||
|
||||
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
|
||||
# We use the wntab32x.lib archive library directly (copy it as libwntab32x.a).
|
||||
@ -19,7 +15,6 @@ CC = gcc -mno-cygwin -mpentium -fnative-struct
|
||||
|
||||
CP = cp
|
||||
LD = ld
|
||||
INSTALL = install
|
||||
|
||||
GLIB_VER=1.3
|
||||
GTK_VER=1.3
|
||||
@ -29,10 +24,9 @@ CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENAB
|
||||
|
||||
all: \
|
||||
../../config.h \
|
||||
gdk-win32-$(GTK_VER).dll
|
||||
|
||||
install : all
|
||||
$(INSTALL) gdk-win32-$(GTK_VER).dll $(BIN)
|
||||
libgdk-win32.a \
|
||||
gdk-win32res.o \
|
||||
libwntab32x.a
|
||||
|
||||
gdk_win32_OBJECTS = \
|
||||
gdkcolor-win32.o \
|
||||
@ -61,8 +55,9 @@ gdk_win32_OBJECTS = \
|
||||
gdk-win32res.o : rc/gdk.rc
|
||||
windres --include-dir rc rc/gdk.rc gdk-win32res.o
|
||||
|
||||
gdk-win32-$(GTK_VER).dll : $(gdk_win32_OBJECTS) gdk-win32.def gdk-win32res.o libwntab32x.a
|
||||
$(GLIB)/build-dll gdk-win32 $(GTK_VER) gdk-win32.def $(gdk_win32_OBJECTS) -L $(GLIB) -lglib-$(GLIB_VER) -L . -lwntab32x -lgdi32 -luser32 -limm32 -lshell32 -lole32 -luuid $(LDFLAGS) gdk-win32res.o
|
||||
libgdk-win32.a : $(gdk_win32_OBJECTS)
|
||||
-rm -f $@
|
||||
$(AR) rv $@ $(gdk_win32_OBJECTS)
|
||||
|
||||
libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
|
||||
cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a
|
||||
|
Loading…
Reference in New Issue
Block a user