dia r4015 - trunk/plug-ins/postscript



Author: hans
Date: Sun May 11 12:21:41 2008
New Revision: 4015
URL: http://svn.gnome.org/viewvc/dia?rev=4015&view=rev

Log:
2008-05-11  Hans Breuer  <hans breuer org>

	* plug-ins/postscript/* copied mainly from app/* :
	* plug-ins/postscript/postscript.c : register Dia's formerly built-in
	PS filters as plug-in, so they can be switched off when obsoleted by
	cairo or the user does not want them, printing temporary registered as
	"Print (PS)"



Added:
   trunk/plug-ins/postscript/Makefile.am
Modified:
   trunk/plug-ins/postscript/paginate_psprint.c
   trunk/plug-ins/postscript/paginate_psprint.h
   trunk/plug-ins/postscript/render_eps.c
   trunk/plug-ins/postscript/render_eps.h

Added: trunk/plug-ins/postscript/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plug-ins/postscript/Makefile.am	Sun May 11 12:21:41 2008
@@ -0,0 +1,32 @@
+if WITH_FREETYPE
+freetype_files = diapsft2renderer.h diapsft2renderer.c
+else
+freetype_files = 
+endif
+
+plugin_sources = \
+	diapsrenderer.h \
+	diapsrenderer.c \
+	$(freetype_files) \
+	$(freetype_files) \
+	paginate_psprint.c \
+	paginate_psprint.h \
+	render_eps.c \
+	render_eps.h
+
+pkglib_LTLIBRARIES = libcairo_filter.la
+
+EXTRA_DIST = \
+	win32print.c \
+	win32print.h
+
+libpostscript_filter_la_SOURCES = $(plugin_sources)
+
+libpostscript_filter_la_LDFLAGS = -export-dynamic -module -avoid-version
+
+libpostscript_filter_la_LIBADD =
+if WITH_FREETYPE
+libpostscript_filter_la_LIBADD = $(FREETYPE_LIBS)
+endif
+
+INCLUDES = -I$(srcdir)/../../lib $(GTK_CFLAGS) $(DEBUG_FLAGS) $(CAIRO_CFLAGS)

Modified: trunk/plug-ins/postscript/paginate_psprint.c
==============================================================================
--- trunk/plug-ins/postscript/paginate_psprint.c	(original)
+++ trunk/plug-ins/postscript/paginate_psprint.c	Sun May 11 12:21:41 2008
@@ -35,12 +35,10 @@
 
 #include "intl.h"
 #include "message.h"
-#include "diagram.h"
 #include "diagramdata.h"
 #include "render_eps.h"
 #include "diapsrenderer.h"
 #include "paginate_psprint.h"
-#include "diapagelayout.h"
 #include "persistence.h"
 
 #include <gtk/gtk.h>
@@ -146,7 +144,7 @@
 }
 
 void
-paginate_psprint(Diagram *dia, FILE *file)
+paginate_psprint(DiagramData *dia, FILE *file)
 {
   DiaRenderer *rend;
   Rectangle *extents;
@@ -158,20 +156,20 @@
 
 #ifdef DIA_PS_RENDERER_DUAL_PASS
   /* Prepare the prolog (with fonts etc) */
-  data_render(dia->data, DIA_RENDERER(rend), NULL, NULL, NULL);
+  data_render(dia, DIA_RENDERER(rend), NULL, NULL, NULL);
   eps_renderer_prolog_done(rend);
 #endif
 
   /* the usable area of the page */
-  width = dia->data->paper.width;
-  height = dia->data->paper.height;
+  width = dia->paper.width;
+  height = dia->paper.height;
 
   /* get extents, and make them multiples of width / height */
-  extents = &dia->data->extents;
+  extents = &dia->extents;
   initx = extents->left;
   inity = extents->top;
   /* make page boundaries align with origin */
-  if (!dia->data->paper.fitto) {
+  if (!dia->paper.fitto) {
     initx = floor(initx / width)  * width;
     inity = floor(inity / height) * height;
   }
@@ -192,7 +190,7 @@
       page_bounds.top = y;
       page_bounds.bottom = y + height;
 
-      nobjs += print_page(dia->data,rend, &page_bounds);
+      nobjs += print_page(dia,rend, &page_bounds);
     }
   }
 
@@ -223,7 +221,7 @@
 static gboolean
 diagram_print_destroy(GtkWidget *widget)
 {
-  Diagram *dia;
+  DiagramData *dia;
 
   if ((dia = gtk_object_get_user_data(GTK_OBJECT(widget))) != NULL) {
     g_object_unref(dia);
@@ -234,7 +232,7 @@
 }
 
 void
-diagram_print_ps(Diagram *dia)
+diagram_print_ps(DiagramData *dia)
 {
   GtkWidget *dialog;
   GtkWidget *vbox, *frame, *table, *box, *button;
@@ -351,7 +349,11 @@
   orig_command = printcmd;
 
   /* Work out diagram filename and use this as default .ps file */
+#if 0
   filename = g_path_get_basename(dia->filename);
+#else
+  filename = "diapsprint.dia";
+#endif
   printer_filename = g_malloc(strlen(filename) + 4);
   printer_filename = strcpy(printer_filename, filename);
   dot = strrchr(printer_filename, '.');
@@ -439,8 +441,11 @@
         if (!g_path_is_absolute(filename)) {
           char *dirname;
           char *full_filename;
-
+#if 0
           dirname = g_path_get_dirname(dia->filename);
+#else
+	  dirname = g_get_home_dir ();
+#endif
           full_filename = g_build_filename(dirname, filename, NULL);
           file = g_fopen(full_filename, "w");
           g_free(full_filename);

Modified: trunk/plug-ins/postscript/paginate_psprint.h
==============================================================================
--- trunk/plug-ins/postscript/paginate_psprint.h	(original)
+++ trunk/plug-ins/postscript/paginate_psprint.h	Sun May 11 12:21:41 2008
@@ -25,11 +25,10 @@
 #include <stdio.h>
 #include <glib.h>
 
-#include "diagram.h"
 #include "diagramdata.h"
 
-void paginate_psprint (Diagram *dia, FILE *file);
+void paginate_psprint (DiagramData *dia, FILE *file);
 
-void diagram_print_ps (Diagram *dia);
+void diagram_print_ps (DiagramData *dia, const gchar *filename);
 
 #endif

Modified: trunk/plug-ins/postscript/render_eps.c
==============================================================================
--- trunk/plug-ins/postscript/render_eps.c	(original)
+++ trunk/plug-ins/postscript/render_eps.c	Sun May 11 12:21:41 2008
@@ -126,7 +126,7 @@
 }
 
 DiaRenderer *
-new_psprint_renderer(Diagram *dia, FILE *file)
+new_psprint_renderer(DiagramData *dia, FILE *file)
 {
   DiaPsRenderer *renderer;
 

Modified: trunk/plug-ins/postscript/render_eps.h
==============================================================================
--- trunk/plug-ins/postscript/render_eps.h	(original)
+++ trunk/plug-ins/postscript/render_eps.h	Sun May 11 12:21:41 2008
@@ -22,10 +22,10 @@
 
 #include "diatypes.h"
 #include "filter.h"
-#include "diagram.h"
+#include "diagramdata.h"
 
-DiaRenderer *new_eps_renderer(Diagram *dia, char *filename);
-DiaRenderer *new_psprint_renderer(Diagram *dia, FILE *file);
+DiaRenderer *new_eps_renderer(DiagramData *dia, char *filename);
+DiaRenderer *new_psprint_renderer(DiagramData *dia, FILE *file);
 void eps_renderer_prolog_done(DiaRenderer *renderer);
 
 extern DiaExportFilter eps_ft2_export_filter;



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