aboutsummaryrefslogtreecommitdiff
path: root/generic/PostScript.c
diff options
context:
space:
mode:
authorlecoanet2003-04-16 09:49:22 +0000
committerlecoanet2003-04-16 09:49:22 +0000
commit3261805fee19e346b4d1f84b23816daa1628764a (patch)
tree63ca1d7e4b0a3d9ae49cc0888e58033c3ef3fe22 /generic/PostScript.c
parenteed2656db0adae2c234c3d74af0913746ed5c444 (diff)
downloadtkzinc-3261805fee19e346b4d1f84b23816daa1628764a.zip
tkzinc-3261805fee19e346b4d1f84b23816daa1628764a.tar.gz
tkzinc-3261805fee19e346b4d1f84b23816daa1628764a.tar.bz2
tkzinc-3261805fee19e346b4d1f84b23816daa1628764a.tar.xz
Update from the Windows port and general cleanup/restructure
Diffstat (limited to 'generic/PostScript.c')
-rw-r--r--generic/PostScript.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/generic/PostScript.c b/generic/PostScript.c
index 71781f1..27923e2 100644
--- a/generic/PostScript.c
+++ b/generic/PostScript.c
@@ -35,10 +35,13 @@
**********************************************************************************
*/
-#include <malloc.h>
+#ifndef _WIN32
+
+#ifndef _WIN32
#include <unistd.h>
-#include <stdio.h>
#include <pwd.h>
+#endif
+#include <stdio.h>
#include <sys/types.h>
#include <time.h>
@@ -75,9 +78,9 @@ static char ps_prolog[] = "";
**********************************************************************************
*/
static void
-SetPostScriptFont(WidgetInfo *wi,
- PostScriptInfo ps_info,
- XFontStruct *fs)
+SetPostScriptFont(ZnWInfo *wi __unused,
+ ZnPostScriptInfo ps_info __unused,
+ XFontStruct *fs __unused)
{
}
@@ -90,31 +93,31 @@ SetPostScriptFont(WidgetInfo *wi,
**********************************************************************************
*/
static void
-EmitPostScript(WidgetInfo *wi,
- FILE *file,
- char *title,
- ZnBool landscape,
- int color_mode,
- int x_world,
- int y_world,
- int world_width,
- int world_height,
- int bbox_ox,
- int bbox_oy,
- int bbox_cx,
- int bbox_cy)
+EmitPostScript(ZnWInfo *wi,
+ FILE *file,
+ char *title,
+ ZnBool landscape,
+ int color_mode,
+ int x_world,
+ int y_world,
+ int world_width,
+ int world_height,
+ int bbox_ox,
+ int bbox_oy,
+ int bbox_cx,
+ int bbox_cy)
{
- PostScriptInfo ps_info;
+ ZnPostScriptInfo ps_info;
/* double scale;*/
ZnBBox damaged_area, bbox;
- Item current_item;
+ ZnItem current_item;
struct passwd *pwd_info;
time_t now;
char *s;
XFontStruct *fs;
int i;
- ps_info = (PostScriptInfo) ZnMalloc(sizeof(PostScriptStruct));
+ ps_info = (ZnPostScriptInfo) ZnMalloc(sizeof(ZnPostScriptStruct));
ps_info->file = file;
ps_info->title = title;
ps_info->landscape = landscape;
@@ -193,9 +196,9 @@ EmitPostScript(WidgetInfo *wi,
*/
current_item = ZnGroupTail(wi->top_group);
while (current_item != ZN_NO_ITEM) {
- if (ISSET(current_item->flags, VISIBLE_BIT)) {
- IntersectBBox(&ps_info->page_bbox, &current_item->item_bounding_box, &bbox);
- if (!IsEmptyBBox(&bbox)) {
+ if (ISSET(current_item->flags, ZN_VISIBLE_BIT)) {
+ ZnIntersectBBox(&ps_info->page_bbox, &current_item->item_bounding_box, &bbox);
+ if (!ZnIsEmptyBBox(&bbox)) {
current_item->class->PostScript(current_item, ps_info);
}
}
@@ -240,7 +243,8 @@ EmitPostScript(WidgetInfo *wi,
**********************************************************************************
*/
-struct _POSTSCRIPT_P POSTSCRIPT_P = {
+struct _ZnPOSTSCRIPT ZnPOSTSCRIPT = {
EmitPostScript,
SetPostScriptFont
};
+#endif /* _WIN32 */