Root/gnuplot-gfx/patches/050-ggi-close.patch

Source at commit 1b3135c created 9 years 8 days ago.
By Xiangfu Liu, new package: SDL-widgets: a GUI toolkit on top of the SDL libraries
1Index: gnuplot-4.4.0/term/ggi.trm
2===================================================================
3--- gnuplot-4.4.0.orig/term/ggi.trm 2011-01-05 13:48:52.000000000 +0100
4+++ gnuplot-4.4.0/term/ggi.trm 2011-01-05 21:52:25.000000000 +0100
5@@ -230,6 +230,7 @@
6 static TBOOLEAN GGI_mode_changed = 1;
7 static char GGI_mode_spec[0xff] = "";
8 static int GGI_acceleration = 7; /* arbitrary */
9+static TBOOLEAN GGI_initialized = 0;
10 
11 enum GGI_id {
12     GGI_MODE,
13@@ -275,6 +276,7 @@
14 /* Called bevore a graphic is displayed */
15 TERM_PUBLIC void GGI_graphics()
16 {
17+ GGI_init();
18 #ifdef USE_MOUSE
19     int i, j;
20     int display_frame = ggiGetDisplayFrame(GGIvisual);
21@@ -355,6 +357,12 @@
22     int success = 0;
23     ggi_mode mode;
24 
25+ if (GGI_initialized) {
26+ return;
27+ }
28+ GGI_initialized = 1;
29+ printf ("gii initializing\n");
30+
31 #if 0
32     if (0 != giiInit()) {
33     ggiPanic("*** giiInit() failed *** \n");
34@@ -554,6 +562,10 @@
35 TERM_PUBLIC void
36 GGI_close()
37 {
38+ if (!GGI_initialized) {
39+ return;
40+ }
41+
42     ggiFlush(GGIvisual);
43     /* DETACH EXTENSIONS */
44 #if HAVE_WMH_H
45@@ -567,6 +579,8 @@
46 
47     ggiClose(GGIvisual);
48     GGIvisual = (ggi_visual_t)0;
49+ ggiExit();
50+ GGI_initialized = 0;
51 
52     /* EXIT EXTENSIONS */
53 #if HAVE_WMH_H
54@@ -578,6 +592,8 @@
55 #ifdef ENABLE_XMI
56     xmiExit();
57 #endif
58+
59+ printf ("gii closed\n");
60 }
61 
62 /* Called when terminal is terminated i.e.
63@@ -614,6 +630,8 @@
64 GGI_resume()
65 {
66     /* do nothing */
67+ /* why? this looks broken! */
68+ GGI_init();
69 }
70 
71 TERM_PUBLIC void
72

Archive Download this file



interactive