1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2025-04-21 12:27:27 +03:00

gnuplot-gfx: a graphical gnuplot that uses truecolor libvga graphics

This commit is contained in:
David Kühling
2011-01-06 17:17:15 +01:00
parent 437e156f07
commit 7336686dfa
9 changed files with 166 additions and 21 deletions

View File

@@ -0,0 +1,13 @@
Index: gnuplot-4.4.0/Makefile.in
===================================================================
--- gnuplot-4.4.0.orig/Makefile.in 2010-03-13 22:20:04.000000000 +0100
+++ gnuplot-4.4.0/Makefile.in 2011-01-05 12:48:51.000000000 +0100
@@ -240,7 +240,7 @@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign 1.2h
-SUBDIRS = config m4 term src docs $(LISPDIR) man demo tutorial share
+SUBDIRS = config m4 term src docs $(LISPDIR) share
EXTRA_DIST = BUGS CodeStyle Copyright FAQ.pdf GNUmakefile INSTALL INSTALL.gnu \
Makefile.maint PATCHLEVEL PGPKEYS PORTING README README.1ST \
VERSION configure.vms pm3d

View File

@@ -0,0 +1,26 @@
Index: gnuplot-4.4.0/term/ggi.trm
===================================================================
--- gnuplot-4.4.0.orig/term/ggi.trm 2011-01-04 21:47:00.000000000 +0100
+++ gnuplot-4.4.0/term/ggi.trm 2011-01-05 11:52:43.000000000 +0100
@@ -374,6 +374,7 @@
/* user specified mode */
if (!ggiParseMode(GGI_mode_spec, &mode)) {
mode.frames = GGI_frames;
+ ggiCheckMode(GGIvisual, &mode);
if (!ggiSetMode(GGIvisual, &mode)) {
success = 1;
}
@@ -381,8 +382,11 @@
}
if (!success) {
- /* try the default mode */
- if(ggiSetSimpleMode(GGIvisual,GGI_AUTO,GGI_AUTO,GGI_frames,GT_AUTO)) {
+ /* try the default mode */
+ ggiParseMode("", &mode);
+ ggiCheckMode(GGIvisual, &mode);
+
+ if (ggiSetMode(GGIvisual, &mode)) {
ggiPanic("(GGI_init() unable to set default mode\n");
GGIvisual = (ggi_visual_t)0;
}

View File

@@ -0,0 +1,26 @@
Index: gnuplot-4.4.0/docs/Makefile.in
===================================================================
--- gnuplot-4.4.0.orig/docs/Makefile.in 2011-01-05 13:07:42.000000000 +0100
+++ gnuplot-4.4.0/docs/Makefile.in 2011-01-05 13:08:04.000000000 +0100
@@ -339,9 +339,11 @@
### gnuplot interactive help format
gih: gnuplot.gih
+# Note: here we have to use the host-compiled doc2gih tool, that the build
+# process installs in the staging bin directory
gnuplot.gih: doc2gih $(srcdir)/gnuplot.doc
@rm -f alldoc2gih
- ./doc2gih $(srcdir)/gnuplot.doc gnuplot.gih
+ doc2gih $(srcdir)/gnuplot.doc gnuplot.gih
doc2gih: doc2gih.o termdoc.o
$(LINK) doc2gih.o termdoc.o $(LIBS)
@@ -349,7 +351,7 @@
# To include all terminals in the .gih file
allgih: alldoc2gih $(srcdir)/gnuplot.doc
@rm -f doc2gih
- ./alldoc2gih $(srcdir)/gnuplot.doc gnuplot.gih
+ alldoc2gih $(srcdir)/gnuplot.doc gnuplot.gih
alldoc2gih: alldoc2gih.o termdoc.o
$(LINK) alldoc2gih.o termdoc.o $(LIBS)

View File

@@ -0,0 +1,30 @@
Index: gnuplot-4.4.0/term/ggi.trm
===================================================================
--- gnuplot-4.4.0.orig/term/ggi.trm 2011-01-05 13:35:52.000000000 +0100
+++ gnuplot-4.4.0/term/ggi.trm 2011-01-05 13:39:52.000000000 +0100
@@ -499,6 +499,12 @@
ggiSetGCForeground(GGIvisual,GGIcolors[linetype]);
}
+TERM_PUBLIC int
+GGI_y(int32_t y)
+{
+ return GGIymax - y;
+}
+
TERM_PUBLIC void GGI_move(unsigned int x, unsigned int y)
{
GGIx=x;
@@ -831,12 +837,6 @@
}
TERM_PUBLIC int
-GGI_y(int32_t y)
-{
- return GGIymax - y;
-}
-
-TERM_PUBLIC int
GGI_eventually_update_modifiers(const ggi_event* event, const int add)
{
int mod = 0;

View File

@@ -0,0 +1,71 @@
Index: gnuplot-4.4.0/term/ggi.trm
===================================================================
--- gnuplot-4.4.0.orig/term/ggi.trm 2011-01-05 13:48:52.000000000 +0100
+++ gnuplot-4.4.0/term/ggi.trm 2011-01-05 21:52:25.000000000 +0100
@@ -230,6 +230,7 @@
static TBOOLEAN GGI_mode_changed = 1;
static char GGI_mode_spec[0xff] = "";
static int GGI_acceleration = 7; /* arbitrary */
+static TBOOLEAN GGI_initialized = 0;
enum GGI_id {
GGI_MODE,
@@ -275,6 +276,7 @@
/* Called bevore a graphic is displayed */
TERM_PUBLIC void GGI_graphics()
{
+ GGI_init();
#ifdef USE_MOUSE
int i, j;
int display_frame = ggiGetDisplayFrame(GGIvisual);
@@ -355,6 +357,12 @@
int success = 0;
ggi_mode mode;
+ if (GGI_initialized) {
+ return;
+ }
+ GGI_initialized = 1;
+ printf ("gii initializing\n");
+
#if 0
if (0 != giiInit()) {
ggiPanic("*** giiInit() failed *** \n");
@@ -554,6 +562,10 @@
TERM_PUBLIC void
GGI_close()
{
+ if (!GGI_initialized) {
+ return;
+ }
+
ggiFlush(GGIvisual);
/* DETACH EXTENSIONS */
#if HAVE_WMH_H
@@ -567,6 +579,8 @@
ggiClose(GGIvisual);
GGIvisual = (ggi_visual_t)0;
+ ggiExit();
+ GGI_initialized = 0;
/* EXIT EXTENSIONS */
#if HAVE_WMH_H
@@ -578,6 +592,8 @@
#ifdef ENABLE_XMI
xmiExit();
#endif
+
+ printf ("gii closed\n");
}
/* Called when terminal is terminated i.e.
@@ -614,6 +630,8 @@
GGI_resume()
{
/* do nothing */
+ /* why? this looks broken! */
+ GGI_init();
}
TERM_PUBLIC void

View File

@@ -0,0 +1,15 @@
Index: gnuplot-4.4.0/term/linux.trm
===================================================================
--- gnuplot-4.4.0.orig/term/linux.trm 2011-01-06 16:19:41.000000000 +0100
+++ gnuplot-4.4.0/term/linux.trm 2011-01-06 16:20:00.000000000 +0100
@@ -120,7 +120,9 @@
char line[256];
FILE *pipe;
- LINUX_graphics_allowed = FALSE;
+ /* enabling this. No need to be paranoid on openwrt. popen() below won't
+ even work */
+ LINUX_graphics_allowed = TRUE;
if (geteuid() != 0)
return; /* if we aren't root, we cannot init graphics */

View File

@@ -0,0 +1,19 @@
Index: gnuplot-4.4.0/term/linux.trm
===================================================================
--- gnuplot-4.4.0.orig/term/linux.trm 2011-01-06 16:42:27.000000000 +0100
+++ gnuplot-4.4.0/term/linux.trm 2011-01-06 17:14:41.000000000 +0100
@@ -94,8 +94,12 @@
#define _STRING_H_
#include <vga.h>
-static int linux_vmode = G1024x768x256; /* default mode */
-static int vgacolor[] = { 7, 8, 2, 3, 4, 5, 9, 14, 12, 15, 13, 10, 11, 1, 6 };
+static int linux_vmode = G320x240x16M32; /* default mode */
+/* static int vgacolor[] = { 7, 8, 2, 3, 4, 5, 9, 14, 12, 15, 13, 10, 11, 1, 6 }; */
+static int vgacolor[] = {
+ 0x808080, 0xc0c0c0, 0x008000, 0x008080, 0x800000, 0x800080,
+ 0x0000ff, 0xffff00, 0xff0000, 0xffffff, 0xff00ff, 0x00ff00,
+ 0x00ffff, 0x000080, 0x808000 };
static int graphics_on = FALSE;
static vga_modeinfo *modeinfo;
static int linux_startx, linux_starty, linux_lasty;

View File

@@ -0,0 +1,13 @@
Index: gnuplot-4.4.0/src/term.c
===================================================================
--- gnuplot-4.4.0.orig/src/term.c 2011-01-06 17:10:50.000000000 +0100
+++ gnuplot-4.4.0/src/term.c 2011-01-06 17:13:37.000000000 +0100
@@ -1792,7 +1792,7 @@
LINUX_setup has failed, also if we are logged in by network */
#ifdef LINUXVGA
if (LINUX_graphics_allowed)
-#ifdef VGAGL
+#if defined(VGAGL) && defined (THREEDKIT)
term_name = "vgagl";
#else
term_name = "linux";