forked from AuroraMiddleware/gtk
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_atom_name
|
||||||
gdk_beep
|
gdk_beep
|
||||||
gdk_bitmap_create_from_data
|
gdk_bitmap_create_from_data
|
||||||
gdk_bitmap_ref
|
|
||||||
gdk_bitmap_unref
|
|
||||||
gdk_char_height
|
gdk_char_height
|
||||||
gdk_char_measure
|
gdk_char_measure
|
||||||
gdk_char_width
|
gdk_char_width
|
||||||
@ -55,7 +53,6 @@ EXPORTS
|
|||||||
gdk_draw_indexed_image
|
gdk_draw_indexed_image
|
||||||
gdk_draw_line
|
gdk_draw_line
|
||||||
gdk_draw_lines
|
gdk_draw_lines
|
||||||
gdk_draw_pixmap
|
|
||||||
gdk_draw_point
|
gdk_draw_point
|
||||||
gdk_draw_points
|
gdk_draw_points
|
||||||
gdk_draw_polygon
|
gdk_draw_polygon
|
||||||
@ -103,7 +100,6 @@ EXPORTS
|
|||||||
gdk_free_compound_text
|
gdk_free_compound_text
|
||||||
gdk_free_text_list
|
gdk_free_text_list
|
||||||
gdk_gc_copy
|
gdk_gc_copy
|
||||||
gdk_gc_destroy
|
|
||||||
gdk_gc_get_values
|
gdk_gc_get_values
|
||||||
gdk_gc_new
|
gdk_gc_new
|
||||||
gdk_gc_new_with_values
|
gdk_gc_new_with_values
|
||||||
@ -142,7 +138,6 @@ EXPORTS
|
|||||||
gdk_im_ready
|
gdk_im_ready
|
||||||
gdk_im_set_best_style
|
gdk_im_set_best_style
|
||||||
gdk_image_bitmap_new
|
gdk_image_bitmap_new
|
||||||
gdk_image_destroy
|
|
||||||
gdk_image_get
|
gdk_image_get
|
||||||
gdk_image_get_pixel
|
gdk_image_get_pixel
|
||||||
gdk_image_new
|
gdk_image_new
|
||||||
@ -184,8 +179,6 @@ EXPORTS
|
|||||||
gdk_pixmap_create_on_shared_image
|
gdk_pixmap_create_on_shared_image
|
||||||
gdk_pixmap_foreign_new
|
gdk_pixmap_foreign_new
|
||||||
gdk_pixmap_new
|
gdk_pixmap_new
|
||||||
gdk_pixmap_ref
|
|
||||||
gdk_pixmap_unref
|
|
||||||
gdk_pointer_grab
|
gdk_pointer_grab
|
||||||
gdk_pointer_is_grabbed
|
gdk_pointer_is_grabbed
|
||||||
gdk_pointer_ungrab
|
gdk_pointer_ungrab
|
||||||
@ -212,18 +205,6 @@ EXPORTS
|
|||||||
gdk_regions_subtract
|
gdk_regions_subtract
|
||||||
gdk_regions_union
|
gdk_regions_union
|
||||||
gdk_regions_xor
|
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_root_parent
|
||||||
gdk_screen_height
|
gdk_screen_height
|
||||||
gdk_screen_height_mm
|
gdk_screen_height_mm
|
||||||
@ -291,7 +272,6 @@ EXPORTS
|
|||||||
gdk_window_move_resize
|
gdk_window_move_resize
|
||||||
gdk_window_new
|
gdk_window_new
|
||||||
gdk_window_raise
|
gdk_window_raise
|
||||||
gdk_window_ref
|
|
||||||
gdk_window_register_dnd
|
gdk_window_register_dnd
|
||||||
gdk_window_remove_filter
|
gdk_window_remove_filter
|
||||||
gdk_window_reparent
|
gdk_window_reparent
|
||||||
@ -316,7 +296,6 @@ EXPORTS
|
|||||||
gdk_window_set_user_data
|
gdk_window_set_user_data
|
||||||
gdk_window_shape_combine_mask
|
gdk_window_shape_combine_mask
|
||||||
gdk_window_show
|
gdk_window_show
|
||||||
gdk_window_unref
|
|
||||||
gdk_window_withdraw
|
gdk_window_withdraw
|
||||||
gdk_xid_table_insert
|
gdk_xid_table_insert
|
||||||
gdk_xid_table_lookup
|
gdk_xid_table_lookup
|
||||||
|
@ -178,8 +178,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
|||||||
|
|
||||||
if (source_image->depth != 1 || mask_image->depth != 1)
|
if (source_image->depth != 1 || mask_image->depth != 1)
|
||||||
{
|
{
|
||||||
gdk_image_destroy (source_image);
|
gdk_image_unref (source_image);
|
||||||
gdk_image_destroy (mask_image);
|
gdk_image_unref (mask_image);
|
||||||
g_return_val_if_fail (source_image->depth == 1 && mask_image->depth == 1,
|
g_return_val_if_fail (source_image->depth == 1 && mask_image->depth == 1,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -243,8 +243,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
|||||||
g_free (XORmask);
|
g_free (XORmask);
|
||||||
g_free (ANDmask);
|
g_free (ANDmask);
|
||||||
|
|
||||||
gdk_image_destroy (source_image);
|
gdk_image_unref (source_image);
|
||||||
gdk_image_destroy (mask_image);
|
gdk_image_unref (mask_image);
|
||||||
|
|
||||||
private = g_new (GdkCursorPrivate, 1);
|
private = g_new (GdkCursorPrivate, 1);
|
||||||
private->xcursor = xcursor;
|
private->xcursor = xcursor;
|
||||||
|
@ -741,7 +741,7 @@ gdk_dnd_init (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_dnd_exit (void)
|
gdk_win32_dnd_exit (void)
|
||||||
{
|
{
|
||||||
#ifdef OLE2_DND
|
#ifdef OLE2_DND
|
||||||
OleUninitialize ();
|
OleUninitialize ();
|
||||||
|
@ -69,8 +69,6 @@
|
|||||||
typedef struct _GdkIOClosure GdkIOClosure;
|
typedef struct _GdkIOClosure GdkIOClosure;
|
||||||
typedef struct _GdkEventPrivate GdkEventPrivate;
|
typedef struct _GdkEventPrivate GdkEventPrivate;
|
||||||
|
|
||||||
gint gdk_event_func_from_window_proc = FALSE;
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
/* Following flag is set for events on the event queue during
|
/* Following flag is set for events on the event queue during
|
||||||
@ -669,54 +667,6 @@ gdk_io_invoke (GIOChannel *source,
|
|||||||
return TRUE;
|
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
|
static GdkFilterReturn
|
||||||
gdk_event_apply_filters (MSG *xevent,
|
gdk_event_apply_filters (MSG *xevent,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
@ -4660,3 +4610,8 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
|
|||||||
/* XXX */
|
/* XXX */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_flush (void)
|
||||||
|
{
|
||||||
|
GdiFlush ();
|
||||||
|
}
|
||||||
|
@ -917,6 +917,16 @@ _gdk_font_destroy (GdkFont *font)
|
|||||||
g_free (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
|
gint
|
||||||
gdk_font_id (const GdkFont *font)
|
gdk_font_id (const GdkFont *font)
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,7 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
|||||||
if (values_mask & GDK_GC_TILE)
|
if (values_mask & GDK_GC_TILE)
|
||||||
{
|
{
|
||||||
data->tile = values->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)));
|
GDK_NOTE (MISC, g_print (" tile=%#x", GDK_DRAWABLE_XID (data->tile)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -164,7 +164,7 @@ _gdk_win32_gc_new (GdkDrawable *drawable,
|
|||||||
if (values_mask & GDK_GC_STIPPLE)
|
if (values_mask & GDK_GC_STIPPLE)
|
||||||
{
|
{
|
||||||
data->stipple = values->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)));
|
GDK_NOTE (MISC, g_print (" stipple=%#x", GDK_DRAWABLE_XID (data->stipple)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -288,10 +288,10 @@ gdk_win32_gc_destroy (GdkGC *gc)
|
|||||||
gdk_font_unref (data->font);
|
gdk_font_unref (data->font);
|
||||||
|
|
||||||
if (data->values_mask & GDK_GC_TILE)
|
if (data->values_mask & GDK_GC_TILE)
|
||||||
gdk_pixmap_unref (data->tile);
|
gdk_drawable_unref (data->tile);
|
||||||
|
|
||||||
if (data->values_mask & GDK_GC_STIPPLE)
|
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)
|
if (data->values_mask & GDK_GC_CLIP_MASK)
|
||||||
DeleteObject (data->clip_region);
|
DeleteObject (data->clip_region);
|
||||||
@ -506,13 +506,13 @@ gdk_win32_gc_set_values (GdkGC *gc,
|
|||||||
if (values_mask & GDK_GC_TILE)
|
if (values_mask & GDK_GC_TILE)
|
||||||
{
|
{
|
||||||
if (data->tile != NULL)
|
if (data->tile != NULL)
|
||||||
gdk_pixmap_unref (data->tile);
|
gdk_drawable_unref (data->tile);
|
||||||
data->tile = values->tile;
|
data->tile = values->tile;
|
||||||
if (data->tile != NULL)
|
if (data->tile != NULL)
|
||||||
{
|
{
|
||||||
GDK_NOTE (MISC, g_print ("tile = %#x ",
|
GDK_NOTE (MISC, g_print ("tile = %#x ",
|
||||||
GDK_DRAWABLE_XID (values->tile)));
|
GDK_DRAWABLE_XID (values->tile)));
|
||||||
gdk_pixmap_ref (data->tile);
|
gdk_drawable_ref (data->tile);
|
||||||
data->values_mask |= GDK_GC_TILE;
|
data->values_mask |= GDK_GC_TILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -525,13 +525,13 @@ gdk_win32_gc_set_values (GdkGC *gc,
|
|||||||
if (values_mask & GDK_GC_STIPPLE)
|
if (values_mask & GDK_GC_STIPPLE)
|
||||||
{
|
{
|
||||||
if (data->stipple != NULL)
|
if (data->stipple != NULL)
|
||||||
gdk_pixmap_unref (data->stipple);
|
gdk_drawable_unref (data->stipple);
|
||||||
data->stipple = values->stipple;
|
data->stipple = values->stipple;
|
||||||
if (data->stipple != NULL)
|
if (data->stipple != NULL)
|
||||||
{
|
{
|
||||||
GDK_NOTE (MISC, g_print ("stipple = %#x ",
|
GDK_NOTE (MISC, g_print ("stipple = %#x ",
|
||||||
GDK_DRAWABLE_XID (values->stipple)));
|
GDK_DRAWABLE_XID (values->stipple)));
|
||||||
gdk_pixmap_ref (data->stipple);
|
gdk_drawable_ref (data->stipple);
|
||||||
data->values_mask |= GDK_GC_STIPPLE;
|
data->values_mask |= GDK_GC_STIPPLE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -741,18 +741,18 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
|
|||||||
if (dst_data->font)
|
if (dst_data->font)
|
||||||
gdk_font_unref (dst_data->font);
|
gdk_font_unref (dst_data->font);
|
||||||
if (dst_data->tile)
|
if (dst_data->tile)
|
||||||
gdk_pixmap_unref (dst_data->tile);
|
gdk_drawable_unref (dst_data->tile);
|
||||||
if (dst_data->stipple)
|
if (dst_data->stipple)
|
||||||
gdk_pixmap_unref (dst_data->stipple);
|
gdk_drawable_unref (dst_data->stipple);
|
||||||
|
|
||||||
*dst_data = *src_data;
|
*dst_data = *src_data;
|
||||||
|
|
||||||
if (dst_data->font)
|
if (dst_data->font)
|
||||||
gdk_font_ref (dst_data->font);
|
gdk_font_ref (dst_data->font);
|
||||||
if (dst_data->tile)
|
if (dst_data->tile)
|
||||||
gdk_pixmap_ref (dst_data->tile);
|
gdk_drawable_ref (dst_data->tile);
|
||||||
if (dst_data->stipple)
|
if (dst_data->stipple)
|
||||||
gdk_pixmap_ref (dst_data->stipple);
|
gdk_drawable_ref (dst_data->stipple);
|
||||||
}
|
}
|
||||||
|
|
||||||
HDC
|
HDC
|
||||||
|
@ -25,12 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gdktypes.h"
|
#include "gdktypes.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate-win32.h"
|
||||||
|
|
||||||
guint gdk_debug_flags = 0;
|
|
||||||
HWND gdk_root_window = NULL;
|
HWND gdk_root_window = NULL;
|
||||||
HWND gdk_leader_window;
|
gint gdk_event_func_from_window_proc = FALSE;
|
||||||
GDKVAR GdkWindowPrivate *gdk_root_parent = NULL;
|
|
||||||
HDC gdk_DC;
|
HDC gdk_DC;
|
||||||
HINSTANCE gdk_DLLInstance;
|
HINSTANCE gdk_DLLInstance;
|
||||||
HINSTANCE gdk_ProgInstance;
|
HINSTANCE gdk_ProgInstance;
|
||||||
@ -40,12 +38,7 @@ UINT gdk_selection_clear_msg;
|
|||||||
GdkAtom gdk_clipboard_atom;
|
GdkAtom gdk_clipboard_atom;
|
||||||
GdkAtom gdk_win32_dropfiles_atom;
|
GdkAtom gdk_win32_dropfiles_atom;
|
||||||
GdkAtom gdk_ole2_dnd_atom;
|
GdkAtom gdk_ole2_dnd_atom;
|
||||||
Atom gdk_selection_property;
|
ATOM gdk_selection_property;
|
||||||
gchar *gdk_progclass = NULL;
|
|
||||||
gint gdk_error_code;
|
|
||||||
gint gdk_error_warnings = TRUE;
|
|
||||||
gint gdk_null_window_warnings = TRUE;
|
gint gdk_null_window_warnings = TRUE;
|
||||||
|
|
||||||
GMutex *gdk_threads_mutex = NULL;
|
|
||||||
|
|
||||||
DWORD windows_version = 0;
|
DWORD windows_version = 0;
|
||||||
|
@ -29,17 +29,24 @@
|
|||||||
#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
|
#include "gdk.h" /* For gdk_error_trap_* / gdk_flush_* */
|
||||||
#include "gdkimage.h"
|
#include "gdkimage.h"
|
||||||
#include "gdkprivate.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;
|
static GList *image_list = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -50,7 +57,7 @@ gdk_image_exit (void)
|
|||||||
while (image_list)
|
while (image_list)
|
||||||
{
|
{
|
||||||
image = image_list->data;
|
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;
|
Visual *xvisual;
|
||||||
GdkImage *image;
|
GdkImage *image;
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivateWin32 *private;
|
||||||
struct {
|
struct {
|
||||||
BITMAPINFOHEADER bmiHeader;
|
BITMAPINFOHEADER bmiHeader;
|
||||||
union {
|
union {
|
||||||
@ -74,9 +81,11 @@ gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint w, gint h)
|
|||||||
int bpl = (w-1)/8 + 1;
|
int bpl = (w-1)/8 + 1;
|
||||||
int bpl32 = ((w-1)/32 + 1)*4;
|
int bpl32 = ((w-1)/32 + 1)*4;
|
||||||
|
|
||||||
private = g_new(GdkImagePrivate, 1);
|
private = g_new (GdkImagePrivateWin32, 1);
|
||||||
image = (GdkImage *) private;
|
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->type = GDK_IMAGE_SHARED;
|
||||||
image->visual = visual;
|
image->visual = visual;
|
||||||
image->width = w;
|
image->width = w;
|
||||||
@ -140,7 +149,7 @@ gdk_image_new_with_depth (GdkImageType type,
|
|||||||
gint depth)
|
gint depth)
|
||||||
{
|
{
|
||||||
GdkImage *image;
|
GdkImage *image;
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivateWin32 *private;
|
||||||
Visual *xvisual;
|
Visual *xvisual;
|
||||||
struct {
|
struct {
|
||||||
BITMAPINFOHEADER bmiHeader;
|
BITMAPINFOHEADER bmiHeader;
|
||||||
@ -162,10 +171,11 @@ gdk_image_new_with_depth (GdkImageType type,
|
|||||||
(type == GDK_IMAGE_SHARED_PIXMAP ? "shared_pixmap" :
|
(type == GDK_IMAGE_SHARED_PIXMAP ? "shared_pixmap" :
|
||||||
"???"))));
|
"???"))));
|
||||||
|
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = g_new (GdkImagePrivateWin32, 1);
|
||||||
image = (GdkImage*) private;
|
image = (GdkImage *) private;
|
||||||
|
|
||||||
private->image_put = NULL;
|
private->base.ref_count = 1;
|
||||||
|
private->base.klass = &image_class;
|
||||||
|
|
||||||
image->type = type;
|
image->type = type;
|
||||||
image->visual = visual;
|
image->visual = visual;
|
||||||
@ -175,8 +185,6 @@ gdk_image_new_with_depth (GdkImageType type,
|
|||||||
|
|
||||||
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
|
||||||
|
|
||||||
private->image_put = gdk_image_put_normal;
|
|
||||||
|
|
||||||
bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
|
bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
|
||||||
bmi.bmiHeader.biWidth = width;
|
bmi.bmiHeader.biWidth = width;
|
||||||
bmi.bmiHeader.biHeight = -height;
|
bmi.bmiHeader.biHeight = -height;
|
||||||
@ -300,7 +308,7 @@ gdk_image_get (GdkWindow *window,
|
|||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
GdkImage *image;
|
GdkImage *image;
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivateWin32 *private;
|
||||||
HDC hdc, memdc;
|
HDC hdc, memdc;
|
||||||
struct {
|
struct {
|
||||||
BITMAPINFOHEADER bmiHeader;
|
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_NOTE (MISC, g_print ("gdk_image_get: %#x %dx%d@+%d+%d\n",
|
||||||
GDK_DRAWABLE_XID (window), width, height, x, y));
|
GDK_DRAWABLE_XID (window), width, height, x, y));
|
||||||
|
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = g_new (GdkImagePrivateWin32, 1);
|
||||||
image = (GdkImage*) private;
|
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->type = GDK_IMAGE_SHARED;
|
||||||
image->visual = gdk_window_get_visual (window);
|
image->visual = gdk_window_get_visual (window);
|
||||||
@ -540,12 +549,9 @@ gdk_image_get_pixel (GdkImage *image,
|
|||||||
gint y)
|
gint y)
|
||||||
{
|
{
|
||||||
guint32 pixel;
|
guint32 pixel;
|
||||||
GdkImagePrivate *private;
|
|
||||||
|
|
||||||
g_return_val_if_fail (image != NULL, 0);
|
g_return_val_if_fail (image != NULL, 0);
|
||||||
|
|
||||||
private = (GdkImagePrivate *) image;
|
|
||||||
|
|
||||||
g_return_val_if_fail (x >= 0 && x < image->width
|
g_return_val_if_fail (x >= 0 && x < image->width
|
||||||
&& y >= 0 && y < image->height, 0);
|
&& y >= 0 && y < image->height, 0);
|
||||||
|
|
||||||
@ -585,12 +591,8 @@ gdk_image_put_pixel (GdkImage *image,
|
|||||||
gint y,
|
gint y,
|
||||||
guint32 pixel)
|
guint32 pixel)
|
||||||
{
|
{
|
||||||
GdkImagePrivate *private;
|
|
||||||
|
|
||||||
g_return_if_fail (image != NULL);
|
g_return_if_fail (image != NULL);
|
||||||
|
|
||||||
private = (GdkImagePrivate *) image;
|
|
||||||
|
|
||||||
g_return_if_fail (x >= 0 && x < image->width && y >= 0 && y < image->height);
|
g_return_if_fail (x >= 0 && x < image->width && y >= 0 && y < image->height);
|
||||||
|
|
||||||
if (image->depth == 1)
|
if (image->depth == 1)
|
||||||
@ -617,16 +619,16 @@ gdk_image_put_pixel (GdkImage *image,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gdk_image_destroy (GdkImage *image)
|
gdk_win32_image_destroy (GdkImage *image)
|
||||||
{
|
{
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivateWin32 *private;
|
||||||
|
|
||||||
g_return_if_fail (image != NULL);
|
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,
|
private->ximage,
|
||||||
(image->type == GDK_IMAGE_SHARED_PIXMAP ?
|
(image->type == GDK_IMAGE_SHARED_PIXMAP ?
|
||||||
" (shared pixmap)" : "")));
|
" (shared pixmap)" : "")));
|
||||||
@ -641,7 +643,7 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
|
|
||||||
case GDK_IMAGE_SHARED:
|
case GDK_IMAGE_SHARED:
|
||||||
if (!DeleteObject (private->ximage))
|
if (!DeleteObject (private->ximage))
|
||||||
g_warning ("gdk_image_destroy: DeleteObject failed");
|
g_warning ("gdk_win32_image_destroy: DeleteObject failed");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -652,21 +654,21 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_image_put_normal (GdkDrawable *drawable,
|
gdk_image_put (GdkImage *image,
|
||||||
GdkGC *gc,
|
GdkDrawable *drawable,
|
||||||
GdkImage *image,
|
GdkGC *gc,
|
||||||
gint xsrc,
|
gint xsrc,
|
||||||
gint ysrc,
|
gint ysrc,
|
||||||
gint xdest,
|
gint xdest,
|
||||||
gint ydest,
|
gint ydest,
|
||||||
gint width,
|
gint width,
|
||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
GdkDrawablePrivate *drawable_private;
|
GdkDrawablePrivate *drawable_private;
|
||||||
GdkImagePrivate *image_private;
|
GdkImagePrivateWin32 *image_private;
|
||||||
GdkGCPrivate *gc_private;
|
GdkGCPrivate *gc_private;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
GdkColormapPrivate *colormap_private;
|
GdkColormapPrivateWin32 *colormap_private;
|
||||||
|
|
||||||
g_return_if_fail (drawable != NULL);
|
g_return_if_fail (drawable != NULL);
|
||||||
g_return_if_fail (image != NULL);
|
g_return_if_fail (image != NULL);
|
||||||
@ -674,14 +676,14 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
|||||||
|
|
||||||
if (GDK_DRAWABLE_DESTROYED (drawable))
|
if (GDK_DRAWABLE_DESTROYED (drawable))
|
||||||
return;
|
return;
|
||||||
image_private = (GdkImagePrivate*) image;
|
image_private = (GdkImagePrivateWin32 *) image;
|
||||||
drawable_private = (GdkDrawablePrivate*) drawable;
|
drawable_private = (GdkDrawablePrivate *) drawable;
|
||||||
gc_private = (GdkGCPrivate*) gc;
|
gc_private = (GdkGCPrivate *) gc;
|
||||||
|
|
||||||
/* The image can in fact be "shared", so don't test */
|
/* The image can in fact be "shared", so don't test */
|
||||||
|
|
||||||
hdc = gdk_gc_predraw (drawable_private, gc_private);
|
hdc = gdk_gc_predraw (drawable, gc_private);
|
||||||
colormap_private = (GdkColormapPrivate *) drawable_private->colormap;
|
colormap_private = (GdkColormapPrivateWin32 *) drawable_private->colormap;
|
||||||
if (colormap_private && colormap_private->xcolormap->rc_palette)
|
if (colormap_private && colormap_private->xcolormap->rc_palette)
|
||||||
{
|
{
|
||||||
DIBSECTION ds;
|
DIBSECTION ds;
|
||||||
@ -702,7 +704,7 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
|||||||
if (GetObject (image_private->ximage, sizeof (DIBSECTION),
|
if (GetObject (image_private->ximage, sizeof (DIBSECTION),
|
||||||
&ds) != sizeof (DIBSECTION))
|
&ds) != sizeof (DIBSECTION))
|
||||||
{
|
{
|
||||||
g_warning ("gdk_image_put_normal: GetObject failed");
|
g_warning ("gdk_image_put: GetObject failed");
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
g_print("xdest = %d, ydest = %d, xsrc = %d, ysrc = %d, width = %d, height = %d\n",
|
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)
|
if ((memdc = CreateCompatibleDC (hdc)) == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("gdk_image_put_normal: CreateCompatibleDC failed");
|
g_warning ("gdk_image_put: CreateCompatibleDC failed");
|
||||||
gdk_gc_postdraw (drawable_private, gc_private);
|
gdk_gc_postdraw (drawable, gc_private);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((oldbitmap = SelectObject (memdc, image_private->ximage)) == NULL)
|
if ((oldbitmap = SelectObject (memdc, image_private->ximage)) == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("gdk_image_put_normal: SelectObject #1 failed");
|
g_warning ("gdk_image_put: SelectObject #1 failed");
|
||||||
gdk_gc_postdraw (drawable_private, gc_private);
|
gdk_gc_postdraw (drawable, gc_private);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!BitBlt (hdc, xdest, ydest, width, height,
|
if (!BitBlt (hdc, xdest, ydest, width, height,
|
||||||
memdc, xsrc, ysrc, SRCCOPY))
|
memdc, xsrc, ysrc, SRCCOPY))
|
||||||
g_warning ("gdk_image_put_normal: BitBlt failed");
|
g_warning ("gdk_image_put: BitBlt failed");
|
||||||
|
|
||||||
if (SelectObject (memdc, oldbitmap) == NULL)
|
if (SelectObject (memdc, oldbitmap) == NULL)
|
||||||
g_warning ("gdk_image_put_normal: SelectObject #2 failed");
|
g_warning ("gdk_image_put_normal: SelectObject #2 failed");
|
||||||
|
|
||||||
if (!DeleteDC (memdc))
|
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 "gdk.h"
|
||||||
#include "gdkinput.h"
|
#include "gdkinput.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkx.h"
|
#include "gdkwin32.h"
|
||||||
|
|
||||||
#ifdef HAVE_WINTAB
|
#ifdef HAVE_WINTAB
|
||||||
#include <wintab.h>
|
#include <wintab.h>
|
||||||
@ -78,8 +78,8 @@ struct _GdkDevicePrivate {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef G_PI
|
||||||
#define M_PI 3.14159265358979323846
|
#define G_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If USE_SYSCONTEXT is on, we open the Wintab device (hmm, what if
|
/* If USE_SYSCONTEXT is on, we open the Wintab device (hmm, what if
|
||||||
@ -94,7 +94,7 @@ struct _GdkDevicePrivate {
|
|||||||
#define DEBUG_WINTAB 1
|
#define DEBUG_WINTAB 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TWOPI (2.*M_PI)
|
#define TWOPI (2.*G_PI)
|
||||||
|
|
||||||
#define PING() g_print("%s: %d\n",__FILE__,__LINE__)
|
#define PING() g_print("%s: %d\n",__FILE__,__LINE__)
|
||||||
|
|
||||||
@ -289,7 +289,6 @@ gdk_input_init (void)
|
|||||||
guint32 deviceid_counter = 0;
|
guint32 deviceid_counter = 0;
|
||||||
#ifdef HAVE_WINTAB
|
#ifdef HAVE_WINTAB
|
||||||
GdkDevicePrivate *gdkdev;
|
GdkDevicePrivate *gdkdev;
|
||||||
GdkDrawablePrivate *window_private;
|
|
||||||
GdkWindowAttr wa;
|
GdkWindowAttr wa;
|
||||||
WORD specversion;
|
WORD specversion;
|
||||||
LOGCONTEXT defcontext;
|
LOGCONTEXT defcontext;
|
||||||
@ -341,7 +340,6 @@ gdk_input_init (void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gdk_window_ref (wintab_window);
|
gdk_window_ref (wintab_window);
|
||||||
window_private = (GdkDrawablePrivate *) wintab_window;
|
|
||||||
|
|
||||||
for (devix = 0; devix < ndevices; devix++)
|
for (devix = 0; devix < ndevices; devix++)
|
||||||
{
|
{
|
||||||
@ -420,7 +418,7 @@ gdk_input_init (void)
|
|||||||
print_lc(&lc)));
|
print_lc(&lc)));
|
||||||
#endif
|
#endif
|
||||||
hctx = g_new (HCTX, 1);
|
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");
|
g_warning ("gdk_input_init: WTOpen failed");
|
||||||
return;
|
return;
|
||||||
@ -991,7 +989,6 @@ gdk_input_win32_other_event (GdkEvent *event,
|
|||||||
GdkWindow *current_window;
|
GdkWindow *current_window;
|
||||||
GdkInputWindow *input_window;
|
GdkInputWindow *input_window;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *window_private;
|
|
||||||
GdkDevicePrivate *gdkdev;
|
GdkDevicePrivate *gdkdev;
|
||||||
GdkEventMask masktest;
|
GdkEventMask masktest;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
@ -1009,12 +1006,10 @@ gdk_input_win32_other_event (GdkEvent *event,
|
|||||||
#if USE_SYSCONTEXT
|
#if USE_SYSCONTEXT
|
||||||
window = gdk_window_at_pointer (&x, &y);
|
window = gdk_window_at_pointer (&x, &y);
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
window = (GdkWindow *) gdk_root_parent;
|
window = gdk_parent_root;
|
||||||
|
|
||||||
gdk_window_ref (window);
|
gdk_window_ref (window);
|
||||||
|
|
||||||
window_private = (GdkWindowPrivate *) window;
|
|
||||||
|
|
||||||
GDK_NOTE (EVENTS,
|
GDK_NOTE (EVENTS,
|
||||||
g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n",
|
g_print ("gdk_input_win32_other_event: window=%#x (%d,%d)\n",
|
||||||
GDK_DRAWABLE_XID (window), x, y));
|
GDK_DRAWABLE_XID (window), x, y));
|
||||||
@ -1039,7 +1034,7 @@ gdk_input_win32_other_event (GdkEvent *event,
|
|||||||
switch (xevent->message)
|
switch (xevent->message)
|
||||||
{
|
{
|
||||||
case WT_PACKET:
|
case WT_PACKET:
|
||||||
if (window_private == gdk_root_parent)
|
if (window == gdk_parent_root)
|
||||||
{
|
{
|
||||||
GDK_NOTE (EVENTS, g_print ("...is root\n"));
|
GDK_NOTE (EVENTS, g_print ("...is root\n"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1102,21 +1097,20 @@ gdk_input_win32_other_event (GdkEvent *event,
|
|||||||
* propagate if necessary.
|
* propagate if necessary.
|
||||||
*/
|
*/
|
||||||
dijkstra:
|
dijkstra:
|
||||||
if (!window_private->extension_events_selected
|
if (!GDK_WINDOW_WIN32DATA (window)->extension_events_selected
|
||||||
|| !(window_private->extension_events & masktest))
|
|| !(GDK_WINDOW_WIN32DATA (window)->extension_events & masktest))
|
||||||
{
|
{
|
||||||
GDK_NOTE (EVENTS, g_print ("...not selected\n"));
|
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;
|
return FALSE;
|
||||||
|
|
||||||
pt.x = x;
|
pt.x = x;
|
||||||
pt.y = y;
|
pt.y = y;
|
||||||
ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
|
ClientToScreen (GDK_DRAWABLE_XID (window), &pt);
|
||||||
gdk_window_unref (window);
|
gdk_window_unref (window);
|
||||||
window = window_private->parent;
|
window = ((GdkWindowPrivate *) window)->parent;
|
||||||
gdk_window_ref (window);
|
gdk_window_ref (window);
|
||||||
window_private = (GdkWindowPrivate *) window;
|
|
||||||
ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
|
ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
|
||||||
x = pt.x;
|
x = pt.x;
|
||||||
y = pt.y;
|
y = pt.y;
|
||||||
@ -1263,9 +1257,7 @@ static gint
|
|||||||
gdk_input_win32_enable_window (GdkWindow *window,
|
gdk_input_win32_enable_window (GdkWindow *window,
|
||||||
GdkDevicePrivate *gdkdev)
|
GdkDevicePrivate *gdkdev)
|
||||||
{
|
{
|
||||||
GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
|
GDK_WINDOW_WIN32DATA (window)->extension_events_selected = TRUE;
|
||||||
|
|
||||||
window_private->extension_events_selected = TRUE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1273,9 +1265,7 @@ static gint
|
|||||||
gdk_input_win32_disable_window (GdkWindow *window,
|
gdk_input_win32_disable_window (GdkWindow *window,
|
||||||
GdkDevicePrivate *gdkdev)
|
GdkDevicePrivate *gdkdev)
|
||||||
{
|
{
|
||||||
GdkWindowPrivate *window_private = (GdkWindowPrivate *) window;
|
GDK_WINDOW_WIN32DATA (window)->extension_events_selected = FALSE;
|
||||||
|
|
||||||
window_private->extension_events_selected = FALSE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1483,23 +1473,19 @@ gdk_input_window_find (GdkWindow *window)
|
|||||||
static GdkInputWindow *
|
static GdkInputWindow *
|
||||||
gdk_input_window_find_within (GdkWindow *window)
|
gdk_input_window_find_within (GdkWindow *window)
|
||||||
{
|
{
|
||||||
GList *tmp_list;
|
GList *list;
|
||||||
GdkWindowPrivate *window_private;
|
GdkWindow *tmpw;
|
||||||
GdkWindowPrivate *tmp_private;
|
|
||||||
GdkInputWindow *candidate = NULL;
|
GdkInputWindow *candidate = NULL;
|
||||||
|
|
||||||
window_private = (GdkWindowPrivate *) window;
|
for (list = gdk_input_windows; list != NULL; list = list->next)
|
||||||
|
|
||||||
for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next)
|
|
||||||
{
|
{
|
||||||
(GdkWindowPrivate *) tmp_private =
|
tmpw = ((GdkInputWindow *) (tmp_list->data))->window;
|
||||||
(GdkWindowPrivate *) (((GdkInputWindow *)(tmp_list->data))->window);
|
if (tmpw == window
|
||||||
if (tmp_private == window_private
|
|| IsChild (GDK_DRAWABLE_XID (window), GDK_DRAWABLE_XID (tmpw)))
|
||||||
|| IsChild (window_private->xwindow, tmp_private->xwindow))
|
|
||||||
{
|
{
|
||||||
if (candidate)
|
if (candidate)
|
||||||
return NULL; /* Multiple hits */
|
return NULL; /* Multiple hits */
|
||||||
candidate = (GdkInputWindow *)(tmp_list->data);
|
candidate = (GdkInputWindow *) (list->data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,36 +34,28 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
||||||
#include "gdk.h"
|
#include "gdk.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate-win32.h"
|
||||||
#include "gdkinputprivate.h"
|
#include "gdkinputprivate.h"
|
||||||
#include "gdkkeysyms.h"
|
#include "gdkkeysyms.h"
|
||||||
|
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
|
|
||||||
static void gdkx_XConvertCase (KeySym symbol,
|
static gboolean gdk_synchronize = FALSE;
|
||||||
KeySym *lower,
|
|
||||||
KeySym *upper);
|
|
||||||
static void gdk_exit_func (void);
|
|
||||||
|
|
||||||
|
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
|
/* 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
|
int __stdcall
|
||||||
DllMain(HINSTANCE hinstDLL,
|
DllMain(HINSTANCE hinstDLL,
|
||||||
@ -75,163 +67,21 @@ DllMain(HINSTANCE hinstDLL,
|
|||||||
return TRUE;
|
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
|
gboolean
|
||||||
gdk_init_check (int *argc,
|
_gdk_windowing_init_check (int argc,
|
||||||
char ***argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
gint i, j, k;
|
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)
|
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
|
||||||
gdk_input_ignore_wintab = TRUE;
|
gdk_input_ignore_wintab = TRUE;
|
||||||
|
|
||||||
if (getenv ("GDK_EVENT_FUNC_FROM_WINDOW_PROC") != NULL)
|
if (getenv ("GDK_EVENT_FUNC_FROM_WINDOW_PROC") != NULL)
|
||||||
gdk_event_func_from_window_proc = TRUE;
|
gdk_event_func_from_window_proc = TRUE;
|
||||||
|
|
||||||
if (argc && argv)
|
if (gdk_synchronize)
|
||||||
{
|
GdiSetBatchLimit (1);
|
||||||
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 (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_ProgInstance = GetModuleHandle (NULL);
|
||||||
gdk_DC = CreateDC ("DISPLAY", NULL, NULL, NULL);
|
gdk_DC = CreateDC ("DISPLAY", NULL, NULL, NULL);
|
||||||
gdk_root_window = GetDesktopWindow ();
|
gdk_root_window = GetDesktopWindow ();
|
||||||
@ -248,61 +98,11 @@ gdk_init_check (int *argc,
|
|||||||
gdk_win32_dropfiles_atom = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
gdk_win32_dropfiles_atom = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
||||||
gdk_ole2_dnd_atom = gdk_atom_intern ("OLE2_DND", FALSE);
|
gdk_ole2_dnd_atom = gdk_atom_intern ("OLE2_DND", FALSE);
|
||||||
|
|
||||||
gdk_progclass = g_basename (g_get_prgname ());
|
gdk_win32_selection_init ();
|
||||||
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;
|
|
||||||
|
|
||||||
return TRUE;
|
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
|
void
|
||||||
gdk_set_use_xshm (gint use_xshm)
|
gdk_set_use_xshm (gint use_xshm)
|
||||||
{
|
{
|
||||||
@ -333,11 +133,7 @@ gdk_get_use_xshm (void)
|
|||||||
gint
|
gint
|
||||||
gdk_screen_width (void)
|
gdk_screen_width (void)
|
||||||
{
|
{
|
||||||
gint return_val;
|
return ((GdkWindowPrivate *) gdk_parent_root)->drawable.width;
|
||||||
|
|
||||||
return_val = gdk_root_parent->drawable.width;
|
|
||||||
|
|
||||||
return return_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -358,11 +154,7 @@ gdk_screen_width (void)
|
|||||||
gint
|
gint
|
||||||
gdk_screen_height (void)
|
gdk_screen_height (void)
|
||||||
{
|
{
|
||||||
gint return_val;
|
return ((GdkWindowPrivate *) gdk_parent_root)->drawable.height;
|
||||||
|
|
||||||
return_val = gdk_root_parent->drawable.height;
|
|
||||||
|
|
||||||
return return_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -383,14 +175,7 @@ gdk_screen_height (void)
|
|||||||
gint
|
gint
|
||||||
gdk_screen_width_mm (void)
|
gdk_screen_width_mm (void)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
return GetDeviceCaps (gdk_DC, HORZSIZE);
|
||||||
gint return_val;
|
|
||||||
|
|
||||||
hdc = GetDC (NULL);
|
|
||||||
return_val = GetDeviceCaps (hdc, HORZSIZE);
|
|
||||||
ReleaseDC (NULL, hdc);
|
|
||||||
|
|
||||||
return return_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -411,14 +196,7 @@ gdk_screen_width_mm (void)
|
|||||||
gint
|
gint
|
||||||
gdk_screen_height_mm (void)
|
gdk_screen_height_mm (void)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
return GetDeviceCaps (gdk_DC, VERTSIZE);
|
||||||
gint return_val;
|
|
||||||
|
|
||||||
hdc = GetDC (NULL);
|
|
||||||
return_val = GetDeviceCaps (hdc, VERTSIZE);
|
|
||||||
ReleaseDC (NULL, hdc);
|
|
||||||
|
|
||||||
return return_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -433,245 +211,25 @@ gdk_key_repeat_restore (void)
|
|||||||
/* XXX */
|
/* 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
|
void
|
||||||
gdk_beep (void)
|
gdk_beep (void)
|
||||||
{
|
{
|
||||||
Beep(1000, 50);
|
Beep(1000, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void
|
||||||
*--------------------------------------------------------------
|
gdk_windowing_exit (void)
|
||||||
* 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)
|
|
||||||
{
|
{
|
||||||
static gboolean in_gdk_exit_func = FALSE;
|
gdk_win32_dnd_exit ();
|
||||||
|
CoUninitialize ();
|
||||||
GDK_NOTE (MISC, g_print ("gdk_exit_func\n"));
|
DeleteDC (gdk_DC);
|
||||||
/* This is to avoid an infinite loop if a program segfaults in
|
gdk_DC = NULL;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
gdk_get_display(void)
|
gdk_get_display(void)
|
||||||
{
|
{
|
||||||
return "local:";
|
return "Win32";
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************
|
|
||||||
* 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 */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct gdk_key {
|
static struct gdk_key {
|
||||||
@ -2044,72 +1602,3 @@ gdk_keyval_from_name (const gchar *keyval_name)
|
|||||||
else
|
else
|
||||||
return GDK_VoidSymbol;
|
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 "gdkpixmap.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkx.h"
|
#include "gdkwin32.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -49,6 +49,49 @@ typedef struct
|
|||||||
gulong pixels[1];
|
gulong pixels[1];
|
||||||
} _GdkPixmapInfo;
|
} _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*
|
GdkPixmap*
|
||||||
gdk_pixmap_new (GdkWindow *window,
|
gdk_pixmap_new (GdkWindow *window,
|
||||||
gint width,
|
gint width,
|
||||||
@ -57,7 +100,6 @@ gdk_pixmap_new (GdkWindow *window,
|
|||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
GdkPixmap *pixmap;
|
||||||
GdkDrawablePrivate *private;
|
GdkDrawablePrivate *private;
|
||||||
GdkWindowPrivate *window_private;
|
|
||||||
struct {
|
struct {
|
||||||
BITMAPINFOHEADER bmiHeader;
|
BITMAPINFOHEADER bmiHeader;
|
||||||
union {
|
union {
|
||||||
@ -77,11 +119,10 @@ gdk_pixmap_new (GdkWindow *window,
|
|||||||
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
window = (GdkWindow*) gdk_root_parent;
|
window = gdk_parent_root;
|
||||||
|
|
||||||
if (GDK_DRAWABLE_DESTROYED (window))
|
if (GDK_DRAWABLE_DESTROYED (window))
|
||||||
return NULL;
|
return NULL;
|
||||||
window_private = (GdkWindowPrivate*) window;
|
|
||||||
|
|
||||||
if (depth == -1)
|
if (depth == -1)
|
||||||
depth = gdk_drawable_get_visual (window)->depth;
|
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",
|
GDK_NOTE (MISC, g_print ("gdk_pixmap_new: %dx%dx%d\n",
|
||||||
width, height, depth));
|
width, height, depth));
|
||||||
|
|
||||||
private = g_new0 (GdkDrawablePrivate, 1);
|
pixmap = gdk_win32_pixmap_alloc ();
|
||||||
pixmap = (GdkPixmap*) private;
|
private = (GdkDrawablePrivate *) pixmap;
|
||||||
|
|
||||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
|
||||||
|
|
||||||
visual = gdk_drawable_get_visual (window);
|
visual = gdk_drawable_get_visual (window);
|
||||||
|
|
||||||
@ -139,7 +178,7 @@ gdk_pixmap_new (GdkWindow *window,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
private->colormap = window_private->drawable.colormap;
|
private->colormap = ((GdkWindowPrivate *) window)->drawable.colormap;
|
||||||
if (private->colormap == NULL)
|
if (private->colormap == NULL)
|
||||||
private->colormap = gdk_colormap_get_system ();
|
private->colormap = gdk_colormap_get_system ();
|
||||||
|
|
||||||
@ -164,25 +203,23 @@ gdk_pixmap_new (GdkWindow *window,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((private->xwindow =
|
if ((GDK_DRAWABLE_WIN32DATA (pixmap)->xid =
|
||||||
CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
||||||
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
|
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("gdk_pixmap_new: CreateDIBSection failed: %d", GetLastError ());
|
g_warning ("gdk_pixmap_new: CreateDIBSection failed: %d", GetLastError ());
|
||||||
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
|
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
|
||||||
g_free (private);
|
g_free (pixmap);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ReleaseDC (GDK_DRAWABLE_XID (window), hdc);
|
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->width = width;
|
||||||
private->height = height;
|
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;
|
return pixmap;
|
||||||
}
|
}
|
||||||
@ -196,13 +233,10 @@ gdk_pixmap_create_on_shared_image (GdkImage **image_return,
|
|||||||
gint depth)
|
gint depth)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
GdkPixmap *pixmap;
|
||||||
GdkImagePrivate *image_private;
|
|
||||||
GdkDrawablePrivate *private;
|
GdkDrawablePrivate *private;
|
||||||
GdkWindowPrivate *window_private;
|
|
||||||
|
|
||||||
g_return_val_if_fail (window != NULL, NULL);
|
g_return_val_if_fail (window != NULL, NULL);
|
||||||
|
|
||||||
window_private = (GdkWindowPrivate *) window;
|
|
||||||
|
|
||||||
if (depth == 1)
|
if (depth == 1)
|
||||||
*image_return = gdk_image_bitmap_new (GDK_IMAGE_SHARED_PIXMAP, visual, width, height);
|
*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);
|
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);
|
GDK_DRAWABLE_WIN32DATA (pixmap)->xid =
|
||||||
pixmap = (GdkPixmap*) private;
|
((GdkImagePrivateWin32 *) *image_return)->ximage;
|
||||||
|
private->colormap = ((GdkWindowPrivate *) window)->drawable.colormap;
|
||||||
private->xwindow = image_private->ximage;
|
|
||||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
|
||||||
private->colormap = window_private->drawable.colormap;
|
|
||||||
private->width = width;
|
private->width = width;
|
||||||
private->height = height;
|
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,
|
GDK_NOTE (MISC,
|
||||||
g_print ("gdk_pixmap_create_on_shared_image: %dx%dx%d = %#x\n",
|
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;
|
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);
|
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
window = (GdkWindow*) gdk_root_parent;
|
window = gdk_parent_root;
|
||||||
|
|
||||||
if (GDK_DRAWABLE_DESTROYED (window))
|
if (GDK_DRAWABLE_DESTROYED (window))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
private = g_new0 (GdkDrawablePrivate, 1);
|
pixmap = gdk_win32_pixmap_alloc ();
|
||||||
pixmap = (GdkPixmap*) private;
|
private = (GdkDrawablePrivate *) pixmap;
|
||||||
|
|
||||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
|
||||||
private->width = width;
|
private->width = width;
|
||||||
private->height = height;
|
private->height = height;
|
||||||
private->ref_count = 1;
|
|
||||||
private->destroyed = FALSE;
|
|
||||||
|
|
||||||
bpl = ((width - 1) / 8 + 1);
|
bpl = ((width - 1) / 8 + 1);
|
||||||
aligned_bpl = ((bpl - 1) / 2 + 1) * 2;
|
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 (i = 0; i < height; i++)
|
||||||
for (j = 0; j < bpl; j++)
|
for (j = 0; j < bpl; j++)
|
||||||
bits[i*aligned_bpl + j] = mirror[(guchar) data[i*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",
|
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);
|
g_free (bits);
|
||||||
|
|
||||||
private->colormap = NULL;
|
private->colormap = NULL;
|
||||||
gdk_xid_table_insert (&private->xwindow, pixmap);
|
gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap);
|
||||||
|
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
@ -341,8 +369,8 @@ gdk_pixmap_create_from_data (GdkWindow *window,
|
|||||||
GdkGC *gc = gdk_gc_new (result);
|
GdkGC *gc = gdk_gc_new (result);
|
||||||
gdk_gc_set_foreground (gc, fg);
|
gdk_gc_set_foreground (gc, fg);
|
||||||
gdk_gc_set_background (gc, bg);
|
gdk_gc_set_background (gc, bg);
|
||||||
gdk_draw_pixmap (result, gc, source, 0, 0, 0, 0, width, height);
|
gdk_draw_drawable (result, gc, source, 0, 0, 0, 0, width, height);
|
||||||
gdk_pixmap_unref (source);
|
gdk_drawable_unref (source);
|
||||||
gdk_gc_unref (gc);
|
gdk_gc_unref (gc);
|
||||||
|
|
||||||
GDK_NOTE (MISC, g_print ("gdk_pixmap_create_from_data: %dx%dx%d = %#x\n",
|
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");
|
g_warning ("Creating pixmap from xpm with NULL window and colormap");
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
window = (GdkWindow *) gdk_root_parent;
|
window = gdk_parent_root;
|
||||||
|
|
||||||
if (colormap == NULL)
|
if (colormap == NULL)
|
||||||
{
|
{
|
||||||
colormap = gdk_window_get_colormap (window);
|
colormap = gdk_drawable_get_colormap (window);
|
||||||
visual = gdk_window_get_visual (window);
|
visual = gdk_drawable_get_visual (window);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
visual = ((GdkColormapPrivate *)colormap)->visual;
|
visual = ((GdkColormapPrivate *)colormap)->visual;
|
||||||
@ -761,7 +789,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
|||||||
error:
|
error:
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
gdk_gc_destroy (gc);
|
gdk_gc_unref (gc);
|
||||||
|
|
||||||
if (image != NULL)
|
if (image != NULL)
|
||||||
{
|
{
|
||||||
@ -774,8 +802,8 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
|
|||||||
gc = gdk_gc_new (pixmap);
|
gc = gdk_gc_new (pixmap);
|
||||||
gdk_gc_set_foreground (gc, transparent_color);
|
gdk_gc_set_foreground (gc, transparent_color);
|
||||||
gdk_draw_image (pixmap, gc, image, 0, 0, 0, 0, image->width, image->height);
|
gdk_draw_image (pixmap, gc, image, 0, 0, 0, 0, image->width, image->height);
|
||||||
gdk_gc_destroy (gc);
|
gdk_gc_unref (gc);
|
||||||
gdk_image_destroy (image);
|
gdk_image_unref (image);
|
||||||
}
|
}
|
||||||
else if (color_info)
|
else if (color_info)
|
||||||
gdk_xpm_destroy_notify (color_info);
|
gdk_xpm_destroy_notify (color_info);
|
||||||
@ -859,7 +887,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
|||||||
const gchar *filename)
|
const gchar *filename)
|
||||||
{
|
{
|
||||||
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
|
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
|
||||||
transparent_color, filename);
|
transparent_color, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mem_handle
|
struct mem_handle
|
||||||
@ -917,7 +945,6 @@ gdk_pixmap_foreign_new (guint32 anid)
|
|||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
GdkPixmap *pixmap;
|
||||||
GdkDrawablePrivate *private;
|
GdkDrawablePrivate *private;
|
||||||
GdkWindowPrivate *window_private;
|
|
||||||
HBITMAP xpixmap;
|
HBITMAP xpixmap;
|
||||||
SIZE size;
|
SIZE size;
|
||||||
unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret;
|
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 */
|
/* set the pixmap to the passed in value */
|
||||||
xpixmap = (HBITMAP) anid;
|
xpixmap = (HBITMAP) anid;
|
||||||
/* get the root window */
|
|
||||||
window_private = gdk_root_parent;
|
|
||||||
|
|
||||||
/* get information about the BITMAP to fill in the structure for
|
/* get information about the BITMAP to fill in the structure for
|
||||||
the gdk window */
|
the gdk window */
|
||||||
@ -938,65 +963,15 @@ gdk_pixmap_foreign_new (guint32 anid)
|
|||||||
h_ret = size.cy;
|
h_ret = size.cy;
|
||||||
|
|
||||||
/* allocate a new gdk pixmap */
|
/* allocate a new gdk pixmap */
|
||||||
private = g_new (GdkDrawablePrivate, 1);
|
pixmap = gdk_win32_pixmap_alloc ();
|
||||||
pixmap = (GdkPixmap *)private;
|
private = (GdkDrawablePrivate *) pixmap;
|
||||||
|
|
||||||
private->window_type = GDK_DRAWABLE_PIXMAP;
|
GDK_DRAWABLE_WIN32DATA (pixmap)->xid = xpixmap;
|
||||||
private->xwindow = xpixmap;
|
|
||||||
private->colormap = NULL;
|
private->colormap = NULL;
|
||||||
private->width = w_ret;
|
private->width = w_ret;
|
||||||
private->height = h_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;
|
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;
|
HRGN xregion;
|
||||||
};
|
};
|
||||||
|
|
||||||
void gdk_selection_init (void);
|
void gdk_win32_selection_init (void);
|
||||||
void gdk_dnd_exit (void);
|
void gdk_win32_dnd_exit (void);
|
||||||
|
|
||||||
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
|
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
|
||||||
GdkVisual* gdk_visual_lookup (Visual *xvisual);
|
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 LRESULT CALLBACK gdk_WindowProc (HWND, UINT, WPARAM, LPARAM);
|
||||||
|
|
||||||
|
extern GdkDrawableClass _gdk_win32_drawable_class;
|
||||||
extern HWND gdk_root_window;
|
extern HWND gdk_root_window;
|
||||||
GDKVAR ATOM gdk_selection_property;
|
GDKVAR ATOM gdk_selection_property;
|
||||||
GDKVAR gchar *gdk_progclass;
|
GDKVAR gchar *gdk_progclass;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "gdkproperty.h"
|
#include "gdkproperty.h"
|
||||||
#include "gdkselection.h"
|
#include "gdkselection.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkx.h"
|
#include "gdkwin32.h"
|
||||||
|
|
||||||
GdkAtom
|
GdkAtom
|
||||||
gdk_atom_intern (const gchar *atom_name,
|
gdk_atom_intern (const gchar *atom_name,
|
||||||
@ -119,6 +119,12 @@ gdk_property_get (GdkWindow *window,
|
|||||||
gint *actual_length,
|
gint *actual_length,
|
||||||
guchar **data)
|
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");
|
g_warning ("gdk_property_get: Not implemented");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -138,10 +144,13 @@ gdk_property_change (GdkWindow *window,
|
|||||||
gchar *prop_name, *type_name;
|
gchar *prop_name, *type_name;
|
||||||
guchar *ptr;
|
guchar *ptr;
|
||||||
|
|
||||||
|
g_return_if_fail (window != NULL);
|
||||||
|
g_return_if_fail (!GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
if (GDK_DRAWABLE_DESTROYED (window))
|
if (GDK_DRAWABLE_DESTROYED (window))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(prop_name = gdk_atom_name (property),
|
(prop_name = gdk_atom_name (property),
|
||||||
type_name = gdk_atom_name (type),
|
type_name = gdk_atom_name (type),
|
||||||
g_print ("gdk_property_change: %#x %#x (%s) %#x (%s) %s %d*%d bytes %.10s\n",
|
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')
|
if (*ptr++ == '\n')
|
||||||
length++;
|
length++;
|
||||||
#if 1
|
#if 1
|
||||||
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n",
|
GDK_NOTE (MISC, g_print ("...OpenClipboard(%#x)\n",
|
||||||
GDK_DRAWABLE_XID (window)));
|
GDK_DRAWABLE_XID (window)));
|
||||||
if (!OpenClipboard (GDK_DRAWABLE_XID (window)))
|
if (!OpenClipboard (GDK_DRAWABLE_XID (window)))
|
||||||
{
|
{
|
||||||
g_warning ("gdk_property_change: OpenClipboard failed");
|
g_warning ("gdk_property_change: OpenClipboard failed");
|
||||||
@ -176,7 +185,7 @@ gdk_property_change (GdkWindow *window,
|
|||||||
#endif
|
#endif
|
||||||
hdata = GlobalAlloc (GMEM_MOVEABLE|GMEM_DDESHARE, length + 1);
|
hdata = GlobalAlloc (GMEM_MOVEABLE|GMEM_DDESHARE, length + 1);
|
||||||
ptr = GlobalLock (hdata);
|
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++)
|
for (i = 0; i < nelements; i++)
|
||||||
{
|
{
|
||||||
@ -186,13 +195,13 @@ gdk_property_change (GdkWindow *window,
|
|||||||
}
|
}
|
||||||
*ptr++ = '\0';
|
*ptr++ = '\0';
|
||||||
GlobalUnlock (hdata);
|
GlobalUnlock (hdata);
|
||||||
GDK_NOTE (SELECTION, g_print ("...SetClipboardData(CF_TEXT, %#x)\n",
|
GDK_NOTE (MISC, g_print ("...SetClipboardData(CF_TEXT, %#x)\n",
|
||||||
hdata));
|
hdata));
|
||||||
if (!SetClipboardData(CF_TEXT, hdata))
|
if (!SetClipboardData(CF_TEXT, hdata))
|
||||||
g_warning ("gdk_property_change: SetClipboardData failed: %d",
|
g_warning ("gdk_property_change: SetClipboardData failed: %d",
|
||||||
GetLastError ());
|
GetLastError ());
|
||||||
#if 1
|
#if 1
|
||||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||||
if (!CloseClipboard ())
|
if (!CloseClipboard ())
|
||||||
{
|
{
|
||||||
g_warning ("gdk_property_change: CloseClipboard failed");
|
g_warning ("gdk_property_change: CloseClipboard failed");
|
||||||
@ -211,10 +220,10 @@ gdk_property_delete (GdkWindow *window,
|
|||||||
gchar *prop_name, *type_name;
|
gchar *prop_name, *type_name;
|
||||||
extern void gdk_selection_property_delete (GdkWindow *);
|
extern void gdk_selection_property_delete (GdkWindow *);
|
||||||
|
|
||||||
if (GDK_DRAWABLE_DESTROYED (window))
|
g_return_if_fail (window != NULL);
|
||||||
return;
|
g_return_if_fail (!GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(prop_name = gdk_atom_name (property),
|
(prop_name = gdk_atom_name (property),
|
||||||
g_print ("gdk_property_delete: %#x %#x (%s)\n",
|
g_print ("gdk_property_delete: %#x %#x (%s)\n",
|
||||||
(window ? GDK_DRAWABLE_XID (window) : 0),
|
(window ? GDK_DRAWABLE_XID (window) : 0),
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gdk.h"
|
#include "gdk.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate-win32.h"
|
||||||
|
|
||||||
|
|
||||||
GdkRegion*
|
GdkRegion*
|
||||||
@ -274,9 +274,10 @@ gdk_region_union_with_rect (GdkRegion *region,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkRegion*
|
static GdkRegion *
|
||||||
gdk_regions_intersect (GdkRegion *source1,
|
gdk_regions_op (GdkRegion *source1,
|
||||||
GdkRegion *source2)
|
GdkRegion *source2,
|
||||||
|
guint op)
|
||||||
{
|
{
|
||||||
GdkRegionPrivate *private1;
|
GdkRegionPrivate *private1;
|
||||||
GdkRegionPrivate *private2;
|
GdkRegionPrivate *private2;
|
||||||
@ -292,76 +293,34 @@ gdk_regions_intersect (GdkRegion *source1,
|
|||||||
res = gdk_region_new ();
|
res = gdk_region_new ();
|
||||||
res_private = (GdkRegionPrivate *) res;
|
res_private = (GdkRegionPrivate *) res;
|
||||||
|
|
||||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
CombineRgn (res_private->xregion, private1->xregion, private2->xregion, op);
|
||||||
RGN_AND);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkRegion*
|
GdkRegion*
|
||||||
gdk_regions_union (GdkRegion *source1,
|
gdk_regions_intersect (GdkRegion *source1,
|
||||||
GdkRegion *source2)
|
GdkRegion *source2)
|
||||||
{
|
{
|
||||||
GdkRegionPrivate *private1;
|
return gdk_regions_op (source1, source2, RGN_AND);
|
||||||
GdkRegionPrivate *private2;
|
}
|
||||||
GdkRegion *res;
|
|
||||||
GdkRegionPrivate *res_private;
|
|
||||||
|
|
||||||
g_return_val_if_fail (source1 != NULL, NULL);
|
GdkRegion*
|
||||||
g_return_val_if_fail (source2 != NULL, NULL);
|
gdk_regions_union (GdkRegion *source1,
|
||||||
|
GdkRegion *source2)
|
||||||
private1 = (GdkRegionPrivate *) source1;
|
{
|
||||||
private2 = (GdkRegionPrivate *) source2;
|
return gdk_regions_op (source1, source2, RGN_OR);
|
||||||
|
|
||||||
res = gdk_region_new ();
|
|
||||||
res_private = (GdkRegionPrivate *) res;
|
|
||||||
|
|
||||||
CombineRgn (res_private->xregion, private1->xregion, private2->xregion,
|
|
||||||
RGN_OR);
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkRegion*
|
GdkRegion*
|
||||||
gdk_regions_subtract (GdkRegion *source1,
|
gdk_regions_subtract (GdkRegion *source1,
|
||||||
GdkRegion *source2)
|
GdkRegion *source2)
|
||||||
{
|
{
|
||||||
GdkRegionPrivate *private1;
|
return gdk_regions_op (source1, source2, RGN_DIFF);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkRegion*
|
GdkRegion*
|
||||||
gdk_regions_xor (GdkRegion *source1,
|
gdk_regions_xor (GdkRegion *source1,
|
||||||
GdkRegion *source2)
|
GdkRegion *source2)
|
||||||
{
|
{
|
||||||
GdkRegionPrivate *private1;
|
return gdk_regions_op (source1, source2, RGN_XOR);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include "gdkx.h"
|
#include "gdkwin32.h"
|
||||||
|
|
||||||
/* We emulate the GDK_SELECTION window properties by storing
|
/* We emulate the GDK_SELECTION window properties by storing
|
||||||
* it's data in a per-window hashtable.
|
* it's data in a per-window hashtable.
|
||||||
@ -45,7 +45,7 @@ typedef struct {
|
|||||||
static GHashTable *sel_prop_table = NULL;
|
static GHashTable *sel_prop_table = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_selection_init (void)
|
gdk_win32_selection_init (void)
|
||||||
{
|
{
|
||||||
if (sel_prop_table == NULL)
|
if (sel_prop_table == NULL)
|
||||||
sel_prop_table = g_hash_table_new (g_int_hash, g_int_equal);
|
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;
|
gchar *sel_name;
|
||||||
HWND xwindow;
|
HWND xwindow;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(sel_name = gdk_atom_name (selection),
|
(sel_name = gdk_atom_name (selection),
|
||||||
g_print ("gdk_selection_owner_set: %#x %#x (%s)\n",
|
g_print ("gdk_selection_owner_set: %#x %#x (%s)\n",
|
||||||
(owner ? GDK_DRAWABLE_XID (owner) : 0),
|
(owner ? GDK_DRAWABLE_XID (owner) : 0),
|
||||||
@ -98,13 +98,13 @@ gdk_selection_owner_set (GdkWindow *owner,
|
|||||||
else
|
else
|
||||||
xwindow = NULL;
|
xwindow = NULL;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION, g_print ("...OpenClipboard(%#x)\n", xwindow));
|
GDK_NOTE (MISC, g_print ("...OpenClipboard(%#x)\n", xwindow));
|
||||||
if (!OpenClipboard (xwindow))
|
if (!OpenClipboard (xwindow))
|
||||||
{
|
{
|
||||||
g_warning ("gdk_selection_owner_set: OpenClipboard failed");
|
g_warning ("gdk_selection_owner_set: OpenClipboard failed");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GDK_NOTE (SELECTION, g_print ("...EmptyClipboard()\n"));
|
GDK_NOTE (MISC, g_print ("...EmptyClipboard()\n"));
|
||||||
if (!EmptyClipboard ())
|
if (!EmptyClipboard ())
|
||||||
{
|
{
|
||||||
g_warning ("gdk_selection_owner_set: EmptyClipboard failed");
|
g_warning ("gdk_selection_owner_set: EmptyClipboard failed");
|
||||||
@ -116,7 +116,7 @@ gdk_selection_owner_set (GdkWindow *owner,
|
|||||||
if (xwindow != NULL)
|
if (xwindow != NULL)
|
||||||
SetClipboardData (CF_TEXT, NULL);
|
SetClipboardData (CF_TEXT, NULL);
|
||||||
#endif
|
#endif
|
||||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||||
if (!CloseClipboard ())
|
if (!CloseClipboard ())
|
||||||
{
|
{
|
||||||
g_warning ("gdk_selection_owner_set: CloseClipboard failed");
|
g_warning ("gdk_selection_owner_set: CloseClipboard failed");
|
||||||
@ -154,7 +154,7 @@ gdk_selection_owner_get (GdkAtom selection)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(sel_name = gdk_atom_name (selection),
|
(sel_name = gdk_atom_name (selection),
|
||||||
g_print ("gdk_selection_owner_get: %#x (%s) = %#x\n",
|
g_print ("gdk_selection_owner_get: %#x (%s) = %#x\n",
|
||||||
selection, sel_name,
|
selection, sel_name,
|
||||||
@ -180,7 +180,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
|||||||
if (GDK_DRAWABLE_DESTROYED (requestor))
|
if (GDK_DRAWABLE_DESTROYED (requestor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(sel_name = gdk_atom_name (selection),
|
(sel_name = gdk_atom_name (selection),
|
||||||
tgt_name = gdk_atom_name (target),
|
tgt_name = gdk_atom_name (target),
|
||||||
g_print ("gdk_selection_convert: %#x %#x (%s) %#x (%s)\n",
|
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,
|
* contents of the clipboard. Get the clipboard data,
|
||||||
* and store it for later.
|
* 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)));
|
GDK_DRAWABLE_XID (requestor)));
|
||||||
if (!OpenClipboard (GDK_DRAWABLE_XID (requestor)))
|
if (!OpenClipboard (GDK_DRAWABLE_XID (requestor)))
|
||||||
{
|
{
|
||||||
@ -202,15 +202,15 @@ gdk_selection_convert (GdkWindow *requestor,
|
|||||||
return;
|
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 ((hdata = GetClipboardData (CF_TEXT)) != NULL)
|
||||||
{
|
{
|
||||||
if ((ptr = GlobalLock (hdata)) != NULL)
|
if ((ptr = GlobalLock (hdata)) != NULL)
|
||||||
{
|
{
|
||||||
length = GlobalSize (hdata);
|
length = GlobalSize (hdata);
|
||||||
|
|
||||||
GDK_NOTE (SELECTION, g_print ("...got data: %d bytes: %.10s\n",
|
GDK_NOTE (MISC, g_print ("...got data: %d bytes: %.10s\n",
|
||||||
length, ptr));
|
length, ptr));
|
||||||
|
|
||||||
slength = 0;
|
slength = 0;
|
||||||
p = ptr;
|
p = ptr;
|
||||||
@ -240,7 +240,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
|||||||
GlobalUnlock (hdata);
|
GlobalUnlock (hdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GDK_NOTE (SELECTION, g_print ("...CloseClipboard()\n"));
|
GDK_NOTE (MISC, g_print ("...CloseClipboard()\n"));
|
||||||
CloseClipboard ();
|
CloseClipboard ();
|
||||||
|
|
||||||
|
|
||||||
@ -257,11 +257,13 @@ gdk_selection_convert (GdkWindow *requestor,
|
|||||||
*/
|
*/
|
||||||
GdkSelProp *prop;
|
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)
|
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,
|
gdk_sel_prop_store (requestor, prop->type, prop->format,
|
||||||
prop->data, prop->length);
|
prop->data, prop->length);
|
||||||
g_free (prop);
|
g_free (prop);
|
||||||
@ -288,8 +290,8 @@ gdk_selection_property_get (GdkWindow *requestor,
|
|||||||
if (GDK_DRAWABLE_DESTROYED (requestor))
|
if (GDK_DRAWABLE_DESTROYED (requestor))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION, g_print ("gdk_selection_property_get: %#x\n",
|
GDK_NOTE (MISC, g_print ("gdk_selection_property_get: %#x\n",
|
||||||
GDK_DRAWABLE_XID (requestor)));
|
GDK_DRAWABLE_XID (requestor)));
|
||||||
|
|
||||||
prop = g_hash_table_lookup (sel_prop_table, &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;
|
gchar *sel_name, *tgt_name, *prop_name;
|
||||||
|
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
(sel_name = gdk_atom_name (selection),
|
(sel_name = gdk_atom_name (selection),
|
||||||
tgt_name = gdk_atom_name (target),
|
tgt_name = gdk_atom_name (target),
|
||||||
prop_name = gdk_atom_name (property),
|
prop_name = gdk_atom_name (property),
|
||||||
@ -370,7 +372,7 @@ gdk_text_property_to_text_list (GdkAtom encoding,
|
|||||||
gint length,
|
gint length,
|
||||||
gchar ***list)
|
gchar ***list)
|
||||||
{
|
{
|
||||||
GDK_NOTE (SELECTION,
|
GDK_NOTE (MISC,
|
||||||
g_print ("gdk_text_property_to_text_list not implemented\n"));
|
g_print ("gdk_text_property_to_text_list not implemented\n"));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gdkvisual.h"
|
#include "gdkvisual.h"
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate-win32.h"
|
||||||
|
|
||||||
static void gdk_visual_decompose_mask (gulong mask,
|
static void gdk_visual_decompose_mask (gulong mask,
|
||||||
gint *shift,
|
gint *shift,
|
||||||
|
@ -29,18 +29,18 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
|
|
||||||
#include "gdkprivate.h"
|
#include "gdkprivate-win32.h"
|
||||||
|
|
||||||
static guint gdk_xid_hash (XID *xid);
|
static guint gdk_xid_hash (HANDLE *xid);
|
||||||
static gint gdk_xid_compare (XID *a,
|
static gint gdk_xid_compare (HANDLE *a,
|
||||||
XID *b);
|
HANDLE *b);
|
||||||
|
|
||||||
|
|
||||||
static GHashTable *xid_ht = NULL;
|
static GHashTable *xid_ht = NULL;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_xid_table_insert (XID *xid,
|
gdk_xid_table_insert (HANDLE *xid,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
g_return_if_fail (xid != NULL);
|
g_return_if_fail (xid != NULL);
|
||||||
@ -53,7 +53,7 @@ gdk_xid_table_insert (XID *xid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_xid_table_remove (XID xid)
|
gdk_xid_table_remove (HANDLE xid)
|
||||||
{
|
{
|
||||||
if (!xid_ht)
|
if (!xid_ht)
|
||||||
xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
|
xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
|
||||||
@ -63,7 +63,7 @@ gdk_xid_table_remove (XID xid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gpointer
|
gpointer
|
||||||
gdk_xid_table_lookup (XID xid)
|
gdk_xid_table_lookup (HANDLE xid)
|
||||||
{
|
{
|
||||||
gpointer data = NULL;
|
gpointer data = NULL;
|
||||||
|
|
||||||
@ -75,14 +75,14 @@ gdk_xid_table_lookup (XID xid)
|
|||||||
|
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
gdk_xid_hash (XID *xid)
|
gdk_xid_hash (HANDLE *xid)
|
||||||
{
|
{
|
||||||
return (guint) *xid;
|
return (guint) *xid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
gdk_xid_compare (XID *a,
|
gdk_xid_compare (HANDLE *a,
|
||||||
XID *b)
|
HANDLE *b)
|
||||||
{
|
{
|
||||||
return (*a == *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
|
## Makefile for building the machine dependent part of GDK with gcc on cygwin
|
||||||
## Use: make -f makefile.cygwin install
|
## Use: make -f makefile.cygwin
|
||||||
|
|
||||||
# Change this to wherever you want to install the DLL. This directory
|
|
||||||
# should be in your PATH.
|
|
||||||
BIN = /bin
|
|
||||||
|
|
||||||
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
|
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
|
||||||
# We use the wntab32x.lib archive library directly (copy it as libwntab32x.a).
|
# 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
|
CP = cp
|
||||||
LD = ld
|
LD = ld
|
||||||
INSTALL = install
|
|
||||||
|
|
||||||
GLIB_VER=1.3
|
GLIB_VER=1.3
|
||||||
GTK_VER=1.3
|
GTK_VER=1.3
|
||||||
@ -29,10 +24,9 @@ CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENAB
|
|||||||
|
|
||||||
all: \
|
all: \
|
||||||
../../config.h \
|
../../config.h \
|
||||||
gdk-win32-$(GTK_VER).dll
|
libgdk-win32.a \
|
||||||
|
gdk-win32res.o \
|
||||||
install : all
|
libwntab32x.a
|
||||||
$(INSTALL) gdk-win32-$(GTK_VER).dll $(BIN)
|
|
||||||
|
|
||||||
gdk_win32_OBJECTS = \
|
gdk_win32_OBJECTS = \
|
||||||
gdkcolor-win32.o \
|
gdkcolor-win32.o \
|
||||||
@ -61,8 +55,9 @@ gdk_win32_OBJECTS = \
|
|||||||
gdk-win32res.o : rc/gdk.rc
|
gdk-win32res.o : rc/gdk.rc
|
||||||
windres --include-dir rc rc/gdk.rc gdk-win32res.o
|
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
|
libgdk-win32.a : $(gdk_win32_OBJECTS)
|
||||||
$(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
|
-rm -f $@
|
||||||
|
$(AR) rv $@ $(gdk_win32_OBJECTS)
|
||||||
|
|
||||||
libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
|
libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
|
||||||
cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a
|
cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a
|
||||||
|
Loading…
Reference in New Issue
Block a user