dia r4065 - in trunk: . app lib



Author: hans
Date: Sun Jun  1 17:17:02 2008
New Revision: 4065
URL: http://svn.gnome.org/viewvc/dia?rev=4065&view=rev

Log:
2008-06-01  Hans Breuer  <hans breuer org>

	* app/display.c : get rid of HAVE_LIBART, there is antialiased 
	rendering with cairo, too. Update menu by plug-ins types 
	being available.
	* lib/font.c : now that I can look at the cairo renderer interactively
	the renderers font-size mismatch raised it's ugly head again. Some 
	code in	comment which does not solve the issue

	* app/app_procs.c : updated version dump for cairo and pango
	* configure.in : updated pango version required (to the same 
	already dragged in by gkt+ (still 2.6 as minimum)
	



Modified:
   trunk/ChangeLog
   trunk/app/app_procs.c
   trunk/app/display.c
   trunk/configure.in
   trunk/lib/font.c

Modified: trunk/app/app_procs.c
==============================================================================
--- trunk/app/app_procs.c	(original)
+++ trunk/app/app_procs.c	Sun Jun  1 17:17:02 2008
@@ -76,10 +76,6 @@
 #include "newgroup.h"
 #include "libdia.h"
 
-static void
-integrated_ui_create_initial_diagrams_callback (GtkWidget *widget,
-                                                gpointer   user_data);
-
 static gboolean
 handle_initial_diagram(const char *input_file_name, 
 		       const char *export_file_name,
@@ -414,13 +410,16 @@
 #ifdef HAVE_LIBART
   "libart "
 #endif
+#ifdef HAVE_CAIRO
+  "cairo "
+#endif
   "\n");
 
   /* print out all those dependies, both compile and runtime if possible 
    * Note: this is not meant to be complete but does only include libaries 
    * which may or have cause(d) us trouble in some versions 
    */
-  g_print ("Library versions\n");
+  g_print ("Library versions (at compile time)\n");
 #ifdef HAVE_LIBPNG
   g_print ("libpng  : %s (%s)\n", png_get_header_ver(NULL), PNG_LIBPNG_VER_STRING);
 #endif
@@ -445,7 +444,7 @@
   }
 #endif
   {
-    gchar* libxml_rt_version = "?";
+    const gchar* libxml_rt_version = "?";
 #if 0
     /* this is stupid, does not compile on Linux:
      * app_procs.c:504: error: expected identifier before '(' token
@@ -468,7 +467,14 @@
   g_print ("glib    : %d.%d.%d (%d.%d.%d)\n", 
            glib_major_version, glib_minor_version, glib_micro_version,
            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
-  g_print ("pango   : version not available\n"); /* Pango does not provide such */
+#ifdef PANGO_VERSION_ENCODE
+  g_print ("pango   : %s (%d.%d.%d.)\n", pango_version_string(), PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR, PANGO_VERSION_MICRO);
+#else
+  g_print ("pango   : version not available (>= 1.14.x)\n"); /* Pango did not provide such */
+#endif
+#if HAVE_CAIRO
+  g_print ("cairo   : %s (%d.%d.%d)\n", cairo_version_string(), CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO);
+#endif
 #if 0
   {
     gchar  linkedname[1024];

Modified: trunk/app/display.c
==============================================================================
--- trunk/app/display.c	(original)
+++ trunk/app/display.c	Sun Jun  1 17:17:02 2008
@@ -1183,8 +1183,7 @@
                                   GTK_DIALOG_MODAL,
                                   GTK_MESSAGE_QUESTION,
                                   GTK_BUTTONS_NONE, /* no standard buttons */
-				  _("Closing diagram without saving"),
-				  NULL);
+				  _("Closing diagram without saving"));
   gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
     _("The diagram '%s'\n"
       "has not been saved. Save changes now?"), fname);
@@ -1216,32 +1215,24 @@
   GtkToggleAction *visible_grid;
   GtkToggleAction *snap_to_grid;
   GtkToggleAction *show_cx_pts;
-#ifdef HAVE_LIBART
   GtkToggleAction *antialiased;
-#endif
 
   if (ddisp->menu_bar == NULL) {
     rulers       = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowrulers"));
     visible_grid = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowgrid"));
     snap_to_grid = GTK_TOGGLE_ACTION (menus_get_action ("ViewSnaptogrid"));
     show_cx_pts  = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowconnectionpoints"));
-#ifdef HAVE_LIBART
     antialiased  = GTK_TOGGLE_ACTION (menus_get_action ("ViewAntialiased"));
-#else 
-    /* the action is registered to avoid crashing, disable the entry */
-    gtk_action_set_sensitive (menus_get_action ("ViewAntialiased"), FALSE);
-#endif
   } else {
     rulers       = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowrulers"));
     visible_grid = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowgrid"));
     snap_to_grid = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewSnaptogrid"));
     show_cx_pts  = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowconnectionpoints"));
-#ifdef HAVE_LIBART
+
     antialiased  = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewAntialiased"));
-#else
-    gtk_action_set_sensitive (gtk_action_group_get_action (ddisp->actions, "ViewAntialiased"), FALSE);
-#endif
   }
+  gtk_action_set_sensitive (menus_get_action ("ViewAntialiased"), 
+		            g_type_from_name ("DiaCairoInteractiveRenderer") != 0 || g_type_from_name ("DiaLibartRenderer") != 0);
 
 
   ddisplay_do_update_menu_sensitivity (ddisp);
@@ -1253,10 +1244,9 @@
 				 ddisp->grid.snap);
   gtk_toggle_action_set_active (show_cx_pts,
 				 ddisp->show_cx_pts); 
-#ifdef HAVE_LIBART
+
   gtk_toggle_action_set_active (antialiased,
-				 ddisp->aa_renderer);
-#endif 
+				ddisp->aa_renderer);
 }
 
 void 

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sun Jun  1 17:17:02 2008
@@ -56,8 +56,8 @@
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
 GTK_MODULES="gtk+-2.0 >= 2.6.0 glib-2.0 >= 2.6.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0"
-PKG_CHECK_MODULES(PANGOVERSION, pango >= 1.1.5, , 
-                  AC_MSG_ERROR([Need Pango version 1.1.5 or higher]))
+PKG_CHECK_MODULES(PANGOVERSION, pango >= 1.8.0, , 
+                  AC_MSG_ERROR([Need Pango version 1.8.0 or higher]))
 
 AC_ARG_WITH(freetype,
 [  --without-freetype        compile without FreeType support],,with_freetype=yes)

Modified: trunk/lib/font.c
==============================================================================
--- trunk/lib/font.c	(original)
+++ trunk/lib/font.c	Sun Jun  1 17:17:02 2008
@@ -136,6 +136,11 @@
 PangoContext *
 dia_font_get_context() {
   if (pango_context == NULL) {
+/* Maybe this one with pangocairo
+     dia_font_push_context (pango_cairo_font_map_create_context (pango_cairo_font_map_get_default()));
+ * but it gives: 
+     (lt-dia:30476): Pango-CRITICAL **: pango_renderer_draw_layout: assertion `PANGO_IS_RENDERER (renderer)' failed
+ */
 #ifdef HAVE_FREETYPE
     /* This is suggested by new Pango (1.2.4+), but doesn't get us the
      * right resolution:(



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]