Make sure you can compile out the implementation/wrapper assert macros.

2001-05-10  Alexander Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkprivate-fb.h:
	Make sure you can compile out the implementation/wrapper assert
	macros.

	* gdk/linux-fb/gdkdrawable-fb2.c:
	Check implementation/wrappers, initialize type for pixmap dummys.

	* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
	Hide the cursor if reading from the screen.

	* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
	Fix sign bug in tiling code.

	* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
	Handle background pixmaps.
This commit is contained in:
Alexander Larsson 2001-05-10 22:44:27 +00:00 committed by Alexander Larsson
parent 6e70564088
commit 2c396fea9f
12 changed files with 206 additions and 24 deletions

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -1,3 +1,21 @@
2001-05-10 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkprivate-fb.h:
Make sure you can compile out the implementation/wrapper assert
macros.
* gdk/linux-fb/gdkdrawable-fb2.c:
Check implementation/wrappers, initialize type for pixmap dummys.
* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
Hide the cursor if reading from the screen.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_fill_span_generic):
Fix sign bug in tiling code.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_clear_area):
Handle background pixmaps.
Wed May 9 15:27:22 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_function): New

View File

@ -311,6 +311,8 @@ gdk_fb_clip_region (GdkDrawable *drawable,
GdkDrawableFBData *private;
GdkWindowObject *parent;
GDK_CHECK_IMPL (drawable);
private = GDK_DRAWABLE_FBDATA (drawable);
g_assert(!GDK_IS_WINDOW (private->wrapper) ||
@ -588,6 +590,8 @@ gdk_fb_drawing_context_init (GdkFBDrawingContext *dc,
dc->bg_relto = private->wrapper;
dc->draw_bg = draw_bg;
GDK_CHECK_IMPL (drawable);
if (GDK_IS_WINDOW (private->wrapper))
{
dc->bgpm = GDK_WINDOW_P (private->wrapper)->bg_pixmap;
@ -651,6 +655,9 @@ gdk_fb_draw_drawable_2 (GdkDrawable *drawable,
GdkFBDrawingContext *dc, dc_data;
dc = &dc_data;
GDK_CHECK_IMPL (src);
GDK_CHECK_IMPL (drawable);
gdk_fb_drawing_context_init (dc, drawable, gc, draw_bg, do_clipping);
gdk_fb_draw_drawable_3 (drawable, gc, src, dc, xsrc, ysrc, xdest, ydest, width, height);
gdk_fb_drawing_context_finalize (dc);
@ -680,6 +687,9 @@ gdk_fb_draw_drawable_3 (GdkDrawable *drawable,
g_assert (gc);
GDK_CHECK_IMPL (src);
GDK_CHECK_IMPL (drawable);
if (GDK_IS_WINDOW (private->wrapper))
{
if (!GDK_WINDOW_IS_MAPPED (private->wrapper))
@ -797,6 +807,7 @@ gdk_fb_draw_drawable (GdkDrawable *drawable,
else
src_impl = GDK_DRAWABLE_IMPL (src);
GDK_CHECK_IMPL (drawable);
gdk_fb_draw_drawable_2 (drawable, gc, src_impl , xsrc, ysrc, xdest, ydest, width, height, TRUE, TRUE);
}
@ -1188,6 +1199,7 @@ _gdk_fb_draw_glyphs (GdkDrawable *drawable,
/* Fake its existence as a pixmap */
((GTypeInstance *)&pixmap)->g_class = g_type_class_peek (_gdk_pixmap_impl_get_type ());
pixmap.drawable_data.abs_x = 0;
pixmap.drawable_data.abs_y = 0;
pixmap.drawable_data.depth = 78;
@ -1275,6 +1287,9 @@ gdk_fb_draw_image (GdkDrawable *drawable,
/* Fake its existence as a pixmap */
memset (&fbd, 0, sizeof(fbd));
((GTypeInstance *)&fbd)->g_class = g_type_class_peek (_gdk_pixmap_impl_get_type ());
fbd.drawable_data.mem = image->mem;
fbd.drawable_data.rowstride = image->bpl;
fbd.drawable_data.width = fbd.drawable_data.lim_x = image->width;

View File

@ -172,6 +172,8 @@ _gdk_fb_get_image (GdkDrawable *drawable,
GdkImage *image;
GdkImagePrivateFB *private;
GdkPixmapFBData fbd;
GdkRegion *region = NULL;
gboolean handle_cursor = FALSE;
g_return_val_if_fail (drawable != NULL, NULL);
@ -200,6 +202,7 @@ _gdk_fb_get_image (GdkDrawable *drawable,
/* Fake its existence as a pixmap */
memset (&fbd, 0, sizeof(fbd));
((GTypeInstance *)&fbd)->g_class = g_type_class_peek (_gdk_pixmap_impl_get_type ());
fbd.drawable_data.mem = image->mem;
fbd.drawable_data.rowstride = image->bpl;
fbd.drawable_data.width = fbd.drawable_data.lim_x = image->width;
@ -207,6 +210,17 @@ _gdk_fb_get_image (GdkDrawable *drawable,
fbd.drawable_data.depth = image->depth;
fbd.drawable_data.window_type = GDK_DRAWABLE_PIXMAP;
if (GDK_DRAWABLE_FBDATA (drawable)->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem)
{
region = gdk_fb_clip_region (drawable, _gdk_fb_screen_gc, TRUE, FALSE, FALSE);
if (gdk_fb_cursor_region_need_hide (region))
{
handle_cursor = TRUE;
gdk_fb_cursor_hide ();
}
}
gdk_fb_draw_drawable_2 ((GdkPixmap *)&fbd,
_gdk_fb_screen_gc,
drawable,
@ -215,6 +229,12 @@ _gdk_fb_get_image (GdkDrawable *drawable,
width, height,
TRUE, TRUE);
if (region)
gdk_region_destroy (region);
if (handle_cursor)
gdk_fb_cursor_unhide ();
return image;
}

View File

@ -52,11 +52,17 @@
#define GDK_FONT_FB(f) ((GdkFontPrivateFB *)(f))
#define GDK_CURSOR_FB(c) ((GdkCursorPrivateFB *)(c))
#define CHECK_IMPL_AND_INTF
#ifdef CHECK_IMPL_AND_INTF
#define GDK_CHECK_IMPL(drawable) \
g_assert(G_OBJECT_TYPE(drawable) == _gdk_window_impl_get_type() || G_OBJECT_TYPE(drawable) == _gdk_pixmap_impl_get_type())
#define GDK_CHECK_INTF(drawable) \
g_assert(G_OBJECT_TYPE(drawable) == gdk_window_object_get_type() || G_OBJECT_TYPE(drawable) == gdk_pixmap_get_type())
#else
#define GDK_CHECK_IMPL(drawable)
#define GDK_CHECK_INTF(drawable)
#endif
typedef struct _GdkDrawableFBData GdkDrawableFBData;
typedef struct _GdkWindowFBData GdkWindowFBData;
typedef struct _GdkPixmapFBData GdkPixmapFBData;

View File

@ -388,9 +388,9 @@ gdk_fb_fill_span_generic (GdkDrawable *drawable,
ts_private = GDK_DRAWABLE_IMPL_FBDATA (ts);
rely = y - private->abs_y;
drawh = (rely + gc_private->values.ts_y_origin) % ts_private->height;
drawh = (rely - gc_private->values.ts_y_origin) % ts_private->height;
if (drawh < 0)
drawh += GDK_DRAWABLE_FBDATA (ts)->height;
drawh += ts_private->height;
for (curx = left; curx < right; curx += xstep)
{
@ -398,7 +398,7 @@ gdk_fb_fill_span_generic (GdkDrawable *drawable,
relx = curx - private->abs_x;
draww = (relx + gc_private->values.ts_x_origin) % ts_private->width;
draww = (relx - gc_private->values.ts_x_origin) % ts_private->width;
if (draww < 0)
draww += ts_private->width;

View File

@ -1243,42 +1243,44 @@ _gdk_windowing_window_clear_area (GdkWindow *window,
if (height == 0)
height = GDK_DRAWABLE_IMPL_FBDATA (window)->height - y;
#if 0
for (relto = window; bgpm == GDK_PARENT_RELATIVE_BG && relto; relto = (GdkWindow *)GDK_WINDOW_P(relto)->parent)
relto = window;
while ((bgpm == GDK_PARENT_RELATIVE_BG) && relto)
{
relto = (GdkWindow *)GDK_WINDOW_P(relto)->parent;
bgpm = GDK_WINDOW_P (relto)->bg_pixmap;
#endif
}
if (bgpm && bgpm != GDK_NO_BG)
{
int curx, cury;
int xtrans, ytrans;
int xstep, ystep;
int xtrans, ytrans;
GdkFBDrawingContext fbdc;
return; /* Don't bother doing this - gtk+ will do it itself using GC tiles. If removing this line,
then also remove the #if 0 stuff */
gdk_fb_drawing_context_init (&fbdc, GDK_DRAWABLE_IMPL (window), NULL, FALSE, TRUE);
gdk_fb_drawing_context_init (&fbdc, window, NULL, FALSE, TRUE);
xtrans = GDK_DRAWABLE_IMPL_FBDATA (window)->abs_x - GDK_DRAWABLE_IMPL_FBDATA (relto)->abs_x;
ytrans = GDK_DRAWABLE_IMPL_FBDATA (window)->abs_y - GDK_DRAWABLE_IMPL_FBDATA (relto)->abs_y;
xtrans = GDK_DRAWABLE_IMPL_FBDATA (relto)->abs_x - GDK_DRAWABLE_IMPL_FBDATA (window)->abs_x;
ytrans = GDK_DRAWABLE_IMPL_FBDATA (relto)->abs_y - GDK_DRAWABLE_IMPL_FBDATA (window)->abs_y;
for (cury = y - ytrans; cury < (y - ytrans + height); cury += ystep)
for (cury = y; cury < (y + height); cury += ystep)
{
int drawh = cury % GDK_DRAWABLE_FBDATA (bgpm)->height;
ystep = GDK_DRAWABLE_FBDATA (bgpm)->height - drawh;
int drawh = (cury + ytrans) % GDK_DRAWABLE_IMPL_FBDATA (bgpm)->height;
ystep = GDK_DRAWABLE_IMPL_FBDATA (bgpm)->height - drawh;
for(curx = x - xtrans; curx < (x - xtrans + width); curx += xstep)
ystep = MIN (ystep, y + height - cury);
for (curx = x; curx < (x + width); curx += xstep)
{
int draww = curx % GDK_DRAWABLE_IMPL_FBDATA (bgpm)->width;
int draww = (curx + xtrans) % GDK_DRAWABLE_IMPL_FBDATA (bgpm)->width;
xstep = GDK_DRAWABLE_IMPL_FBDATA (bgpm)->width - draww;
xstep = MIN (xstep, x + width - curx);
gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL (window),
_gdk_fb_screen_gc,
GDK_DRAWABLE_IMPL (bgpm),
&fbdc,
draww, drawh,
curx + xtrans, cury + ytrans,
curx, cury,
xstep, ystep);
}
}
@ -1286,7 +1288,20 @@ _gdk_windowing_window_clear_area (GdkWindow *window,
gdk_fb_drawing_context_finalize (&fbdc);
}
else if (!bgpm)
{
if (relto == window)
gdk_draw_rectangle (window, _gdk_fb_screen_gc, TRUE, x, y, width, height);
else
{
/* GDK_PARENT_RELATIVE_BG, but no pixmap, get the color from the parent window. */
GdkGC *gc;
GdkGCValues values;
values.foreground = GDK_WINDOW_P (relto)->bg_color;
gc = gdk_gc_new_with_values (window, &values, GDK_GC_FOREGROUND);
gdk_draw_rectangle (window, gc, TRUE, x, y, width, height);
gdk_gc_unref (gc);
}
}
}
/* What's the diff? */