📄 gtk+-2.4.14-xynth.diff
字号:
diff -U 3 -H -d -r -N gtk+-2.4.14/gdk/Makefile.am gtk+-2.4.14-xynth/gdk/Makefile.am--- gtk+-2.4.14/gdk/Makefile.am 2003-12-10 15:49:52.000000000 +0200+++ gtk+-2.4.14-xynth/gdk/Makefile.am 2005-12-08 18:05:04.000000000 +0200@@ -131,7 +131,7 @@ libgdk_linux_fb_2_0_la_SOURCES = $(common_sources) gdkkeynames.c libgdk_linux_fb_2_0_la_LIBADD = linux-fb/libgdk-linux-fb.la $(GDK_DEP_LIBS) \- $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la+ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -lxynth libgdk_linux_fb_2_0_la_LDFLAGS = $(LDADD) libgdk_win32_2_0_la_SOURCES = $(common_sources) gdkkeynames.cdiff -U 3 -H -d -r -N gtk+-2.4.14/gdk/Makefile.in gtk+-2.4.14-xynth/gdk/Makefile.in--- gtk+-2.4.14/gdk/Makefile.in 2004-12-03 05:55:46.000000000 +0200+++ gtk+-2.4.14-xynth/gdk/Makefile.in 2005-12-08 18:05:04.000000000 +0200@@ -412,7 +412,7 @@ libgdk_linux_fb_2_0_la_SOURCES = $(common_sources) gdkkeynames.c libgdk_linux_fb_2_0_la_LIBADD = linux-fb/libgdk-linux-fb.la $(GDK_DEP_LIBS) \- $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la+ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -lxynth libgdk_linux_fb_2_0_la_LDFLAGS = $(LDADD) diff -U 3 -H -d -r -N gtk+-2.4.14/gdk/linux-fb/gdkcursor-fb.c gtk+-2.4.14-xynth/gdk/linux-fb/gdkcursor-fb.c--- gtk+-2.4.14/gdk/linux-fb/gdkcursor-fb.c 2004-03-06 05:37:04.000000000 +0200+++ gtk+-2.4.14-xynth/gdk/linux-fb/gdkcursor-fb.c 2005-12-08 18:05:04.000000000 +0200@@ -288,251 +288,41 @@ g_free (private); } -/* Global data to keep track of cursor */-static GdkPixmap *last_contents = NULL;-static GdkPoint last_location, last_contents_size;-static GdkCursor *last_cursor = NULL;-static GdkFBDrawingContext *gdk_fb_cursor_dc = NULL;-static GdkFBDrawingContext cursor_dc_dat;-static GdkGC *cursor_gc;-static gint cursor_visibility_count = 1;--static GdkFBDrawingContext *-gdk_fb_cursor_dc_reset (void)+void gdk_fb_cursor_hide (void) {- if (gdk_fb_cursor_dc)- gdk_fb_drawing_context_finalize (gdk_fb_cursor_dc);-- gdk_fb_cursor_dc = &cursor_dc_dat;- gdk_fb_drawing_context_init (gdk_fb_cursor_dc,- GDK_DRAWABLE_IMPL(_gdk_parent_root),- cursor_gc,- TRUE,- FALSE);-- return gdk_fb_cursor_dc; } -void-gdk_fb_cursor_hide (void)+void gdk_fb_cursor_invalidate (void) {- GdkFBDrawingContext *mydc = gdk_fb_cursor_dc;-- cursor_visibility_count--;- g_assert (cursor_visibility_count <= 0);- - if (cursor_visibility_count < 0)- return;-- if (!mydc)- mydc = gdk_fb_cursor_dc_reset ();-- if (last_contents)- {- gdk_gc_set_clip_mask (cursor_gc, NULL);- /* Restore old picture */- gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL(_gdk_parent_root),- cursor_gc,- GDK_DRAWABLE_IMPL(last_contents),- mydc,- 0, 0,- last_location.x,- last_location.y,- last_contents_size.x,- last_contents_size.y);- gdk_shadow_fb_update (last_location.x, last_location.y,- last_location.x + last_contents_size.x,- last_location.y + last_contents_size.y);- } } -void-gdk_fb_cursor_invalidate (void)-{- if (last_contents)- {- gdk_pixmap_unref (last_contents);- last_contents = NULL;- }-}--void-gdk_fb_cursor_unhide()+void gdk_fb_cursor_unhide() {- GdkFBDrawingContext *mydc = gdk_fb_cursor_dc;- GdkCursorPrivateFB *last_private;- GdkDrawableFBData *pixmap_last;- - last_private = GDK_CURSOR_FB (last_cursor);- cursor_visibility_count++;- g_assert (cursor_visibility_count <= 1);- if (cursor_visibility_count < 1)- return;-- if (!mydc)- mydc = gdk_fb_cursor_dc_reset ();-- if (last_cursor)- {- pixmap_last = GDK_DRAWABLE_IMPL_FBDATA (last_private->cursor);- - if (!last_contents ||- pixmap_last->width > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->width ||- pixmap_last->height > GDK_DRAWABLE_IMPL_FBDATA (last_contents)->height)- {- if (last_contents)- gdk_pixmap_unref (last_contents);-- last_contents = gdk_pixmap_new (_gdk_parent_root,- pixmap_last->width,- pixmap_last->height,- GDK_DRAWABLE_IMPL_FBDATA (_gdk_parent_root)->depth);- }-- gdk_gc_set_clip_mask (cursor_gc, NULL);- gdk_fb_draw_drawable_2 (GDK_DRAWABLE_IMPL (last_contents),- cursor_gc,- GDK_DRAWABLE_IMPL (_gdk_parent_root),- last_location.x,- last_location.y,- 0, 0,- pixmap_last->width,- pixmap_last->height,- TRUE, FALSE);- last_contents_size.x = pixmap_last->width;- last_contents_size.y = pixmap_last->height;- - gdk_gc_set_clip_mask (cursor_gc, last_private->mask);- gdk_gc_set_clip_origin (cursor_gc,- last_location.x,- last_location.y);-- gdk_fb_cursor_dc_reset ();- gdk_fb_draw_drawable_3 (GDK_DRAWABLE_IMPL (_gdk_parent_root),- cursor_gc,- GDK_DRAWABLE_IMPL (last_private->cursor),- mydc,- 0, 0,- last_location.x, last_location.y,- pixmap_last->width,- pixmap_last->height);- gdk_shadow_fb_update (last_location.x, last_location.y,- last_location.x + pixmap_last->width,- last_location.y + pixmap_last->height);- }- else- gdk_fb_cursor_invalidate (); } -gboolean-gdk_fb_cursor_region_need_hide (GdkRegion *region)+gboolean gdk_fb_cursor_region_need_hide (GdkRegion *region) {- GdkRectangle testme;-- if (!last_cursor)- return FALSE;-- testme.x = last_location.x;- testme.y = last_location.y;- testme.width = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width;- testme.height = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height;-- return (gdk_region_rect_in (region, &testme) != GDK_OVERLAP_RECTANGLE_OUT);+ return FALSE; } -gboolean-gdk_fb_cursor_need_hide (GdkRectangle *rect)+gboolean gdk_fb_cursor_need_hide (GdkRectangle *rect) {- GdkRectangle testme;-- if (!last_cursor)- return FALSE;-- testme.x = last_location.x;- testme.y = last_location.y;- testme.width = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width;- testme.height = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height;-- return gdk_rectangle_intersect (rect, &testme, &testme);+ return FALSE; } -void-gdk_fb_get_cursor_rect (GdkRectangle *rect)+void gdk_fb_get_cursor_rect (GdkRectangle *rect) {- if (last_cursor)- {- rect->x = last_location.x;- rect->y = last_location.y;- rect->width = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->width;- rect->height = GDK_DRAWABLE_IMPL_FBDATA (GDK_CURSOR_FB (last_cursor)->cursor)->height;- }- else- {- rect->x = rect->y = -1;- rect->width = rect->height = 0;- } } -void-gdk_fb_cursor_move (gint x, gint y, GdkWindow *in_window)+void gdk_fb_cursor_move (gint x, gint y, GdkWindow *in_window) {- GdkCursor *the_cursor;-- if (!cursor_gc)- {- GdkColor white, black;- cursor_gc = gdk_gc_new (_gdk_parent_root);- gdk_color_black (gdk_colormap_get_system (), &black);- gdk_color_white (gdk_colormap_get_system (), &white);- gdk_gc_set_foreground (cursor_gc, &black);- gdk_gc_set_background (cursor_gc, &white);- }-- gdk_fb_cursor_hide ();-- if (_gdk_fb_pointer_grab_window)- {- if (_gdk_fb_pointer_grab_cursor)- the_cursor = _gdk_fb_pointer_grab_cursor;- else- {- GdkWindow *win = _gdk_fb_pointer_grab_window;- while (!GDK_WINDOW_IMPL_FBDATA (win)->cursor && GDK_WINDOW_OBJECT (win)->parent)- win = (GdkWindow *)GDK_WINDOW_OBJECT (win)->parent;- the_cursor = GDK_WINDOW_IMPL_FBDATA (win)->cursor;- }- }- else- {- while (!GDK_WINDOW_IMPL_FBDATA (in_window)->cursor && GDK_WINDOW_P (in_window)->parent)- in_window = (GdkWindow *)GDK_WINDOW_P (in_window)->parent;- the_cursor = GDK_WINDOW_IMPL_FBDATA (in_window)->cursor;- }-- last_location.x = x - GDK_CURSOR_FB (the_cursor)->hot_x;- last_location.y = y - GDK_CURSOR_FB (the_cursor)->hot_y;-- if (the_cursor)- gdk_cursor_ref (the_cursor);- if (last_cursor)- gdk_cursor_unref (last_cursor);- last_cursor = the_cursor;-- gdk_fb_cursor_unhide (); } -void-gdk_fb_cursor_reset(void)+void gdk_fb_cursor_reset(void) {- GdkWindow *win = gdk_window_at_pointer (NULL, NULL);- gint x, y;-- gdk_fb_mouse_get_info (&x, &y, NULL);- gdk_fb_cursor_move (x, y, win); } -GdkDisplay *-gdk_cursor_get_display (GdkCursor *cursor)+GdkDisplay * gdk_cursor_get_display (GdkCursor *cursor) {- return gdk_display_get_default ();+ return gdk_display_get_default(); }diff -U 3 -H -d -r -N gtk+-2.4.14/gdk/linux-fb/gdkdrawable-fb2.c gtk+-2.4.14-xynth/gdk/linux-fb/gdkdrawable-fb2.c--- gtk+-2.4.14/gdk/linux-fb/gdkdrawable-fb2.c 2004-03-06 05:37:04.000000000 +0200+++ gtk+-2.4.14-xynth/gdk/linux-fb/gdkdrawable-fb2.c 2005-12-08 18:05:04.000000000 +0200@@ -1,3 +1,9 @@+/*+ * Gtk-Xynth port is based on linux-fb port+ * Xynth Team+ * http://www.xynth.org+ */+ #include <config.h> #include "gdkprivate-fb.h" #include "mi.h"@@ -1353,7 +1359,8 @@ maxx += extra_width; maxy += extra_width; }- gdk_shadow_fb_update (minx, miny, maxx, maxy);++ gdk_shadow_fb_update(drawable, minx, miny, maxx, maxy); } } @@ -1392,7 +1399,8 @@ maxx += extra_width; maxy += extra_width; }- gdk_shadow_fb_update (minx, miny, maxx, maxy);++ gdk_shadow_fb_update(drawable, minx, miny, maxx, maxy); } } @@ -1434,8 +1442,8 @@ 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);++ gdk_shadow_fb_update(drawable, minx + private->abs_x, miny + private->abs_y, maxx + private->abs_x, maxy + private->abs_y); } } @@ -1477,9 +1485,10 @@ _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);++ if (GDK_IS_WINDOW(private->wrapper)) {+ gdk_shadow_fb_update(drawable, 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@@ -1498,9 +1507,10 @@ 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);++ if (GDK_IS_WINDOW(private->wrapper)) {+ gdk_shadow_fb_update(drawable, xdest + private->abs_x, ydest + private->abs_y, xdest + private->abs_x + width, ydest + private->abs_y + height);+ } } static void@@ -1519,9 +1529,10 @@ 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);++ if (GDK_IS_WINDOW(private->wrapper)) {+ gdk_shadow_fb_update(drawable, xdest + private->abs_x, ydest + private->abs_y, xdest + private->abs_x + width, ydest + private->abs_y + height);+ } } static void@@ -1551,8 +1562,7 @@ 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);+ gdk_shadow_fb_update(drawable, minx + private->abs_x, miny + private->abs_y, maxx + private->abs_x, maxy + private->abs_y); } } @@ -1597,8 +1607,7 @@ 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);+ gdk_shadow_fb_update(drawable, minx + private->abs_x, miny + private->abs_y, maxx + private->abs_x, maxy + private->abs_y); } } @@ -1637,8 +1646,7 @@ 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);+ gdk_shadow_fb_update(drawable, minx + private->abs_x, miny + private->abs_y, maxx + private->abs_x, maxy + private->abs_y); } } diff -U 3 -H -d -r -N gtk+-2.4.14/gdk/linux-fb/gdkevents-fb.c gtk+-2.4.14-xynth/gdk/linux-fb/gdkevents-fb.c--- gtk+-2.4.14/gdk/linux-fb/gdkevents-fb.c 2004-03-06 05:37:04.000000000 +0200+++ gtk+-2.4.14-xynth/gdk/linux-fb/gdkevents-fb.c 2005-12-08 18:05:04.000000000 +0200@@ -23,6 +23,12 @@ * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */+ +/*+ * Gtk-Xynth port is based on linux-fb port+ * Xynth Team+ * http://www.xynth.org+ */ #include <config.h> #include "gdk.h"@@ -124,13 +130,10 @@ { } -static gboolean-fb_events_prepare (GSource *source,- gint *timeout)+static gboolean fb_events_prepare (GSource *source, gint *timeout) {- *timeout = -1;-- return fb_events_check (source);+ *timeout = 100;+ return fb_events_check (source); } static gboolean@@ -147,34 +150,40 @@ return retval; } -static gboolean-fb_events_dispatch (GSource *source,- GSourceFunc callback,- gpointer user_data)+static gboolean fb_events_dispatch (GSource *source, GSourceFunc callback, gpointer user_data) {- GdkEvent *event;-- GDK_THREADS_ENTER ();-- while ((event = _gdk_event_unqueue (gdk_display_get_default ())))- {- if (event->type == GDK_EXPOSE &&- event->expose.window == _gdk_parent_root)- gdk_window_clear_area (event->expose.window,- event->expose.area.x,- event->expose.area.y,- event->expose.area.width,- event->expose.area.height);-- else if (_gdk_event_func)- (*_gdk_event_func) (event, _gdk_event_data);+ GdkEvent *event; - gdk_event_free (event);- }+ GDK_THREADS_ENTER(); - GDK_THREADS_LEAVE ();+ while ((event = _gdk_event_unqueue(gdk_display_get_default()))) {+ if (event->type == GDK_CONFIGURE) {+ if ((event->configure.x != GDK_DRAWABLE_IMPL_FBDATA(event->configure.window)->xynth_window->surface->buf.x) ||+ (event->configure.y != GDK_DRAWABLE_IMPL_FBDATA(event->configure.window)->xynth_window->surface->buf.y) ||+ (event->configure.width != GDK_DRAWABLE_IMPL_FBDATA(event->configure.window)->xynth_window->surface->buf.w) ||+ (event->configure.height != GDK_DRAWABLE_IMPL_FBDATA(event->configure.window)->xynth_window->surface->buf.h)) {+ s_window_set_coor(GDK_DRAWABLE_IMPL_FBDATA(event->configure.window)->xynth_window,+ NO_FORM,+ event->configure.x,+ event->configure.y,+ event->configure.width,+ event->configure.height);+ }+ }+ if (event->type == GDK_EXPOSE && event->expose.window == _gdk_parent_root) {+ gdk_window_clear_area (event->expose.window,+ event->expose.area.x,+ event->expose.area.y,+ event->expose.area.width,+ event->expose.area.height);+ } else if (_gdk_event_func) {+ (*_gdk_event_func) (event, _gdk_event_data);+ }+ gdk_event_free(event);+ }+ GDK_THREADS_LEAVE(); - return TRUE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -