Misc stuff

This commit is contained in:
Cody Russell 2009-02-16 18:26:35 +00:00 committed by Alexander Larsson
parent a93c6cd6e1
commit 3fdd1333b2
9 changed files with 142 additions and 146 deletions

View File

@ -37,10 +37,8 @@
#undef DEBUG_WINDOW_PRINTING
#if defined(GDK_WINDOWING_X11)
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h" /* For workaround */
#elif defined(GDK_WINDOWING_WIN32)
#include "win32/gdkwin32.h"
#endif
#include "math.h"

View File

@ -50,75 +50,75 @@
(gcwin32->line_style == GDK_LINE_ON_OFF_DASH && gcwin32->pen_dash_offset))
static void gdk_win32_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height);
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height);
static void gdk_win32_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
static void gdk_win32_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gboolean filled,
GdkPoint *points,
gint npoints);
GdkGC *gc,
gboolean filled,
GdkPoint *points,
gint npoints);
static void gdk_win32_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
static void gdk_win32_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
static void gdk_win32_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_win32_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_win32_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
static void gdk_win32_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_win32_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
static void gdk_win32_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap);
GdkColormap *colormap);
static GdkColormap* gdk_win32_get_colormap (GdkDrawable *drawable);
@ -367,7 +367,7 @@ render_line_horizontal (GdkGCWin32 *gcwin32,
static inline gboolean
render_line_vertical (GdkGCWin32 *gcwin32,
int x,
int x,
int y1,
int y2)
{
@ -423,16 +423,16 @@ render_line_vertical (GdkGCWin32 *gcwin32,
static void
draw_tiles_lowlevel (HDC dest,
HDC tile,
int rop3,
gint dest_x,
gint dest_y,
gint tile_x_origin,
gint tile_y_origin,
gint width,
gint height,
gint tile_width,
gint tile_height)
HDC tile,
int rop3,
gint dest_x,
gint dest_y,
gint tile_x_origin,
gint tile_y_origin,
gint width,
gint height,
gint tile_width,
gint tile_height)
{
gint x, y;
@ -477,15 +477,15 @@ draw_tiles_lowlevel (HDC dest,
static void
draw_tiles (GdkDrawable *drawable,
GdkGC *gc,
int rop3,
GdkPixmap *tile,
gint dest_x,
gint dest_y,
gint tile_x_origin,
gint tile_y_origin,
gint width,
gint height)
GdkGC *gc,
int rop3,
GdkPixmap *tile,
gint dest_x,
gint dest_y,
gint tile_x_origin,
gint tile_y_origin,
gint width,
gint height)
{
const GdkGCValuesMask mask = GDK_GC_FOREGROUND;
gint tile_width, tile_height;
@ -510,11 +510,11 @@ draw_tiles (GdkDrawable *drawable,
static void
generic_draw (GdkDrawable *drawable,
GdkGC *gc,
GdkGCValuesMask mask,
void (*function) (GdkGCWin32 *, HDC, gint, gint, va_list),
const GdkRegion *region,
...)
GdkGC *gc,
GdkGCValuesMask mask,
void (*function) (GdkGCWin32 *, HDC, gint, gint, va_list),
const GdkRegion *region,
...)
{
GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
GdkGCWin32 *gcwin32 = GDK_GC_WIN32 (gc);
@ -742,7 +742,7 @@ generic_draw (GdkDrawable *drawable,
static GdkRegion *
widen_bounds (GdkRectangle *bounds,
gint pen_width)
gint pen_width)
{
if (pen_width == 0)
pen_width = 1;
@ -757,10 +757,10 @@ widen_bounds (GdkRectangle *bounds,
static void
draw_rectangle (GdkGCWin32 *gcwin32,
HDC hdc,
gint x_offset,
gint y_offset,
va_list args)
HDC hdc,
gint x_offset,
gint y_offset,
va_list args)
{
HGDIOBJ old_pen_or_brush;
gboolean filled;
@ -803,12 +803,12 @@ draw_rectangle (GdkGCWin32 *gcwin32,
static void
gdk_win32_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height)
GdkGC *gc,
gboolean filled,
gint x,
gint y,
gint width,
gint height)
{
GdkRectangle bounds;
GdkRegion *region;
@ -1141,20 +1141,20 @@ gdk_win32_draw_text_wc (GdkDrawable *drawable,
static void
gdk_win32_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
g_assert (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable));
_gdk_win32_blit (FALSE, (GdkDrawableImplWin32 *) drawable,
gc, src, xsrc, ysrc,
xdest, ydest, width, height);
gc, src, xsrc, ysrc,
xdest, ydest, width, height);
}
static void
@ -1666,7 +1666,9 @@ _gdk_win32_blit (gboolean use_fg_bg,
else if ((draw_rgn = CreateRectRgn (xsrc, ysrc,
xsrc + width + 1,
ysrc + height + 1)) == NULL)
WIN32_GDI_FAILED ("CreateRectRgn");
{
WIN32_GDI_FAILED ("CreateRectRgn");
}
else
{
if (GDK_IS_WINDOW_IMPL_WIN32 (draw_impl))
@ -1846,8 +1848,8 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
cairo_surface_t *
_gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
gint width,
gint height)
gint width,
gint height)
{
GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
@ -1878,11 +1880,11 @@ gdk_win32_ref_cairo_surface (GdkDrawable *drawable)
if (!impl->cairo_surface)
{
// On Win32 cairo surface, width and height are determined from the DC
// On Win32 cairo surface, width and height are determined from the DC
impl->cairo_surface = _gdk_windowing_create_cairo_surface (drawable, 0, 0);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_win32_cairo_key,
drawable, gdk_win32_cairo_surface_destroy);
drawable, gdk_win32_cairo_surface_destroy);
}
else
cairo_surface_reference (impl->cairo_surface);
@ -1892,10 +1894,10 @@ gdk_win32_ref_cairo_surface (GdkDrawable *drawable)
void
_gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
gint width,
gint height)
gint width,
gint height)
{
// Do nothing. The surface size is determined by the DC
// Do nothing. The surface size is determined by the DC
}
static gint

View File

@ -61,7 +61,6 @@ struct _GdkDrawableImplWin32
struct _GdkDrawableImplWin32Class
{
GdkDrawableClass parent_class;
};
GType gdk_drawable_impl_win32_get_type (void);

View File

@ -2028,6 +2028,7 @@ handle_wm_paint (MSG *msg,
gdk_region_offset (update_region, xoffset, yoffset);
_gdk_window_process_expose (window, update_region);
g_print ("handle_wm_paint\n");
gdk_region_destroy (update_region);
DeleteObject (hrgn);

View File

@ -573,7 +573,7 @@ gdk_win32_gc_set_dashes (GdkGC *gc,
void
_gdk_windowing_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region,
gboolean reset_origin)
gboolean reset_origin)
{
GdkGCWin32 *win32_gc = GDK_GC_WIN32 (gc);

View File

@ -107,10 +107,10 @@ _gdk_window_move_resize_child (GdkWindow *window,
void
_gdk_window_process_expose (GdkWindow *window,
GdkRegion *invalidate_region)
GdkRegion *invalidate_region)
{
GdkWindowImplWin32 *impl;
GdkRegion *clip_region;
//GdkRegion *clip_region;
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
GDK_NOTE (EVENTS, g_print ("_gdk_window_process_expose: %p %s\n",
@ -120,7 +120,8 @@ _gdk_window_process_expose (GdkWindow *window,
if (!gdk_region_empty (invalidate_region))
_gdk_window_invalidate_for_expose (window, invalidate_region);
gdk_region_destroy (clip_region);
g_print ("_gdk_window_process_expose\n");
gdk_region_destroy (invalidate_region);
}
static void
@ -185,9 +186,11 @@ gdk_window_clip_changed (GdkWindow *window,
gdk_window_tmp_unset_bg (window);
else
{
g_print ("gdk_window_clip_changed (new_clip_region)\n");
gdk_region_destroy (new_clip_region);
new_clip_region = NULL;
}
g_print ("gdk_window_clip_changed (old_clip_region)\n");
gdk_region_destroy (old_clip_region);
return new_clip_region;
@ -202,5 +205,6 @@ gdk_window_post_scroll (GdkWindow *window,
_gdk_win32_gdkregion_to_string (new_clip_region)));
gdk_window_invalidate_region (window, new_clip_region, FALSE);
g_print ("gdk_window_post_scroll\n");
gdk_region_destroy (new_clip_region);
}

View File

@ -641,11 +641,11 @@ decode_tilt (gint *axis_data,
static void
gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
GdkInputWindow *input_window,
gint *axis_data,
gdouble *axis_out,
gdouble *x_out,
gdouble *y_out)
GdkInputWindow *input_window,
gint *axis_data,
gdouble *axis_out,
gdouble *x_out,
gdouble *y_out)
{
GdkWindowImplWin32 *impl, *root_impl;
GdkWindowObject *window_object;

View File

@ -123,6 +123,8 @@ gdk_pixmap_impl_win32_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_print ("gdk_pixmap_impl_win32_get_size()\n");
if (width)
*width = GDK_PIXMAP_IMPL_WIN32 (drawable)->width;
if (height)

View File

@ -233,19 +233,6 @@ gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
}
/*
static void
gdk_window_impl_win32_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
if (width)
*width = GDK_WINDOW_IMPL_WIN32 (drawable)->width;
if (height)
*height = GDK_WINDOW_IMPL_WIN32 (drawable)->height;
}
static GdkRegion*
gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable)
{
@ -492,12 +479,12 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
void
_gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkVisual *visual,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
GdkWindow *real_parent,
GdkScreen *screen,
GdkVisual *visual,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
{
HWND hwndNew;
HANDLE hparent;
@ -529,6 +516,7 @@ _gdk_window_impl_new (GdkWindow *window,
impl = g_object_new (_gdk_window_impl_get_type (), NULL);
private->impl = (GdkDrawable *)impl;
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
// XXX: xattributes_mask = 0
@ -2079,6 +2067,7 @@ static void
gdk_win32_window_set_background (GdkWindow *window,
const GdkColor *color)
{
#if 0
GdkWindowObject *private = (GdkWindowObject *)window;
GDK_NOTE (MISC, g_print ("gdk_window_set_background: %p: %s\n",
@ -2094,6 +2083,7 @@ gdk_win32_window_set_background (GdkWindow *window,
g_object_unref (private->bg_pixmap);
private->bg_pixmap = NULL;
}
#endif
}
static void
@ -3815,15 +3805,15 @@ _gdk_win32_window_queue_antiexpose (GdkWindow *window,
static void
gdk_win32_input_shape_combine_region (GdkWindow *window,
const GdkRegion *shape_region,
gint offset_x,
gint offset_y)
const GdkRegion *shape_region,
gint offset_x,
gint offset_y)
{
}
void
_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
GdkRegion *region)
GdkRegion *region)
{
}