diff options
author | Hans Breuer <hans@breuer.org> | 2001-04-13 23:56:19 +0000 |
---|---|---|
committer | Hans Breuer <hans@src.gnome.org> | 2001-04-13 23:56:19 +0000 |
commit | eed3dbb64c30d40b49b58c968e636a2dccb2033f (patch) | |
tree | cfb67d39fdf5bba45206e5ae61610193f18be1e9 /gdk | |
parent | 21f13fb7e0ec9a48926167152e06b7301fe34546 (diff) | |
download | gtk+-eed3dbb64c30d40b49b58c968e636a2dccb2033f.tar.gz |
updated
2001-04-14 Hans Breuer <hans@breuer.org>
* gdk/gdk.def :
* gdk/makefile.msc : updated
* gdk/win32/gdkdrawable.win32 (gdk_win32_draw_rectangle) : if modus is
"fill with tile" do so with new helper function gdk_win32_draw_tiles
(the testgtk::text backgound pixmap is drawn again)
Changed SetTextAlign before pango_win32_render to TA_BASELINE to reflect
Win32 Pango change
* gdk/win32/gdkprivate-win32.h : prototype for gdk_win32_draw_tiles
* gdk/win32/gdkproperty-win32.c : first implementation of gdk_setting_get
Not sure if the returned settings have the right unit, because I couldn't
find any docs for the X version ...
* gtk/gtk.def :
* gtk/makefile.msc.in : updated
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.def | 16 | ||||
-rw-r--r-- | gdk/makefile.msc | 39 | ||||
-rw-r--r-- | gdk/win32/gdkdrawable-win32.c | 51 | ||||
-rw-r--r-- | gdk/win32/gdkprivate-win32.h | 9 | ||||
-rw-r--r-- | gdk/win32/gdkproperty-win32.c | 22 |
5 files changed, 132 insertions, 5 deletions
diff --git a/gdk/gdk.def b/gdk/gdk.def index dee8704f84..9609ecabb6 100644 --- a/gdk/gdk.def +++ b/gdk/gdk.def @@ -304,17 +304,21 @@ EXPORTS gdk_win32_hdc_release gdk_window_add_filter gdk_window_at_pointer + gdk_window_begin_move_drag gdk_window_begin_paint_rect gdk_window_begin_paint_region + gdk_window_begin_resize_drag gdk_window_clear gdk_window_clear_area gdk_window_clear_area_e + gdk_window_constrain_size gdk_window_destroy gdk_window_end_paint gdk_window_foreign_new gdk_window_get_children gdk_window_get_deskrelative_origin gdk_window_get_events + gdk_window_get_frame_extents gdk_window_get_geometry gdk_window_get_origin gdk_window_get_parent @@ -376,7 +380,11 @@ EXPORTS gdk_window_stick gdk_window_unmaximize gdk_window_unstick -gdk_window_begin_move_drag -gdk_window_begin_resize_drag -gdk_window_constrain_size -gdk_window_get_frame_extents +gdk_color_get_type +gdk_event_get_type +gdk_event_mask_get_type +gdk_extension_mode_get_type +gdk_input_condition_get_type +gdk_modifier_type_get_type +gdk_set_double_click_time +gdk_setting_get diff --git a/gdk/makefile.msc b/gdk/makefile.msc index a04e387d70..72d4736ad4 100644 --- a/gdk/makefile.msc +++ b/gdk/makefile.msc @@ -36,6 +36,10 @@ LDFLAGS = /link $(LINKDEBUG) GTK_VER=1.3 GDK_PIXBUF_VER=$(GTK_VER) +!IFNDEF PERL +PERL = perl +!ENDIF + CFLAGS = -I . -I .. $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I ../gdk-pixbuf \ -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \ @@ -44,6 +48,8 @@ EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \ all: \ ..\config.h \ gdkconfig.h \ + gdkenumtypes.h \ + gdkenumtypes.c \ gdk-win32-$(GTK_VER).dll \ testgdk.exe @@ -52,6 +58,7 @@ gdk_OBJECTS = \ gdkcolor.obj \ gdkcursor.obj \ gdkdraw.obj \ + gdkenumtypes.obj \ gdkevents.obj \ gdkfont.obj \ gdkgc.obj \ @@ -69,6 +76,38 @@ gdk_OBJECTS = \ gdkrgb.obj \ gdkwindow.obj +gdk_public_h_sources = \ + gdk.h \ + gdkcolor.h \ + gdkcompat.h \ + gdkcursor.h \ + gdkcursors.h \ + gdkdnd.h \ + gdkdrawable.h \ + gdkevents.h \ + gdkfont.h \ + gdkgc.h \ + gdkkeysyms.h \ + gdki18n.h \ + gdkimage.h \ + gdkinput.h \ + gdkkeys.h \ + gdkpango.h \ + gdkpixbuf.h \ + gdkpixmap.h \ + gdkproperty.h \ + gdkregion.h \ + gdkrgb.h \ + gdkselection.h \ + gdktypes.h \ + gdkvisual.h \ + gdkwindow.h \ + +gdkenumtypes.h: $(gdk_public_h_sources) makeenums.pl + $(PERL) makeenums.pl include $(gdk_public_h_sources) > gdkenumtypes.h + +gdkenumtypes.c: $(gdk_public_h_sources) makeenums.pl + $(PERL) makeenums.pl cfile $(gdk_public_h_sources) > gdkenumtypes.c ..\config.h : ..\config.h.win32 copy ..\config.h.win32 ..\config.h diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c index e8381b4ce3..75092ae497 100644 --- a/gdk/win32/gdkdrawable-win32.c +++ b/gdk/win32/gdkdrawable-win32.c @@ -233,6 +233,15 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable, (filled ? "fill " : ""), width, height, x, y)); + if (filled + && (gc_private->tile) + && (gc_private->values_mask & GDK_GC_TILE) + && (gc_private->values_mask & GDK_GC_FILL)) + { + gdk_win32_draw_tiles (drawable, gc, gc_private->tile, x, y, width, height); + return; + } + hdc = gdk_win32_hdc_get (drawable, gc, mask); #if 0 @@ -629,6 +638,7 @@ gdk_win32_draw_drawable (GdkDrawable *drawable, src_rgn = CreateRectRgn (0, 0, src_width + 1, src_height + 1); draw_rgn = CreateRectRgn (xsrc, ysrc, xsrc + width + 1, ysrc + height + 1); +#if 0 /* HB: I dont't see reason to do this ... */ if (GDK_IS_WINDOW_IMPL_WIN32 (drawable)) { /* If we are drawing on a window, calculate the region that is @@ -652,6 +662,7 @@ gdk_win32_draw_drawable (GdkDrawable *drawable, if (!DeleteObject (outside_rgn)) WIN32_GDI_FAILED ("DeleteObject"); } +#endif #if 1 /* Don't know if this is necessary */ if (CombineRgn (draw_rgn, draw_rgn, src_rgn, RGN_AND) == COMPLEXREGION) @@ -746,6 +757,44 @@ gdk_win32_draw_drawable (GdkDrawable *drawable, gdk_win32_hdc_release (drawable, gc, 0); } +void +gdk_win32_draw_tiles (GdkDrawable *drawable, + GdkGC *gc, + GdkPixmap *tile, + gint x_from, + gint y_from, + gint max_width, + gint max_height) +{ + gint x = x_from, y = y_from; + gint tile_width, tile_height; + gint width, height; + + gdk_drawable_get_size (drawable, &width, &height); + gdk_drawable_get_size (tile, &tile_width, &tile_height); + + width = MIN (width, max_width); + height = MIN (height, max_height); + + tile_width = MIN (tile_width, max_width); + tile_height = MIN (tile_height, max_height); + + while (y < height) + { + x = x_from; + while (x < width) + { + gdk_win32_draw_drawable (drawable, gc, tile, + x % tile_width, /* xsrc */ + y % tile_height, /* ysrc */ + x, y, /* dest */ + tile_width, tile_height); + x += tile_width; + } + y += tile_height; + } +} + static void gdk_win32_draw_points (GdkDrawable *drawable, GdkGC *gc, @@ -893,7 +942,7 @@ gdk_win32_draw_glyphs (GdkDrawable *drawable, if (SetBkMode (hdc, TRANSPARENT) == 0) WIN32_GDI_FAILED ("SetBkMode"); - if (GDI_ERROR == SetTextAlign (hdc, TA_LEFT|TA_BOTTOM|TA_NOUPDATECP)) + if (GDI_ERROR == SetTextAlign (hdc, TA_LEFT|TA_BASELINE|TA_NOUPDATECP)) WIN32_GDI_FAILED ("SetTextAlign"); pango_win32_render (hdc, font, glyphs, x, y); diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index e436695640..6669d264bd 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -43,6 +43,15 @@ void _gdk_window_process_expose (GdkWindow *window, gulong serial, GdkRectangle *area); +/* gdkdrawable-win32.c, background draw helper */ +void gdk_win32_draw_tiles (GdkDrawable *drawable, + GdkGC *gc, + GdkPixmap *tile, + gint x, + gint y, + gint width, + gint height); + void gdk_win32_selection_init (void); void gdk_win32_dnd_exit (void); diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index 598a0841a9..ec1e4090f3 100644 --- a/gdk/win32/gdkproperty-win32.c +++ b/gdk/win32/gdkproperty-win32.c @@ -233,3 +233,25 @@ gdk_property_delete (GdkWindow *window, else g_warning ("gdk_property_delete: General case not implemented"); } + +gboolean +gdk_setting_get (const gchar *name, + GValue *value) +{ + /* + * XXX : if these values get changed through the Windoze UI the + * respective gdk_events are not generated yet. + */ + if (strcmp ("double-click-timeout", name) == 0) + { + g_value_set_int (value, GetDoubleClickTime ()); + return TRUE; + } + else if (strcmp ("drag-threshold", name) == 0) + { + g_value_set_int (value, MAX(GetSystemMetrics (SM_CXDRAG), GetSystemMetrics (SM_CYDRAG))); + return TRUE; + } + else + return FALSE; +}
\ No newline at end of file |