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

*** empty log message ***

parent 2eb7985b
...@@ -27,7 +27,8 @@ typedef enum ...@@ -27,7 +27,8 @@ typedef enum
* drags */ * drags */
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */ GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */ 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; } GdkDragProtocol;
/* Structure that holds information about a drag in progress. /* Structure that holds information about a drag in progress.
......
...@@ -375,7 +375,6 @@ gdk_draw_image (GdkDrawable *drawable, ...@@ -375,7 +375,6 @@ gdk_draw_image (GdkDrawable *drawable,
if (height == -1) if (height == -1)
height = image->height; height = image->height;
if (GDK_IS_WINDOW (drawable)) if (GDK_IS_WINDOW (drawable))
_gdk_window_draw_image (drawable, gc, image, xsrc, ysrc, _gdk_window_draw_image (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height); xdest, ydest, width, height);
......
...@@ -135,7 +135,6 @@ gdk_event_queue_remove_link (GList *node) ...@@ -135,7 +135,6 @@ gdk_event_queue_remove_link (GList *node)
node->next->prev = node->prev; node->next->prev = node->prev;
else else
gdk_queued_tail = node->prev; gdk_queued_tail = node->prev;
} }
/************************************************************* /*************************************************************
......
...@@ -342,8 +342,8 @@ struct _GdkEventSelection ...@@ -342,8 +342,8 @@ struct _GdkEventSelection
GdkAtom selection; GdkAtom selection;
GdkAtom target; GdkAtom target;
GdkAtom property; GdkAtom property;
guint32 requestor;
guint32 time; guint32 time;
GdkNativeWindow requestor;
}; };
/* This event type will be used pretty rarely. It only is important /* This event type will be used pretty rarely. It only is important
......
...@@ -73,6 +73,7 @@ typedef enum ...@@ -73,6 +73,7 @@ typedef enum
GDK_COPY_INVERT, GDK_COPY_INVERT,
GDK_OR_INVERT, GDK_OR_INVERT,
GDK_NAND, GDK_NAND,
GDK_NOR,
GDK_SET GDK_SET
} GdkFunction; } GdkFunction;
......
...@@ -49,10 +49,9 @@ extern "C" { ...@@ -49,10 +49,9 @@ extern "C" {
GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN) GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
#define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP) #define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
#define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed) #define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
#define GDK_DRAWABLE_P(d) ((GdkDrawablePrivate*)d)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid)) #define GDK_WINDOW_P(d) ((GdkWindowPrivate*)d)
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid)) #define GDK_GC_P(d) ((GdkGCPrivate*)d)
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
typedef struct _GdkDrawablePrivate GdkDrawablePrivate; typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
typedef struct _GdkWindowPrivate GdkWindowPrivate; typedef struct _GdkWindowPrivate GdkWindowPrivate;
......
...@@ -45,12 +45,9 @@ SOFTWARE. ...@@ -45,12 +45,9 @@ SOFTWARE.
#ifndef __GDK_REGION_GENERIC_H__ #ifndef __GDK_REGION_GENERIC_H__
#define __GDK_REGION_GENERIC_H__ #define __GDK_REGION_GENERIC_H__
typedef struct _GdkRegionBox GdkRegionBox; #include "gdktypes.h"
struct _GdkRegionBox typedef GdkSegment GdkRegionBox;
{
int x1, x2, y1, y2;
};
/* /*
* clip region * clip region
......
...@@ -76,6 +76,12 @@ typedef struct _GdkSegment GdkSegment; ...@@ -76,6 +76,12 @@ typedef struct _GdkSegment GdkSegment;
*/ */
typedef guint32 GdkWChar; typedef guint32 GdkWChar;
typedef gulong GdkAtom; typedef gulong GdkAtom;
#ifdef GDK_NATIVE_WINDOW_POINTER
typedef gpointer GdkNativeWindow;
#else
typedef guint32 GdkNativeWindow;
#endif
/* Forward declarations of commonly used types /* Forward declarations of commonly used types
*/ */
......
...@@ -657,7 +657,7 @@ gdk_window_begin_paint_region (GdkWindow *window, ...@@ -657,7 +657,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
{ {
tmp_paint = private->paint_stack->data; tmp_paint = private->paint_stack->data;
gdk_region_subtract (init_region, tmp_paint->region); gdk_region_subtract (init_region, tmp_paint->region);
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
} }
...@@ -745,6 +745,7 @@ gdk_window_free_paint_stack (GdkWindow *window) ...@@ -745,6 +745,7 @@ gdk_window_free_paint_stack (GdkWindow *window)
while (tmp_list) while (tmp_list)
{ {
GdkWindowPaint *paint = tmp_list->data; GdkWindowPaint *paint = tmp_list->data;
if (tmp_list == private->paint_stack) if (tmp_list == private->paint_stack)
gdk_drawable_unref (paint->pixmap); gdk_drawable_unref (paint->pixmap);
...@@ -1119,6 +1120,7 @@ gdk_window_draw_glyphs (GdkDrawable *drawable, ...@@ -1119,6 +1120,7 @@ gdk_window_draw_glyphs (GdkDrawable *drawable,
if (private->paint_stack) if (private->paint_stack)
{ {
GdkWindowPaint *paint = private->paint_stack->data; GdkWindowPaint *paint = private->paint_stack->data;
gdk_draw_glyphs (paint->pixmap, gc, font, x - x_offset, y - y_offset, glyphs); gdk_draw_glyphs (paint->pixmap, gc, font, x - x_offset, y - y_offset, glyphs);
} }
else else
......
...@@ -9,23 +9,22 @@ INCLUDES = @STRIP_BEGIN@ \ ...@@ -9,23 +9,22 @@ INCLUDES = @STRIP_BEGIN@ \
@GTK_XIM_FLAGS@ \ @GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \ @GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \ @GLIB_CFLAGS@ \
@PANGO_CFLAGS@ \
@STRIP_END@ @STRIP_END@
LDFLAGS = @STRIP_BEGIN@ \ LDFLAGS = @STRIP_BEGIN@ \
@GLIB_LIBS@ \ @GLIB_LIBS@ \
-L/gnome2/lib \ @PANGO_CFLAGS@ \
-lt1 \ -lfreetype \
-lm \ -lm \
@STRIP_END@ @STRIP_END@
if USE_LINUX_FB noinst_LTLIBRARIES = libgdk-linux-fb.la
noinst_PROGRAMS=#test-fb
lib_LTLIBRARIES = libgdk-fb.la #test_fb_LDFLAGS=../libgdk.la libgdk-linux-fb.la
noinst_PROGRAMS=test-fb
test_fb_LDFLAGS=../libgdk.la libgdk-fb.la libgdk_linux_fb_la_SOURCES = \
libgdk_fb_la_SOURCES = \
gdkcolor-fb.c \ gdkcolor-fb.c \
gdkcursor-fb.c \ gdkcursor-fb.c \
gdkdnd-fb.c \ gdkdnd-fb.c \
...@@ -57,10 +56,6 @@ libgdk_fb_la_SOURCES = \ ...@@ -57,10 +56,6 @@ libgdk_fb_la_SOURCES = \
miwideline.c \ miwideline.c \
mizerclip.c \ mizerclip.c \
mizerline.c \ mizerline.c \
mispans.c \
gdkpango-fb.c
mispans.c mispans.c
else
lib_LTLIBRARIES =
noinst_PROGRAMS=
endif
...@@ -28,20 +28,199 @@ ...@@ -28,20 +28,199 @@
#include "gdkprivate-fb.h" #include "gdkprivate-fb.h"
#include "gdkcursor.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* GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type) gdk_cursor_new (GdkCursorType cursor_type)
{ {
GdkCursorPrivateFB *private; GdkPixmap *pm, *mask;
GdkCursor *cursor;
return NULL; if(cursor_type >= sizeof(stock_cursors)/sizeof(stock_cursors[0]))
return NULL;
private = g_new0(GdkCursorPrivateFB, 1); pm = stock_cursors[cursor_type].pm;
cursor = (GdkCursor*) private; if(!pm)
cursor->type = cursor_type; {
cursor->ref_count = 1; pm = stock_cursors[cursor_type].pm = gdk_bitmap_create_from_data(gdk_parent_root,
stock_cursors[cursor_type].bits,
return cursor; 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* GdkCursor*
...@@ -63,6 +242,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source, ...@@ -63,6 +242,8 @@ gdk_cursor_new_from_pixmap (GdkPixmap *source,
cursor->ref_count = 1; cursor->ref_count = 1;
private->cursor = gdk_pixmap_ref(source); private->cursor = gdk_pixmap_ref(source);
private->mask = gdk_pixmap_ref(mask); private->mask = gdk_pixmap_ref(mask);
private->hot_x = x;
private->hot_y = y;
return cursor; return cursor;
} }
......
This diff is collapsed.
...@@ -90,10 +90,27 @@ static GSourceFuncs event_funcs = { ...@@ -90,10 +90,27 @@ static GSourceFuncs event_funcs = {
* Functions for maintaining the event queue * * Functions for maintaining the event queue *
*********************************************/ *********************************************/
static gboolean fb_events_prepare(gpointer source_data,
GTimeVal *current_time,
gint *timeout,
gpointer user_data);
static gboolean fb_events_check(gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
static gboolean fb_events_dispatch(gpointer source_data,
GTimeVal *dispatch_time,
gpointer user_data);
void void
gdk_events_init (void) gdk_events_init (void)
{ {
static GSourceFuncs fb_events_funcs = {
fb_events_prepare,
fb_events_check,
fb_events_dispatch,
NULL
};
g_source_add(G_PRIORITY_HIGH_IDLE, TRUE, &fb_events_funcs, NULL, NULL, NULL);
} }
/* /*
...@@ -121,21 +138,64 @@ gdk_events_pending (void) ...@@ -121,21 +138,64 @@ gdk_events_pending (void)
GdkEvent* GdkEvent*
gdk_event_get_graphics_expose (GdkWindow *window) gdk_event_get_graphics_expose (GdkWindow *window)
{ {
GList *ltmp;
g_return_val_if_fail (window != NULL, NULL); g_return_val_if_fail (window != NULL, NULL);
return NULL; for(ltmp = gdk_queued_events; ltmp; ltmp = ltmp->next)
{
GdkEvent *event = ltmp->data;
if(event->type == GDK_EXPOSE
&& event->expose.window == window)
break;
}
if(ltmp)
{
GdkEvent *retval = ltmp->data;
gdk_event_queue_remove_link(ltmp);
g_list_free_1(ltmp);
return retval;
}
return NULL;
} }
void void
gdk_events_queue (void) gdk_events_queue (void)
{
}
static gboolean
fb_events_prepare(gpointer source_data,
GTimeVal *current_time,
gint *timeout,
gpointer user_data)
{ {
*timeout = -1;
return fb_events_check(source_data, current_time, user_data);
} }
static gint handler_tag = 0; static gboolean
fb_events_check(gpointer source_data,
GTimeVal *current_time,
gpointer user_data)
{
gboolean retval;
GDK_THREADS_ENTER();
retval = (gdk_event_queue_find_first () != NULL);
GDK_THREADS_LEAVE();
return retval;
}
static gboolean static gboolean
dispatch_events(gpointer data) fb_events_dispatch(gpointer source_data, GTimeVal *dispatch_time, gpointer user_data)
{ {
GdkEvent *event; GdkEvent *event;
...@@ -148,31 +208,13 @@ dispatch_events(gpointer data) ...@@ -148,31 +208,13 @@ dispatch_events(gpointer data)
gdk_fb_drawable_clear(event->expose.window); gdk_fb_drawable_clear(event->expose.window);
else if(gdk_event_func) else if(gdk_event_func)
(*gdk_event_func)(event, gdk_event_data); (*gdk_event_func)(event, gdk_event_data);
gdk_event_free(event); gdk_event_free(event);
} }
GDK_THREADS_LEAVE(); GDK_THREADS_LEAVE();
if(event && !handler_tag)
handler_tag = g_idle_add_full(G_PRIORITY_HIGH_IDLE, dispatch_events, NULL, NULL);
else if(!event && handler_tag)
{
g_source_remove(handler_tag);
handler_tag = 0;
}
return handler_tag?TRUE:FALSE;
}
void return TRUE;