Commit dd7510dc authored by Elliot Lee's avatar Elliot Lee
Browse files

*** empty log message ***

parent 2eb7985b
......@@ -27,7 +27,8 @@ typedef enum
* drags */
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
GDK_DRAG_PROTO_OLE2 /* The complex OLE2 dnd (not implemented) */
GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */
GDK_DRAG_PROTO_LOCAL /* Intra-app */
} GdkDragProtocol;
/* Structure that holds information about a drag in progress.
......
......@@ -375,7 +375,6 @@ gdk_draw_image (GdkDrawable *drawable,
if (height == -1)
height = image->height;
if (GDK_IS_WINDOW (drawable))
_gdk_window_draw_image (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
......
......@@ -135,7 +135,6 @@ gdk_event_queue_remove_link (GList *node)
node->next->prev = node->prev;
else
gdk_queued_tail = node->prev;
}
/*************************************************************
......
......@@ -342,8 +342,8 @@ struct _GdkEventSelection
GdkAtom selection;
GdkAtom target;
GdkAtom property;
guint32 requestor;
guint32 time;
GdkNativeWindow requestor;
};
/* This event type will be used pretty rarely. It only is important
......
......@@ -73,6 +73,7 @@ typedef enum
GDK_COPY_INVERT,
GDK_OR_INVERT,
GDK_NAND,
GDK_NOR,
GDK_SET
} GdkFunction;
......
......@@ -49,10 +49,9 @@ extern "C" {
GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
#define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
#define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
#define GDK_DRAWABLE_P(d) ((GdkDrawablePrivate*)d)
#define GDK_WINDOW_P(d) ((GdkWindowPrivate*)d)
#define GDK_GC_P(d) ((GdkGCPrivate*)d)
typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
typedef struct _GdkWindowPrivate GdkWindowPrivate;
......
......@@ -45,12 +45,9 @@ SOFTWARE.
#ifndef __GDK_REGION_GENERIC_H__
#define __GDK_REGION_GENERIC_H__
typedef struct _GdkRegionBox GdkRegionBox;
#include "gdktypes.h"
struct _GdkRegionBox
{
int x1, x2, y1, y2;
};
typedef GdkSegment GdkRegionBox;
/*
* clip region
......
......@@ -76,6 +76,12 @@ typedef struct _GdkSegment GdkSegment;
*/
typedef guint32 GdkWChar;
typedef gulong GdkAtom;
#ifdef GDK_NATIVE_WINDOW_POINTER
typedef gpointer GdkNativeWindow;
#else
typedef guint32 GdkNativeWindow;
#endif
/* Forward declarations of commonly used types
*/
......
......@@ -657,7 +657,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
{
tmp_paint = private->paint_stack->data;
gdk_region_subtract (init_region, tmp_paint->region);
tmp_list = tmp_list->next;
}
}
......@@ -745,6 +745,7 @@ gdk_window_free_paint_stack (GdkWindow *window)
while (tmp_list)
{
GdkWindowPaint *paint = tmp_list->data;
if (tmp_list == private->paint_stack)
gdk_drawable_unref (paint->pixmap);
......@@ -1119,6 +1120,7 @@ gdk_window_draw_glyphs (GdkDrawable *drawable,
if (private->paint_stack)
{
GdkWindowPaint *paint = private->paint_stack->data;
gdk_draw_glyphs (paint->pixmap, gc, font, x - x_offset, y - y_offset, glyphs);
}
else
......
......@@ -9,23 +9,22 @@ INCLUDES = @STRIP_BEGIN@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@PANGO_CFLAGS@ \
@STRIP_END@
LDFLAGS = @STRIP_BEGIN@ \
@GLIB_LIBS@ \
-L/gnome2/lib \
-lt1 \
@PANGO_CFLAGS@ \
-lfreetype \
-lm \
@STRIP_END@
if USE_LINUX_FB
noinst_LTLIBRARIES = libgdk-linux-fb.la
noinst_PROGRAMS=#test-fb
lib_LTLIBRARIES = libgdk-fb.la
noinst_PROGRAMS=test-fb
#test_fb_LDFLAGS=../libgdk.la libgdk-linux-fb.la
test_fb_LDFLAGS=../libgdk.la libgdk-fb.la
libgdk_fb_la_SOURCES = \
libgdk_linux_fb_la_SOURCES = \
gdkcolor-fb.c \
gdkcursor-fb.c \
gdkdnd-fb.c \
......@@ -57,10 +56,6 @@ libgdk_fb_la_SOURCES = \
miwideline.c \
mizerclip.c \
mizerline.c \
mispans.c \
gdkpango-fb.c
mispans.c
else
lib_LTLIBRARIES =
noinst_PROGRAMS=
endif
......@@ -28,20 +28,199 @@
#include "gdkprivate-fb.h"
#include "gdkcursor.h"
#include "/home/sopwith/bin/t.xbm"
static struct {
const guchar *bits;
int width, height, hotx, hoty;
GdkPixmap *pm;
} stock_cursors[] = {
{X_cursor_bits, 14, 14, 6, 8},
{X_cursor_mask_bits, 16, 16, 7, 9},
{arrow_bits, 14, 14, 13, 14},
{arrow_mask_bits, 16, 16, 14, 15},
{based_arrow_down_bits, 8, 10, 3, 1},
{based_arrow_down_mask_bits, 10, 12, 4, 2},
{based_arrow_up_bits, 8, 10, 3, 1},
{based_arrow_up_mask_bits, 10, 12, 4, 2},
{boat_bits, 16, 8, 14, 5},
{boat_mask_bits, 16, 9, 14, 5},
{bogosity_bits, 13, 14, 6, 8},
{bogosity_mask_bits, 15, 16, 7, 9},
{bottom_left_corner_bits, 14, 14, 0, 1},
{bottom_left_corner_mask_bits, 16, 16, 1, 2},
{bottom_right_corner_bits, 14, 14, 13, 1},
{bottom_right_corner_mask_bits, 16, 16, 14, 2},
{bottom_side_bits, 13, 14, 6, 1},
{bottom_side_mask_bits, 15, 16, 7, 2},
{bottom_tee_bits, 14, 10, 7, 1},
{bottom_tee_mask_bits, 16, 12, 8, 2},
{box_spiral_bits, 15, 16, 8, 8},
{box_spiral_mask_bits, 16, 16, 8, 8},
{center_ptr_bits, 10, 14, 4, 14},
{center_ptr_mask_bits, 12, 16, 5, 15},
{circle_bits, 14, 14, 7, 7},
{circle_mask_bits, 16, 16, 8, 8},
{clock_bits, 14, 16, 6, 13},
{clock_mask_bits, 15, 16, 6, 13},
{coffee_mug_bits, 15, 16, 7, 7},
{coffee_mug_mask_bits, 16, 16, 7, 7},
{cross_bits, 16, 15, 7, 8},
{cross_mask_bits, 16, 16, 7, 9},
{cross_reverse_bits, 16, 15, 7, 8},
{cross_reverse_mask_bits, 16, 15, 7, 8},
{crosshair_bits, 16, 15, 7, 8},
{crosshair_mask_bits, 16, 16, 7, 9},
{diamond_cross_bits, 15, 15, 7, 8},
{diamond_cross_mask_bits, 16, 16, 7, 9},
{dot_bits, 10, 10, 5, 5},
{dot_mask_bits, 12, 12, 6, 6},
{dotbox_bits, 12, 12, 6, 7},
{dotbox_mask_bits, 14, 14, 7, 8},
{double_arrow_bits, 10, 14, 5, 7},
{double_arrow_mask_bits, 12, 16, 6, 8},
{draft_large_bits, 15, 15, 14, 15},
{draft_large_mask_bits, 15, 16, 14, 16},
{draft_small_bits, 15, 15, 14, 15},
{draft_small_mask_bits, 15, 15, 14, 15},
{draped_box_bits, 12, 12, 6, 7},
{draped_box_mask_bits, 14, 14, 7, 8},
{exchange_bits, 14, 14, 6, 8},
{exchange_mask_bits, 16, 16, 7, 9},
{fleur_bits, 14, 14, 7, 7},
{fleur_mask_bits, 16, 16, 8, 8},
{gobbler_bits, 16, 15, 14, 13},
{gobbler_mask_bits, 16, 16, 14, 13},
{gumby_bits, 16, 16, 2, 16},
{gumby_mask_bits, 16, 16, 2, 16},
{hand1_bits, 13, 16, 12, 16},
{hand1_mask_bits, 13, 16, 12, 16},
{hand2_bits, 15, 14, 0, 14},
{hand2_mask_bits, 16, 16, 0, 15},
{heart_bits, 15, 14, 6, 6},
{heart_mask_bits, 15, 14, 6, 6},
{icon_bits, 16, 16, 8, 8},
{icon_mask_bits, 16, 16, 8, 8},
{iron_cross_bits, 14, 14, 7, 8},
{iron_cross_mask_bits, 16, 16, 8, 9},
{left_ptr_bits, 8, 14, 0, 14},
{left_ptr_mask_bits, 10, 16, 1, 15},
{left_side_bits, 14, 13, 0, 7},
{left_side_mask_bits, 16, 15, 1, 8},
{left_tee_bits, 10, 14, 0, 7},
{left_tee_mask_bits, 12, 16, 1, 8},
{leftbutton_bits, 16, 16, 8, 8},
{leftbutton_mask_bits, 15, 16, 8, 8},
{ll_angle_bits, 10, 10, 0, 1},
{ll_angle_mask_bits, 12, 12, 1, 2},
{lr_angle_bits, 10, 10, 9, 1},
{lr_angle_mask_bits, 12, 12, 10, 2},
{man_bits, 16, 16, 14, 11},
{man_mask_bits, 16, 16, 14, 11},
{middlebutton_bits, 16, 16, 8, 8},
{middlebutton_mask_bits, 15, 16, 8, 8},
{mouse_bits, 15, 14, 4, 13},
{mouse_mask_bits, 16, 16, 4, 15},
{pencil_bits, 11, 16, 10, 1},
{pencil_mask_bits, 13, 16, 11, 1},
{pirate_bits, 15, 16, 7, 4},
{pirate_mask_bits, 16, 16, 7, 4},
{plus_bits, 10, 10, 4, 5},
{plus_mask_bits, 12, 12, 5, 6},
{question_arrow_bits, 9, 15, 4, 8},
{question_arrow_mask_bits, 11, 16, 5, 8},
{right_ptr_bits, 8, 14, 7, 14},
{right_ptr_mask_bits, 10, 16, 8, 15},
{right_side_bits, 14, 13, 13, 7},
{right_side_mask_bits, 16, 15, 14, 8},
{right_tee_bits, 10, 14, 9, 7},
{right_tee_mask_bits, 12, 16, 10, 8},
{rightbutton_bits, 16, 16, 8, 8},
{rightbutton_mask_bits, 15, 16, 8, 8},
{rtl_logo_bits, 14, 14, 6, 8},
{rtl_logo_mask_bits, 16, 16, 7, 9},
{sailboat_bits, 12, 13, 6, 14},
{sailboat_mask_bits, 16, 16, 8, 16},
{sb_down_arrow_bits, 7, 15, 3, 0},
{sb_down_arrow_mask_bits, 9, 16, 4, 1},
{sb_h_double_arrow_bits, 15, 7, 7, 4},
{sb_h_double_arrow_mask_bits, 15, 9, 7, 5},
{sb_left_arrow_bits, 15, 7, -1, 4},
{sb_left_arrow_mask_bits, 16, 9, 0, 5},
{sb_right_arrow_bits, 15, 7, 15, 4},
{sb_right_arrow_mask_bits, 16, 9, 15, 5},
{sb_up_arrow_bits, 7, 15, 3, 16},
{sb_up_arrow_mask_bits, 9, 16, 4, 16},
{sb_v_double_arrow_bits, 7, 15, 3, 8},
{sb_v_double_arrow_mask_bits, 9, 15, 4, 8},
{shuttle_bits, 15, 16, 10, 16},
{shuttle_mask_bits, 16, 16, 11, 16},
{sizing_bits, 14, 14, 7, 7},
{sizing_mask_bits, 16, 16, 8, 8},
{spider_bits, 16, 16, 6, 9},
{spider_mask_bits, 16, 16, 6, 9},
{spraycan_bits, 11, 16, 9, 14},
{spraycan_mask_bits, 12, 16, 10, 14},
{star_bits, 15, 16, 7, 9},
{star_mask_bits, 16, 16, 7, 9},
{target_bits, 15, 13, 7, 7},
{target_mask_bits, 16, 14, 7, 7},
{tcross_bits, 13, 13, 6, 7},
{tcross_mask_bits, 15, 15, 7, 8},
{top_left_arrow_bits, 14, 14, 0, 14},
{top_left_arrow_mask_bits, 16, 16, 1, 15},
{top_left_corner_bits, 14, 14, 0, 14},
{top_left_corner_mask_bits, 16, 16, 1, 15},
{top_right_corner_bits, 14, 14, 13, 14},
{top_right_corner_mask_bits, 16, 16, 14, 15},
{top_side_bits, 13, 14, 6, 14},
{top_side_mask_bits, 15, 16, 7, 15},
{top_tee_bits, 14, 10, 7, 10},
{top_tee_mask_bits, 16, 12, 8, 11},
{trek_bits, 7, 16, 3, 16},
{trek_mask_bits, 9, 16, 4, 16},
{ul_angle_bits, 10, 10, 0, 10},
{ul_angle_mask_bits, 12, 12, 1, 11},
{umbrella_bits, 14, 14, 7, 12},
{umbrella_mask_bits, 16, 16, 8, 14},
{ur_angle_bits, 10, 10, 9, 10},
{ur_angle_mask_bits, 12, 12, 10, 11},
{watch_bits, 16, 16, 15, 7},
{watch_mask_bits, 16, 16, 15, 7},
{xterm_bits, 7, 14, 3, 7},
{xterm_mask_bits, 9, 16, 4, 8}
};
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
{
GdkCursorPrivateFB *private;
GdkCursor *cursor;
GdkPixmap *pm, *mask;
return NULL;
if(cursor_type >= sizeof(stock_cursors)/sizeof(stock_cursors[0]))
return NULL;
private = g_new0(GdkCursorPrivateFB, 1);
cursor = (GdkCursor*) private;
cursor->type = cursor_type;
cursor->ref_count = 1;
return cursor;
pm = stock_cursors[cursor_type].pm;
if(!pm)
{
pm = stock_cursors[cursor_type].pm = gdk_bitmap_create_from_data(gdk_parent_root,
stock_cursors[cursor_type].bits,
stock_cursors[cursor_type].width,
stock_cursors[cursor_type].height);
gdk_pixmap_ref(pm);
}
mask = stock_cursors[cursor_type+1].pm;
if(!mask)
{
mask = stock_cursors[cursor_type+1].pm = gdk_bitmap_create_from_data(gdk_parent_root,
stock_cursors[cursor_type+1].bits,
stock_cursors[cursor_type+1].width,
stock_cursors[cursor_type+1].height);
gdk_pixmap_ref(mask);
}
return gdk_cursor_new_from_pixmap(pm, mask, NULL, NULL,
stock_cursors[cursor_type].hotx,
stock_cursors[cursor_type].hoty);
}
GdkCursor*
......@@ -63,6 +242,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
cursor->ref_count = 1;
private->cursor = gdk_pixmap_ref(source);
private->mask = gdk_pixmap_ref(mask);
private->hot_x = x;
private->hot_y = y;
return cursor;
}
......
#include "gdkprivate-fb.h"
#include "mi.h"
#include <t1lib.h>
/* #define USE_FTGRAYS */
#define USE_AA
#include <freetype/ftglyph.h>
#include <endian.h>
#ifndef __BYTE_ORDER
#error "endian.h needs to #define __BYTE_ORDER"
#endif
#ifndef g_alloca
#define g_alloca alloca
#endif
static void gdk_fb_drawable_set_pixel(GdkDrawable *drawable, GdkGC *gc, int x, int y, GdkColor *spot, gboolean abs_coords);
static void gdk_fb_drawable_destroy (GdkDrawable *drawable);
void gdk_fb_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
......@@ -42,6 +52,12 @@ static void gdk_fb_draw_text_wc (GdkDrawable *drawable,
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,
......@@ -75,7 +91,8 @@ GdkDrawableClass _gdk_fb_drawable_class = {
gdk_fb_draw_drawable,
gdk_fb_draw_points,
gdk_fb_draw_segments,
gdk_fb_draw_lines
gdk_fb_draw_lines,
gdk_fb_draw_glyphs
};
/*****************************************************
......@@ -184,12 +201,10 @@ gdk_fb_clip_region(GdkDrawable *drawable, GdkGC *gc, gboolean do_clipping)
}
static void
gdk_fb_fill_span(GdkDrawable *drawable, GdkGC *gc, GdkSegment *cur, guint pixel, GdkVisual *visual)
gdk_fb_fill_span(GdkDrawable *drawable, GdkGC *gc, GdkSegment *cur, GdkColor *color, GdkVisual *visual)
{
int curx, cury;
guchar *mem = GDK_DRAWABLE_FBDATA(drawable)->mem;
guint rowstride = GDK_DRAWABLE_FBDATA(drawable)->rowstride;
guint depth = GDK_DRAWABLE_P(drawable)->depth;
GdkColor spot = *color;
if(gc
&& (GDK_GC_FBDATA(gc)->values.clip_mask
......@@ -218,6 +233,10 @@ gdk_fb_fill_span(GdkDrawable *drawable, GdkGC *gc, GdkSegment *cur, guint pixel,
{
gint xstep, ystep;
gint relx, rely;
GdkFBDrawingContext *dc, dc_data;
dc = &dc_data;
gdk_fb_drawing_context_init(dc, drawable, gc, FALSE, TRUE);
ts = GDK_GC_FBDATA(gc)->values.tile;
for(cury = cur->y1; cury < cur->y2; cury += ystep)
......@@ -243,13 +262,16 @@ gdk_fb_fill_span(GdkDrawable *drawable, GdkGC *gc, GdkSegment *cur, guint pixel,
xstep = MIN(GDK_DRAWABLE_P(ts)->width - draww, cur->x2 - relx);
gdk_fb_draw_drawable_2(drawable, gc, ts,
gdk_fb_draw_drawable_3(drawable, gc, ts,
dc,
draww, drawh,
relx, rely,
xstep, ystep, FALSE, TRUE);
xstep, ystep);
}
}
gdk_fb_drawing_context_finalize(dc);
return;
}
else if((GDK_GC_FBDATA(gc)->values.fill == GDK_STIPPLED
......@@ -262,163 +284,165 @@ gdk_fb_fill_span(GdkDrawable *drawable, GdkGC *gc, GdkSegment *cur, guint pixel,
solid_stipple = (GDK_GC_FBDATA(gc)->values.fill == GDK_OPAQUE_STIPPLED);
}
switch(depth)
for(cury = cur->y1; cury < cur->y2; cury++)
{
case 1:
g_assert(!ts);
for(cury = cur->y1; cury < cur->y2; cury++)
for(curx = cur->x1; curx < cur->x2; curx++)
{
for(curx = cur->x1; curx < cur->x2; curx++)
{
guchar *ptr = mem + (cury * rowstride) + (curx >> 3);
int maskx = curx+clipxoff, masky = cury + clipyoff;
guchar foo;
if(cmask)
{
foo = clipmem[masky*mask_rowstride + (maskx >> 3)];
int maskx = curx+clipxoff, masky = cury + clipyoff;
guchar foo;
if(!(foo & (1 << (maskx % 8))))
continue;
}
*ptr |= (1 << (curx % 8));
}
}
break;
case 8:
for(cury = cur->y1; cury < cur->y2; cury++)
{
for(curx = cur->x1; curx < cur->x2; curx++)
if(cmask)
{
guchar *ptr = mem + (cury * rowstride) + curx;
int maskx = curx+clipxoff, masky = cury + clipyoff;
guchar foo;
foo = clipmem[masky*mask_rowstride + (maskx >> 3)];
if(cmask)
{
foo = clipmem[masky*mask_rowstride + (maskx >> 3)];
if(!(foo & (1 << (maskx % 8))))
continue;
}
if(ts)
{
int wid = GDK_DRAWABLE_P(ts)->width, hih = GDK_DRAWABLE_P(ts)->height;
maskx = (curx+tsxoff)%wid;
masky = (cury+tsyoff)%hih;
if(maskx < 0)
maskx += wid;
if(masky < 0)
masky += hih;
foo = GDK_DRAWABLE_FBDATA(ts)->mem[(maskx >> 3) + GDK_DRAWABLE_FBDATA(ts)->rowstride*masky];
if(foo & (1 << (maskx % 8)))
{
pixel = GDK_GC_FBDATA(gc)->values.foreground.pixel;
}
else if(solid_stipple)
{
pixel = GDK_GC_FBDATA(gc)->values.background.pixel;
}
else
continue;
}
*ptr = pixel;
if(!(foo & (1 << (maskx % 8))))
continue;
}
}
break;
case 16:
case 24:
case 32:
for(cury = cur->y1; cury < cur->y2; cury++)
{
for(curx = cur->x1; curx < cur->x2; curx++)
if(ts)
{
guint *ptr2 = (guint *)(mem + (cury * rowstride) + (curx * (depth >> 3)));
int maskx = curx+clipxoff, masky = cury + clipyoff;
guchar foo;
int wid = GDK_DRAWABLE_P(ts)->width, hih = GDK_DRAWABLE_P(ts)->height;
if(cmask)
{
foo = clipmem[masky*mask_rowstride + (maskx >> 3)];
maskx = (curx+tsxoff)%wid;
masky = (cury+tsyoff)%hih;
if(maskx < 0)
maskx += wid;
if(masky < 0)
masky += hih;
if(!(foo & (1 << (maskx % 8))))
continue;
foo = GDK_DRAWABLE_FBDATA(ts)->mem[(maskx >> 3) + GDK_DRAWABLE_FBDATA(ts)->rowstride*masky];
if(foo & (1 << (maskx % 8)))
{
spot = GDK_GC_FBDATA(gc)->values.foreground;
}
if(ts)
else if(solid_stipple)
{
int wid = GDK_DRAWABLE_P(ts)->width, hih = GDK_DRAWABLE_P(ts)->height;
maskx = (curx+tsxoff)%wid;
masky = (cury+tsyoff)%hih;
if(maskx < 0)
maskx += wid;
if(masky < 0)
masky += hih;
foo = GDK_DRAWABLE_FBDATA(ts)->mem[(maskx >> 3) + GDK_DRAWABLE_FBDATA(ts)->rowstride*masky];
if(foo & (1 << (maskx % 8)))
{
pixel = GDK_GC_FBDATA(gc)->values.foreground.pixel;