Commit Graph

33 Commits

Author SHA1 Message Date
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 06eef6e324 Corrected ext2sim.c calls to hierAP and others using "scale" and
declaring it to be an integer when it is actually a float.  This
will cause magic to crash when using, e.g., "ext2sim -f su".
2020-02-11 10:21:36 -05:00
Tim Edwards 2ca9511152 Added fix for SVG output. This brings back the original behavior
of generating scalable output.  Some libcairo update had caused
the output to use the wrong version of SVG by default, which
generates an SVG-wrapped PNG data block, which is not scalable,
and not what was intended with the "plot svg" command.
2020-02-07 11:38:00 -05:00
Tim 'mithro' Ansell 4f30e76688 Make SVG output actually SVG again.
Currently the SVG output is a SVG file with an embedded `image/png`
file. Restricting to `CAIRO_SVG_VERSION_1_2` means the file goes back to
being a vector.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
2020-02-07 17:31:05 +01:00
Tim Edwards 1f3a512909 Added a "plot svg" command that, when used in conjuction with the
Cairo graphics package (magic -d XR), will map the display onto
an SVG surface and save it to a file using the Cairo SVG backend.
Due to the simplicity of the mapping, there are no options to this
plot command;  it just creates a file that is a (scalable!)
replica of the layout window.
2019-03-12 13:29:24 -04:00
Tim Edwards 54e6171e9c Corrected an error that prevents the compile option
"--enable-cairo-offscreen" from working.  Because the option
does not run the full Cario initialization, the grTCairoVisualInfo
is not set, and the first attempt to create a Cairo surface
fails with a segfault.
2018-09-13 10:19:48 -04:00
Tim Edwards cfccdb84c1 Rewrote the configuration scripts, makefiles, and some initialization
routines to use the Tcl and Tk stubs libraries.
2017-10-13 10:28:07 -04:00
Tim Edwards 9c22e2e059 Corrected duplicate global variable grVisualInfo between grTOGL1.c
and grTCairo1.c.
2017-10-12 10:42:13 -04:00
Tim Edwards 93bcfeb093 Finally worked out how to correctly use the OpenGL general-purpose
frame buffers and render buffers, and use fast frame buffer bit
block transfers to do copies to and from backing store.  Also found
a long-standing problem where multiple windows fail to refresh
properly in OpenGL and Cairo interfaces due to a lack of calling
GrLock() and GrUnlock() around the call to fetch backing store
after an expose event.  The use of the general purpose frame
buffer allows magic to avoid calling any indirect rendering methods
and should now (finally) allow magic to run in OpenGL mode over a
VNC.  Use of direct rendering methods only also means that magic
does not need to be compiled with the ad hoc switch to have Cairo
handle drawing into pixmaps for the icons (this remains to be
tested).
2017-10-04 14:53:01 -04:00
Tim Edwards 18ebf84ad8 One more attempt at correcting off-screen rendering. Noting that
Cairo works perfectly for the off-screen rendering and that OpenGL
works perfectly for the on-screen rendering, make a compile-time
option to use both in their respective areas of perfection.
2017-09-17 12:31:31 -04:00
Tim Edwards 0fd9f890c5 Corrected error attempting to free the backing store memory twice
during a window close event (Cairo graphics interface only).
2017-09-16 15:40:18 -04:00
Tim Edwards b1770396e5 Corrected text clipping to cell bounds, and adjusted screen to
a half-pixel offset that centers coordinates on pixels, so single-
pixel objects like cell boundaries or the crosshair will be drawn
a single pixel in width.
2017-09-15 16:51:13 -04:00
Tim Edwards f12d98c2c7 Applied an upside-down scale transformation to the pattern matrix,
otherwise patterns end up upside-down relative to other graphics
interfaces.
2017-09-15 14:55:41 -04:00
Tim Edwards 536e198ee8 Corrected typo in call to cairo_surface_destroy, incorrectly
written cairo_destroy_surface (fails to run with Tcl <= 8.5,
runs with Tcl 8.6 and "load -lazy" but then creates a
potential crash condition).
2017-09-15 11:22:52 -04:00
Tim Edwards 35c3510ea7 Finished the implementation of Cairo 2D graphics (yay!).
Specifically, fixed the initial background, display of text,
reinstated supercolor values, and fixed the backing store
coordinates.
2017-09-14 17:03:53 -04:00
Tim Edwards 1d3bb0d698 Corrected problems having to do with color (blue and green were swapped)
and incorrect call to cairo_set_source_rgba which is in an unused
function and has no effect except with versions of Tcl less than 8.6
where "load -lazy" is not available and unknown functions cause
immediate exit.  Cleaned up remaining references to OpenGL in the
Cairo code, and updated the copyright and acknowledged Chuan Chen, who
coded the Cairo interface.  No attempt yet to deal with memory leaks
caused by calling Cairo "create" functions without the accompanying
"destroy" functions.
2017-09-12 15:42:08 -04:00
Chuan Chen 683892981c Remote changes at Mon Sep 4 23:20:22 EDT 2017 by chuan on vivaldi 2017-09-04 23:20:22 -04:00
Tim Edwards 37e7b7ffeb Changed the offscreen-rendering handling in SetProjection to be
more like the Tk/X11 model than the OpenGL model, since Cairo
isn't picky about pixmaps.
2017-09-01 09:12:02 -04:00
Chuan Chen 2aff81a748 Remote changes at Fri Sep 1 00:39:19 EDT 2017 by chuan on vivaldi 2017-09-01 00:39:19 -04:00
Chuan Chen b397adadef Remote changes at Thu Aug 31 23:54:11 EDT 2017 by chuan on vivaldi 2017-08-31 23:54:11 -04:00
Chuan Chen bf471d26ef Remote changes at Thu Aug 31 14:11:17 EDT 2017 by chuan on vivaldi 2017-08-31 14:11:17 -04:00
Chuan Chen a40c1f21a7 Remote changes at Wed Aug 30 16:34:42 EDT 2017 by chuan on vivaldi 2017-08-30 16:34:42 -04:00
Chuan Chen 77da51d416 Remote changes at Thu Aug 24 17:24:48 EDT 2017 by chuan on vivaldi 2017-08-24 17:24:48 -04:00
Chuan Chen 902ae0c7d4 Remote changes at Fri Aug 18 14:15:12 EDT 2017 by chuan on vivaldi 2017-08-18 14:15:12 -04:00
Chuan Chen 72f9a2a1ab Remote changes at Tue Aug 15 15:19:13 EDT 2017 by chuan on vivaldi 2017-08-15 15:19:13 -04:00
Chuan Chen ad6cbe2e2f Remote changes at Fri Aug 11 15:42:32 EDT 2017 by chuan on vivaldi 2017-08-11 15:42:32 -04:00
Chuan Chen 9e183c63f4 Remote changes at Fri Aug 11 15:18:32 EDT 2017 by chuan on vivaldi 2017-08-11 15:18:32 -04:00
Chuan Chen 6e8274ab5c Remote changes at Wed Aug 9 14:55:30 EDT 2017 by chuan on vivaldi 2017-08-09 14:55:30 -04:00
Chuan Chen a90545be3f Remote changes at Mon Aug 7 15:37:14 EDT 2017 by chuan on vivaldi 2017-08-07 15:37:14 -04:00
Chuan Chen 31ac164be4 Remote changes at Mon Aug 7 14:38:50 EDT 2017 by chuan on vivaldi 2017-08-07 14:38:50 -04:00
Chuan Chen 9bd159f1c8 Remote changes at Mon Aug 7 14:17:12 EDT 2017 by chuan on vivaldi 2017-08-07 14:17:12 -04:00
Chuan Chen d92f400a8b Remote changes at Fri Aug 4 16:43:56 EDT 2017 by chuan on vivaldi 2017-08-04 16:43:56 -04:00
Chuan Chen 75f69c8b3e Update at Fri Aug 4 14:25:41 EDT 2017 by chuan 2017-08-04 14:25:41 -04:00