This commit is contained in:
Cody Russell 2009-02-24 15:52:32 +00:00 committed by Alexander Larsson
parent 08961c4def
commit 49a0ec6e95
10 changed files with 137 additions and 63 deletions

View File

@ -150,6 +150,7 @@ gdk_drawable_get_size (GdkDrawable *drawable,
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
if (GDK_DRAWABLE_GET_CLASS (drawable)->get_size != NULL)
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
}

View File

@ -1662,7 +1662,9 @@ _gdk_win32_blit (gboolean use_fg_bg,
gdk_drawable_get_size (src, &src_width, &src_height);
if ((src_rgn = CreateRectRgn (0, 0, src_width + 1, src_height + 1)) == NULL)
{
WIN32_GDI_FAILED ("CreateRectRgn");
}
else if ((draw_rgn = CreateRectRgn (xsrc, ysrc,
xsrc + width + 1,
ysrc + height + 1)) == NULL)
@ -1733,6 +1735,7 @@ _gdk_win32_blit (gboolean use_fg_bg,
xsrc, ysrc, xdest, ydest, width, height);
else
blit_from_window (hdc, GDK_GC_WIN32 (gc), src_impl, xsrc, ysrc, xdest, ydest, width, height);
gdk_win32_hdc_release (&draw_impl->parent_instance, gc, GDK_GC_FOREGROUND);
}
@ -1947,6 +1950,6 @@ _gdk_win32_drawable_finish (GdkDrawable *drawable)
NULL, NULL);
}
g_assert (impl->hdc_count == 0);
//g_assert (impl->hdc_count == 0);
}

View File

@ -1377,15 +1377,13 @@ synthesize_enter_or_leave_event (GdkWindow *window,
gint y)
{
GdkEvent *event;
gint xoffset, yoffset;
event = gdk_event_new (type);
event->crossing.window = window;
event->crossing.subwindow = NULL;
event->crossing.time = _gdk_win32_get_next_tick (msg->time);
//_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
event->crossing.x = x + xoffset;
event->crossing.y = y + yoffset;
event->crossing.x = x;
event->crossing.y = y;
event->crossing.x_root = msg->pt.x + _gdk_offset_x;
event->crossing.y_root = msg->pt.y + _gdk_offset_y;
event->crossing.mode = mode;
@ -1940,7 +1938,6 @@ handle_wm_paint (MSG *msg,
HDC hdc;
PAINTSTRUCT paintstruct;
GdkRegion *update_region;
gint xoffset, yoffset;
if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR)
{
@ -2025,10 +2022,13 @@ handle_wm_paint (MSG *msg,
update_region = _gdk_win32_hrgn_to_region (hrgn);
//_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
gdk_region_offset (update_region, xoffset, yoffset);
//gdk_region_offset (update_region, xoffset, yoffset);
// g_print ("handle_wm_paint: rect [%d %d %d %d]\n",
// update_region->x, update_region->y,
// update_region->width, update_region->height);
_gdk_window_process_expose (window, update_region);
g_print ("handle_wm_paint\n");
gdk_region_destroy (update_region);
DeleteObject (hrgn);
@ -2085,7 +2085,6 @@ generate_button_event (GdkEventType type,
MSG *msg)
{
GdkEvent *event = gdk_event_new (type);
gint xoffset, yoffset;
event->button.window = window;
event->button.time = _gdk_win32_get_next_tick (msg->time);
@ -2093,9 +2092,6 @@ generate_button_event (GdkEventType type,
translate_mouse_coords (orig_window, window, msg);
event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
//_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
event->button.x += xoffset;
event->button.y += yoffset;
event->button.x_root = msg->pt.x + _gdk_offset_x;
event->button.y_root = msg->pt.y + _gdk_offset_y;
event->button.axes = NULL;
@ -2271,7 +2267,6 @@ gdk_event_translate (MSG *msg,
GdkWindowImplWin32 *impl;
GdkWindow *orig_window, *new_window;
gint xoffset, yoffset;
static gint update_colors_counter = 0;
gint button;
@ -2813,9 +2808,6 @@ gdk_event_translate (MSG *msg,
event->motion.time = _gdk_win32_get_next_tick (msg->time);
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
// gdk_window_get_offsets (window, &xoffset, &yoffset);
event->motion.x += xoffset;
event->motion.y += yoffset;
event->motion.x_root = current_root_x;
event->motion.y_root = current_root_y;
event->motion.axes = NULL;
@ -2904,9 +2896,8 @@ gdk_event_translate (MSG *msg,
event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
GDK_SCROLL_UP : GDK_SCROLL_DOWN;
event->scroll.time = _gdk_win32_get_next_tick (msg->time);
//_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
event->scroll.x = (gint16) point.x + xoffset;
event->scroll.y = (gint16) point.y + yoffset;
event->scroll.x = (gint16) point.x;
event->scroll.y = (gint16) point.y;
event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x;
event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y;
event->scroll.state = build_pointer_event_state (msg);

View File

@ -67,8 +67,8 @@ _gdk_window_move_resize_child (GdkWindow *window,
obj = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
is_move = (x - obj->x != 0) && (y - obj->y != 0);
is_resize = obj->width != width && obj->height != height;
is_move = 0; // (x - obj->x != 0) && (y - obj->y != 0);
is_resize = 0; // obj->width != width && obj->height != height;
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
_gdk_win32_drawable_description (window),
@ -89,6 +89,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
obj->width = width;
obj->height = height;
_gdk_win32_window_tmp_unset_parent_bg (window);
_gdk_win32_window_tmp_unset_bg (window, TRUE);
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER%s%s)\n",
GDK_WINDOW_HWND (window),
@ -103,6 +106,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)));
//_gdk_win32_window_tmp_reset_parent_bg (window);
//_gdk_win32_window_tmp_reset_bg (window, TRUE);
}
void
@ -119,13 +125,44 @@ _gdk_window_process_expose (GdkWindow *window,
if (!gdk_region_empty (invalidate_region))
_gdk_window_invalidate_for_expose (window, invalidate_region);
else
g_print ("process_expose(), empty region\n");
g_print ("_gdk_window_process_expose\n");
gdk_region_destroy (invalidate_region);
//gdk_region_destroy (invalidate_region);
}
void
_gdk_win32_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse)
{
GdkWindowObject *private;
g_return_if_fail (GDK_IS_WINDOW (window));
private = (GdkWindowObject *)window;
if (private->input_only || private->destroyed ||
(private->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)))
return;
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_WIN32 (window) &&
private->window_type != GDK_WINDOW_ROOT &&
private->window_type != GDK_WINDOW_FOREIGN)
tmp_unset_bg (window);
if (recurse)
{
GList *l;
for (l = private->children; l != NULL; l = l->next)
_gdk_win32_window_tmp_unset_bg (l->data, TRUE);
}
}
static void
gdk_window_tmp_unset_bg (GdkWindow *window)
tmp_unset_bg (GdkWindow *window)
{
GdkWindowImplWin32 *impl;
GdkWindowObject *obj;
@ -140,11 +177,28 @@ gdk_window_tmp_unset_bg (GdkWindow *window)
* Not sure if this could really emulate it.
*/
if (obj->bg_pixmap != GDK_NO_BG)
/* handled in WM_ERASEBKGRND proceesing */;
{
///* handled in WM_ERASEBKGRND proceesing */;
//HDC hdc = GetDC (GDK_WINDOW_HWND (window));
//erase_background (window, hdc);
}
}
static void
gdk_window_tmp_reset_bg (GdkWindow *window)
void
_gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window)
{
GdkWindowObject *private = (GdkWindowObject*)window;
if (GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_ROOT)
return;
window = _gdk_window_get_impl_window ((GdkWindow*)private->parent);
_gdk_win32_window_tmp_unset_bg (window, FALSE);
}
void
_gdk_win32_window_tmp_reset_bg (GdkWindow *window)
{
GdkWindowImplWin32 *impl;
GdkWindowObject *obj;
@ -155,6 +209,7 @@ gdk_window_tmp_reset_bg (GdkWindow *window)
impl->no_bg = FALSE;
}
#if 0
static GdkRegion *
gdk_window_clip_changed (GdkWindow *window,
GdkRectangle *old_clip,
@ -186,16 +241,17 @@ 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;
}
#endif
#if 0
static void
gdk_window_post_scroll (GdkWindow *window,
GdkRegion *new_clip_region)
@ -208,3 +264,5 @@ gdk_window_post_scroll (GdkWindow *window,
g_print ("gdk_window_post_scroll\n");
gdk_region_destroy (new_clip_region);
}
#endif

View File

@ -647,7 +647,7 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
gdouble *x_out,
gdouble *y_out)
{
GdkWindowImplWin32 *impl, *root_impl;
GdkWindowImplWin32 *root_impl;
GdkWindowObject *window_object;
int i;
@ -658,7 +658,6 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
double x_offset, y_offset, x_scale, y_scale;
window_object = GDK_WINDOW_OBJECT (input_window);
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (input_window->window)->impl);
for (i=0; i<gdkdev->info.num_axes; i++)
{

View File

@ -1165,6 +1165,8 @@ _gdk_win32_drawable_description (GdkDrawable *d)
{
gint width, height, depth;
g_return_val_if_fail (GDK_IS_DRAWABLE (d), NULL);
gdk_drawable_get_size (d, &width, &height);
depth = gdk_drawable_get_depth (d);

View File

@ -123,8 +123,6 @@ 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

@ -115,6 +115,8 @@
//#define GDK_WINDOW_SCREEN(win) (_gdk_screen)
GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
#define GDK_WINDOW_IS_WIN32(win) (GDK_IS_WINDOW_IMPL_WIN32 (((GdkWindowObject *)win)->impl))
typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
typedef struct _GdkCursorPrivate GdkCursorPrivate;
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;

View File

@ -1431,6 +1431,7 @@ static void
erase_background (GdkWindow *window,
HDC hdc)
{
#if 0
HDC bgdc = NULL;
HBRUSH hbr = NULL;
HPALETTE holdpal = NULL;
@ -1558,6 +1559,7 @@ erase_background (GdkWindow *window,
DeleteDC (bgdc);
}
}
#endif
}
static void
@ -3786,6 +3788,15 @@ _gdk_win32_window_queue_antiexpose (GdkWindow *window,
return FALSE;
}
static void
_gdk_win32_window_queue_translation (GdkWindow *window,
GdkRegion *area,
gint dx,
gint dy)
{
g_print ("queue_translation\n");
}
static void
gdk_win32_input_shape_combine_region (GdkWindow *window,
const GdkRegion *shape_region,
@ -3798,6 +3809,7 @@ void
_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
GdkRegion *region)
{
_gdk_window_process_updates_recurse (window, region);
}
void
@ -3833,6 +3845,6 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->get_deskrelative_origin = gdk_win32_window_get_deskrelative_origin;
iface->set_static_gravities = gdk_win32_window_set_static_gravities;
iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose;
iface->queue_translation = NULL; //_gdk_win32_window_queue_translation;
iface->queue_translation = _gdk_win32_window_queue_translation;
iface->destroy = _gdk_win32_window_destroy;
}

View File

@ -99,6 +99,14 @@ struct _GdkWindowImplWin32Class
GType _gdk_window_impl_win32_get_type (void);
void _gdk_win32_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse);
void _gdk_win32_window_tmp_reset_bg (GdkWindow *window,
gboolean recurse);
void _gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window);
void _gdk_win32_window_tmp_reset_parent_bg (GdkWindow *window);
G_END_DECLS
#endif /* __GDK_WINDOW_WIN32_H__ */