gucharmap r1708 - trunk/gucharmap



Author: chpe
Date: Fri Mar 21 10:59:52 2008
New Revision: 1708
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1708&view=rev

Log:
Don't make the print operation part of libgucharmap for now.


Modified:
   trunk/gucharmap/Makefile.am
   trunk/gucharmap/gucharmap-print-operation.c
   trunk/gucharmap/gucharmap-print-operation.h
   trunk/gucharmap/gucharmap-window.c
   trunk/gucharmap/gucharmap-window.h
   trunk/gucharmap/gucharmap.h.in

Modified: trunk/gucharmap/Makefile.am
==============================================================================
--- trunk/gucharmap/Makefile.am	(original)
+++ trunk/gucharmap/Makefile.am	Fri Mar 21 10:59:52 2008
@@ -44,8 +44,6 @@
 	gucharmap-init.c \
 	gucharmap-marshal.c \
 	gucharmap-marshal.h \
-	gucharmap-print-operation.c \
-	gucharmap-print-operation.h \
 	gucharmap-private.h \
 	gucharmap-script-chapters-model.c \
 	gucharmap-script-chapters-model.h \
@@ -105,6 +103,8 @@
 gucharmap_SOURCES = \
 	gucharmap-mini-fontsel.c \
 	gucharmap-mini-fontsel.h \
+	gucharmap-print-operation.c \
+	gucharmap-print-operation.h \
 	gucharmap-search-dialog.c \
 	gucharmap-search-dialog.h \
 	gucharmap-settings.c \
@@ -159,6 +159,13 @@
           && mv gucharmap-marshal.c.tmp gucharmap-marshal.c ) \
         || ( rm -f gucharmap-marshal.c.tmp && exit 1 )
 
+printoptions.h: print.glade
+	$(GTK_BUILDER_CONVERT) --root custom_tab_container $< - | \
+		$(XMLLINT) --noblanks - | \
+		$(HEXDUMP) -v -e '"" 1/1 "0x%02x,""\n"' > xgen-$(@F) \
+	&& (cmp -s xgen-$(@F) $@ || cp -f xgen-$(@F) $@) \
+	&& rm -f xgen-$(@F)
+
 # don't do the symlink stuff if this is windows
 if OS_WIN32
 

Modified: trunk/gucharmap/gucharmap-print-operation.c
==============================================================================
--- trunk/gucharmap/gucharmap-print-operation.c	(original)
+++ trunk/gucharmap/gucharmap-print-operation.c	Fri Mar 21 10:59:52 2008
@@ -20,14 +20,11 @@
 
 #include <gtk/gtk.h>
 
-#include "gucharmap-codepoint-list.h"
-#include "gucharmap-unicode-info.h"
-
 #include "gucharmap-print-operation.h"
 
 #define GUCHARMAP_PRINT_OPERATION_GET_PRIVATE(print_operation)(G_TYPE_INSTANCE_GET_PRIVATE ((print_operation), GUCHARMAP_TYPE_PRINT_OPERATION, GucharmapPrintOperationPrivate))
 
-#define GRID_LINE_WIDTH (2.0)
+#define GRID_LINE_WIDTH (0.25)
 
 struct _GucharmapPrintOperationPrivate
 {
@@ -76,6 +73,7 @@
   char utf8[7];
   int len;
   double x, y;
+  PangoRectangle ink_rect;
 
   wc = gucharmap_codepoint_list_get_char (priv->codepoint_list, character_index);
   if (!gucharmap_unichar_validate (wc))
@@ -84,6 +82,8 @@
   len = g_unichar_to_utf8 (wc, utf8);
   pango_layout_set_text (priv->character_layout, utf8, len);
 
+  pango_layout_get_extents (priv->character_layout, &ink_rect, NULL);
+
   /* FIXME: RTL? */
   x = col * priv->cell_width + priv->cell_margin_left;
   y = row * priv->cell_height + priv->cell_margin_top;
@@ -174,6 +174,15 @@
   priv->cell_margin_left = priv->cell_margin_right = priv->cell_margin_top = priv->cell_margin_bottom = MARGIN;
   //XXX  calculate cell_width/height
 
+  priv->character_width = priv->cell_width -
+                          priv->cell_margin_left -
+                          priv->cell_margin_right;
+  priv->character_height = priv->cell_height -
+                           priv->cell_margin_top -
+                           priv->cell_margin_bottom -
+                           priv->info_text_gap -
+                           priv->info_text_height;
+
   priv->n_rows = height / priv->cell_height;
   page_size = priv->n_rows * priv->n_columns;
   pages = (priv->last_codepoint_index + page_size) / page_size;

Modified: trunk/gucharmap/gucharmap-print-operation.h
==============================================================================
--- trunk/gucharmap/gucharmap-print-operation.h	(original)
+++ trunk/gucharmap/gucharmap-print-operation.h	Fri Mar 21 10:59:52 2008
@@ -16,15 +16,11 @@
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
-#if !defined (__GUCHARMAP_GUCHARMAP_H_INSIDE__) && !defined (GUCHARMAP_COMPILATION)
-#error "Only <gucharmap/gucharmap.h> can be included directly."
-#endif
-
 #ifndef GUCHARMAP_PRINT_OPERATION_H
 #define GUCHARMAP_PRINT_OPERATION_H
 
 #include <gtk/gtkprintoperation.h>
-#include "gucharmap-codepoint-list.h"
+#include <gucharmap/gucharmap.h>
 
 G_BEGIN_DECLS
 

Modified: trunk/gucharmap/gucharmap-window.c
==============================================================================
--- trunk/gucharmap/gucharmap-window.c	(original)
+++ trunk/gucharmap/gucharmap-window.c	Fri Mar 21 10:59:52 2008
@@ -1,5 +1,6 @@
 /*
  * Copyright  2004 Noah Levitt
+ * Copyright  2007, 2008 Christian Persch
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -20,12 +21,15 @@
 
 #include <stdlib.h>
 #include <string.h>
+
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include "gucharmap-window.h"
+
+#include "gucharmap-print-operation.h"
 #include "gucharmap-search-dialog.h"
 #include "gucharmap-settings.h"
+#include "gucharmap-window.h"
 
 static void gucharmap_window_class_init (GucharmapWindowClass *klass);
 static void gucharmap_window_init       (GucharmapWindow *window);
@@ -319,12 +323,14 @@
                                          guw);
 }
 
+#if 0
 static void
 file_print_preview (GtkAction *action,
                     GucharmapWindow *guw)
 {
   gucharmap_window_print (guw, GTK_PRINT_OPERATION_ACTION_PREVIEW);
 }
+#endif
 
 static void
 file_print (GtkAction *action,
@@ -648,7 +654,9 @@
   "<menubar name='MenuBar'>"
     "<menu action='File'>"
       "<menuitem action='PageSetup' />"
+#if 0
       "<menuitem action='PrintPreview' />"
+#endif
       "<menuitem action='Print' />"
       "<separator />"
       "<menuitem action='Close' />"
@@ -786,8 +794,10 @@
 
     { "PageSetup", NULL, N_("Page _Setup"), NULL,
       NULL, G_CALLBACK (file_page_setup) },
+#if 0
     { "PrintPreview", GTK_STOCK_PRINT_PREVIEW, NULL, NULL,
       NULL, G_CALLBACK (file_print_preview) },
+#endif
     { "Print", GTK_STOCK_PRINT, NULL, NULL,
       NULL, G_CALLBACK (file_print) },
     { "Close", GTK_STOCK_CLOSE, NULL, NULL,

Modified: trunk/gucharmap/gucharmap-window.h
==============================================================================
--- trunk/gucharmap/gucharmap-window.h	(original)
+++ trunk/gucharmap/gucharmap-window.h	Fri Mar 21 10:59:52 2008
@@ -1,5 +1,6 @@
 /*
  * Copyright  2004 Noah Levitt
+ * Copyright  2007, 2008 Christian Persch
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the

Modified: trunk/gucharmap/gucharmap.h.in
==============================================================================
--- trunk/gucharmap/gucharmap.h.in	(original)
+++ trunk/gucharmap/gucharmap.h.in	Fri Mar 21 10:59:52 2008
@@ -38,7 +38,6 @@
 #include <gucharmap/gucharmap-charmap.h>
 #include <gucharmap/gucharmap-chartable.h>
 #include <gucharmap/gucharmap-codepoint-list.h>
-#include <gucharmap/gucharmap-print-operation.h>
 #include <gucharmap/gucharmap-script-chapters-model.h>
 #include <gucharmap/gucharmap-script-codepoint-list.h>
 #include <gucharmap/gucharmap-unicode-info.h>



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