summaryrefslogtreecommitdiff
path: root/graphics/tgif
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2001-07-18 20:28:35 +0000
committerdmcmahill <dmcmahill>2001-07-18 20:28:35 +0000
commit0de12539173f01b6cb58e5fc412eb3ae8cce9e28 (patch)
tree20c883cb7087619b3c493e19ab5f598116698224 /graphics/tgif
parentdd4022cfed30cfdcb7a1ae071502a032d0d4a375 (diff)
downloadpkgsrc-0de12539173f01b6cb58e5fc412eb3ae8cce9e28.tar.gz
forgot to cvs add first...
Diffstat (limited to 'graphics/tgif')
-rw-r--r--graphics/tgif/patches/patch-ab147
-rw-r--r--graphics/tgif/patches/patch-ac40
2 files changed, 187 insertions, 0 deletions
diff --git a/graphics/tgif/patches/patch-ab b/graphics/tgif/patches/patch-ab
new file mode 100644
index 00000000000..1f0d0be3224
--- /dev/null
+++ b/graphics/tgif/patches/patch-ab
@@ -0,0 +1,147 @@
+$NetBSD: patch-ab,v 1.3 2001/07/18 20:28:35 dmcmahill Exp $
+
+Fixes a bug in exporting postscript from the command line where the
+temporary directory name is not initialized properly.
+
+Patch is from the tgif author and it will be in the next release.
+
+*** tgif.c.orig Wed Jul 18 10:33:11 2001
+--- tgif.c Wed Jul 18 10:33:25 2001
+***************
+*** 336,339 ****
+--- 336,340 ----
+ }
+ InitPaperSize();
++ InitTmpDir();
+ if (PRTGIF && !cmdLineOpenDisplay) InitDontReencode(NULL);
+ if (argc <= 0) {
+*** setup.e.orig Wed Jul 18 10:33:08 2001
+--- setup.e Wed Jul 18 10:33:32 2001
+***************
+*** 183,186 ****
+--- 183,187 ----
+ extern void InitPaperSize ARGS_DECL((void));
+ extern void CleanUpPaperSize ARGS_DECL((void));
++ extern void InitTmpDir ARGS_DECL((void));
+ extern void Setup ARGS_DECL((void));
+ extern void CleanUpResiduals ARGS_DECL((void));
+*** setup.c.orig Wed Jul 18 10:33:05 2001
+--- setup.c Wed Jul 18 10:36:36 2001
+***************
+*** 843,846 ****
+--- 843,895 ----
+ }
+
++ void InitTmpDir()
++ {
++ int tmp_dir_in_x_def=FALSE;
++ char *c_ptr=NULL;
++
++ if (!PRTGIF || cmdLineOpenDisplay) {
++ /* do not translate -- program constants */
++ if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDir")) != NULL) {
++ UtilTrimBlanks(c_ptr);
++ if (*c_ptr == '\0') {
++ fprintf(stderr, TgLoadString(STID_INVALID_DIR_IN_X_DEFAULT),
++ c_ptr, TOOL_NAME, "TmpDir");
++ fprintf(stderr, "\n");
++ } else {
++ UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, c_ptr);
++ strcat(tmpDir, DIR_SEP_STR);
++ if (UtilIsDirectory(tmpDir)) {
++ tmp_dir_in_x_def = TRUE;
++ } else {
++ fprintf(stderr, TgLoadString(STID_TMP_DIR_NOT_EXIST_USE_XDEF),
++ tmpDir, TOOL_NAME, "TmpDir");
++ fprintf(stderr, "\n");
++ }
++ }
++ }
++ }
++ if (!tmp_dir_in_x_def) {
++ #ifndef _TMP_DIR_IN_HOME_DIR
++ UtilStrCpyN(tmpDir, sizeof(tmpDir), TMP_DIR);
++ if (!PRTGIF || cmdLineOpenDisplay) {
++ if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDirInHomeDir")) !=
++ NULL && UtilStrICmp(c_ptr, "true") == 0) {
++ UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, tgifDir);
++ strcat(tmpDir, DIR_SEP_STR);
++ }
++ }
++ #else /* _TMP_DIR_IN_HOME_DIR */
++ UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, tgifDir);
++ strcat(tmpDir, DIR_SEP_STR);
++ if (!PRTGIF || cmdLineOpenDisplay) {
++ if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDirInHomeDir")) !=
++ NULL && UtilStrICmp(c_ptr, "false") == 0) {
++ UtilStrCpyN(tmpDir, sizeof(tmpDir), TMP_DIR);
++ }
++ }
++ #endif /* ~_TMP_DIR_IN_HOME_DIR */
++ }
++ }
++
+ void Setup()
+ {
+***************
+*** 849,853 ****
+ int bg_pixel=(-1);
+ char *c_ptr=NULL;
+! int def_x_neg=0, def_y_neg=0, paper_size_set, tmp_dir_in_x_def=FALSE;
+ struct stat stat_buf;
+ XWMHints wmhints;
+--- 898,902 ----
+ int bg_pixel=(-1);
+ char *c_ptr=NULL;
+! int def_x_neg=0, def_y_neg=0, paper_size_set;
+ struct stat stat_buf;
+ XWMHints wmhints;
+***************
+*** 1448,1487 ****
+ GetWorkingDirectory(bootDir, sizeof(bootDir));
+ }
+! /* do not translate -- program constants */
+! if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDir")) != NULL) {
+! UtilTrimBlanks(c_ptr);
+! if (*c_ptr == '\0') {
+! fprintf(stderr, TgLoadString(STID_INVALID_DIR_IN_X_DEFAULT),
+! c_ptr, TOOL_NAME, "TmpDir");
+! fprintf(stderr, "\n");
+! } else {
+! UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, c_ptr);
+! strcat(tmpDir, DIR_SEP_STR);
+! if (UtilIsDirectory(tmpDir)) {
+! tmp_dir_in_x_def = TRUE;
+! } else {
+! fprintf(stderr, TgLoadString(STID_TMP_DIR_NOT_EXIST_USE_XDEF),
+! tmpDir, TOOL_NAME, "TmpDir");
+! fprintf(stderr, "\n");
+! }
+! }
+! }
+! if (!tmp_dir_in_x_def) {
+! #ifndef _TMP_DIR_IN_HOME_DIR
+! UtilStrCpyN(tmpDir, sizeof(tmpDir), TMP_DIR);
+! if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDirInHomeDir")) !=
+! NULL && UtilStrICmp(c_ptr, "true") == 0) {
+! UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, tgifDir);
+! strcat(tmpDir, DIR_SEP_STR);
+! }
+! #else /* _TMP_DIR_IN_HOME_DIR */
+! UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, tgifDir);
+! strcat(tmpDir, DIR_SEP_STR);
+! if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "TmpDirInHomeDir")) !=
+! NULL && UtilStrICmp(c_ptr, "false") == 0) {
+! UtilStrCpyN(tmpDir, sizeof(tmpDir), TMP_DIR);
+! }
+! #endif /* ~_TMP_DIR_IN_HOME_DIR */
+! }
+ enableMouseWheel = TRUE;
+ if (threeDLook && (c_ptr=XGetDefault(mainDisplay, TOOL_NAME,
+--- 1497,1502 ----
+ GetWorkingDirectory(bootDir, sizeof(bootDir));
+ }
+! InitTmpDir();
+!
+ enableMouseWheel = TRUE;
+ if (threeDLook && (c_ptr=XGetDefault(mainDisplay, TOOL_NAME,
diff --git a/graphics/tgif/patches/patch-ac b/graphics/tgif/patches/patch-ac
new file mode 100644
index 00000000000..b33c6f067d4
--- /dev/null
+++ b/graphics/tgif/patches/patch-ac
@@ -0,0 +1,40 @@
+$NetBSD: patch-ac,v 1.3 2001/07/18 20:28:35 dmcmahill Exp $
+
+work around a compiler bug which causes arrowheads to not
+display correctly on NetBSD-1.5 and older alpha's when
+optimization is used.
+
+--- poly.c.orig Sat Aug 5 09:57:25 2000
++++ poly.c Wed Jul 18 16:12:24 2001
+@@ -3232,4 +3232,5 @@
+ double len, sin, cos;
+ XGCValues values;
++ short tmps;
+
+ trans_pat = ObjPtr->trans_pat;
+@@ -3320,8 +3321,8 @@
+ tmp_v[0].x = tmp_v[3].x = v0.x;
+ tmp_v[0].y = tmp_v[3].y = v0.y;
+- tmp_v[1].x = round(v0.x + aw*cos - ah*sin);
+- tmp_v[1].y = round(v0.y + aw*sin + ah*cos);
+- tmp_v[2].x = round(v0.x + aw*cos + ah*sin);
+- tmp_v[2].y = round(v0.y + aw*sin - ah*cos);
++ tmps = round(v0.x + aw*cos - ah*sin); tmp_v[1].x = tmps;
++ tmps = round(v0.y + aw*sin + ah*cos); tmp_v[1].y = tmps;
++ tmps = round(v0.x + aw*cos + ah*sin); tmp_v[2].x = tmps;
++ tmps = round(v0.y + aw*sin - ah*cos); tmp_v[2].y = tmps;
+
+ XFillPolygon(mainDisplay, Win, drawGC, tmp_v, 4, Convex,
+@@ -3340,8 +3341,8 @@
+ tmp_v[0].x = tmp_v[3].x = vnminus1.x;
+ tmp_v[0].y = tmp_v[3].y = vnminus1.y;
+- tmp_v[1].x = round(vnminus1.x - aw*cos + ah*sin);
+- tmp_v[1].y = round(vnminus1.y - aw*sin - ah*cos);
+- tmp_v[2].x = round(vnminus1.x - aw*cos - ah*sin);
+- tmp_v[2].y = round(vnminus1.y - aw*sin + ah*cos);
++ tmps = round(vnminus1.x - aw*cos + ah*sin); tmp_v[1].x = tmps;
++ tmps = round(vnminus1.y - aw*sin - ah*cos); tmp_v[1].y = tmps;
++ tmps = round(vnminus1.x - aw*cos - ah*sin); tmp_v[2].x = tmps;
++ tmps = round(vnminus1.y - aw*sin + ah*cos); tmp_v[2].y = tmps;
+
+ XFillPolygon(mainDisplay, Win, drawGC, tmp_v, 4, Convex,