Commit Graph

189 Commits

Author SHA1 Message Date
Julien Fischer
41193dc437 Adjust some documentation for the Tcl/Tk binding.
extras/graphics/mercury_tcltk/Mmakefile.MacOSX:
extras/graphics/mercury_tcltk/README:
     As above.
2023-02-13 21:05:09 +11:00
Darren Bane
d2b26c759c Document how to use the Homebrew version of Tcl/Tk. 2023-02-13 21:02:47 +11:00
Peter Wang
3124fcfc06 Attribute memory allocations in mercury_cairo.
extras/graphics/mercury_cairo/*.m:
    As above.
2022-05-20 14:36:02 +10:00
Julien Fischer
81e2d33789 Replace use of I/O globals in OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    As above, use mutables intead of the I/O globals.

extras/graphics/samples/maze/globals.m:
    Delete this module; it is no longer required.
2022-03-20 16:29:01 +11:00
Julien Fischer
12731885e5 Update OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    Use the new random number generator framework.

    Seed the random number generator using the system RNG, if
    the user does not provide a seed.

    Use the list shuffling code from the standard library.
2022-03-20 16:08:20 +11:00
Julien Fischer
f3d0812f4b Simplify OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    As above.
2022-01-23 15:39:01 +11:00
Julien Fischer
4fac134384 Update programming style in OpenGL gears example.
extras/graphics/samples/gears/gears.m:
    As above.

    Replace tabs with spaces; delete trailing whitespace.
2022-01-23 15:02:29 +11:00
Julien Fischer
03c441fa8a Update programming style in OpenGL maze example.
Fix Makefiles for OpenGL examples on macOS.

extras/graphics/samples/maze.m:
extras/graphics/samples/globals.m:
    Update programming style.

    Replace tabs with spaces.

extras/graphics/samples/gears/Mmakefile.MacOSX:
extras/graphics/samples/maze/Mmakefile.MacOSX:
    Set header includes for the C compiler.

    Add a "run" target that sets DYLD_LIBRARY_PATH appropriately
    for running the examples in situ.
2022-01-23 14:49:50 +11:00
Julien Fischer
736b52c5c2 Convert mercury_glut README to Markdown.
extras/graphics/mercury_glut/README:
    Rename this file to README.md.

    Convert the contents of this file to Markdown.

    Delete the link to the opengl.org site which is now empty.

    Add a link to the freeglut site.
2022-01-19 15:19:18 +11:00
Julien Fischer
69b6ec5955 Fix mispelling.
extras/graphics/mercury_cairo/README.md:
    s/cario/cairo/
2022-01-18 21:28:18 +11:00
Julien Fischer
4cb8c3f39d Fix broken link.
extras/graphics/mercury_cairo/README.md:
    Delete stray '>' from the end of a link target.
2022-01-18 21:24:21 +11:00
Julien Fischer
6613b0d3e9 Convert Cario binding README to Markdown.
extras/graphics/mercury_cairo/README:
    Rename to README.md and convert contents to Markdown.

    Simplify some wording.
2022-01-18 21:17:46 +11:00
Julien Fischer
543a74938a Delete an old graphics sample.
extras/graphics/samples/pent/:
    Delete this; the togl library it used has not been supported
    for many years.

extras/graphics/README:
    Delete the (incorrect) entry for the above.

    Add a missing entry.
2022-01-12 17:08:34 +11:00
Julien Fischer
0b17d59528 Further adjustments to Tcl/Tk binding.
extras/graphics/mercury_tcltk/Mmakefile:
    Update the contents of this file, so that it builds on a recent Linux
    system (Debian 10).

    Define the Tcl/Tk version using a variable, so that it can be overridden
    on the command line.

extras/graphics/mercury_tcltk/mtcltk.m:
     Fix an error in my previous commit: use the correct variable name
     in some C code.
2022-01-12 16:27:55 +11:00
Julien Fischer
c3d4ff1b6b Adjustments to Tcl/Tk binding.
extras/graphics/mercury_tcltk/mtcltk.m:
    Add a 'can_pass_as_mercury_type' annotation to a foreign type.

    Do not limit the size of the result string to 2047 bytes.
2022-01-12 16:25:05 +11:00
Fabrice Nicol
d844b4b2a6 Avoid obsolete 'result' field in Tcl/Tk binding.
extras/graphics/mercury_tcltk/mtcltk.m:
    Use Tcl_GetStringResult() and Tcl_SetResult() to set the
    interpreter's result field; accessing the result field directly is no
    longer supported.

    Copy strings that are stored in the interpreter's result
    field into Tcl managed memory.

    Add a foreign_enum pragma for Mercury type 'tcl_status'.
    Previously, tcl_ok and tcl_error only had the correct C
    representation by chance.
2022-01-12 16:19:02 +11:00
Fabrice Nicol
ffee6ac229 Fix type error in easyx sample scribble.
extras/graphics/easyx/samples.m:
    Fix type error in first argument of predicate 'sm'.
2022-01-12 15:51:59 +11:00
Fabrice Nicol
f793adfa37 Fix unterminated octal escapes.
extras/graphics/mercury_allegro/samples/demo/title.m:
extras/graphics/mercury_allegro/sampels/mandel/mandel.m:
    As above.

extras/graphics/mercury_allegro/README:
     Update the list of Allegro versions this works with.
2022-01-05 19:48:31 +11:00
Fabrice Nicol
3180f3197d Fix compilation of OpenGL example. 2022-01-05 14:53:35 +11:00
Julien Fischer
a908799acb Fix issues in extras caused by recent changes.
extras/*/*.m:
     Avoid ambiguous pragmas.

     Replace an use of is.

     Fix module imports.
2021-06-19 21:11:35 +10:00
Julien Fischer
77cdaf36d2 Delete references to erlang grade.
extras/base64/Mercury.options:
extras/graphics/mercury_cairo/Mercury.options:
extras/graphics/mercury_glfw/Mercury.options:
extras/posix/Mercury.options:
extras/trail/Mercury.options:
     As above.
2021-01-23 19:46:15 +11:00
Julien Fischer
b55c2ad6a8 Delete trailing whitespace.
extras/graphics/samples/calc/calc.m:
    As above.
2020-10-02 17:29:54 +10:00
Julien Fischer
cc9ec7293a Update programming style in Tk binding.
extras/graphics/mercury_tcltk/mtk.m:
    As above.
2020-10-02 17:13:48 +10:00
Julien Fischer
97bf7cf9a8 Fix Mantis #519.
extras/graphics/mercury_tcltk/mltcltk.m:
    Delete an old workaround that has not been required for versions of Tcl
    from 8.1 (released in 1999) onwards

    Minor syntax and style updates.
2020-10-01 23:07:27 +10:00
Julien Fischer
c96c723760 Avoid warnings about redundant module imports in the GLUT binding.
extras/graphics/mercury_glut/*.m:
    As above.
2020-05-15 16:09:52 +10:00
Julien Fischer
84e2536618 Fix minor compilation problems in extras and benchmarks.
These are due to:

- differences between module and file names.
- redundant imports
- the recent change from math.domain_error -> exception.domain_error.

benchmarks/*/*.m:
extras/*/*.m:
    As above.
2020-05-15 16:00:41 +10:00
Julien Fischer
d2f72cc75f Minor fixes to the allegro binding.
extras/graphics/mercury_allegro/allegro.m:
   Add missing include_module declaration for the util
   submodule.

extras/graphics/mercury_allegro/Mercury.options:
   Avoid a warning.
2020-01-13 21:35:23 +11:00
Julien Fischer
97f1720c30 Delete a doubled-up word.
extras/graphics/mercury_cairo/README:
   As above.
2020-01-02 13:52:07 +11:00
Julien Fischer
e8ebc795a9 Use typed insts in the OpenGL binding.
extras/graphics/mercury_opengl/mogl.m:
    As above.
2019-09-29 14:10:16 +10:00
Julien Fischer
c9d76c57a6 Change the license for the Mercury-Cario binding.
Change the license the Mercury-Cairo binding to a 2-clause BSD license.
This change has been agreed to by both Peter and myself; we are the
only authors of the affected code.

extras/graphics/mercury_cairo/COPYING.LIB:
    Add the new license.

extras/graphics/mercury_cairo/README:
    Add a link to the license file.

    Fix a typo.
2018-07-02 09:32:35 -04:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Julien Fischer
769c6de2c2 Style and formatting fixes for the GLUT binding.
extras/graphics/mercury_glut/*.m:
     As above.
2017-05-07 22:48:33 +10:00
Julien Fischer
ff3d166ab7 Minor updates for the OpenGL binding.
extras/graphics/mercury_opengl/mogl.m:
     Fix a foreign_enum pragma that referred to a non-existent type
     constructor.

extras/graphics/mercury_opengl/*.m:
      Delete trailing whitespace.

      Avoid referring to the I/O state directly in foreign_proc bodies.
2017-05-07 22:39:33 +10:00
Peter Wang
3524766a21 mercury_cairo: Pass pointers to doubles instead of MR_Float where required.
extras/graphics/mercury_cairo/cairo.m:
extras/graphics/mercury_cairo/cairo.path.m:
extras/graphics/mercury_cairo/cairo.surface.m:
    As above.
2017-05-04 15:07:47 +10:00
Peter Wang
149fe4d2d3 mercury_cairo: Add set_device_scale, get_device_scale.
extras/graphics/mercury_cairo/cairo.surface.m:
    Add set_device_scale, get_device_scale.
2017-05-04 15:07:47 +10:00
Peter Wang
fc426fc35f mercury_cairo: Delete hard to maintain insts.
extras/graphics/mercury_cairo/cairo.m:
    Delete surface_status, pattern_status and region_status insts as
    there is no guarantee that they cover the range of values returned
    by cairo_surface_status, cairo_pattern_status and
    cairo_region_status (in past and future versions of cairo).

extras/graphics/mercury_cairo/cairo.png.m:
    Delete png_write_result for same reason.
2017-04-28 18:07:12 +10:00
Peter Wang
d92e5f07f3 mercury_cairo: Use if-then-else syntax.
extras/graphics/mercury_cairo/cairo.image.m:
extras/graphics/mercury_cairo/cairo.pdf.m:
extras/graphics/mercury_cairo/cairo.ps.m:
extras/graphics/mercury_cairo/cairo.recording.m:
extras/graphics/mercury_cairo/cairo.svg.m:
    Use if-then-else syntax.
2017-04-28 17:17:17 +10:00
Peter Wang
b9dad460bd mercury_cairo: Update enumerations.
extras/graphics/mercury_cairo/cairo.m:
    Add newer cairo status values.

    Add newer cairo operator values.

    Update surface_status and pattern_status insts to reflect current
    cairo documentation.

extras/graphics/mercury_cairo/cairo.font_options.m:
    Add subpixel_order_rgb.

extras/graphics/mercury_cairo/cairo.pattern.m:
    Add newer pattern_type values.

    Do not switch on the result of pattern_status in case the inst does
    not cover all possible return values.

extras/graphics/mercury_cairo/cairo.png.m:
    Do not switch on the result of surface_status in case the inst does
    not cover all possible return values.
2017-04-28 17:17:04 +10:00
Peter Wang
2c1281be5b mercury_cairo: Use double instead of MR_Float where appropriate.
extras/graphics/mercury_cairo/cairo.transformations.m:
    As above.
2017-04-24 14:53:28 +10:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.

I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
2017-04-04 12:05:56 +10:00
Peter Wang
220c1af46b Fix whitespace in mercury_cairo modules.
extras/graphics/mercury_cairo/cairo.font_options.m:
extras/graphics/mercury_cairo/cairo.image.m:
extras/graphics/mercury_cairo/cairo.m:
extras/graphics/mercury_cairo/cairo.matrix.m:
extras/graphics/mercury_cairo/cairo.path.m:
extras/graphics/mercury_cairo/cairo.pattern.m:
extras/graphics/mercury_cairo/cairo.pdf.m:
extras/graphics/mercury_cairo/cairo.png.m:
extras/graphics/mercury_cairo/cairo.ps.m:
extras/graphics/mercury_cairo/cairo.recording.m:
extras/graphics/mercury_cairo/cairo.region.m:
extras/graphics/mercury_cairo/cairo.surface.m:
extras/graphics/mercury_cairo/cairo.svg.m:
extras/graphics/mercury_cairo/cairo.text.m:
extras/graphics/mercury_cairo/cairo.transformations.m:
	Expand tabs to spaces.

	Delete trailing whitespace.

	Correct fix indentation to 4 spaces in some places.
2016-08-30 14:35:24 +10:00
Peter Wang
9d23694a25 Thread I/O state through time routines that depend on the time zone.
library/time.m:
	Deprecate non-pure functions `localtime/1' and `mktime/1'.
	They depend on the current time zone, which depends on the
	environment that the program is running in, and may also be
	changed at run time (e.g. by setting the environment variable
	"TZ").

	Add replacement predicates `localtime/4' and `mktime/4' that
	thread the I/O state.

	Deprecate the non-pure function `ctime/1'.  It does not seem
	necessary to add a pure replacement for it, being a minor
	convenience at best.

	Try to clarify some documentation.

library/calendar.m:
	Conform to above changes.

tests/hard_coded/dst_test.m:
tests/hard_coded/time_test.m
	Conform to above changes.

	Update code style.

extras/curs/samples/nibbles.m:
extras/graphics/easyx/samples/bounce.m:
extras/graphics/easyx/samples/mclock.m:
extras/log4m/log4m.m:
	Conform to above changes.

NEWS:
	Announce changes.
2016-06-06 23:14:29 +10:00
Julien Fischer
17446e64d6 Delete trailing whitespace in GLFW binding.
extras/graphics/mercury_glfw/glfw.m:
     As above.

     Delete unnecessary module qualifications.
2016-05-04 10:06:11 +10:00
Julien Fischer
e7010327d9 Delete references to picreg.
browser/interactive_query.m:
extras/dynamic_linking/Mmakefile:
extras/graphics/mercury_glut/Mmakefile:
extras/graphics/mercury_glut/Mmakefile.MacOSX:
extras/graphics/samples/calc/Makefile:
extras/graphics/samples/gears/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
extras/morphine/source/collect.op:
    As above.
2016-04-26 14:03:04 +10:00
Julien Fischer
8a786c9a92 Documentation fixes for cairo binding.
extras/graphics/mercury_cairo/*.m:
    Minor documentation fixes for cairo binding.
2015-12-05 17:48:01 +11:00
Peter Wang
803c5f1699 mercury_cairo: Do not enumerate possible return statuses.
Do not try to exhaustively enumerate possible status values after
creating cairo objects.  It is error prone and unnecessary.

extras/graphics/mercury_cairo/cairo.image.m:
extras/graphics/mercury_cairo/cairo.pdf.m:
extras/graphics/mercury_cairo/cairo.ps.m:
extras/graphics/mercury_cairo/cairo.recording.m:
extras/graphics/mercury_cairo/cairo.svg.m:
	As above.  After creating a cairo object, return the status
	to the user whether successful or not.
2015-12-04 16:54:57 +11:00
Julien Fischer
169e72879b Fix compilation fo the Tcl/Tk binding.
extras/graphics/mercury_tcltk/mercury_tcltk.m:
    Add a missing ':- interface' declaration.
2015-11-16 10:58:53 +11:00
Julien Fischer
87d96305ae Fix compilation of the OpenGL binding.
extras/graphics/mercury_opengl/mercury_opengl.m:
    Add a missing ':- interface' declaration.

extras/graphics/mercury_opengl/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile.MacOSX:
    Don't warn about unused interface imports in the above module.
2015-11-16 10:51:48 +11:00
Julien Fischer
f506c437f2 Fix compilation of the Allegro binding.
extras/graphics/mercury_allegro/mercury_allegro.m:
    Add a missing ':- interface' declaration.
2015-11-16 10:46:25 +11:00
Peter Wang
82f8be162f mercury_cairo: Fix build in absence of ps/svg support.
extras/graphics/mercury_cairo/cairo.ps.m:
extras/graphics/mercury_cairo/cairo.svg.m:
	Let these modules build when support for their respective
	surfaces is disabled in the cairo installation.
2015-09-04 11:24:39 +10:00