dia r4175 - in trunk: . plug-ins/cairo
- From: hans svn gnome org
- To: svn-commits-list gnome org
- Subject: dia r4175 - in trunk: . plug-ins/cairo
- Date: Tue, 6 Jan 2009 09:17:12 +0000 (UTC)
Author: hans
Date: Tue Jan 6 09:17:12 2009
New Revision: 4175
URL: http://svn.gnome.org/viewvc/dia?rev=4175&view=rev
Log:
2009-01-06 Hans Breuer <hans breuer org>
* plug-ins/cairo/diacairo-renderer.c : compiles without warnings ...
* plug-ins/cairo/diacairo-interactive.c : ... intialize parent_class
and actually use cairo_interactive_renderer_finalize
Modified:
trunk/ChangeLog
trunk/plug-ins/cairo/diacairo-interactive.c
trunk/plug-ins/cairo/diacairo-renderer.c
Modified: trunk/plug-ins/cairo/diacairo-interactive.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-interactive.c (original)
+++ trunk/plug-ins/cairo/diacairo-interactive.c Tue Jan 6 09:17:12 2009
@@ -250,6 +250,10 @@
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
DiaRendererClass *renderer_class = DIA_RENDERER_CLASS (klass);
+ parent_class = g_type_class_peek_parent (klass);
+
+ gobject_class->finalize = cairo_interactive_renderer_finalize;
+
gobject_class->set_property = cairo_interactive_renderer_set_property;
gobject_class->get_property = cairo_interactive_renderer_get_property;
@@ -474,3 +478,4 @@
cairo_fill (renderer->cr);
#endif
}
+
Modified: trunk/plug-ins/cairo/diacairo-renderer.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-renderer.c (original)
+++ trunk/plug-ins/cairo/diacairo-renderer.c Tue Jan 6 09:17:12 2009
@@ -291,10 +291,12 @@
set_font(DiaRenderer *self, DiaFont *font, real height)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
+#ifndef HAVE_PANGOCAIRO_H
DiaFontStyle style = dia_font_get_style (font);
+ const char *family_name;
+#endif
PangoFontDescription *pfd = pango_font_description_copy (dia_font_get_description (font));
- const char *family_name;
DIAG_NOTE(g_message("set_font %f %s", height, dia_font_get_family(font)));
#ifdef HAVE_PANGOCAIRO_H
@@ -638,10 +640,7 @@
Color *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
- cairo_text_extents_t extents;
- double x = 0, y = 0;
int len = strlen(text);
- PangoRectangle logical_rect;
DIAG_NOTE(g_message("draw_string(%d) %f,%f %s",
len, pos->x, pos->y, text));
@@ -671,27 +670,30 @@
cairo_restore (renderer->cr);
#else
/* using the 'toy API' */
- cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, 1.0);
- cairo_text_extents (renderer->cr,
- text,
- &extents);
-
- y = pos->y; /* ?? */
-
- switch (alignment) {
- case ALIGN_LEFT:
- x = pos->x;
- break;
- case ALIGN_CENTER:
- x = pos->x - extents.width / 2 + +extents.x_bearing;
- break;
- case ALIGN_RIGHT:
- x = pos->x - extents.width + extents.x_bearing;
- break;
+ {
+ cairo_text_extents_t extents;
+ double x = 0, y = 0;
+ cairo_set_source_rgba (renderer->cr, color->red, color->green, color->blue, 1.0);
+ cairo_text_extents (renderer->cr,
+ text,
+ &extents);
+
+ y = pos->y; /* ?? */
+
+ switch (alignment) {
+ case ALIGN_LEFT:
+ x = pos->x;
+ break;
+ case ALIGN_CENTER:
+ x = pos->x - extents.width / 2 + +extents.x_bearing;
+ break;
+ case ALIGN_RIGHT:
+ x = pos->x - extents.width + extents.x_bearing;
+ break;
+ }
+ cairo_move_to (renderer->cr, x, y);
+ cairo_show_text (renderer->cr, text);
}
-
- cairo_move_to (renderer->cr, x, y);
- cairo_show_text (renderer->cr, text);
#endif
DIAG_STATE(renderer->cr)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]