Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
#include "config.h"
|
2000-05-31 21:50:38 +00:00
|
|
|
#include "gdkprivate-fb.h"
|
|
|
|
#include "mi.h"
|
2000-07-24 16:19:00 +00:00
|
|
|
#include <string.h>
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-12-21 10:33:40 +00:00
|
|
|
#include <pango/pangoft2.h>
|
2000-11-22 10:07:34 +00:00
|
|
|
#include <freetype/ftglyph.h>
|
2000-11-15 12:45:30 +00:00
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
#ifndef g_alloca
|
|
|
|
#define g_alloca alloca
|
|
|
|
#endif
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
void gdk_fb_draw_rectangle (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_fb_draw_arc (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint angle1,
|
|
|
|
gint angle2);
|
|
|
|
static void gdk_fb_draw_polygon (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
|
|
|
static void gdk_fb_draw_text (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length);
|
|
|
|
static void gdk_fb_draw_text_wc (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length);
|
|
|
|
static void gdk_fb_draw_glyphs (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
PangoFont *font,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoGlyphString *glyphs);
|
|
|
|
void gdk_fb_draw_drawable (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_fb_draw_image (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkImage *image,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_fb_draw_points (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
|
|
|
static void gdk_fb_draw_segments (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkSegment *segs,
|
|
|
|
gint nsegs);
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
static void gdk_fb_draw_lines (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
2000-11-13 17:40:23 +00:00
|
|
|
static GdkColormap* gdk_fb_get_colormap (GdkDrawable *drawable);
|
|
|
|
static void gdk_fb_set_colormap (GdkDrawable *drawable,
|
|
|
|
GdkColormap *colormap);
|
|
|
|
static gint gdk_fb_get_depth (GdkDrawable *drawable);
|
|
|
|
static GdkVisual* gdk_fb_get_visual (GdkDrawable *drawable);
|
2001-01-05 14:01:36 +00:00
|
|
|
static void gdk_fb_drawable_finalize (GObject *object);
|
2000-07-24 16:19:00 +00:00
|
|
|
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
#ifdef ENABLE_SHADOW_FB
|
|
|
|
static void gdk_shadow_fb_draw_rectangle (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_shadow_fb_draw_arc (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint angle1,
|
|
|
|
gint angle2);
|
|
|
|
static void gdk_shadow_fb_draw_polygon (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
|
|
|
static void gdk_shadow_fb_draw_text (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length);
|
|
|
|
static void gdk_shadow_fb_draw_text_wc (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length);
|
|
|
|
static void gdk_shadow_fb_draw_glyphs (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
PangoFont *font,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoGlyphString *glyphs);
|
|
|
|
static void gdk_shadow_fb_draw_drawable (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_shadow_fb_draw_image (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkImage *image,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void gdk_shadow_fb_draw_points (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
|
|
|
static void gdk_shadow_fb_draw_segments (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkSegment *segs,
|
|
|
|
gint nsegs);
|
|
|
|
static void gdk_shadow_fb_draw_lines (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
static gpointer parent_class = NULL;
|
|
|
|
|
|
|
|
static void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_get_size (GdkDrawable *d, gint *width, gint *height)
|
2000-07-24 16:19:00 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
if (width)
|
|
|
|
*width = GDK_DRAWABLE_FBDATA (d)->width;
|
|
|
|
if (height)
|
|
|
|
*height = GDK_DRAWABLE_FBDATA (d)->height;
|
2000-07-24 16:19:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_drawable_impl_fb_class_init (GdkDrawableFBClass *klass)
|
|
|
|
{
|
|
|
|
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
|
2001-01-05 14:01:36 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2000-07-24 16:19:00 +00:00
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2001-01-05 14:01:36 +00:00
|
|
|
object_class->finalize = gdk_fb_drawable_finalize;
|
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
drawable_class->create_gc = _gdk_fb_gc_new;
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_SHADOW_FB
|
|
|
|
drawable_class->draw_rectangle = gdk_shadow_fb_draw_rectangle;
|
|
|
|
drawable_class->draw_arc = gdk_shadow_fb_draw_arc;
|
|
|
|
drawable_class->draw_polygon = gdk_shadow_fb_draw_polygon;
|
|
|
|
drawable_class->draw_text = gdk_shadow_fb_draw_text;
|
|
|
|
drawable_class->draw_text_wc = gdk_shadow_fb_draw_text_wc;
|
|
|
|
drawable_class->draw_drawable = gdk_shadow_fb_draw_drawable;
|
|
|
|
drawable_class->draw_points = gdk_shadow_fb_draw_points;
|
|
|
|
drawable_class->draw_segments = gdk_shadow_fb_draw_segments;
|
|
|
|
drawable_class->draw_lines = gdk_shadow_fb_draw_lines;
|
|
|
|
drawable_class->draw_glyphs = gdk_shadow_fb_draw_glyphs;
|
|
|
|
drawable_class->draw_image = gdk_shadow_fb_draw_image;
|
|
|
|
#else
|
2000-07-24 16:19:00 +00:00
|
|
|
drawable_class->draw_rectangle = gdk_fb_draw_rectangle;
|
|
|
|
drawable_class->draw_arc = gdk_fb_draw_arc;
|
|
|
|
drawable_class->draw_polygon = gdk_fb_draw_polygon;
|
|
|
|
drawable_class->draw_text = gdk_fb_draw_text;
|
|
|
|
drawable_class->draw_text_wc = gdk_fb_draw_text_wc;
|
|
|
|
drawable_class->draw_drawable = gdk_fb_draw_drawable;
|
|
|
|
drawable_class->draw_points = gdk_fb_draw_points;
|
|
|
|
drawable_class->draw_segments = gdk_fb_draw_segments;
|
|
|
|
drawable_class->draw_lines = gdk_fb_draw_lines;
|
|
|
|
drawable_class->draw_glyphs = gdk_fb_draw_glyphs;
|
|
|
|
drawable_class->draw_image = gdk_fb_draw_image;
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
#endif
|
2000-07-24 16:19:00 +00:00
|
|
|
|
|
|
|
drawable_class->set_colormap = gdk_fb_set_colormap;
|
|
|
|
drawable_class->get_colormap = gdk_fb_get_colormap;
|
2000-11-09 12:15:40 +00:00
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
drawable_class->get_size = gdk_fb_get_size;
|
2000-11-09 12:15:40 +00:00
|
|
|
|
|
|
|
drawable_class->get_depth = gdk_fb_get_depth;
|
|
|
|
drawable_class->get_visual = gdk_fb_get_visual;
|
2000-11-02 15:38:04 +00:00
|
|
|
|
|
|
|
drawable_class->get_image = _gdk_fb_get_image;
|
2000-07-24 16:19:00 +00:00
|
|
|
}
|
|
|
|
|
2001-01-05 14:01:36 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_drawable_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
GType
|
|
|
|
gdk_drawable_impl_fb_get_type (void)
|
|
|
|
{
|
|
|
|
static GType object_type = 0;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
if (!object_type)
|
|
|
|
{
|
|
|
|
static const GTypeInfo object_info =
|
|
|
|
{
|
|
|
|
sizeof (GdkDrawableFBClass),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gdk_drawable_impl_fb_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GdkDrawableFBData),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
object_type = g_type_register_static (GDK_TYPE_DRAWABLE,
|
|
|
|
"GdkDrawableFB",
|
2000-11-02 15:38:04 +00:00
|
|
|
&object_info,
|
|
|
|
0);
|
2000-07-24 16:19:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return object_type;
|
|
|
|
}
|
2000-05-31 21:50:38 +00:00
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
* FB specific implementations of generic functions *
|
|
|
|
*****************************************************/
|
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
static GdkColormap*
|
|
|
|
gdk_fb_get_colormap (GdkDrawable *drawable)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkColormap *retval = GDK_DRAWABLE_FBDATA (drawable)->colormap;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (!retval)
|
|
|
|
retval = gdk_colormap_get_system ();
|
2000-05-31 21:50:38 +00:00
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_set_colormap (GdkDrawable *drawable,
|
|
|
|
GdkColormap *colormap)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
2001-01-05 14:01:36 +00:00
|
|
|
|
|
|
|
if (private->colormap == colormap)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (private->colormap)
|
|
|
|
gdk_colormap_unref (private->colormap);
|
|
|
|
private->colormap = colormap;
|
|
|
|
if (private->colormap)
|
|
|
|
gdk_colormap_ref (private->colormap);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
/* Calculates the real clipping region for a drawable, taking into account
|
|
|
|
* other windows, gc clip region and gc clip mask.
|
2000-05-31 21:50:38 +00:00
|
|
|
*/
|
2000-07-24 16:19:00 +00:00
|
|
|
GdkRegion *
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_clip_region (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gboolean do_clipping,
|
|
|
|
gboolean do_children)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
GdkRectangle draw_rect;
|
|
|
|
GdkRegion *real_clip_region, *tmpreg;
|
2000-11-13 17:40:23 +00:00
|
|
|
gboolean skipit = FALSE;
|
|
|
|
GdkDrawableFBData *private;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
|
|
|
|
g_assert(!GDK_IS_WINDOW (private->wrapper) ||
|
|
|
|
!GDK_WINDOW_P (private->wrapper)->input_only);
|
|
|
|
|
|
|
|
draw_rect.x = private->llim_x;
|
|
|
|
draw_rect.y = private->llim_y;
|
|
|
|
if (!GDK_IS_WINDOW (private) ||
|
|
|
|
GDK_WINDOW_P (private->wrapper)->mapped)
|
2000-07-31 17:18:36 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
draw_rect.width = private->lim_x - draw_rect.x;
|
|
|
|
draw_rect.height = private->lim_y - draw_rect.y;
|
2000-07-31 17:18:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
draw_rect.width = draw_rect.height = 0;
|
|
|
|
skipit = TRUE;
|
|
|
|
}
|
2000-11-13 17:40:23 +00:00
|
|
|
real_clip_region = gdk_region_rectangle (&draw_rect);
|
|
|
|
if (skipit)
|
2000-07-31 17:18:36 +00:00
|
|
|
return real_clip_region;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (gc && GDK_GC_FBDATA(gc)->values.subwindow_mode == GDK_INCLUDE_INFERIORS)
|
2000-08-07 23:00:38 +00:00
|
|
|
do_children = FALSE;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (do_clipping &&
|
|
|
|
GDK_IS_WINDOW (private->wrapper) &&
|
|
|
|
GDK_WINDOW_P (private->wrapper)->mapped &&
|
|
|
|
!GDK_WINDOW_P (private->wrapper)->input_only)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
GdkWindow *parentwin, *lastwin;
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawableFBData *impl_private;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
lastwin = private->wrapper;
|
|
|
|
if (do_children)
|
2000-07-24 16:19:00 +00:00
|
|
|
parentwin = lastwin;
|
|
|
|
else
|
2000-11-13 17:40:23 +00:00
|
|
|
parentwin = (GdkWindow *)GDK_WINDOW_P (lastwin)->parent;
|
2000-07-24 16:19:00 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
for (; parentwin; lastwin = parentwin, parentwin = (GdkWindow *)GDK_WINDOW_P (parentwin)->parent)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
for (cur = GDK_WINDOW_P (parentwin)->children; cur && cur->data != lastwin; cur = cur->next)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
if (!GDK_WINDOW_P (cur->data)->mapped || GDK_WINDOW_P (cur->data)->input_only)
|
2000-05-31 21:50:38 +00:00
|
|
|
continue;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
impl_private = GDK_DRAWABLE_IMPL_FBDATA(cur->data);
|
|
|
|
draw_rect.x = impl_private->llim_x;
|
|
|
|
draw_rect.y = impl_private->llim_y;
|
|
|
|
draw_rect.width = impl_private->lim_x - draw_rect.x;
|
|
|
|
draw_rect.height = impl_private->lim_y - draw_rect.y;
|
2000-07-24 16:19:00 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
tmpreg = gdk_region_rectangle (&draw_rect);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_region_subtract (real_clip_region, tmpreg);
|
|
|
|
gdk_region_destroy (tmpreg);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (gc)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_GC_FBDATA (gc)->clip_region)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
tmpreg = gdk_region_copy (GDK_GC_FBDATA (gc)->clip_region);
|
|
|
|
gdk_region_offset (tmpreg, private->abs_x + GDK_GC_P (gc)->clip_x_origin,
|
|
|
|
private->abs_y + GDK_GC_P (gc)->clip_y_origin);
|
|
|
|
gdk_region_intersect (real_clip_region, tmpreg);
|
|
|
|
gdk_region_destroy (tmpreg);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_GC_FBDATA (gc)->values.clip_mask)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawable *cmask = GDK_GC_FBDATA (gc)->values.clip_mask;
|
|
|
|
GdkDrawableFBData *cmask_private;
|
|
|
|
|
|
|
|
cmask_private = GDK_DRAWABLE_IMPL_FBDATA (cmask);
|
|
|
|
|
|
|
|
g_assert (cmask_private->depth == 1);
|
|
|
|
g_assert (cmask_private->abs_x == 0 &&
|
|
|
|
cmask_private->abs_y == 0);
|
|
|
|
|
|
|
|
draw_rect.x = private->abs_x +
|
|
|
|
cmask_private->llim_x +
|
|
|
|
GDK_GC_FBDATA (gc)->values.clip_x_origin;
|
|
|
|
|
|
|
|
draw_rect.y = private->abs_y +
|
|
|
|
cmask_private->llim_y +
|
|
|
|
GDK_GC_FBDATA (gc)->values.clip_y_origin;
|
|
|
|
|
|
|
|
draw_rect.width = cmask_private->width;
|
|
|
|
draw_rect.height = cmask_private->height;
|
|
|
|
|
|
|
|
tmpreg = gdk_region_rectangle (&draw_rect);
|
|
|
|
gdk_region_intersect (real_clip_region, tmpreg);
|
|
|
|
gdk_region_destroy (tmpreg);
|
2001-01-05 14:01:36 +00:00
|
|
|
/*
|
2000-11-13 17:40:23 +00:00
|
|
|
if (!real_clip_region->numRects)
|
|
|
|
g_warning ("Empty clip region");
|
2001-01-05 14:01:36 +00:00
|
|
|
*/
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return real_clip_region;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
struct GdkSpanHelper
|
2000-11-15 12:45:30 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
GdkDrawable *drawable;
|
|
|
|
GdkGC *gc;
|
|
|
|
GdkColor color;
|
|
|
|
};
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
static void
|
2000-11-22 10:07:34 +00:00
|
|
|
gdk_fb_fill_span_helper(GdkSpan *span,
|
|
|
|
gpointer data)
|
2000-11-15 12:45:30 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
struct GdkSpanHelper *info = (struct GdkSpanHelper *)data;
|
|
|
|
GdkGC * gc = info->gc;
|
|
|
|
|
|
|
|
(GDK_GC_FBDATA (gc)->fill_span) (info->drawable, gc, span, &info->color);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_fill_spans (GdkDrawable *real_drawable,
|
|
|
|
GdkGC *gc,
|
2000-11-22 10:07:34 +00:00
|
|
|
GdkSpan *spans,
|
|
|
|
int nspans,
|
|
|
|
gboolean sorted)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
int i;
|
2000-11-22 10:07:34 +00:00
|
|
|
struct GdkSpanHelper info;
|
|
|
|
GdkRegion *real_clip_region;
|
2000-05-31 21:50:38 +00:00
|
|
|
gboolean handle_cursor = FALSE;
|
2000-07-24 16:19:00 +00:00
|
|
|
GdkDrawable *drawable;
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawableFBData *private;
|
2000-11-22 10:07:34 +00:00
|
|
|
|
2000-07-24 16:19:00 +00:00
|
|
|
drawable = real_drawable;
|
2000-11-13 17:40:23 +00:00
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
g_assert (gc);
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_IS_WINDOW (private->wrapper) && !GDK_WINDOW_P (private->wrapper)->mapped)
|
2000-05-31 21:50:38 +00:00
|
|
|
return;
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_IS_WINDOW (private->wrapper) && GDK_WINDOW_P (private->wrapper)->input_only)
|
|
|
|
g_error ("Drawing on the evil input-only!");
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
info.drawable = drawable;
|
|
|
|
info.gc = gc;
|
|
|
|
|
|
|
|
if (GDK_GC_FBDATA (gc)->values_mask & GDK_GC_FOREGROUND)
|
|
|
|
info.color = GDK_GC_FBDATA (gc)->values.foreground;
|
2000-11-13 17:40:23 +00:00
|
|
|
else if (GDK_IS_WINDOW (private->wrapper))
|
2000-11-22 10:07:34 +00:00
|
|
|
info.color = GDK_WINDOW_P (private->wrapper)->bg_color;
|
2000-05-31 21:50:38 +00:00
|
|
|
else
|
2000-11-22 10:07:34 +00:00
|
|
|
gdk_color_black (private->colormap, &info.color);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem &&
|
|
|
|
gdk_fb_cursor_region_need_hide (real_clip_region))
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
handle_cursor = TRUE;
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_cursor_hide ();
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
for (i = 0; i < nspans; i++)
|
|
|
|
{
|
|
|
|
GdkSpan *cur;
|
|
|
|
|
|
|
|
cur = &spans[i];
|
|
|
|
|
|
|
|
cur->x += private->abs_x;
|
|
|
|
cur->y += private->abs_y;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
if ( (cur->y < private->llim_y) || (cur->y >= private->lim_y))
|
|
|
|
cur->width = 0;
|
|
|
|
|
|
|
|
if (cur->x < private->llim_x)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
cur->width -= private->llim_x - cur->x;
|
|
|
|
cur->x = private->llim_x;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cur->x + cur->width > private->lim_x)
|
|
|
|
{
|
|
|
|
cur->width = private->lim_x - cur->x;
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
2000-11-22 10:07:34 +00:00
|
|
|
|
|
|
|
if (cur->width <= 0)
|
|
|
|
cur->width = 0;
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
gdk_region_spans_intersect_foreach (real_clip_region,
|
|
|
|
spans,
|
|
|
|
nspans,
|
|
|
|
sorted,
|
|
|
|
gdk_fb_fill_span_helper,
|
|
|
|
&info);
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_region_destroy (real_clip_region);
|
|
|
|
if (handle_cursor)
|
|
|
|
gdk_fb_cursor_unhide ();
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-06-20 20:20:38 +00:00
|
|
|
void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_drawing_context_init (GdkFBDrawingContext *dc,
|
|
|
|
GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gboolean draw_bg,
|
|
|
|
gboolean do_clipping)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawableFBData *private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
dc->mem = private->mem;
|
|
|
|
dc->rowstride = private->rowstride;
|
2000-06-20 20:20:38 +00:00
|
|
|
dc->handle_cursor = FALSE;
|
|
|
|
dc->bgpm = NULL;
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->bg_relto = private->wrapper;
|
2000-06-20 20:20:38 +00:00
|
|
|
dc->draw_bg = draw_bg;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->bgpm = GDK_WINDOW_P (private->wrapper)->bg_pixmap;
|
|
|
|
if (dc->bgpm == GDK_PARENT_RELATIVE_BG)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
for (; dc->bgpm == GDK_PARENT_RELATIVE_BG && dc->bg_relto; dc->bg_relto = (GdkWindow *)GDK_WINDOW_P (dc->bg_relto)->parent)
|
|
|
|
dc->bgpm = GDK_WINDOW_P (dc->bg_relto)->bg_pixmap;
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (dc->bgpm == GDK_NO_BG)
|
2000-06-20 20:20:38 +00:00
|
|
|
dc->bgpm = NULL;
|
|
|
|
}
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->clipxoff = - private->abs_x;
|
|
|
|
dc->clipyoff = - private->abs_y;
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->real_clip_region = gdk_fb_clip_region (drawable, gc, do_clipping, TRUE);
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (gc)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->clipxoff -= GDK_GC_FBDATA (gc)->values.clip_x_origin;
|
|
|
|
dc->clipyoff -= GDK_GC_FBDATA (gc)->values.clip_y_origin;
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_GC_FBDATA (gc)->values.clip_mask)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
dc->clipmem = GDK_DRAWABLE_IMPL_FBDATA (GDK_GC_FBDATA (gc)->values.clip_mask)->mem;
|
|
|
|
dc->clip_rowstride = GDK_DRAWABLE_IMPL_FBDATA (GDK_GC_FBDATA (gc)->values.clip_mask)->rowstride;
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (do_clipping &&
|
|
|
|
private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem &&
|
|
|
|
gdk_fb_cursor_region_need_hide (dc->real_clip_region))
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-07-24 16:19:00 +00:00
|
|
|
dc->handle_cursor = TRUE;
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_cursor_hide ();
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_drawing_context_finalize (GdkFBDrawingContext *dc)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_region_destroy (dc->real_clip_region);
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (dc->handle_cursor)
|
|
|
|
gdk_fb_cursor_unhide ();
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
void
|
|
|
|
gdk_fb_draw_drawable_2 (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gboolean draw_bg,
|
|
|
|
gboolean do_clipping)
|
|
|
|
{
|
2000-06-20 20:20:38 +00:00
|
|
|
GdkFBDrawingContext *dc, dc_data;
|
|
|
|
dc = &dc_data;
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
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);
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_fb_draw_drawable_3 (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
GdkFBDrawingContext *dc,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
GdkDrawableFBData *private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
GdkDrawableFBData *src_private = GDK_DRAWABLE_FBDATA (src);
|
2000-06-20 20:20:38 +00:00
|
|
|
GdkRectangle rect;
|
|
|
|
int src_x_off, src_y_off;
|
|
|
|
GdkRegion *tmpreg, *real_clip_region;
|
|
|
|
int i;
|
2000-07-24 16:19:00 +00:00
|
|
|
int draw_direction = 1;
|
2000-11-15 12:45:30 +00:00
|
|
|
gdk_fb_draw_drawable_func *draw_func = NULL;
|
|
|
|
GdkGCFBData *gc_private;
|
|
|
|
|
|
|
|
g_assert (gc);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
if (!GDK_WINDOW_P (private->wrapper)->mapped)
|
2000-06-20 20:20:38 +00:00
|
|
|
return;
|
2000-11-13 17:40:23 +00:00
|
|
|
if (GDK_WINDOW_P (private->wrapper)->input_only)
|
|
|
|
g_error ("Drawing on the evil input-only!");
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
gc_private = GDK_GC_FBDATA (gc);
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (drawable == src)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-07-24 16:19:00 +00:00
|
|
|
GdkRegionBox srcb, destb;
|
|
|
|
srcb.x1 = xsrc;
|
|
|
|
srcb.y1 = ysrc;
|
|
|
|
srcb.x2 = xsrc + width;
|
|
|
|
srcb.y2 = ysrc + height;
|
|
|
|
destb.x1 = xdest;
|
|
|
|
destb.y1 = ydest;
|
|
|
|
destb.x2 = xdest + width;
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
destb.y2 = ydest + height;
|
2000-07-24 16:19:00 +00:00
|
|
|
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
if (EXTENTCHECK (&srcb, &destb) && ((ydest > ysrc) || ((ydest == ysrc) && (xdest > xsrc))))
|
2000-07-24 16:19:00 +00:00
|
|
|
draw_direction = -1;
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
switch (src_private->depth)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_1];
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_8];
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_16];
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_24];
|
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_32];
|
|
|
|
break;
|
|
|
|
case 77:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_7_AA_GRAYVAL];
|
|
|
|
break;
|
|
|
|
case 78:
|
|
|
|
draw_func = gc_private->draw_drawable[GDK_FB_SRC_BPP_8_AA_GRAYVAL];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-06-20 20:20:38 +00:00
|
|
|
/* Do some magic to avoid creating extra regions unnecessarily */
|
|
|
|
tmpreg = dc->real_clip_region;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
rect.x = xdest + private->abs_x;
|
|
|
|
rect.y = ydest + private->abs_y;
|
2000-05-31 21:50:38 +00:00
|
|
|
rect.width = width;
|
|
|
|
rect.height = height;
|
2000-11-13 17:40:23 +00:00
|
|
|
real_clip_region = gdk_region_rectangle (&rect);
|
|
|
|
gdk_region_intersect (real_clip_region, tmpreg);
|
|
|
|
|
|
|
|
rect.x = xdest + private->abs_x;
|
|
|
|
rect.y = ydest + private->abs_y;
|
|
|
|
rect.width = MAX (src_private->width - xsrc, 0);
|
|
|
|
rect.height = MAX (src_private->height - ysrc, 0);
|
|
|
|
if (!rect.width || !rect.height)
|
2000-05-31 21:50:38 +00:00
|
|
|
goto out;
|
2000-11-13 17:40:23 +00:00
|
|
|
tmpreg = gdk_region_rectangle (&rect);
|
|
|
|
gdk_region_intersect (real_clip_region, tmpreg);
|
|
|
|
gdk_region_destroy (tmpreg);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
src_x_off = (src_private->abs_x + xsrc) - (private->abs_x + xdest);
|
|
|
|
src_y_off = (src_private->abs_y + ysrc) - (private->abs_y + ydest);
|
2000-05-31 21:50:38 +00:00
|
|
|
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
for (i = (draw_direction>0)?0:real_clip_region->numRects-1; i >= 0 && i < real_clip_region->numRects; i+=draw_direction)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
GdkRegionBox *cur = &real_clip_region->rects[i];
|
2000-07-24 16:19:00 +00:00
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
(*draw_func) (drawable,
|
|
|
|
gc,
|
|
|
|
src,
|
|
|
|
dc,
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
cur->y1,
|
|
|
|
cur->y2,
|
2000-11-15 12:45:30 +00:00
|
|
|
cur->x1,
|
|
|
|
cur->x2,
|
|
|
|
src_x_off,
|
|
|
|
src_y_off,
|
|
|
|
draw_direction);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_region_destroy (real_clip_region);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
void
|
|
|
|
gdk_fb_draw_drawable (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2000-12-05 11:39:26 +00:00
|
|
|
GdkPixmap *src_impl;
|
|
|
|
|
|
|
|
if (GDK_IS_DRAWABLE_IMPL_FBDATA (src))
|
|
|
|
src_impl = src;
|
|
|
|
else
|
|
|
|
src_impl = GDK_DRAWABLE_IMPL (src);
|
|
|
|
|
|
|
|
|
|
|
|
gdk_fb_draw_drawable_2 (drawable, gc, src_impl , xsrc, ysrc, xdest, ydest, width, height, TRUE, TRUE);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-15 12:45:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_text(GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
g_warning ("gdk_fb_draw_text NYI");
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_fb_draw_text_wc (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
g_warning ("gdk_fb_draw_text_wc NYI");
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_fb_draw_rectangle (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (filled)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
gboolean handle_cursor = FALSE;
|
|
|
|
GdkRectangle tmprect;
|
|
|
|
GdkRegion *tmpreg;
|
|
|
|
GdkRegion *real_clip_region;
|
|
|
|
GdkColor color;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (GDK_GC_FBDATA (gc)->values_mask & GDK_GC_FOREGROUND)
|
|
|
|
color = GDK_GC_FBDATA (gc)->values.foreground;
|
|
|
|
else if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
color = GDK_WINDOW_P (private->wrapper)->bg_color;
|
|
|
|
else
|
|
|
|
gdk_color_black (private->colormap, &color);
|
|
|
|
|
|
|
|
real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT);
|
|
|
|
|
|
|
|
if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem &&
|
|
|
|
gdk_fb_cursor_region_need_hide (real_clip_region))
|
|
|
|
{
|
|
|
|
handle_cursor = TRUE;
|
|
|
|
gdk_fb_cursor_hide ();
|
|
|
|
}
|
|
|
|
|
|
|
|
x += private->abs_x;
|
|
|
|
y += private->abs_y;
|
|
|
|
|
|
|
|
if (x < private->llim_x)
|
|
|
|
{
|
|
|
|
width -= private->llim_x - x;
|
|
|
|
x = private->llim_x;
|
|
|
|
}
|
|
|
|
if (x + width > private->lim_x)
|
|
|
|
width = private->lim_x - x;
|
|
|
|
|
|
|
|
if (y < private->llim_y)
|
|
|
|
{
|
|
|
|
height -= private->llim_y - y;
|
|
|
|
y = private->llim_y;
|
|
|
|
}
|
|
|
|
if (y + height > private->lim_y)
|
|
|
|
height = private->lim_y - y;
|
|
|
|
|
|
|
|
tmprect.x = x;
|
|
|
|
tmprect.y = y;
|
|
|
|
tmprect.width = width;
|
|
|
|
tmprect.height = height;
|
|
|
|
tmpreg = gdk_region_rectangle (&tmprect);
|
|
|
|
|
|
|
|
gdk_region_intersect (tmpreg, real_clip_region);
|
|
|
|
|
|
|
|
for (i = 0; i < tmpreg->numRects; i++)
|
|
|
|
{
|
|
|
|
GdkRectangle r;
|
|
|
|
r.x = tmpreg->rects[i].x1;
|
|
|
|
r.y = tmpreg->rects[i].y1;
|
|
|
|
r.width = tmpreg->rects[i].x2 - tmpreg->rects[i].x1;
|
|
|
|
r.height = tmpreg->rects[i].y2 - tmpreg->rects[i].y1;
|
|
|
|
|
|
|
|
if ((r.width > 0) && (r.height > 0))
|
|
|
|
(GDK_GC_FBDATA (gc)->fill_rectangle) (drawable, gc, &r, &color);
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_region_destroy (tmpreg);
|
|
|
|
|
|
|
|
gdk_region_destroy (real_clip_region);
|
|
|
|
if (handle_cursor)
|
|
|
|
gdk_fb_cursor_unhide ();
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GdkPoint pts[5];
|
2000-11-22 10:07:34 +00:00
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
pts[0].x = pts[4].x = x;
|
|
|
|
pts[0].y = pts[4].y = y;
|
|
|
|
pts[1].x = x + width;
|
|
|
|
pts[1].y = y;
|
|
|
|
pts[2].x = x + width;
|
|
|
|
pts[2].y = y + height;
|
|
|
|
pts[3].x = x;
|
|
|
|
pts[3].y = y + height;
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_draw_lines (drawable, gc, pts, 5);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
2000-11-22 10:07:34 +00:00
|
|
|
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_points (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
GdkSpan *spans = g_alloca (npoints * sizeof(GdkSpan));
|
2000-05-31 21:50:38 +00:00
|
|
|
int i;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
for (i = 0; i < npoints; i++)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-22 10:07:34 +00:00
|
|
|
spans[i].x = points[i].x;
|
|
|
|
spans[i].y = points[i].y;
|
|
|
|
spans[i].width = 1;
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-22 10:07:34 +00:00
|
|
|
gdk_fb_fill_spans (drawable, gc, spans, npoints, FALSE);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_arc (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint angle1,
|
|
|
|
gint angle2)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
miArc arc;
|
|
|
|
|
|
|
|
arc.x = x;
|
|
|
|
arc.y = y;
|
|
|
|
arc.width = width;
|
|
|
|
arc.height = height;
|
|
|
|
arc.angle1 = angle1;
|
|
|
|
arc.angle2 = angle2;
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
if (filled)
|
|
|
|
miPolyFillArc (drawable, gc, 1, &arc);
|
2000-05-31 21:50:38 +00:00
|
|
|
else
|
2000-11-13 17:40:23 +00:00
|
|
|
miPolyArc (drawable, gc, 1, &arc);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_polygon (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-11-13 17:40:23 +00:00
|
|
|
if (filled)
|
|
|
|
miFillPolygon (drawable, gc, 0, 0, npoints, points);
|
2000-05-31 21:50:38 +00:00
|
|
|
else
|
|
|
|
{
|
2001-01-05 14:01:36 +00:00
|
|
|
gint tmp_npoints;
|
|
|
|
GdkPoint *tmp_points;
|
|
|
|
|
|
|
|
if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y)
|
|
|
|
{
|
|
|
|
tmp_npoints = npoints + 1;
|
|
|
|
tmp_points = g_new (GdkPoint, tmp_npoints);
|
|
|
|
memcpy (tmp_points, points, sizeof(GdkPoint) * npoints);
|
|
|
|
tmp_points[npoints].x = points[0].x;
|
|
|
|
tmp_points[npoints].y = points[0].y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tmp_npoints = npoints;
|
|
|
|
tmp_points = points;
|
|
|
|
}
|
2000-05-31 21:50:38 +00:00
|
|
|
|
2001-01-05 14:01:36 +00:00
|
|
|
gdk_fb_draw_lines (drawable, gc, tmp_points, tmp_npoints);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
static void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_draw_lines (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
GdkGCFBData *private;
|
|
|
|
|
|
|
|
private = GDK_GC_FBDATA (gc);
|
|
|
|
if (private->values.line_width > 0)
|
|
|
|
{
|
2001-01-05 14:01:36 +00:00
|
|
|
if ((private->values.line_style != GDK_LINE_SOLID) && private->dash_list)
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
miWideDash (drawable, gc, 0, npoints, points);
|
|
|
|
else
|
|
|
|
miWideLine (drawable, gc, 0, npoints, points);
|
|
|
|
}
|
2000-05-31 21:50:38 +00:00
|
|
|
else
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
{
|
2001-01-05 14:01:36 +00:00
|
|
|
if ((private->values.line_style != GDK_LINE_SOLID) && private->dash_list)
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
miZeroDashLine (drawable, gc, 0, npoints, points);
|
|
|
|
else
|
|
|
|
miZeroLine (drawable, gc, 0, npoints, points);
|
|
|
|
}
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_segments (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkSegment *segs,
|
|
|
|
gint nsegs)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
|
|
|
GdkPoint pts[2];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i = 0; i < nsegs; i++)
|
|
|
|
{
|
|
|
|
pts[0].x = segs[i].x1;
|
|
|
|
pts[0].y = segs[i].y1;
|
|
|
|
pts[1].x = segs[i].x2;
|
|
|
|
pts[1].y = segs[i].y2;
|
Huge GtkFB patch with lots of small bugfixes and initial selections implementation.
2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c:
Initial selection implementation.
* gtk/gtkselection.c:
if GDK_WINDOWING_FB defined, include linux-fb/gdkfb.h and look up
requestor in gtk_selection_request.
* gdk/linux-fb/gdkfb.h, gdk/linux-fb/gdkglobals-fb.c:
Added gdk_selection_property atom.
* gdk/linux-fb/gdkprivate-fb.h:
Export _gdk_selection_window_destroyed.
Removed mask_off_x/y from GdkCursorPrivateFB.
Removed hbearing, added top, left to PangoFBGlyphInfo.
* gdk/linux-fb/gdkwindow-fb.c (_gdk_windowing_window_destroy):
Call _gdk_selection_window_destroyed
(_gdk_windowing_window_init): Don't call gdk_cursor_new() before
the root window has been created.
(static_dx_hack, static_dy_hack, compare_draw_rects,
gdk_fb_window_move_resize): Remove unnecessary sort of rectangles
in region. They are already sorted. Instead just traverse them in
reverse if draw_direction < 0.
* gdk/linux-fb/gdkinput-ps2.c (send_button_event):
Double-clicks must be sent after the normal button_press.
(gdk_fb_cursor_unhide): Remove usage of mask_off_x/y. Clean up.
* gdk/linux-fb/gdkgeometry-fb.c (gdk_window_scroll):
Pass _gdk_fb_screen_gc instead of NULL.
* gdk/linux-fb/gdkmain-fb.c (_gdk_windowing_init_check):
Initialize gdk_selection_property.
(gdk_event_make): Remove unused code.
* gdk/linux-fb/gdkcursor-fb.c:
Make the pixmap for the cursor the same size as the mask. Also remove
the mask_off_x/y fields in GdkCursorPrivateFB and combine
_gdk_cursor_new_from_pixmap() and gdk_cursor_new_from_pixmap()
Now the whole cursor is visible.
* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_drawable_3):
Fix bug where xdest+height instead of ydest+height was used
to calculate if the source and dest overlapped. This fixes the
redraw bug when the main window in testgtk was scrolled when
partially covered by a tall window.
Copy rectangles in region in order depending on draw_direction.
Also moved the draw_direction flipping of start_y and end_y into
the gc functions, as this might not be what all of them want.
(gdk_fb_draw_lines): Support dashed lines.
(gdk_fb_draw_glyphs): Clean up glyph placement. Also fix positioning
so that the text is positioned correctly (was 1 pixel high).
gdk/linux-fb/gdkgc-fb.c:
Initialize cap_style to GTK_CAP_BUTT. This fixes a problem where
all lines were drawn a pixel to short. Also checked the default of
the rest of the values, and they're the same as X now.
* gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_glyph_info):
Clean up pixel positioning of the glyphs. Just use bgy->top and
bgy->left. Also used PANGO_PIXEL where appropriate and added 0.5
to all divisions to get correct rounding behaviour.
* gdk/linux-fb/gdkrender-fb.c (gdk_fb_draw_drawable_generic,
gdk_fb_draw_drawable_memmove, gdk_fb_draw_drawable_aa_24):
Moved start_y/end_y flip into draw_drawable implementations.
Flip also x rendering when draw_direction < 0.
Remove unneccesary multiply with draw_direction.
2000-11-25 15:44:35 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_draw_lines (drawable, gc, pts, 2);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_drawable_clear (GdkDrawable *d)
|
2000-05-31 21:50:38 +00:00
|
|
|
{
|
2000-06-20 20:20:38 +00:00
|
|
|
extern void
|
|
|
|
_gdk_windowing_window_clear_area (GdkWindow *window,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
_gdk_windowing_window_clear_area (d, 0, 0, GDK_DRAWABLE_IMPL_FBDATA (d)->width, GDK_DRAWABLE_IMPL_FBDATA (d)->height);
|
2000-05-31 21:50:38 +00:00
|
|
|
}
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
static void
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
_gdk_fb_draw_glyphs (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
PangoFont *font,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoGlyphString *glyphs,
|
|
|
|
GdkRectangle *bbox)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
|
|
|
GdkFBDrawingContext fbdc;
|
2000-12-21 10:33:40 +00:00
|
|
|
GdkPixmapFBData pixmap;
|
|
|
|
PangoFT2Subfont subfont_index;
|
|
|
|
PangoGlyphInfo *gi;
|
|
|
|
FT_Face face;
|
|
|
|
FT_UInt glyph_index;
|
|
|
|
int i, xpos;
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
int maxy, miny;
|
|
|
|
int topy;
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
g_return_if_fail (font);
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_drawing_context_init (&fbdc, drawable, gc, FALSE, TRUE);
|
2000-06-20 20:20:38 +00:00
|
|
|
|
|
|
|
/* Fake its existence as a pixmap */
|
|
|
|
|
2000-12-21 10:33:40 +00:00
|
|
|
pixmap.drawable_data.abs_x = 0;
|
|
|
|
pixmap.drawable_data.abs_y = 0;
|
|
|
|
pixmap.drawable_data.depth = 78;
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
|
|
|
|
maxy = miny = 0;
|
2000-12-21 10:33:40 +00:00
|
|
|
|
|
|
|
gi = glyphs->glyphs;
|
|
|
|
for (i = 0, xpos = 0; i < glyphs->num_glyphs; i++, gi++)
|
2000-06-20 20:20:38 +00:00
|
|
|
{
|
2000-12-21 10:33:40 +00:00
|
|
|
if (gi->glyph)
|
|
|
|
{
|
|
|
|
glyph_index = PANGO_FT2_GLYPH_INDEX (gi->glyph);
|
|
|
|
subfont_index = PANGO_FT2_GLYPH_SUBFONT (gi->glyph);
|
|
|
|
face = pango_ft2_get_face (font, subfont_index);
|
2000-06-20 20:20:38 +00:00
|
|
|
|
2000-12-21 10:33:40 +00:00
|
|
|
if (face)
|
|
|
|
{
|
|
|
|
/* Draw glyph */
|
|
|
|
FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT);
|
|
|
|
if (face->glyph->format != ft_glyph_format_bitmap)
|
|
|
|
FT_Render_Glyph (face->glyph, ft_render_mode_normal);
|
|
|
|
|
|
|
|
pixmap.drawable_data.mem = face->glyph->bitmap.buffer;
|
|
|
|
pixmap.drawable_data.rowstride = face->glyph->bitmap.pitch;
|
|
|
|
pixmap.drawable_data.width = face->glyph->bitmap.width;
|
|
|
|
pixmap.drawable_data.height = face->glyph->bitmap.rows;
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
|
|
|
|
topy = y - face->glyph->bitmap_top + 1;
|
|
|
|
miny = MIN (miny, topy);
|
|
|
|
maxy = MAX (maxy, topy + face->glyph->bitmap.rows);
|
2000-12-21 10:33:40 +00:00
|
|
|
gdk_fb_draw_drawable_3 (drawable, gc, (GdkPixmap *)&pixmap,
|
|
|
|
&fbdc,
|
|
|
|
0, 0,
|
|
|
|
x + PANGO_PIXELS (xpos) + face->glyph->bitmap_left,
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
topy,
|
2000-12-21 10:33:40 +00:00
|
|
|
face->glyph->bitmap.width, face->glyph->bitmap.rows);
|
|
|
|
}
|
|
|
|
}
|
2000-06-20 20:20:38 +00:00
|
|
|
xpos += glyphs->glyphs[i].geometry.width;
|
|
|
|
}
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_drawing_context_finalize (&fbdc);
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
|
|
|
|
if (bbox)
|
|
|
|
{
|
|
|
|
bbox->x = x;
|
|
|
|
bbox->y = miny;
|
|
|
|
bbox->width = xpos;
|
|
|
|
bbox->height = maxy - miny;
|
|
|
|
}
|
2000-06-20 20:20:38 +00:00
|
|
|
}
|
2000-07-24 16:19:00 +00:00
|
|
|
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
static void
|
|
|
|
gdk_fb_draw_glyphs (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
PangoFont *font,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoGlyphString *glyphs)
|
|
|
|
{
|
|
|
|
_gdk_fb_draw_glyphs (drawable, gc, font, x, y, glyphs, NULL);
|
|
|
|
}
|
2000-07-24 16:19:00 +00:00
|
|
|
|
|
|
|
static void
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_draw_image (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkImage *image,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2000-07-24 16:19:00 +00:00
|
|
|
{
|
|
|
|
GdkImagePrivateFB *image_private;
|
|
|
|
GdkPixmapFBData fbd;
|
|
|
|
|
|
|
|
g_return_if_fail (drawable != NULL);
|
|
|
|
g_return_if_fail (image != NULL);
|
|
|
|
g_return_if_fail (gc != NULL);
|
|
|
|
|
|
|
|
image_private = (GdkImagePrivateFB*) image;
|
|
|
|
|
|
|
|
g_return_if_fail (image->type == GDK_IMAGE_NORMAL);
|
|
|
|
|
|
|
|
/* Fake its existence as a pixmap */
|
2000-11-13 17:40:23 +00:00
|
|
|
memset (&fbd, 0, sizeof(fbd));
|
2000-07-24 16:19:00 +00:00
|
|
|
fbd.drawable_data.mem = image->mem;
|
|
|
|
fbd.drawable_data.rowstride = image->bpl;
|
|
|
|
fbd.drawable_data.width = fbd.drawable_data.lim_x = image->width;
|
|
|
|
fbd.drawable_data.height = fbd.drawable_data.lim_y = image->height;
|
|
|
|
fbd.drawable_data.depth = image->depth;
|
|
|
|
fbd.drawable_data.window_type = GDK_DRAWABLE_PIXMAP;
|
2000-12-05 16:58:25 +00:00
|
|
|
fbd.drawable_data.colormap = gdk_colormap_get_system ();
|
|
|
|
|
2000-11-13 17:40:23 +00:00
|
|
|
gdk_fb_draw_drawable_2 (drawable, gc, (GdkPixmap *)&fbd, xsrc, ysrc, xdest, ydest, width, height, TRUE, TRUE);
|
2000-07-24 16:19:00 +00:00
|
|
|
}
|
2000-11-09 12:15:40 +00:00
|
|
|
|
|
|
|
static gint
|
|
|
|
gdk_fb_get_depth (GdkDrawable *drawable)
|
|
|
|
{
|
|
|
|
return GDK_DRAWABLE_IMPL_FBDATA (drawable)->depth;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkVisual*
|
|
|
|
gdk_fb_get_visual (GdkDrawable *drawable)
|
|
|
|
{
|
|
|
|
return gdk_visual_get_system();
|
|
|
|
}
|
Added ENABLE_SHADOW_FB
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:
Added ENABLE_SHADOW_FB
* configure.in:
Added --disable-shadowfb
* gdk/linux-fb/gdkcursor-fb.c:
Update shadowfb when updating cursor
* gdk/linux-fb/gdkdrawable-fb2.c:
Added wrappers for shadowfb that calls the normal drawable
methods, but calls gdk_shadow_fb_update(bounding box) when
GdkWindows are drawed to.
Moved gdk_draw_glyphs implementation to _gdk_draw_glyphs
which also returns the bounding box.
* gdk/linux-fb/gdkfb.h:
Added GdkFBAngle type and gdk_fb_set_rotation declaration.
* gdk/linux-fb/gdkgeometry-fb.c:
Update shadowfb when scrolling window.
* gdk/linux-fb/gdkglobals-fb.c:
Add _gdk_fb_screen_angle.
* gdk/linux-fb/gdkkeyboard-fb.c:
Test code for screen rotation. Shift-F2 in the xlate driver
rotates the screen.
* gdk/linux-fb/gdkmain-fb.c:
Handle shadowfb. Add gdk_fb_set_rotation(). Remove CM and RP.
* gdk/linux-fb/gdkmouse-fb.c:
Use fb_width/height instead of modeinfo.xres/yres.
* gdk/linux-fb/gdkprivate-fb.h:
Added fb_men, fb_width, fb_height & fb_stride. When using
shadow fb these can differ from the framebuffer stuff.
Declarations for gdk_shadow_fb_update, gdk_shadow_fb_init,
gdk_shadow_fb_stop_updates, gdk_fb_recompute_all,
_gdk_fb_screen_angle. Removed CM, RP.
* gdk/linux-fb/gdkrender-fb.c:
Added code for shadowfb handling and screen rotation using
shadowfb.
* gdk/linux-fb/gdkwindow-fb.c:
Use fb_mem, fb_stride, fb_width, fb_height.
Added recompute_rowstride to reset the rowstride of all windows.
Added gdk_fb_recompute_all() which recomputes rootwindow size,
window abs positions and window rowstrides. Usefull when the
rotation has changed.
2001-01-11 16:39:21 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_SHADOW_FB
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_rectangle (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_rectangle (drawable, gc, filled, x, y, width, height);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
gint extra_width;
|
|
|
|
|
|
|
|
minx = x + private->abs_x;
|
|
|
|
miny = y + private->abs_y;
|
|
|
|
maxx = x + width + private->abs_x;
|
|
|
|
maxy = y + height + private->abs_y;
|
|
|
|
|
|
|
|
if (!filled)
|
|
|
|
{
|
|
|
|
extra_width = (GDK_GC_FBDATA (gc)->values.line_width + 1) / 2;
|
|
|
|
|
|
|
|
minx -= extra_width;
|
|
|
|
miny -= extra_width;
|
|
|
|
maxx += extra_width;
|
|
|
|
maxy += extra_width;
|
|
|
|
}
|
|
|
|
gdk_shadow_fb_update (minx, miny, maxx, maxy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_arc (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint angle1,
|
|
|
|
gint angle2)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_arc (drawable, gc, filled, x, y, width, height, angle1, angle2);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
gint extra_width;
|
|
|
|
|
|
|
|
minx = x + private->abs_x;
|
|
|
|
miny = x + private->abs_y;
|
|
|
|
maxx = x + width + private->abs_x;
|
|
|
|
maxy = y + height + private->abs_x;
|
|
|
|
|
|
|
|
if (!filled)
|
|
|
|
{
|
|
|
|
extra_width = (GDK_GC_FBDATA (gc)->values.line_width + 1) / 2;
|
|
|
|
|
|
|
|
minx -= extra_width;
|
|
|
|
miny -= extra_width;
|
|
|
|
maxx += extra_width;
|
|
|
|
maxy += extra_width;
|
|
|
|
}
|
|
|
|
gdk_shadow_fb_update (minx, miny, maxx, maxy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_polygon (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint filled,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_polygon (drawable, gc, filled, points, npoints);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
gint extra_width;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
minx = maxx = points[0].x;
|
|
|
|
miny = maxy = points[0].y;
|
|
|
|
|
|
|
|
for (i=1;i<npoints;i++)
|
|
|
|
{
|
|
|
|
minx = MIN(minx, points[i].x);
|
|
|
|
maxx = MAX(maxx, points[i].x);
|
|
|
|
miny = MIN(miny, points[i].y);
|
|
|
|
maxy = MAX(maxy, points[i].y);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!filled)
|
|
|
|
{
|
|
|
|
extra_width = (GDK_GC_FBDATA (gc)->values.line_width + 1) / 2;
|
|
|
|
|
|
|
|
minx -= extra_width;
|
|
|
|
miny -= extra_width;
|
|
|
|
maxx += extra_width;
|
|
|
|
maxy += extra_width;
|
|
|
|
}
|
|
|
|
gdk_shadow_fb_update (minx + private->abs_x, miny + private->abs_y,
|
|
|
|
maxx + private->abs_x, maxy + private->abs_y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_text (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const gchar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
|
|
|
gdk_fb_draw_text (drawable, font, gc, x, y, text, text_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_text_wc (GdkDrawable *drawable,
|
|
|
|
GdkFont *font,
|
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const GdkWChar *text,
|
|
|
|
gint text_length)
|
|
|
|
{
|
|
|
|
gdk_fb_draw_text_wc (drawable, font, gc, x, y, text, text_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_glyphs (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
PangoFont *font,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
PangoGlyphString *glyphs)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
GdkRectangle bbox;
|
|
|
|
|
|
|
|
_gdk_fb_draw_glyphs (drawable, gc, font, x, y, glyphs, &bbox);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
gdk_shadow_fb_update (bbox.x + private->abs_x, bbox.y + private->abs_y,
|
|
|
|
bbox.x + private->abs_x + bbox.width, bbox.y + private->abs_y + bbox.height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_drawable (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPixmap *src,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_drawable (drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
gdk_shadow_fb_update (xdest + private->abs_x, ydest + private->abs_y,
|
|
|
|
xdest + private->abs_x + width, ydest + private->abs_y + height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_image (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkImage *image,
|
|
|
|
gint xsrc,
|
|
|
|
gint ysrc,
|
|
|
|
gint xdest,
|
|
|
|
gint ydest,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_image (drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
gdk_shadow_fb_update (xdest + private->abs_x, ydest + private->abs_y,
|
|
|
|
xdest + private->abs_x + width, ydest + private->abs_y + height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_points (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_points (drawable, gc, points, npoints);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
minx = maxx = points[0].x;
|
|
|
|
miny = maxy = points[0].y;
|
|
|
|
|
|
|
|
for (i=1;i<npoints;i++)
|
|
|
|
{
|
|
|
|
minx = MIN(minx, points[i].x);
|
|
|
|
maxx = MAX(maxx, points[i].x);
|
|
|
|
miny = MIN(miny, points[i].y);
|
|
|
|
maxy = MAX(maxy, points[i].y);
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_shadow_fb_update (minx + private->abs_x, miny + private->abs_y,
|
|
|
|
maxx + private->abs_x, maxy + private->abs_y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_segments (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkSegment *segs,
|
|
|
|
gint nsegs)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_segments (drawable, gc, segs, nsegs);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
gint extra_width;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
minx = maxx = segs[0].x1;
|
|
|
|
miny = maxy = segs[0].y1;
|
|
|
|
|
|
|
|
for (i=0;i<nsegs;i++)
|
|
|
|
{
|
|
|
|
minx = MIN(minx, segs[i].x1);
|
|
|
|
maxx = MAX(maxx, segs[i].x1);
|
|
|
|
minx = MIN(minx, segs[i].x2);
|
|
|
|
maxx = MAX(maxx, segs[i].x2);
|
|
|
|
|
|
|
|
miny = MIN(miny, segs[i].y1);
|
|
|
|
maxy = MAX(maxy, segs[i].y1);
|
|
|
|
miny = MIN(miny, segs[i].y2);
|
|
|
|
maxy = MAX(maxy, segs[i].y2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_width = (GDK_GC_FBDATA (gc)->values.line_width + 1) / 2;
|
|
|
|
|
|
|
|
minx -= extra_width;
|
|
|
|
miny -= extra_width;
|
|
|
|
maxx += extra_width;
|
|
|
|
maxy += extra_width;
|
|
|
|
|
|
|
|
gdk_shadow_fb_update (minx + private->abs_x, miny + private->abs_y,
|
|
|
|
maxx + private->abs_x, maxy + private->abs_y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_shadow_fb_draw_lines (GdkDrawable *drawable,
|
|
|
|
GdkGC *gc,
|
|
|
|
GdkPoint *points,
|
|
|
|
gint npoints)
|
|
|
|
{
|
|
|
|
GdkDrawableFBData *private;
|
|
|
|
|
|
|
|
gdk_fb_draw_lines (drawable, gc, points, npoints);
|
|
|
|
|
|
|
|
private = GDK_DRAWABLE_FBDATA (drawable);
|
|
|
|
if (GDK_IS_WINDOW (private->wrapper))
|
|
|
|
{
|
|
|
|
gint minx, miny, maxx, maxy;
|
|
|
|
gint extra_width;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
minx = maxx = points[0].x;
|
|
|
|
miny = maxy = points[0].y;
|
|
|
|
|
|
|
|
for (i=1;i<npoints;i++)
|
|
|
|
{
|
|
|
|
minx = MIN(minx, points[i].x);
|
|
|
|
maxx = MAX(maxx, points[i].x);
|
|
|
|
miny = MIN(miny, points[i].y);
|
|
|
|
maxy = MAX(maxy, points[i].y);
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_width = (GDK_GC_FBDATA (gc)->values.line_width + 1) / 2;
|
|
|
|
|
|
|
|
minx -= extra_width;
|
|
|
|
miny -= extra_width;
|
|
|
|
maxx += extra_width;
|
|
|
|
maxy += extra_width;
|
|
|
|
|
|
|
|
gdk_shadow_fb_update (minx + private->abs_x, miny + private->abs_y,
|
|
|
|
maxx + private->abs_x, maxy + private->abs_y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|