Commit 6a3a2cd3 authored by Hans Breuer's avatar Hans Breuer Committed by Hans Breuer

updated

2004-11-21  Hans Breuer  <hans@breuer.org>

	* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
	  gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated

	* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
	* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()

	* demos/gtk-demo/rotated_text.c : use G_PI
parent 506b6c64
2004-11-21 Hans Breuer <hans@breuer.org>
* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated
* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()
* demos/gtk-demo/rotated_text.c : use G_PI
Sat Nov 20 15:13:51 2004 Owen Taylor <otaylor@redhat.com>
* gdk/gdkpango.[ch]: Add GdkPangoRenderer, a subclass of
......
2004-11-21 Hans Breuer <hans@breuer.org>
* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated
* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()
* demos/gtk-demo/rotated_text.c : use G_PI
Sat Nov 20 15:13:51 2004 Owen Taylor <otaylor@redhat.com>
* gdk/gdkpango.[ch]: Add GdkPangoRenderer, a subclass of
......
2004-11-21 Hans Breuer <hans@breuer.org>
* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated
* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()
* demos/gtk-demo/rotated_text.c : use G_PI
Sat Nov 20 15:13:51 2004 Owen Taylor <otaylor@redhat.com>
* gdk/gdkpango.[ch]: Add GdkPangoRenderer, a subclass of
......
2004-11-21 Hans Breuer <hans@breuer.org>
* gdk/makefile.msc.in gtk/stock-icons/makefile.msc
gtk/makefile.msc.in demos/gtk-demo/makefile.msc.in : updated
* gdk/win32/gdkdrawable-win32.c : implement gdk_win32_draw_glyphs_transformed()
* gdk/win32/gdkgc-win32.c : implement _gdk_windowing_gc_get_foreground()
* demos/gtk-demo/rotated_text.c : use G_PI
Sat Nov 20 15:13:51 2004 Owen Taylor <otaylor@redhat.com>
* gdk/gdkpango.[ch]: Add GdkPangoRenderer, a subclass of
......
......@@ -52,6 +52,7 @@ DEMOS = \
menus.c \
panes.c \
pixbufs.c \
rotated_text.c \
sizegroup.c \
stock_browser.c \
textview.c \
......@@ -80,6 +81,7 @@ OBJECTS = \
menus.obj \
panes.obj \
pixbufs.obj \
rotated_text.obj \
sizegroup.obj \
stock_browser.obj \
textview.obj \
......
......@@ -68,7 +68,7 @@ rotated_text_expose_event (GtkWidget *widget,
double angle = (360. * i) / N_WORDS;
/* Gradient from red at angle == 60 to blue at angle == 300 */
color.red = 65535 * (1 + cos ((angle - 60) * M_PI / 180.)) / 2;
color.red = 65535 * (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
color.green = 0;
color.blue = 65535 - color.red;
......
......@@ -148,7 +148,7 @@ gdkalias.h: gdk.symbols
gdk.def: gdk.symbols
echo EXPORTS > gdk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 gdk.symbols >> gdk.def
cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DGDK_WINDOWING_WIN32 gdk.symbols >> gdk.def
libgdk-win32-$(GTK_VER)-0.dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
$(CC) $(CFLAGS) -LD -Fe$@ $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) \
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1998-2002 Tor Lillqvist
* Copyright (C) 1998-2004 Tor Lillqvist
* Copyright (C) 2001-2004 Hans Breuer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -105,6 +106,13 @@ static void gdk_win32_draw_glyphs (GdkDrawable *drawable,
gint x,
gint y,
PangoGlyphString *glyphs);
static void gdk_win32_draw_glyphs_transformed (GdkDrawable *drawable,
GdkGC *gc,
PangoMatrix *matrix,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs);
static void gdk_win32_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
......@@ -181,6 +189,7 @@ gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
drawable_class->draw_segments = gdk_win32_draw_segments;
drawable_class->draw_lines = gdk_win32_draw_lines;
drawable_class->draw_glyphs = gdk_win32_draw_glyphs;
drawable_class->draw_glyphs_transformed = gdk_win32_draw_glyphs_transformed;
drawable_class->draw_image = gdk_win32_draw_image;
drawable_class->set_colormap = gdk_win32_set_colormap;
......@@ -1439,6 +1448,31 @@ draw_glyphs (GdkGCWin32 *gcwin32,
pango_win32_render (hdc, font, glyphs, x, y);
}
static void
draw_glyphs_transformed (GdkGCWin32 *gcwin32,
HDC hdc,
gint x_offset,
gint y_offset,
va_list args)
{
PangoFont *font;
gint x;
gint y;
PangoGlyphString *glyphs;
PangoMatrix *matrix;
matrix = va_arg(args, PangoMatrix *);
font = va_arg (args, PangoFont *);
x = va_arg (args, gint);
y = va_arg (args, gint);
glyphs = va_arg (args, PangoGlyphString *);
x -= x_offset;
y -= y_offset;
pango_win32_render_transformed (hdc, matrix, font, glyphs, x, y);
}
static void
gdk_win32_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
......@@ -1465,6 +1499,47 @@ gdk_win32_draw_glyphs (GdkDrawable *drawable,
gdk_region_destroy (region);
}
static void
gdk_win32_draw_glyphs_transformed (GdkDrawable *drawable,
GdkGC *gc,
PangoMatrix *matrix,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs)
{
GdkRectangle bounds;
GdkRegion *region;
PangoRectangle ink_rect;
pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
bounds.x = x + PANGO_PIXELS (ink_rect.x) - 1;
bounds.y = y + PANGO_PIXELS (ink_rect.y) - 1;
bounds.width = PANGO_PIXELS (ink_rect.width) + 2;
bounds.height = PANGO_PIXELS (ink_rect.height) + 2;
region = gdk_region_rectangle (&bounds);
if (matrix)
{
/* transform region */
bounds.x = bounds.x * matrix->xx + bounds.y * matrix->xy + matrix->x0;
bounds.y = bounds.x * matrix->yx + bounds.y * matrix->yy + matrix->x0;
bounds.width = bounds.width * matrix->xx + bounds.height * matrix->xy;
bounds.height = bounds.height * matrix->yx + bounds.width * matrix->xy;
generic_draw (drawable, gc, GDK_GC_FOREGROUND|GDK_GC_FONT,
draw_glyphs_transformed, region, matrix, font, x, y, glyphs);
}
else
{
generic_draw (drawable, gc, GDK_GC_FOREGROUND|GDK_GC_FONT,
draw_glyphs, region, font, x/PANGO_SCALE, y/PANGO_SCALE, glyphs);
}
gdk_region_destroy (region);
}
static void
blit_from_pixmap (gboolean use_fg_bg,
GdkDrawableImplWin32 *dest,
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1998-2002 Tor Lillqvist
* Copyright (C) 1998-2004 Tor Lillqvist
* Copyright (C) 2000-2004 Hans Breuer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -1259,3 +1260,23 @@ _gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
return (hrgn);
}
void
_gdk_windowing_gc_get_foreground (GdkGC *gc,
GdkColor *color)
{
GdkGCWin32 *win32_gc;
GdkColormap *cmap;
g_return_if_fail (GDK_IS_GC_WIN32 (gc));
win32_gc = GDK_GC_WIN32 (gc);
color->pixel = win32_gc->foreground;
cmap = gdk_gc_get_colormap (gc);
if (cmap)
gdk_colormap_query_color (cmap, win32_gc->foreground, color);
else
g_warning ("No colormap in _gdk_windowing_gc_get_foreground");
}
......@@ -84,6 +84,8 @@ VARIABLES = \
stock_media_pause_24 stock_media_pause_24.png \
stock_media_play_16 stock_media_play_16.png \
stock_media_play_24 stock_media_play_24.png \
stock_media_play_rtl_16 stock_media_play_rtl_16.png \
stock_media_play_rtl_24 stock_media_play_rtl_24.png \
stock_media_previous_16 stock_media_previous_16.png \
stock_media_previous_24 stock_media_previous_24.png \
stock_media_record_16 stock_media_record_16.png \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment