├── src ├── vcpkg-configuration.json ├── gui │ ├── qgle.rc │ ├── images │ │ ├── gle.ico │ │ ├── gle.png │ │ ├── new.png │ │ ├── amove.png │ │ ├── arc_3p.png │ │ ├── circle.png │ │ ├── editor.png │ │ ├── gle.icns │ │ ├── grid.png │ │ ├── line.png │ │ ├── open.png │ │ ├── osnap.png │ │ ├── reload.png │ │ ├── save.png │ │ ├── text.png │ │ ├── ellipse.png │ │ ├── ellipsis.png │ │ ├── gle_icon.png │ │ ├── pointer.png │ │ ├── tan_line.png │ │ ├── zoom_in.png │ │ ├── zoom_out.png │ │ ├── edit_mode.png │ │ ├── gle_shadow.png │ │ ├── grid_snap.png │ │ ├── orthosnap.png │ │ ├── perp_line.png │ │ ├── polarsnap.png │ │ ├── polartrack.png │ │ ├── reload_red.png │ │ ├── preview_mode.png │ │ └── varyingcolours.png │ ├── about.html │ ├── start-qgle.sh │ ├── colourbutton.h │ ├── propertyeditor.h │ ├── variantdelegate.h │ ├── about.h │ ├── colourpicker.h │ ├── macspecific.cpp │ ├── propertymodel.h │ ├── newfile.h │ ├── grid.h │ ├── qgle.qrc │ ├── consolewindow.h │ ├── colourbutton.cpp │ ├── snapline.h │ ├── amove.h │ ├── polararray.h │ ├── 3dviewer.h │ ├── line.h │ ├── qgle_definitions.h │ ├── newfile.cpp │ ├── circle.h │ ├── CMakeLists.txt │ └── ellipse.h ├── fonts │ ├── texstd.enc │ ├── psfont.dat │ ├── glemark.afm │ ├── Adobe-Core35_AFMs-314 │ │ └── MustRead.html │ ├── mkencoding.pl │ ├── checkfonts.pl │ └── LICENSE-FONTS.txt ├── x64-windows-static-release-only.cmake ├── glebtool │ └── CMakeLists.txt ├── vcpkg.json ├── gle │ ├── builtin-double.h │ ├── unit-tests │ │ ├── part1.gle │ │ └── expressions.txt │ ├── builtin-double.cpp │ ├── gle-fitls.h │ ├── gle-block.h │ ├── d_svg.cpp │ ├── bitmap │ │ └── lzwencode.h │ ├── drawit.h │ ├── gle-base.cpp │ ├── gprint.h │ ├── tex.h │ ├── b_text.cpp │ ├── token.h │ ├── justify.h │ ├── tokens │ │ └── Tokenizer.i │ ├── gle-interface │ │ └── gle-const.h │ ├── gle-block.cpp │ └── all.h ├── fbuild │ └── CMakeLists.txt ├── makefmt │ └── CMakeLists.txt ├── tests │ └── CMakeLists.txt ├── manip │ ├── CMakeLists.txt │ ├── test.dat │ ├── mjl.h │ ├── ffblk_def.h │ ├── filemenu.h │ ├── nofnkeys.h │ ├── unix_extra.h │ ├── keyword.h │ ├── vaxconio.h │ ├── color.h │ ├── edt.h │ ├── eval.h │ ├── cell.h │ ├── varargs.cpp │ ├── turbo.cpp │ ├── mscreen.h │ └── manip.h ├── gletests │ └── test_constants.gle └── config.h ├── doc └── ChangeLog.txt ├── graphics ├── nsis_banner_image.bmp └── nsis_welcome_image.bmp ├── .github └── workflows │ ├── testtrigger.yml │ ├── testbuild.yml │ ├── build.yml │ ├── build-linux-macos.yml │ └── release.yml ├── LICENSE └── scripts └── install.sh /src/vcpkg-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /src/gui/qgle.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "images/gle.ico" 2 | -------------------------------------------------------------------------------- /doc/ChangeLog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/doc/ChangeLog.txt -------------------------------------------------------------------------------- /src/fonts/texstd.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/fonts/texstd.enc -------------------------------------------------------------------------------- /src/gui/images/gle.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/gle.ico -------------------------------------------------------------------------------- /src/gui/images/gle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/gle.png -------------------------------------------------------------------------------- /src/gui/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/new.png -------------------------------------------------------------------------------- /src/gui/images/amove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/amove.png -------------------------------------------------------------------------------- /src/gui/images/arc_3p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/arc_3p.png -------------------------------------------------------------------------------- /src/gui/images/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/circle.png -------------------------------------------------------------------------------- /src/gui/images/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/editor.png -------------------------------------------------------------------------------- /src/gui/images/gle.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/gle.icns -------------------------------------------------------------------------------- /src/gui/images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/grid.png -------------------------------------------------------------------------------- /src/gui/images/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/line.png -------------------------------------------------------------------------------- /src/gui/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/open.png -------------------------------------------------------------------------------- /src/gui/images/osnap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/osnap.png -------------------------------------------------------------------------------- /src/gui/images/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/reload.png -------------------------------------------------------------------------------- /src/gui/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/save.png -------------------------------------------------------------------------------- /src/gui/images/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/text.png -------------------------------------------------------------------------------- /src/gui/images/ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/ellipse.png -------------------------------------------------------------------------------- /src/gui/images/ellipsis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/ellipsis.png -------------------------------------------------------------------------------- /src/gui/images/gle_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/gle_icon.png -------------------------------------------------------------------------------- /src/gui/images/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/pointer.png -------------------------------------------------------------------------------- /src/gui/images/tan_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/tan_line.png -------------------------------------------------------------------------------- /src/gui/images/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/zoom_in.png -------------------------------------------------------------------------------- /src/gui/images/zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/zoom_out.png -------------------------------------------------------------------------------- /graphics/nsis_banner_image.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/graphics/nsis_banner_image.bmp -------------------------------------------------------------------------------- /src/gui/images/edit_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/edit_mode.png -------------------------------------------------------------------------------- /src/gui/images/gle_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/gle_shadow.png -------------------------------------------------------------------------------- /src/gui/images/grid_snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/grid_snap.png -------------------------------------------------------------------------------- /src/gui/images/orthosnap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/orthosnap.png -------------------------------------------------------------------------------- /src/gui/images/perp_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/perp_line.png -------------------------------------------------------------------------------- /src/gui/images/polarsnap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/polarsnap.png -------------------------------------------------------------------------------- /src/gui/images/polartrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/polartrack.png -------------------------------------------------------------------------------- /src/gui/images/reload_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/reload_red.png -------------------------------------------------------------------------------- /graphics/nsis_welcome_image.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/graphics/nsis_welcome_image.bmp -------------------------------------------------------------------------------- /src/gui/images/preview_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/preview_mode.png -------------------------------------------------------------------------------- /src/gui/images/varyingcolours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlabella/GLE/HEAD/src/gui/images/varyingcolours.png -------------------------------------------------------------------------------- /src/x64-windows-static-release-only.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE static) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_BUILD_TYPE release) # Only build Release, skip Debug -------------------------------------------------------------------------------- /src/glebtool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(glebtool 2 | glebtool.cpp 3 | ../gle/cutils.cpp 4 | ../gle/file_io.cpp 5 | ) 6 | 7 | if(WIN32) 8 | target_link_libraries(glebtool LINK_PUBLIC Ws2_32.lib ) 9 | endif() 10 | 11 | set_target_properties(glebtool PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 12 | 13 | install(TARGETS glebtool 14 | CONFIGURATIONS Release Debug 15 | RUNTIME 16 | ) 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | "boost-math", 4 | { 5 | "name": "cairo", 6 | "default-features": false 7 | }, 8 | "ecm", 9 | "freetype", 10 | "glib", 11 | "libdeflate", 12 | "libiconv", 13 | "libpng", 14 | "openjpeg", 15 | "pdcurses", 16 | "pixman", 17 | "poppler", 18 | "qtbase", 19 | "qtimageformats", 20 | "tiff", 21 | "zlib", 22 | "zstd" 23 | ] 24 | } -------------------------------------------------------------------------------- /src/gle/builtin-double.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BUILTINDOUBLE_H_ 3 | #define BUILTINDOUBLE_H_ 4 | 5 | class GLEBuiltInBinaryDoubleDouble : public GLEBuiltIn { 6 | public: 7 | GLEBuiltInBinaryDoubleDouble(const char* name, GLEBuiltInFactory* factory); 8 | }; 9 | 10 | class GLEBuiltInOpPlusDouble : public GLEBuiltInBinaryDoubleDouble { 11 | public: 12 | GLEBuiltInOpPlusDouble(GLEBuiltInFactory* factory); 13 | virtual void execute(GLEArrayImpl* stack, unsigned int top); 14 | }; 15 | 16 | 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/fbuild/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # -- fbuild - used during build phase to create font .fve files 3 | # 4 | add_executable(fbuild 5 | fbuild.cpp 6 | ../gle/token.cpp 7 | ../gle/cutils.cpp 8 | ../gle/file_io.cpp 9 | ) 10 | if(WIN32) 11 | target_link_libraries(fbuild LINK_PUBLIC Ws2_32.lib ) 12 | endif() 13 | set_target_properties(fbuild PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 14 | 15 | if(INSTALL_FBUILD) 16 | install(TARGETS fbuild 17 | CONFIGURATIONS Release Debug 18 | RUNTIME 19 | ) 20 | endif() -------------------------------------------------------------------------------- /src/makefmt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # -- makefmt - used during build phase to create font .fmt files 3 | # 4 | add_executable(makefmt 5 | makefmt.cpp 6 | parseAFM.cpp 7 | ../gle/cutils.cpp 8 | ../gle/file_io.cpp 9 | ) 10 | 11 | if(WIN32) 12 | target_link_libraries(makefmt LINK_PUBLIC Ws2_32.lib ) 13 | endif() 14 | 15 | set_target_properties(makefmt PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 16 | 17 | if(INSTALL_MAKEFMT) 18 | install(TARGETS makefmt 19 | CONFIGURATIONS Release Debug 20 | RUNTIME 21 | ) 22 | endif() -------------------------------------------------------------------------------- /.github/workflows/testtrigger.yml: -------------------------------------------------------------------------------- 1 | # 2 | # -- testtrigger.yml - testing of event triggering 3 | # 4 | name: Test Release Trigger 5 | on: 6 | workflow_dispatch: 7 | # workflow_run: 8 | # workflows: [Create Release] 9 | # types: 10 | # - completed 11 | repository_dispatch: 12 | types: [test-trigger] 13 | jobs: 14 | build: 15 | name: Test Release Trigger 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: echo info 19 | run: | 20 | cat << OBJECT 21 | ${{ toJson(github) }} 22 | OBJECT 23 | -------------------------------------------------------------------------------- /src/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(findgs 2 | findgs.cpp 3 | ) 4 | 5 | if(WIN32) 6 | target_link_libraries(findgs LINK_PUBLIC Ws2_32.lib ) 7 | endif() 8 | 9 | set_target_properties(findgs PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 10 | 11 | add_custom_target(run_findgs ALL 12 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 13 | COMMAND $ 14 | COMMENT " === Running Find GhostScript ===" 15 | DEPENDS findgs 16 | ) 17 | 18 | if(INSTALL_TESTS) 19 | install(TARGETS findgs 20 | CONFIGURATIONS Release Debug 21 | RUNTIME ) 22 | endif() 23 | 24 | -------------------------------------------------------------------------------- /src/fonts/psfont.dat: -------------------------------------------------------------------------------- 1 | PSHC Helvetica-Condensed 2 | PSHCB Helvetica-Condensed-Bold 3 | PSHCBO Helvetica-Condensed-BoldObl 4 | PSHCDO Helvetica-Condensed-Oblique 5 | PSHN Helvetica-Narrow 6 | PSHNB Helvetica-Narrow-Bold 7 | PSHNBO Helvetica-Narrow-BoldOblique 8 | PSHNO Helvetica-Narrow-Oblique 9 | ARIAL8 ArialCyrMT 10 | ARIAL8B ArialCyrMT-Bold 11 | ARIAL8I ArialCyrMT-Italic 12 | ARIAL8BI ArialCyrMT-BoldItalic 13 | COUR8 ERKurierKOI8RRegular 14 | COUR8B ERKurierKOI8RBold 15 | COUR8I ERKurierKOI8RItalic 16 | COUR8BI ERKurierKOI8RBoldItalic 17 | TIMES8 TimesNRCyrMT 18 | TIMES8B TimesNRCyrMT-Bold 19 | TIMES8I TimesNRCyrMT-Inclined 20 | TIMES8BI TimesNRCyrMT-BoldInclined 21 | -------------------------------------------------------------------------------- /src/gle/unit-tests/part1.gle: -------------------------------------------------------------------------------- 1 | 2 | 3 | sub test_string_comparison switch1$ switch2$ 4 | if (switch1$ = 'true') and (switch2$ = 'true') then 5 | return 'both' 6 | end if 7 | if (switch1$ = 'true') and (switch2$ = 'false') then 8 | return 'only switch1' 9 | end if 10 | if ('false' = switch1$) and (switch2$ = 'true') then 11 | return 'only switch2' 12 | end if 13 | if (switch1$ = 'false') and (switch2$ = 'false') then 14 | return 'none' 15 | end if 16 | return 'err' 17 | end sub 18 | 19 | sub test_or_in_boolean_expression 20 | a$ = "5" 21 | b$ = "6" 22 | c = 3 23 | d = 5 24 | if (a$ = "3") or (d = 5) then 25 | return 1 26 | end if 27 | return 0 28 | end sub 29 | -------------------------------------------------------------------------------- /src/gle/builtin-double.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "all.h" 3 | #include "gle-interface/gle-base.h" 4 | #include "gle-interface/gle-interface.h" 5 | #include "gle-interface/gle-datatype.h" 6 | #include "var.h" 7 | #include "sub.h" 8 | #include "builtin-double.h" 9 | 10 | using namespace std; 11 | 12 | GLEBuiltInBinaryDoubleDouble::GLEBuiltInBinaryDoubleDouble(const char* name, GLEBuiltInFactory* factory) { 13 | setRoot(factory->createRoot(name, factory->getBinaryArgNamesXY())); 14 | setArgTypeDefaults(factory->getBinaryDoubleDoubleArgTypeDefaults()); 15 | } 16 | 17 | GLEBuiltInOpPlusDouble::GLEBuiltInOpPlusDouble(GLEBuiltInFactory* factory) : GLEBuiltInBinaryDoubleDouble("+", factory) {} 18 | 19 | void GLEBuiltInOpPlusDouble::execute(GLEArrayImpl* stack, unsigned int top) { 20 | } 21 | 22 | void initializeBuiltInDouble(GLESubMap* submap, GLEBuiltInFactory* factory) { 23 | 24 | 25 | 26 | submap->add(new GLEBuiltInOpPlusDouble(factory)); /* +/2 operator */ 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/testbuild.yml: -------------------------------------------------------------------------------- 1 | # 2 | # -- test calling trigger 3 | # 4 | name: Test Calling Trigger 5 | on: 6 | workflow_dispatch: 7 | jobs: 8 | build: 9 | runs-on: windows-latest 10 | steps: 11 | - name: GLE Repository Dispatch 12 | uses: peter-evans/repository-dispatch@v1 13 | with: 14 | token: ${{ secrets.GITHUB_TOKEN }} 15 | event-type: test-trigger 16 | client-payload: '{"upload_url": "foo", "tag": "bar"}' 17 | - name: GLE Library Repository Dispatch 18 | uses: peter-evans/repository-dispatch@v1 19 | with: 20 | token: ${{ SECRETS.GLE_LIBRARY_PAT }} 21 | event-type: test-trigger 22 | repository: vlabella/gle-library 23 | client-payload: '{"upload_url": "foo", "tag": "bar"}' 24 | - name: GLE Manual Repository Dispatch 25 | uses: peter-evans/repository-dispatch@v1 26 | with: 27 | token: ${{ SECRETS.GLE_MANUAL_PAT }} 28 | event-type: test-trigger 29 | repository: vlabella/gle-manual 30 | client-payload: '{"upload_url": "foo", "tag": "bar"}' 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/gle/unit-tests/expressions.txt: -------------------------------------------------------------------------------- 1 | 1+2,3 2 | 6-2,4 3 | 2*7,14 4 | 10/5,2 5 | 2^3,8 6 | 7%5,2 7 | 4=5,false 8 | 5<10,true 9 | 5<=5,true 10 | 6>10,false 11 | 6>=6,true 12 | 5<>5,false 13 | (2 < 6) and (4 = 3),false 14 | (2 < 6) and (4 = 4),true 15 | "'hello' + ' ' + 'world'",hello world 16 | "'ape' < 'zebra'",true 17 | "'zebra' < 'ape'",false 18 | "'ape' > 'zebra'",false 19 | "'zebra' > 'ape'",true 20 | "'ape' <= 'zebra'",true 21 | "'zebra' <= 'ape'",false 22 | "'ape' >= 'zebra'",false 23 | "'zebra' >= 'ape'",true 24 | "'APE' >= 'ape'",true 25 | "'APE' <= 'ape'",true 26 | "'APE' > 'ape'",false 27 | "'APE' < 'ape'",false 28 | "'x' . 'y'",x.y 29 | "'5 = ' + 5",5 = 5 30 | "seg$('Hello', 2, 4)",ell 31 | "seg$('Hello', 1, -1)",Hello 32 | "seg$('Hello', 2, -2)",ell 33 | "left$('Hello', 2)",He 34 | "left$('Hello', 0)", 35 | "right$('Hello', 0)", 36 | "right$('Hello', 3)",llo 37 | chr$(65),A 38 | "pos('HelloWorldHello', 'Hel', 4)", 11 39 | "pos('HelloWorldHello', 'Hel', 11)", 11 40 | "pos('HelloWorldHello', 'Hel', 12)", 0 41 | "pos('HelloWorldHello', 'Hel', 1)", 1 42 | "pos('HelloWorldHello', 'Hel', -5)", 11 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/fonts/glemark.afm: -------------------------------------------------------------------------------- 1 | StartFontMetrics 2.0 2 | FontName GleMarkers 3 | EncodingScheme GLEMARK 4 | FullName Gle Markers 5 | FamilyName GLE 6 | Weight Roman 7 | ItalicAngle 0.0 8 | IsFixedPitch false 9 | UnderlinePosition -109 10 | UnderlineThickness 49 11 | Version 001.002 12 | Notice The GLE marker font is licensed under the Modified BSD license. 13 | FontBBox -170 -223 1024 896 14 | CapHeight 662 15 | XHeight 448 16 | Descender -217 17 | Ascender 682 18 | StartCharMetrics 14 19 | C 1; WX 1000; N C1 ; B 0 0 1000 1000 ; 20 | C 2; WX 1000; N C2 ; B 0 0 1000 1000 ; 21 | C 3; WX 1000; N C3 ; B 0 0 1000 1000 ; 22 | C 4; WX 1000; N C4 ; B 0 0 1000 1000 ; 23 | C 5; WX 1000; N C5 ; B 0 0 1000 1000 ; 24 | C 6; WX 1000; N C6 ; B 0 0 1000 1000 ; 25 | C 7; WX 1000; N C7 ; B 0 0 1000 1000 ; 26 | C 8; WX 1000; N C8 ; B 0 0 1000 1000 ; 27 | C 9; WX 1000; N C9 ; B 0 0 1000 1000 ; 28 | C 10; WX 1000; N C10 ; B 0 0 1000 1000 ; 29 | C 11; WX 1000; N C11 ; B 0 0 1000 1000 ; 30 | C 12; WX 1000; N C12 ; B 0 0 1000 1000 ; 31 | C 13; WX 1000; N C13 ; B 0 0 1000 1000 ; 32 | C 14; WX 1000; N C14 ; B 0 0 1000 1000 ; 33 | EndCharMetrics 34 | EndFontMetrics 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/gui/about.html: -------------------------------------------------------------------------------- 1 |
2 |   3 |
4 |
5 |

About QGLE

6 |
7 |
8 | Version: *VERSION*
9 | Build date: *DATE*
10 |  
11 | glx.sourceforge.net
12 |
13 |
14 |   15 |
16 |
17 | QGLE is the graphical user interface of GLE. 18 |
19 |
20 |   21 |
22 |
23 | GLE (Graphics Layout Engine) is a graphics scripting language designed for creating publication quality figures (e.g., a chart, plot, graph, or diagram). GLE supports various chart types (including function plot, histogram, bar chart, scatter plot, contour plot, color map, and surface plot) through a simple but flexible set of graphing commands. More complex output can be created by relying on GLE's scripting language, which is full featured with subroutines, variables, and logic control. GLE relies on LaTeX for text output and supports mathematical formulea in graphs and figures. GLE's output formats include EPS, PS, PDF, JPEG, and PNG. 24 |
25 | -------------------------------------------------------------------------------- /src/fonts/Adobe-Core35_AFMs-314/MustRead.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | Adobe Core 35 AFM Files with 314 Glyph Entries - ReadMe 7 | 8 | 9 | 10 |

Adobe Core 35 AFM Files with 314 Glyph Entries - ReadMe

11 | 12 | 13 | 14 | 23 | 24 | 25 |
This file and the 35 PostScript(R) AFM files it 15 | accompanies may be used, copied, and distributed for any purpose and 16 | without charge, with or without modification, provided that all 17 | copyright notices are retained; that the AFM files are not 18 | distributed without this file; that all modifications to this file 19 | or any of the AFM files are prominently noted in the modified 20 | file(s); and that this paragraph is not modified. Adobe Systems has 21 | no responsibility or obligation to support the use of the AFM 22 | files.
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/gle/gle-fitls.h: -------------------------------------------------------------------------------- 1 | // 2 | // -- GLE fitting routine based on Powell Minimization - See Numerical Recipes Chapter 10 3 | // 4 | #ifndef INCLUDE_GLE_FITLS 5 | #define INCLUDE_GLE_FITLS 6 | 7 | class GLEPowellFunc { 8 | public: 9 | GLEPowellFunc(); 10 | virtual ~GLEPowellFunc(); 11 | virtual double fitMSE(double* vals) = 0; 12 | }; 13 | 14 | class GLEFitLS : public GLEPowellFunc { 15 | protected: 16 | int m_IdxX, m_NIter; 17 | double m_RSquare; 18 | std::vector m_Vars; 19 | std::vector* m_X; 20 | std::vector* m_Y; 21 | StringIntHash m_VarMap; 22 | std::string m_FunctionStr; 23 | GLERC m_Function; 24 | public: 25 | GLEFitLS(); 26 | virtual ~GLEFitLS(); 27 | void polish(const std::string& str); 28 | void setXY(std::vector* x, std::vector* y); 29 | void fit(); 30 | void testFit(); 31 | void setVarsVals(double* vals); 32 | void toFunctionStr(const std::string& format, std::string* str); 33 | virtual double fitMSE(double* vals); 34 | inline GLEFunctionParserPcode* getFunction() { return m_Function.get(); } 35 | inline double getRSquare() { return m_RSquare; } 36 | }; 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Vincent LaBella 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /src/manip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(manip 2 | cell.cpp 3 | cmd.cpp 4 | eval.cpp 5 | filemenu.cpp 6 | fn.cpp 7 | general.cpp 8 | keyword.cpp 9 | manip.cpp 10 | mjl.cpp 11 | polish.cpp 12 | sub.cpp 13 | token.cpp 14 | var.cpp 15 | varargs.cpp 16 | $<$:unix_extra.cpp> 17 | $<$:unixinkey.cpp> 18 | $<$:unixscr.cpp> 19 | $<$:unix_extra.cpp> 20 | $<$:unixinkey.cpp> 21 | $<$:unixscr.cpp> 22 | $<$:turbo.cpp> 23 | $<$:turboscr.cpp> 24 | $<$:inkey.cpp> 25 | ../gle/cutils.cpp 26 | ../gle/file_io.cpp 27 | ) 28 | 29 | if(WIN32) 30 | target_link_libraries(manip LINK_PUBLIC 31 | opengl32.lib 32 | wsock32.lib 33 | Ws2_32.lib 34 | msimg32.lib 35 | ) 36 | endif() 37 | 38 | target_link_libraries(manip PRIVATE ${CURSES_LIBRARIES}) 39 | target_include_directories(manip SYSTEM PRIVATE ${CURSES_INCLUDE_DIRS}) 40 | 41 | set_target_properties(manip PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 42 | 43 | set(TARGET_NAME manip) 44 | install(TARGETS ${TARGET_NAME} 45 | CONFIGURATIONS Release Debug 46 | RUNTIME 47 | ) 48 | 49 | # if(MSVC_INSTALL_MSVC_RUNTIME OR NOT WIN32) 50 | # install(TARGETS ${TARGET_NAME} 51 | # CONFIGURATIONS Release Debug 52 | # RUNTIME 53 | # BUNDLE DESTINATION bin # setting this to Applications causes problems with cpack 54 | # ) 55 | # else() 56 | # install(TARGETS ${TARGET_NAME} 57 | # CONFIGURATIONS Release Debug 58 | # RUNTIME 59 | # PRE_EXCLUDE_REGEXES 60 | # ".*msvcp.*" 61 | # ".*vcruntime.*" 62 | # ".*concrt.*" 63 | # ".*api-ms-win.*" 64 | # ".*ucrtbase.*" 65 | # ) 66 | # endif() 67 | 68 | -------------------------------------------------------------------------------- /src/gui/start-qgle.sh: -------------------------------------------------------------------------------- 1 | # *********************************************************************************** 2 | # * QGLE - A Graphical Interface to GLE * 3 | # * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | # * * 5 | # * This program is free software; you can redistribute it and/or * 6 | # * modify it under the terms of the GNU General Public License * 7 | # * as published by the Free Software Foundation; either version 2 * 8 | # * of the License, or (at your option) any later version. * 9 | # * * 10 | # * This program is distributed in the hope that it will be useful, * 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | # * GNU General Public License for more details. * 14 | # * * 15 | # * You should have received a copy of the GNU General Public License * 16 | # * along with this program; if not, write to the Free Software * 17 | # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | # * * 19 | # * Also add information on how to contact you by electronic and paper mail. * 20 | # *********************************************************************************** 21 | 22 | #!/bin/sh 23 | LD_LIBRARY_PATH=../../build/lib/:$LD_LIBRARY_PATH 24 | #GLE_TOP=/usr/share/gle/4.0.13-cvs/ 25 | export LD_LIBRARY_PATH 26 | #export GLE_TOP 27 | #./qgle 28 | ../../build/bin/qgle 29 | -------------------------------------------------------------------------------- /src/gle/gle-block.h: -------------------------------------------------------------------------------- 1 | #ifndef GLE_BLOCK_H 2 | #define GLE_BLOCK_H 3 | 4 | class GLEBlockBase; 5 | class GLESourceLine; 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class GLEBlockInstance { 12 | public: 13 | GLEBlockInstance(GLEBlockBase* parent); 14 | virtual ~GLEBlockInstance(); 15 | 16 | virtual void executeLine(GLESourceLine& sline) = 0; 17 | virtual void endExecuteBlock() = 0; 18 | 19 | GLEBlockBase* getParent(); 20 | 21 | private: 22 | GLEBlockBase* m_parent; 23 | }; 24 | 25 | class GLEBlockBase { 26 | public: 27 | GLEBlockBase(const std::string& blockName, 28 | bool allowRecursiveBlocks); 29 | virtual ~GLEBlockBase(); 30 | 31 | virtual GLEBlockInstance* beginExecuteBlockImpl(GLESourceLine& sline, int *pcode, int *cp) = 0; 32 | virtual bool checkLine(GLESourceLine& sline) = 0; 33 | 34 | void beginExecuteBlock(GLESourceLine& sline, int *pcode, int *cp); 35 | void executeLine(GLESourceLine& sline); 36 | void endExecuteBlock(); 37 | 38 | bool allowRecursiveBlocks() const; 39 | const std::string getBlockName() const; 40 | 41 | private: 42 | std::string m_blockName; 43 | bool m_allowRecursiveBlocks; 44 | std::vector m_blockStack; 45 | }; 46 | 47 | class GLEBlockWithSimpleKeywords : public GLEBlockBase { 48 | public: 49 | GLEBlockWithSimpleKeywords(const std::string& blockName, 50 | bool allowRecursiveBlocks); 51 | virtual ~GLEBlockWithSimpleKeywords(); 52 | 53 | virtual bool checkLine(GLESourceLine& sline); 54 | 55 | void addKeyWord(const char* keyword); 56 | void addKeyWord(const std::string& keyword); 57 | 58 | private: 59 | std::set m_keyWords; 60 | }; 61 | 62 | class GLEBlocks { 63 | public: 64 | GLEBlocks(); 65 | ~GLEBlocks(); 66 | 67 | void addBlock(int blockType, GLEBlockBase* block); 68 | GLEBlockBase* getBlock(int blockType); 69 | GLEBlockBase* getBlockIfExists(int blockType); 70 | 71 | private: 72 | std::map m_blocks; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/gletests/test_constants.gle: -------------------------------------------------------------------------------- 1 | ! 2 | ! -- testing of constants 3 | print "pi = " pi 4 | print "mc_catalan = " mc_catalan 5 | print "mc_degree = " mc_degree 6 | print "mc_e = " mc_e 7 | print "mc_e_pow_pi = " mc_e_pow_pi 8 | print "mc_euler = " mc_euler 9 | print "mc_exp_minus_half = " mc_exp_minus_half 10 | print "mc_half = " mc_half 11 | print "mc_half_pi = " mc_half_pi 12 | print "mc_half_root_two = " mc_half_root_two 13 | print "mc_ln_phi = " mc_ln_phi 14 | print "mc_one_div_two_pi = " mc_one_div_two_pi 15 | print "mc_half_root_two = " mc_half_root_two 16 | print "mc_phi = " mc_phi 17 | print "mc_pi = " mc_pi 18 | print "mc_quarter_pi = " mc_quarter_pi 19 | print "mc_radian = " mc_radian 20 | print "mc_root_e = " mc_root_e 21 | print "mc_root_half_pi = " mc_root_half_pi 22 | print "mc_root_ln_four = " mc_root_ln_four 23 | print "mc_root_pi = " mc_root_pi 24 | print "mc_root_three = " mc_root_three 25 | print "mc_root_two = " mc_root_two 26 | print "mc_root_two_pi = " mc_root_two_pi 27 | print "mc_third = " mc_third 28 | print "mc_third_pi = " mc_third_pi 29 | print "mc_two_pi = " mc_two_pi 30 | print "mc_two_thirds = " mc_two_thirds 31 | print "mc_zeta_three = " mc_zeta_three 32 | print "mc_zeta_two = " mc_zeta_two 33 | print "pc_c = " pc_c 34 | print "pc_speed_of_light = " pc_speed_of_light 35 | print "pc_mu_0 = " pc_mu_0 36 | print "pc_epsilon_0 = " pc_epsilon_0 37 | print "pc_h = " pc_h 38 | print "pc_Planck = " pc_Planck 39 | print "pc_hbar = " pc_hbar 40 | print "pc_G = " pc_G 41 | print "pc_gravitational_constant = " pc_gravitational_constant 42 | print "pc_g = " pc_g 43 | print "pc_e = " pc_e 44 | print "pc_elementary_charge = " pc_elementary_charge 45 | print "pc_R = " pc_R 46 | print "pc_gas_constant = " pc_gas_constant 47 | print "pc_alpha = " pc_alpha 48 | print "pc_fine_structure = " pc_fine_structure 49 | print "pc_N_A = " pc_N_A 50 | print "pc_Avogadro = " pc_Avogadro 51 | print "pc_k = " pc_k 52 | print "pc_Boltzmann = " pc_Boltzmann 53 | print "pc_sigma = " pc_sigma 54 | print "pc_Stefan_Boltzmann = " pc_Stefan_Boltzmann 55 | print "pc_Wien = " pc_Wien 56 | print "pc_Rydberg = " pc_Rydberg 57 | print "pc_m_e = " pc_m_e 58 | print "pc_electron_mass = " pc_electron_mass 59 | print "pc_m_p = " pc_m_p 60 | print "pc_proton_mass = " pc_proton_mass 61 | print "pc_m_n = " pc_m_n 62 | print "pc_neutron_mass = " pc_neutron_mass 63 | print "pc_zero_Celsius = " pc_zero_Celsius 64 | -------------------------------------------------------------------------------- /src/gui/colourbutton.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef __COLOURBUTTON_H 23 | #define __COLOURBUTTON_H 24 | 25 | #include 26 | 27 | 28 | class ColourButton : public QAbstractButton 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | ColourButton(QColor col = QColor(), QWidget *parent = 0); 34 | ColourButton(QPixmap px, QWidget *parent = 0); 35 | 36 | void setColour(QColor col); 37 | 38 | public slots: 39 | void onClick(); 40 | 41 | signals: 42 | void colourChosen(QColor col); 43 | 44 | protected: 45 | void paintEvent(QPaintEvent *event); 46 | QSize sizeHint() const; 47 | 48 | private: 49 | QColor colour; 50 | QPixmap pixmap; 51 | bool hasPixmap; 52 | 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # -- install.sh - GLE installation script for Linux/macOS 4 | # 5 | DEFAULT_INSTALL_PREFIX="/usr/local" 6 | echo -e "\e[31mG\e[32mL\e[34mE\e[0m installation script" 7 | 8 | # Check for root privileges first 9 | if [[ $EUID -ne 0 ]]; then 10 | echo "Error: Please run this script as root (e.g., using sudo)." 11 | exit 1 12 | fi 13 | 14 | # Prompt user for installation directory if no option provided 15 | 16 | INSTALL_PREFIX= 17 | while [[ $# -gt 0 ]]; do 18 | case "$1" in 19 | --prefix) 20 | shift 21 | if [[ "$1" == "/usr" || "$1" == "/usr/local" ]]; then 22 | INSTALL_PREFIX="$1" 23 | else 24 | echo "Invalid prefix. Use /usr or /usr/local." 25 | exit 1 26 | fi 27 | ;; 28 | *) 29 | echo "Usage: $0 [--prefix /usr|/usr/local]" 30 | exit 1 31 | ;; 32 | esac 33 | shift 34 | done 35 | 36 | # If no prefix provided, prompt user with default /usr/local 37 | if [[ -z "$INSTALL_PREFIX" ]]; then 38 | read -p "Choose installation directory [$DEFAULT_INSTALL_PREFIX by default]: " USER_INPUT 39 | if [[ -z "$USER_INPUT" ]]; then 40 | INSTALL_PREFIX=$DEFAULT_INSTALL_PREFIX 41 | elif [[ "$USER_INPUT" == "/usr" || "$USER_INPUT" == "/usr/local" ]]; then 42 | INSTALL_PREFIX="$USER_INPUT" 43 | else 44 | echo "Invalid choice. Please run the script again and choose /usr or /usr/local." 45 | exit 1 46 | fi 47 | fi 48 | 49 | echo "Installing GLE to $INSTALL_PREFIX..." 50 | 51 | # Create directories 52 | mkdir -p "$INSTALL_PREFIX/bin" 53 | mkdir -p "$INSTALL_PREFIX/share/doc/gle-graphics" 54 | mkdir -p "$INSTALL_PREFIX/share/gle-graphics" 55 | 56 | # Copy files 57 | cp -v bin/gle "$INSTALL_PREFIX/bin/" 58 | cp -v bin/qgle "$INSTALL_PREFIX/bin/" 59 | cp -v bin/manip "$INSTALL_PREFIX/bin/" 60 | cp glerc "$INSTALL_PREFIX/share/gle-graphics" 61 | cp init.tex "$INSTALL_PREFIX/share/gle-graphics" 62 | cp inittex.ini "$INSTALL_PREFIX/share/gle-graphics" 63 | cp -v doc/* "$INSTALL_PREFIX/share/doc/gle-graphics/" 64 | cp -r gleinc "$INSTALL_PREFIX/share/gle-graphics/gleinc" 65 | cp -r font "$INSTALL_PREFIX/share/gle-graphics/font" 66 | # set environment variable 67 | export GLE_TOP=$INSTALL_PREFIX/share/gle-graphics 68 | # run finddeps 69 | sudo -u "$SUDO_USER" gle -finddeps 70 | # show user information 71 | sudo -u "$SUDO_USER" gle -info 72 | 73 | echo "GLE Installation complete." 74 | -------------------------------------------------------------------------------- /src/gui/propertyeditor.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef __PROPERTYEDITOR_H 23 | #define __PROPERTYEDITOR_H 24 | 25 | #include 26 | #include "drawingobject.h" 27 | #include "propertymodel.h" 28 | 29 | class GLEPropertyEditor : public QTableView 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //! Constructor 35 | GLEPropertyEditor(QWidget *parent, int size); 36 | // virtual QSize sizeHint() const; 37 | // virtual int heightForWidth(int w) const; 38 | public slots: 39 | void objectsSelected(QList objs); 40 | void propertyChanged(const QModelIndex &index, const QModelIndex &index2); 41 | 42 | signals: 43 | void propertiesHaveChanged(); 44 | 45 | 46 | private: 47 | QVariant getPropertyValue(int index, QList objs); 48 | QList objects; 49 | bool hasModel; 50 | GLEPropertyModel *model; 51 | int defaultSize; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/gui/variantdelegate.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef __VARIANTDELEGATE_H 23 | #define __VARIANTDELEGATE_H 24 | 25 | #include 26 | 27 | class ColourPicker; 28 | 29 | class VariantDelegate : public QItemDelegate 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | VariantDelegate(QObject *parent = 0); 35 | 36 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, 37 | const QModelIndex &index) const; 38 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 39 | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 40 | 41 | void updateEditorGeometry(QWidget *editor, 42 | const QStyleOptionViewItem &option, const QModelIndex &index) const; 43 | void paint(QPainter *painter, 44 | const QStyleOptionViewItem &option, 45 | const QModelIndex &index) const; 46 | 47 | void doneEditingColor(ColourPicker* picker); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/gui/about.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | /*************************************************************** 23 | * about.h: The class definition for the about box. * 24 | ***************************************************************/ 25 | #ifndef __ABOUTBOX_H 26 | #define __ABOUTBOX_H 27 | 28 | #include 29 | #include 30 | 31 | class GLEInterface; 32 | 33 | //! Class describing an about box to give information about QGLE 34 | class AboutBox : public QDialog 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | //! The class constructor 40 | AboutBox(QWidget* par,GLEInterface* gleInterface); 41 | 42 | private: 43 | QTextBrowser* createAboutPanel(); 44 | QWidget* createContributorsPanel(); 45 | QWidget* createLicensePanel(); 46 | 47 | private slots: 48 | //! Open a given URL 49 | void showURL(const QUrl&); 50 | 51 | private: 52 | GLEInterface* m_gleInterface; 53 | int m_minWidth; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/gui/colourpicker.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef __COLOURPICKER_H 23 | #define __COLOURPICKER_H 24 | 25 | #include 26 | #include "colourbutton.h" 27 | 28 | class VariantDelegate; 29 | 30 | class ColourPicker : public QAbstractButton 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | ColourPicker(QWidget *parent, VariantDelegate* delegate); 36 | 37 | QColor getColour(); 38 | bool hasChanged(); 39 | void setColour(); 40 | 41 | public slots: 42 | void setColour(QColor col); 43 | void colourChosen(QColor col); 44 | void moreColours(); 45 | void doShowPopup(); 46 | 47 | protected: 48 | void paintEvent(QPaintEvent *event); 49 | void mouseDoubleClickEvent(QMouseEvent *event); 50 | public: 51 | void showPopup(); 52 | 53 | private: 54 | QColor colour; 55 | 56 | bool changed; 57 | bool hasColour; 58 | 59 | QDialog *chooserFrame; 60 | QList buttons; 61 | VariantDelegate* parentDelegate; 62 | QTimer* myTimer; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/gui/macspecific.cpp: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | using namespace std; 28 | 29 | bool copyPDFMac(const string& fname) { 30 | CFMutableDataRef data = CFDataCreateMutable(kCFAllocatorDefault, 0); 31 | if (data != NULL) { 32 | char buffer[10000]; 33 | ifstream file; 34 | file.open(fname.c_str()); 35 | if (file.is_open()) { 36 | while (file.good()) { 37 | file.read(buffer, 9000); 38 | CFDataAppendBytes(data, (const UInt8*)buffer, file.gcount()); 39 | } 40 | file.close(); 41 | // copy PDF to clipboard 42 | PasteboardRef clipboard = NULL; 43 | PasteboardCreate(kPasteboardClipboard, &clipboard); 44 | PasteboardClear(clipboard); 45 | PasteboardPutItemFlavor(clipboard, (PasteboardItemID) 1, kUTTypePDF, data, kPasteboardFlavorNoFlags); 46 | CFRelease(clipboard); 47 | CFRelease(data); 48 | return true; 49 | } 50 | } 51 | return false; 52 | } 53 | -------------------------------------------------------------------------------- /src/gui/propertymodel.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef __PROPERTYMODEL_H 23 | #define __PROPERTYMODEL_H 24 | 25 | #include 26 | 27 | struct GLEDrawingObjectProperty 28 | { 29 | int index; 30 | QString description; 31 | QVariant value; 32 | QVariant validValues; 33 | }; 34 | 35 | class GLEPropertyModel : public QAbstractTableModel 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | GLEPropertyModel(const QList &props, QObject *parent = 0); 41 | 42 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 43 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 44 | QVariant data(const QModelIndex &index, int role) const; 45 | QVariant headerData(int section, Qt::Orientation orientation, 46 | int role = Qt::DisplayRole) const; 47 | 48 | GLEDrawingObjectProperty getFullProperty(const QModelIndex &index); 49 | 50 | Qt::ItemFlags flags(const QModelIndex &index) const; 51 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); 52 | 53 | private: 54 | QList propertyList; 55 | 56 | }; 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/manip/test.dat: -------------------------------------------------------------------------------- 1 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2 | ! ! 3 | ! GLE - Graphics Layout Engine ! 4 | ! ! 5 | ! Modified BSD License ! 6 | ! ! 7 | ! Copyright (C) 2009 GLE. ! 8 | ! ! 9 | ! Redistribution and use in source and binary forms, with or without ! 10 | ! modification, are permitted provided that the following conditions ! 11 | ! are met: ! 12 | ! ! 13 | ! 1. Redistributions of source code must retain the above copyright ! 14 | ! notice, this list of conditions and the following disclaimer. ! 15 | ! ! 16 | ! 2. Redistributions in binary form must reproduce the above ! 17 | ! copyright notice, this list of conditions and the following ! 18 | ! disclaimer in the documentation and/or other materials provided with ! 19 | ! the distribution. ! 20 | ! ! 21 | ! 3. The name of the author may not be used to endorse or promote ! 22 | ! products derived from this software without specific prior written ! 23 | ! permission. ! 24 | ! ! 25 | ! THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR ! 26 | ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ! 27 | ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ! 28 | ! ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ! 29 | ! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ! 30 | ! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ! 31 | ! GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ! 32 | ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER ! 33 | ! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ! 34 | ! OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN ! 35 | ! IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! 36 | ! ! 37 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 38 | 0 2 6 39 | 1 10 16 40 | 2 3 6 41 | 3 6 3 42 | 4 5 4 43 | 5 3 7 44 | -------------------------------------------------------------------------------- /src/gle/d_svg.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | /* We now use the Cairo SVG export */ 40 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | // 40 | // -- empty file not needed anymore with cmake building 41 | // -------------------------------------------------------------------------------- /src/gui/newfile.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | /*************************************************************** 23 | * newfile.h: The class definition for the new file dialogue. * 24 | ***************************************************************/ 25 | #ifndef __NEWFILE_H 26 | #define __NEWFILE_H 27 | 28 | #include 29 | 30 | //! Class used to display a dialogue box asking the user for the size of the drawing 31 | class NewFileBox : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | //! Class constructor 37 | NewFileBox(QWidget *parent = 0); 38 | //! Size of the drawing 39 | QSizeF size(); 40 | //! Should save the new imdage? 41 | inline bool shouldSave() { return save; } 42 | 43 | public slots: 44 | void saveClicked(); 45 | 46 | private: 47 | //! The layout of the dialogue box 48 | QGridLayout *layout; 49 | //! Spinbox for the width 50 | QDoubleSpinBox *width; 51 | //! Spinbox for the height 52 | QDoubleSpinBox *height; 53 | //! Create the drawing 54 | QPushButton *okCmd; 55 | //! Create the drawing and save it 56 | QPushButton *saveCmd; 57 | //! Give up. 58 | QPushButton *cancelCmd; 59 | //! Should save the new image? 60 | bool save; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # 2 | # -- DEPRECATED Build for Linux and macOS - used as starting point for current workflows 3 | # 4 | name: Deprecated Build Linux and macOS Original 5 | on: 6 | workflow_dispatch: 7 | #pull_request: 8 | #push: 9 | # branches: [main] 10 | jobs: 11 | build: 12 | name: Build on ${{ matrix.os }} 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: [macos-latest, ubuntu-latest] 17 | build_type: [Release] 18 | c_compiler: [gcc, clang, cl] 19 | runs-on: ${{ matrix.os }} 20 | defaults: 21 | run: 22 | shell: bash 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v4 26 | - name: Install dependencies 27 | run: | 28 | set -x 29 | touch configure.args 30 | 31 | case $RUNNER_OS in 32 | Linux) 33 | sudo apt-get update 34 | # Add libjbig-dev and libzstd-dev once GLE can find them without 35 | # relying on nonexistent cmake config files. 36 | # See https://github.com/vlabella/GLE/issues/16 37 | sudo apt-get install cmake freeglut3-dev libboost-dev \ 38 | libcairo-dev libdeflate-dev libgs-dev \ 39 | libjpeg-turbo8-dev liblzma-dev libpixman-1-dev \ 40 | libpng-dev libtiff-dev libz-dev qtbase5-dev 41 | jobs=$(nproc) 42 | ;; 43 | macOS) 44 | # Add jbigkit once GLE can find it without relying on nonexistent 45 | # cmake config files. 46 | # See https://github.com/vlabella/GLE/issues/16 47 | # liblzma and libz are already in macOS. 48 | # cmake is preinstalled with Homebrew on GitHub Actions runners and 49 | # trying to install it again produces an unintelligible warning. 50 | brew install --quiet boost cairo ghostscript jpeg-turbo \ 51 | libdeflate libpng libtiff pixman qt@5 zstd 52 | echo "-D Qt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5" >> configure.args 53 | jobs=$(sysctl -n hw.activecpu) 54 | ;; 55 | Windows) 56 | # see build-windows.yml 57 | ;; 58 | *) 59 | jobs=1 60 | esac 61 | 62 | echo "--parallel $jobs" >> build.args 63 | - name: Configure 64 | run: | 65 | xargs -t < configure.args cmake -S src -B build -D CMAKE_BUILD_TYPE=Release 66 | - name: Build 67 | run: | 68 | xargs -t < build.args cmake --build build --verbose 69 | - name: Install 70 | run: | 71 | DESTDIR=destroot cmake --install build 72 | - name: Upload Artifacts - Binaries 73 | uses: actions/upload-artifact@v4.4.3 74 | with: 75 | name: Binary Executables 76 | path: ${{github.workspace}}/destroot 77 | if-no-files-found: warn 78 | retention-days: 0 79 | compression-level: 0 80 | -------------------------------------------------------------------------------- /src/gui/grid.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GRID_H 23 | #define _GRID_H 24 | 25 | #include 26 | #include "qgle_definitions.h" 27 | 28 | //! Class implementing a grid for drawing 29 | class GLEGrid : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //! Constructor: initialise the grid 35 | GLEGrid(QObject *parent = 0); 36 | //! Find the nearest grid point to a given point (QT coordinates) 37 | QPointF nearestPoint(QPointF qt, double *distance = 0); 38 | //! Return all (QT) grid points 39 | QList allPoints(); 40 | //! Return the pen with which to draw the grid 41 | QPen pen(); 42 | //! Draw the grid 43 | void drawGrid(QPainter* paint); 44 | 45 | public slots: 46 | //! Set the grid spacing 47 | void setGrid(QPointF newGrid); 48 | //! Set the drawing area 49 | void setArea(QSize area); 50 | //! Set the resolution 51 | void setDPI(double new_dpi); 52 | 53 | private: 54 | //! Update the pen with a new resolution 55 | void updatePen(); 56 | 57 | //! The grid X & Y spacing 58 | QPointF gridSpacing; 59 | //! The drawing area size 60 | QSizeF areaSize; 61 | //! The resolution 62 | double dpi; 63 | 64 | //! The pen with which to draw the grid 65 | QPen paintPen; 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/manip/mjl.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_MJL_H 40 | #define INC_MJL_H 41 | 42 | void mjl_flush(); 43 | void init_logging(char *infile); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /.github/workflows/build-linux-macos.yml: -------------------------------------------------------------------------------- 1 | # 2 | # -- Linux and macOS build 3 | # no manual or installer creation 4 | # runs on commit 5 | # binary installation folder saved 6 | # 7 | name: Build Linux and macOS 8 | on: 9 | workflow_dispatch: 10 | #pull_request: 11 | #push: 12 | # branches: [main] 13 | jobs: 14 | build: 15 | name: Build on ${{ matrix.os }} 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | os: [macos-latest, ubuntu-latest] 20 | build_type: [Release] 21 | c_compiler: [gcc] 22 | runs-on: ${{ matrix.os }} 23 | defaults: 24 | run: 25 | shell: bash 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@v4 29 | - name: Install dependencies 30 | run: | 31 | set -x 32 | touch configure.args 33 | 34 | case $RUNNER_OS in 35 | Linux) 36 | sudo apt-get update 37 | sudo apt-get install cmake freeglut3-dev libboost-dev libcairo-dev libdeflate-dev \ 38 | libgs-dev libjpeg-turbo8-dev liblzma-dev libpixman-1-dev libpng-dev libtiff-dev \ 39 | libz-dev qt6-base-dev libpoppler-dev libpoppler-cpp-dev libpoppler-glib-dev \ 40 | libpoppler-qt6-dev libglib2.0-dev extra-cmake-modules ghostscript dpkg-dev 41 | jobs=$(nproc) 42 | ;; 43 | macOS) 44 | # liblzma and libz are already in macOS. 45 | # cmake is preinstalled with Homebrew on GitHub Actions runners and 46 | # trying to install it again produces an unintelligible warning. 47 | brew install --quiet boost cairo ghostscript jpeg-turbo \ 48 | libdeflate libpng libtiff pixman qt zstd poppler glib extra-cmake-modules 49 | echo "-D Qt6_DIR=$(brew --prefix qt)/lib/cmake/Qt6" >> configure.args 50 | ls -la /opt/homebrew/opt/ghostscript/lib 51 | jobs=$(sysctl -n hw.activecpu) 52 | ;; 53 | *) 54 | jobs=1 55 | esac 56 | 57 | echo "--parallel $jobs" >> build.args 58 | - name: Configure cmake 59 | run: > 60 | xargs -t < configure.args cmake -S src -B build 61 | -DCMAKE_BUILD_TYPE=Release 62 | -DBUILD_TESTS=ON 63 | - name: Build GLE 64 | run: | 65 | case $RUNNER_OS in 66 | macOS) 67 | export DYLD_LIBRARY_PATH=/opt/homebrew/opt/ghostscript/lib:$DYLD_LIBRARY_PATH 68 | ;; 69 | esac 70 | xargs -t < build.args cmake --build build --config Release 71 | - name: Install GLE 72 | run: | 73 | DESTDIR=destroot cmake --install build --config Release 74 | - name: Upload Artifacts - GLE Binaries 75 | uses: actions/upload-artifact@v4.4.3 76 | with: 77 | name: GLE Binary Executables ${{ runner.os }} 78 | path: ${{github.workspace}}/destroot/usr/local 79 | if-no-files-found: warn 80 | retention-days: 0 81 | compression-level: 0 82 | -------------------------------------------------------------------------------- /src/gle/bitmap/lzwencode.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | /* 40 | * 2004 Jan Struyf 41 | * 42 | */ 43 | 44 | #ifndef INC_LZWENCODE_H 45 | #define INC_LZWENCODE_H 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/gui/qgle.qrc: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | images/amove.png 26 | images/arc_3p.png 27 | images/circle.png 28 | images/edit_mode.png 29 | images/editor.png 30 | images/ellipse.png 31 | images/ellipsis.png 32 | images/gle.png 33 | images/gle_shadow.png 34 | images/grid.png 35 | images/grid_snap.png 36 | images/line.png 37 | images/new.png 38 | images/open.png 39 | images/orthosnap.png 40 | images/osnap.png 41 | images/perp_line.png 42 | images/pointer.png 43 | images/polarsnap.png 44 | images/polartrack.png 45 | images/preview_mode.png 46 | images/save.png 47 | images/tan_line.png 48 | images/text.png 49 | images/varyingcolours.png 50 | images/zoom_in.png 51 | images/zoom_out.png 52 | images/reload.png 53 | images/reload_red.png 54 | readme.txt 55 | about.html 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/manip/ffblk_def.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | // 40 | // 41 | // ffblk_def.h 42 | // 43 | #ifndef INCLUDE_FFBLCK 44 | #define INCLUDE_FFBLCK 45 | 46 | struct ffblk{ 47 | char *ff_name; 48 | }; 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /src/gle/drawit.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | void CompileGLE(const std::string& output_file, GLEGlobalSource &glecode, CmdLineObj* cmdline, bool silent); 40 | void DrawIt(GLEScript* script, GLEFileLocation* outfile, CmdLineObj* cmdline, bool silent = false); 41 | -------------------------------------------------------------------------------- /src/manip/filemenu.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_FILEMENU_H 40 | #define INC_FILEMENU_H 41 | 42 | void do_help(const char *k1, const char *k2 = NULL); 43 | void init_menucolor(void); 44 | int pick_file(char *result, const char *wld); 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/manip/nofnkeys.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #define KEY_UP 999 40 | #define KEY_DOWN 999 41 | #define KEY_LEFT 999 42 | #define KEY_RIGHT 999 43 | #define KEY_F0 999 44 | #define KEY_PPAGE 999 45 | #define KEY_NPAGE 999 46 | #define KEY_BREAK 999 47 | #define KEY_F(n) 999 48 | -------------------------------------------------------------------------------- /src/manip/unix_extra.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | // 40 | // unix_extra.h 41 | // 42 | #ifndef INCLUDE_UNIX_EXTRA 43 | #define INCLUDE_UNIX_EXTRA 44 | #include "ffblk_def.h" 45 | int findfirst(char *wild, struct ffblk *ffblk, int zz); 46 | int findnext(struct ffblk *ffblk); 47 | #endif 48 | -------------------------------------------------------------------------------- /src/gle/gle-base.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #include "basicconf.h" 40 | #include "gle-interface/gle-base.h" 41 | 42 | using namespace std; 43 | 44 | GLERefCountObject::GLERefCountObject() { 45 | m_OwnerCount = 0; 46 | } 47 | 48 | GLERefCountObject::~GLERefCountObject() { 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/fonts/mkencoding.pl: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # # 3 | # GLE - Graphics Layout Engine # 4 | # # 5 | # Modified BSD License # 6 | # # 7 | # Copyright (C) 2009 GLE. # 8 | # # 9 | # Redistribution and use in source and binary forms, with or without # 10 | # modification, are permitted provided that the following conditions # 11 | # are met: # 12 | # # 13 | # 1. Redistributions of source code must retain the above copyright # 14 | # notice, this list of conditions and the following disclaimer. # 15 | # # 16 | # 2. Redistributions in binary form must reproduce the above # 17 | # copyright notice, this list of conditions and the following # 18 | # disclaimer in the documentation and/or other materials provided with # 19 | # the distribution. # 20 | # # 21 | # 3. The name of the author may not be used to endorse or promote # 22 | # products derived from this software without specific prior written # 23 | # permission. # 24 | # # 25 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR # 26 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # 27 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # 28 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # 29 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # 30 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # 31 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # 32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # 33 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # 34 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # 35 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 36 | # # 37 | ######################################################################## 38 | 39 | open(FILE, "<:utf8", $ARGV[0]); 40 | open(OUT, ">:utf8", "$ARGV[0].2"); 41 | while ($line = ) { 42 | $line =~ s/[\n\r]+$//g; 43 | $x = sprintf("%04x",ord($line)); 44 | print OUT "\$$x, ; cyr$x ! $line\n"; 45 | } 46 | close(OUT); 47 | close(FILE); 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/manip/keyword.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | enum { k_save=1, k_load, k_quit, k_exit, k_if, k_for, k_next, k_end 40 | , k_call, k_else, k_print, k_input, k_generate, k_at, k_comment 41 | , k_let, k_copy, k_move, k_set ,k_delete ,k_data ,k_insert 42 | ,k_goto ,k_logging ,k_prop ,k_sort ,k_swap, k_close, k_clear 43 | ,k_help, k_list, k_sum, k_parsum, k_shell, k_new, k_fit}; 44 | -------------------------------------------------------------------------------- /src/manip/vaxconio.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #define YELLOW 1 40 | #define BLACK 0 41 | #define BLUE 0 42 | #define LIGHTGRAY 0 43 | #define WHITE 1 44 | #define MAGENTA 1 45 | 46 | 47 | struct text_info { 48 | int normattr,winleft,wintop,winright,winbottom,curx,cury;}; 49 | struct ffblk {char *ff_name;}; 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/gui/consolewindow.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _CONSOLE_WINDOW_H 23 | #define _CONSOLE_WINDOW_H 24 | 25 | #include "../gle/gle-interface/gle-interface.h" 26 | #include 27 | 28 | class ConsoleWindow; 29 | 30 | class ConsoleWindowOutput : public QObject, public GLEOutputStream 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | ConsoleWindowOutput(); 36 | virtual ~ConsoleWindowOutput(); 37 | virtual void println(); 38 | virtual void println(const char* str); 39 | virtual void error(GLEErrorMessage* msg); 40 | signals: 41 | void print(const QString str); 42 | }; 43 | 44 | class ConsoleWindow : public QTextEdit 45 | { 46 | Q_OBJECT 47 | 48 | protected: 49 | ConsoleWindowOutput output; 50 | QSplitter* splitWindow; 51 | QAction* hideAction; 52 | int autoShowSize; 53 | 54 | public slots: 55 | //! Slot used to toggle the auto-show functionality of the console window 56 | void hideTriggered(); 57 | void print(QString msg); 58 | 59 | public: 60 | ConsoleWindow(QWidget* parent, QSplitter* splitter); 61 | virtual ~ConsoleWindow(); 62 | virtual void contextMenuEvent(QContextMenuEvent * e); 63 | void shouldAutoShow(); 64 | void println(const QString& str); 65 | inline GLEOutputStream* getOutput() { return &output; } 66 | inline void setHideAction(QAction* act) { hideAction = act; } 67 | inline QAction* getHideAction() { return hideAction; } 68 | inline int getAutoShowSize() { return autoShowSize; } 69 | inline void setAutoShowSize(int s) { autoShowSize = s; } 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # 2 | # -- Create Release - Run manually to create a release 3 | # 4 | # - checks out gle source code 5 | # - gets version number from CMakeLists.txt file 6 | # - creates tag and release using version number on GitHub 7 | # - gets changes from docs/ChangeLog.tct 8 | # all lines from version number to first blank line 9 | # - triggers build and package workflows for all three OSes, which upload their artifacts to the release 10 | # - triggers build and release workflows for gle-library and gle-manual to create release with same tag 11 | # 12 | # - When completed manually bump version in src/CMakeLists.txt and create new entry in doc/ChangeLog.txt 13 | # 14 | name: Create Release 15 | on: 16 | workflow_dispatch: 17 | #pull_request: 18 | #push: 19 | # branches: [main] 20 | jobs: 21 | release: 22 | name: Create Release 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v4 27 | - name: Get Version Number from CMakeLists.txt file 28 | id: version-number 29 | #run: echo "VERSION=4.3.5" >> $GITHUB_ENV 30 | run: echo "VERSION=$(awk 'tolower($0) ~ /project\([[:blank:]]*[[:alnum:]]+[[:blank:]]+version[[:blank:]]+[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:blank:]]*\)/{print $4}' src/CMakeLists.txt)" >> $GITHUB_ENV 31 | - name: Use the value 32 | run: printf '%s\n' "$VERSION" 33 | - name: extract changes for only this version 34 | # use sed to extract from change log - must have blank line between version numbers in change log 35 | run: sed -n "/$VERSION/,/^$/p" ${{github.workspace}}/doc/ChangeLog.txt > changes.txt 36 | - name: Release 37 | id: release 38 | uses: softprops/action-gh-release@v2 39 | with: 40 | token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 41 | tag_name: v${{ env.VERSION }} 42 | name: v${{ env.VERSION }} 43 | body_path: ${{github.workspace}}/changes.txt 44 | draft: false 45 | prerelease: false 46 | - name: display URL 47 | run: echo ${{ steps.release.outputs.upload_url }} 48 | #dispatch to this repo to build all binaries 49 | - name: GLE Repository Dispatch 50 | uses: peter-evans/repository-dispatch@v1 51 | with: 52 | token: ${{ secrets.GITHUB_TOKEN }} 53 | event-type: release 54 | client-payload: '{"upload_url": "${{ steps.release.outputs.upload_url }}", "tag": "v${{ env.VERSION }}"}' 55 | - name: GLE-manual Repository Dispatch 56 | uses: peter-evans/repository-dispatch@v1 57 | with: 58 | token: ${{ secrets.GLE_MANUAL_PAT }} 59 | repository: vlabella/gle-manual 60 | event-type: gle-release 61 | client-payload: '{"upload_url": "${{ steps.release.outputs.upload_url }}", "tag": "v${{ env.VERSION }}"}' 62 | - name: GLE-library Repository Dispatch 63 | uses: peter-evans/repository-dispatch@v1 64 | with: 65 | token: ${{ secrets.GLE_LIBRARY_PAT }} 66 | repository: vlabella/gle-library 67 | event-type: gle-release 68 | client-payload: '{"upload_url": "${{ steps.release.outputs.upload_url }}", "tag": "v${{ env.VERSION }}"}' -------------------------------------------------------------------------------- /src/gui/colourbutton.cpp: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #include "colourbutton.h" 23 | #include "qgle_statics.h" 24 | 25 | ColourButton::ColourButton(QColor col, QWidget *parent) 26 | : QAbstractButton(parent) 27 | { 28 | resize(10,10); 29 | connect(this, SIGNAL(clicked()), 30 | this, SLOT(onClick())); 31 | setColour(col); 32 | hasPixmap = false; 33 | } 34 | 35 | ColourButton::ColourButton(QPixmap px, QWidget *parent) 36 | : QAbstractButton(parent) 37 | { 38 | resize(10,10); 39 | connect(this, SIGNAL(clicked()), 40 | this, SLOT(onClick())); 41 | pixmap = px; 42 | hasPixmap = true; 43 | } 44 | 45 | QSize ColourButton::sizeHint() const 46 | { 47 | return QSize(10,10); 48 | } 49 | 50 | 51 | void ColourButton::paintEvent(QPaintEvent *) 52 | { 53 | QPainter painter(this); 54 | painter.fillRect(rect(), Qt::white); 55 | if (hasPixmap) 56 | { 57 | painter.drawPixmap(rect().center()-QPoint(5,5), pixmap); 58 | } 59 | else 60 | { 61 | QPixmap colourSwatch(10,10); 62 | if (colour.isValid()) 63 | { 64 | colourSwatch.fill(colour); 65 | painter.drawPixmap(rect().center()-QPoint(5,5), colourSwatch); 66 | } 67 | else 68 | { 69 | QPen pen; 70 | pen.setColor(Qt::black); 71 | pen.setWidth(1); 72 | QGLE::drawBox(&painter, rect().center(), 5.0, pen); 73 | QGLE::drawCross(&painter, rect().center(), 5.0, pen); 74 | } 75 | } 76 | 77 | } 78 | 79 | void ColourButton::setColour(QColor col) 80 | { 81 | colour = col; 82 | update(); 83 | } 84 | 85 | void ColourButton::onClick() 86 | { 87 | if (!hasPixmap) 88 | emit colourChosen(colour); 89 | } 90 | -------------------------------------------------------------------------------- /src/manip/color.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | /* colors are defined by ncurses library */ 40 | /* #ifndef HAVE_NCURSES_H */ 41 | #if !defined(__unix__) && !( defined(__OS2__) && defined(__EMX__) && !defined(__APPLE__) ) 42 | 43 | #define COLOR_CLEAR 0XFF000000 44 | #define COLOR_BLACK 0X01000000 45 | #define COLOR_WHITE 0X01FFFFFF 46 | #define COLOR_RED 0X01FF0000 47 | #define COLOR_GREEN 0X0100FF00 48 | #define COLOR_BLUE 0X010000FF 49 | #define COLOR_GREY 0X017F7F7F 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/manip/edt.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | enum {eup=129,edown,eleft,eright,epagedown,epageup,edelline 40 | ,edeleol,eescape,eendoffile,etopoffile,edelright 41 | ,eselect,ecut,ecopy,emark,epaste,emove 42 | ,eeol,ebol,eword,ebword,ereturn,etrace 43 | ,eblockread,eblockwrite 44 | ,ehelp,edelete,eundelline,esearch,esearchreplace,efindnext 45 | ,esaveas,esave,eload,equit,edrawit,egraphmenu,eshowerror,egold 46 | ,eundeleol,eexitnow,eshell,eedt,efast,ebackline,ebigleft,ebigright}; 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/gui/snapline.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _SNAPLINE_H 23 | #define _SNAPLINE_H 24 | 25 | #include "component.h" 26 | 27 | class SnapLine : public GLEComponent 28 | { 29 | Q_OBJECT 30 | 31 | 32 | public: 33 | enum Points 34 | { 35 | StartPoint, 36 | EndPoint, 37 | Angle 38 | }; 39 | 40 | SnapLine(double resolution, QSize imageSize, QObject *parent = 0); 41 | 42 | bool isEqual(SnapLine sn); 43 | bool isEqual(SnapLine *sn); 44 | 45 | QString getKey(); 46 | 47 | //! Draw the line on the provided painter 48 | void draw(QPainter *p); 49 | //! Return the shortest distance between a given point and the line 50 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 51 | //! Set one of the enumerated points 52 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 53 | 54 | 55 | //! Find points where a line intersects the line 56 | // If vertical = true, m contains 'x' 57 | QList intersections(double qtm, double qtc, bool vertical = false); 58 | QList intersections(QPointF qtp1, double angle); 59 | QList intersections(QPointF qtp1, QPointF qtp2); 60 | 61 | void deactivate(); 62 | bool isActive(); 63 | void activate(); 64 | 65 | private slots: 66 | //! Update the painter path when the resolution or start/end points change 67 | void updateLine(); 68 | 69 | private: 70 | bool active; 71 | bool ready; 72 | 73 | QString key; 74 | 75 | bool hitsRightBorder(QPointF *pt); 76 | bool hitsLeftBorder(QPointF *pt); 77 | bool hitsTopBorder(QPointF *pt); 78 | bool hitsBottomBorder(QPointF *pt); 79 | 80 | }; 81 | 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /src/gle/gprint.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #if defined(NO_CYGWIN) 40 | #include 41 | #endif 42 | 43 | // not needed cuases compile errors on windows 44 | // #if defined(__unix__) || defined(__APPLE__) 45 | // void gprint(const char* arg_list, ...); 46 | // #else 47 | // void gprint(va_list arg_list, ...); 48 | // #endif 49 | 50 | void gprint(const char* arg_list, ...); 51 | void gprint(const std::string& output); 52 | 53 | void g_set_error_column(int col); 54 | void g_set_error_line(int lin); 55 | int g_get_error_line(); 56 | -------------------------------------------------------------------------------- /src/manip/eval.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_EVAL_H 40 | #define INC_EVAL_H 41 | 42 | void eval_setxyd(int x, int y); 43 | void eval_setxy(int x, int y); 44 | void eval(int32 *pcode,int *cp,double *oval,char *ostr,int *otyp); 45 | void debug_polish(int32 *pcode,int *zcp); 46 | char *eval_str(int32 *pcode,int *plen); 47 | void setdstr(char **s,char *in); 48 | 49 | enum {f_plus=61 ,f_minus ,f_abs ,f_atn ,f_cos , f_date ,f_exp ,f_fix 50 | ,f_int ,f_left ,f_len ,f_log ,f_log10 ,f_not 51 | ,f_num ,f_num1 ,f_pos ,f_right ,f_rnd ,f_seg 52 | ,f_sgn ,f_sin ,f_sqr ,f_sqrt ,f_tan ,f_time 53 | ,f_val ,f_cell,f_miss }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/gle/tex.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | enum { tp_parskip=1, tp_char, tp_def, tp_defbegin, 40 | tp_delcode, tp_delimiter, tp_frac, tp_left, 41 | tp_lineskip, tp_mathchar, tp_mathchardef, tp_mathcode, 42 | tp_movexy, tp_nolimits, tp_overbrace, tp_overline, 43 | tp_right, tp_setfont, tp_sethei, tp_sfont, 44 | tp_ssfont, tp_sub, tp_sup, tp_tfont, 45 | tp_underbrace, tp_underline, tp_presave, tp_chardef, 46 | tp_newline, tp_hfill, tp_setstretch, tp_linegap, 47 | tp_rule, tp_accent, tp_tex, tp_accentxy, 48 | tp_unicode, tp_uchr, tp_acccmb, tp_fontenc }; 49 | 50 | void tex_term(); 51 | void decode_utf8_notex(string& sc); 52 | -------------------------------------------------------------------------------- /src/gui/amove.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GLEAMOVE_H 23 | #define _GLEAMOVE_H 24 | 25 | #include "drawingobject.h" 26 | 27 | //! Class describing a line drawing object 28 | class GLEAmove : public GLEDrawingObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | //! Enumeration of the points needed to draw a line 35 | enum Points 36 | { 37 | CentrePoint 38 | }; 39 | 40 | //! Constructor used for initialising variables and connections 41 | GLEAmove(double resolution, QSize imageSize, GLEDrawingArea *area); 42 | 43 | //! Draw the line on the provided painter 44 | void draw(QPainter *p); 45 | //! Return the shortest distance between a given point and the line 46 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 47 | //! Set one of the enumerated points 48 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 49 | void addRelativeOSnaps(QPointF p); 50 | 51 | //! Find points where a line intersects the line 52 | // If vertical = true, m contains 'x' 53 | QList intersections(double qtm, double qtc, bool vertical = false); 54 | QList intersections(QPointF qtp1, double angle); 55 | QList intersections(QPointF qtp1, QPointF qtp2); 56 | QList getTangents(QPointF p); 57 | bool hasTangents(); 58 | QList getPerpendiculars(QPointF p); 59 | bool hasPerpendiculars(); 60 | 61 | //! Is the point inside the object (for a line, always false) 62 | bool isInside(QPointF p); 63 | 64 | void scaleBy(double xratio, double yratio); 65 | void moveBy(QPointF offset); 66 | void rotateBy(double radians); 67 | void createOTracks(); 68 | 69 | private slots: 70 | //! Update the painter path when the resolution or start/end points change 71 | void updateAmove(); 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/gle/b_text.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #include "all.h" 40 | #include "justify.h" 41 | #include "mem_limits.h" 42 | #include "token.h" 43 | #include "core.h" 44 | 45 | #define BEGINDEF extern 46 | #include "begin.h" 47 | 48 | using namespace std; 49 | 50 | #define dbg if ((gle_debug & 32)>0) 51 | extern int gle_debug; 52 | 53 | void begin_text(int *pln,int *pcode, int *cp, double width, int just) { 54 | (*pln)++; 55 | int cjust; 56 | string text, line; 57 | while (begin_line(pln, line)) { 58 | text += line; 59 | text += "\n"; 60 | } 61 | g_get_just(&cjust); 62 | // cout << "line = '" << text << "'" << endl; 63 | text_block(text, width, cjust, just); 64 | } 65 | -------------------------------------------------------------------------------- /src/gui/polararray.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GLEPOLARARRAY_H 23 | #define _GLEPOLARARRAY_H 24 | 25 | #include "drawingobject.h" 26 | 27 | //! Class describing a line drawing object 28 | class GLEPolarArray : public GLEDrawingObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | enum Points 35 | { 36 | SpanAngle, 37 | NumberOfObjects 38 | }; 39 | //! Constructor used for initialising variables and connections 40 | GLEPolarArray(double resolution, QSize imageSize, GLEDrawingArea* area); 41 | 42 | //! Draw the line on the provided painter 43 | void draw(QPainter *p); 44 | //! Return the shortest distance between a given point and the line 45 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 46 | 47 | //! Set one of the enumerated points 48 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 49 | void addRelativeOSnaps(QPointF p); 50 | 51 | void setBaseObject(GLEDrawingObject *obj); 52 | 53 | void createOTracks(); 54 | 55 | //! Find points where a line intersects the line 56 | // If vertical = true, m contains 'x' 57 | QList intersections(double qtm, double qtc, bool vertical = false); 58 | QList intersections(QPointF qtp1, double angle); 59 | QList intersections(QPointF qtp1, QPointF qtp2); 60 | QList getTangents(QPointF p); 61 | bool hasTangents(); 62 | QList getPerpendiculars(QPointF p); 63 | bool hasPerpendiculars(); 64 | 65 | //! Is the point inside the object (for a line, always false) 66 | bool isInside(QPointF p); 67 | 68 | void scaleBy(double xratio, double yratio); 69 | void moveBy(QPointF offset); 70 | void rotateBy(double radians); 71 | 72 | void updateObjects(); 73 | 74 | private: 75 | QList baseObject; 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/manip/cell.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_CELL_H 40 | #define INC_CELL_H 41 | 42 | void data_setsize(int x, int y); 43 | void xdata_setsize(int x, int y,int mx,int my); 44 | void set_cell(int x, int y, double d); 45 | void set_scell(int x, int y, char *s); 46 | void get_cell(int x, int y, double *v); 47 | void get_cellboth(int x, int y, double *v, char **s); 48 | bool cell_greater(int x1,int y1, int x2, int y2); 49 | void copy_cell(int x, int y, int x2, int y2); 50 | void swap_cell(int x, int y, int x2, int y2); 51 | void clear_cell(int x, int y); 52 | void set_size(int x, int y); 53 | void clear_data(); 54 | void trim_data(); 55 | void data_expand(int x, int y); 56 | void set_usefloat(); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/gui/3dviewer.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _3DVIEWER_H 23 | #define _3DVIEWER_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include "mainwindow.h" 29 | 30 | class QGLE3DWidget : public QOpenGLWidget 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | QGLE3DWidget(QWidget *parent = 0, GLEInterface* iface = NULL); 36 | ~QGLE3DWidget(); 37 | 38 | QSize minimumSizeHint() const; 39 | QSize sizeHint() const; 40 | void zoom(double zoom); 41 | void rotate(double angle, bool horiz); 42 | void reference(const GLEPoint3D& p); 43 | void adjustV(double angle); 44 | void perspectiveAngle(double delta); 45 | 46 | protected: 47 | void initializeGL(); 48 | void paintGL(); 49 | void resizeGL(int width, int height); 50 | void mousePressEvent(QMouseEvent *event); 51 | void mouseMoveEvent(QMouseEvent *event); 52 | 53 | private: 54 | GLuint makeObject(); 55 | void normalizeAngle(int *angle); 56 | 57 | double perspAngle; 58 | GLuint object; 59 | QPoint lastPos; 60 | GLEInterface* gleInterface; 61 | GLEProjection proj; 62 | }; 63 | 64 | typedef enum {CTRL_EYE, CTRL_REF, CTRL_VVEC, CTRL_PERSP_ANG} CTRL_CMD; 65 | 66 | class QGLE3DViewer : public QDialog 67 | { 68 | Q_OBJECT 69 | 70 | public: 71 | QGLE3DViewer(QWidget* parent, GLEInterface* iface); 72 | 73 | protected: 74 | //! Called when the user presses a key 75 | void keyPressEvent(QKeyEvent *event); 76 | 77 | private slots: 78 | void ctrlSelectionChanged(int value); 79 | 80 | private: 81 | QSlider *createSlider(); 82 | 83 | QGLE3DWidget *glWidget; 84 | QComboBox *crCtrl; 85 | 86 | CTRL_CMD ctrl; 87 | double zoomStep; 88 | double rotateStep; 89 | double distanceStep; 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /src/gle/token.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INCLUDE_TOKEN 40 | #define INCLUDE_TOKEN 41 | 42 | //typedef struct op_key (*OPKEY)[]; 43 | //typedef char (*(*TOKENS)[]); 44 | //typedef char** TOKENS; 45 | typedef char TOKENS[][TOKEN_WIDTH]; 46 | 47 | 48 | char *find_non_space(char *cp); 49 | char *find_term(char *cp); 50 | void add_tokf(char* pp1,int n,TOKENS tok, int* ntok, char* outbuff, int tj); 51 | void subscript(void); 52 | void token(char *lin,TOKENS tok,int *ntok,char *outbuff); 53 | void token_data(char *lin,TOKENS tk,int *ntok,char *outbuff); 54 | void token_equal(void); 55 | void token_init(void); 56 | void token_norm(void); 57 | void token_space(void); 58 | bool get_on_off(TOKENS tk, int* ct); 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /src/gle/justify.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #define JUST_LEFT 0x100 40 | #define JUST_CENTER 0x110 41 | #define JUST_CENTRE 0x110 42 | #define JUST_RIGHT 0x120 43 | #define JUST_LT 0x02 44 | #define JUST_TL 0x02 45 | #define JUST_CL 0x01 46 | #define JUST_LC 0x01 47 | #define JUST_BL 0x00 48 | #define JUST_LB 0x00 49 | #define JUST_CB 0x10 50 | #define JUST_BC 0x10 51 | #define JUST_RB 0x20 52 | #define JUST_BR 0x20 53 | #define JUST_CR 0x21 54 | #define JUST_RC 0x21 55 | #define JUST_TR 0x22 56 | #define JUST_RT 0x22 57 | #define JUST_TC 0x12 58 | #define JUST_CT 0x12 59 | #define JUST_CC 0x11 60 | #define JUST_C 0x11 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/gui/line.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GLELINE_H 23 | #define _GLELINE_H 24 | 25 | #include "drawingobject.h" 26 | 27 | //! Class describing a line drawing object 28 | class GLELine : public GLEDrawingObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | //! Enumeration of the points needed to draw a line 35 | enum Points 36 | { 37 | StartPoint, 38 | EndPoint 39 | }; 40 | 41 | //! Constructor used for initialising variables and connections 42 | GLELine(double resolution, QSize imageSize, GLEDrawingArea *area); 43 | 44 | //! Draw the line on the provided painter 45 | void draw(QPainter *p); 46 | //! Return the shortest distance between a given point and the line 47 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 48 | //! Set one of the enumerated points 49 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 50 | void addRelativeOSnaps(QPointF p); 51 | 52 | void createOTracks(); 53 | 54 | //! Find points where a line intersects the line 55 | // If vertical = true, m contains 'x' 56 | QList intersections(double qtm, double qtc, bool vertical = false); 57 | QList intersections(QPointF qtp1, double angle); 58 | QList intersections(QPointF qtp1, QPointF qtp2); 59 | QList getTangents(QPointF p); 60 | bool hasTangents(); 61 | QList getPerpendiculars(QPointF p); 62 | bool hasPerpendiculars(); 63 | 64 | //! Is the point inside the object (for a line, always false) 65 | bool isInside(QPointF p); 66 | 67 | int supportedTransformMode(); 68 | void linearTransform(const GLELinearEquation& ex, const GLELinearEquation& ey); 69 | void moveBy(QPointF offset); 70 | void rotateBy(double radians); 71 | 72 | private slots: 73 | //! Update the painter path when the resolution or start/end points change 74 | void updateLine(); 75 | void updateFromProperty(int property); 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/gui/qgle_definitions.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _QGLE_DEF_H 23 | #define _QGLE_DEF_H 24 | 25 | // The version number and application name 26 | #define APP_NAME tr("QGLE") 27 | 28 | // Some application defaults/defines 29 | #define DEFAULT_PORT 6667 30 | #define CM_PER_INCH 2.54 31 | // 32 | // This is the offset (in inches) that is added around the border 33 | // of the drawing by GLE 34 | #define GS_OFFSET (1.0/72.0) 35 | 36 | // The maximum allowable distance between a click point and an object 37 | // to be selected 38 | #define MAX_SELECT_DISTANCE 8.0 39 | 40 | // The length of the AMove cross 41 | #define AMOVE_LENGTH 8 42 | 43 | // The step to zoom in by 44 | #define ZOOM_STEP 1.5 45 | 46 | // The maximum number of decimal places in GLE coordinates 47 | #define GLE_NUMBER_MAX_DP 6 48 | 49 | // The default size for new diagrams 50 | #define DEFAULT_NEW_SIZE 12.0 51 | 52 | // The maximum distance at which to draw OSNAP handles 53 | #define MAX_OSNAP_DRAW_DISTANCE 20.0 54 | 55 | // The maximum distance at which to set the current position to be 56 | // the osnap 57 | #define MAX_OSNAP_DISTANCE 5.0 58 | 59 | // The maximum distance at which to keep snap lines 60 | #define MAX_SNAP_LINE_DISTANCE 10.0 61 | 62 | // Half the size of the OSNAP box 63 | #define OSNAP_BOX_SIZE 3 64 | 65 | // Prevents unused argument warnings 66 | #define UNUSED_ARG(x) (void) x 67 | 68 | // The size of the handles used to resize objects 69 | #define HANDLE_SIZE 3.0 70 | 71 | // The minimum on-screen circle radius 72 | #define MINIMUM_CIRCLE_RADIUS 1e-6 73 | 74 | // The maximum number of iterations to use when finding 75 | // elliptical perpendicular points 76 | #define MAX_ELLIPSE_PERP_ITERATIONS 15 77 | 78 | // The target accuracy (in radians) for elliptical perpendicular 79 | // points 80 | #define ELLIPSE_PERP_ACCURACY 1e-3 81 | 82 | #ifndef M_PI 83 | #define M_PI 3.14159265358979323846 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /src/gle/tokens/Tokenizer.i: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | inline std::ostream& TokenizerLangHashPtr::write(std::ostream &os, int tab) const { 40 | return get()->write(os,tab); 41 | } 42 | inline void TokenizerLangHashPtr::addLangElem(Tokenizer* tokens, TokenizerLangElem* elem) { 43 | GetPtr()->addLangElem(tokens,elem); 44 | } 45 | 46 | inline void TokenizerLangHashPtr::addLangElem(const std::vector& toks, TokenizerLangElem* elem, unsigned int pos) { 47 | GetPtr()->addLangElem(toks,elem,pos); 48 | } 49 | 50 | inline TokenizerLangHashPtr::TokenizerLangHashPtr(TokenizerLangHash* src) 51 | : RefCountPtr(src) {} 52 | 53 | inline TokenizerLangHashPtr::TokenizerLangHashPtr() {} 54 | 55 | inline TokenizerLangHashPtr::TokenizerLangHashPtr(const std::string& name) { 56 | SetPtr(new TokenizerLangHash(name)); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/manip/varargs.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | /* 40 | 41 | As varargs are so difficult to make work, I've put them 42 | in this module by themselves. On a DEC5400 it was necessary 43 | to compile this module using the native C compiler instead of 44 | GCC 45 | 46 | */ 47 | 48 | void fner_do(char *output); 49 | void printmess_do(char *output); 50 | 51 | #include "all.h" 52 | using namespace std; 53 | 54 | void fner(const char* fmt,...) { 55 | va_list args; 56 | char str[1024]; 57 | 58 | va_start(args,fmt); 59 | vsprintf(str, fmt, args); 60 | va_end(args); 61 | fner_do(str); 62 | } 63 | 64 | void printmess(const char* fmt,...) { 65 | va_list args; 66 | char str[1024]; 67 | 68 | va_start(args,fmt); 69 | vsprintf(str, fmt, args); 70 | va_end(args); 71 | printmess_do(str); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/fonts/checkfonts.pl: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # # 3 | # GLE - Graphics Layout Engine # 4 | # # 5 | # Modified BSD License # 6 | # # 7 | # Copyright (C) 2009 GLE. # 8 | # # 9 | # Redistribution and use in source and binary forms, with or without # 10 | # modification, are permitted provided that the following conditions # 11 | # are met: # 12 | # # 13 | # 1. Redistributions of source code must retain the above copyright # 14 | # notice, this list of conditions and the following disclaimer. # 15 | # # 16 | # 2. Redistributions in binary form must reproduce the above # 17 | # copyright notice, this list of conditions and the following # 18 | # disclaimer in the documentation and/or other materials provided with # 19 | # the distribution. # 20 | # # 21 | # 3. The name of the author may not be used to endorse or promote # 22 | # products derived from this software without specific prior written # 23 | # permission. # 24 | # # 25 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR # 26 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # 27 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # 28 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # 29 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # 30 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # 31 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # 32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # 33 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # 34 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # 35 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 36 | # # 37 | ######################################################################## 38 | 39 | $files1 = `/bin/ls *.gle`; 40 | $files2 = `/bin/ls *.afm`; 41 | 42 | $files = "$files1 $files2"; 43 | $files =~ s/\.gle//g; 44 | $files =~ s/\.afm//g; 45 | 46 | @LIST = split(/\s+/, $files); 47 | 48 | foreach $f (@LIST) { 49 | $FONT{$f} = 1; 50 | } 51 | 52 | open(IN, "font.dat") || die "Can't open font.dat"; 53 | while ($line = ) { 54 | chomp($line); 55 | if (!($line =~ /^\s*\!/)) { 56 | if ($line =~ /^([^\s]+)\s/) { 57 | $HAS{$1} = 1; 58 | } 59 | } 60 | } 61 | close(IN); 62 | 63 | foreach $f (sort keys %FONT) { 64 | if ($HAS{$f} != 1) { 65 | print "Missing: $f\n"; 66 | } 67 | } 68 | 69 | @AFM = split(/\s+/, $files2); 70 | 71 | $count = 0; 72 | foreach $afm (@AFM) { 73 | $file = $afm; 74 | $file =~ s/\.afm//g; 75 | if (-f "$file.gle") { 76 | print "$afm [GLE]\n"; 77 | } else { 78 | print "$afm\n"; 79 | } 80 | $count++; 81 | } 82 | 83 | print "Total: $count\n"; 84 | -------------------------------------------------------------------------------- /src/gle/gle-interface/gle-const.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INCLUDE_GLECONST 40 | #define INCLUDE_GLECONST 41 | 42 | #define GLE_DEVICE_NONE -1 43 | #define GLE_DEVICE_EPS 0 44 | #define GLE_DEVICE_PS 1 45 | #define GLE_DEVICE_PDF 2 46 | #define GLE_DEVICE_SVG 3 47 | #define GLE_DEVICE_JPEG 4 48 | #define GLE_DEVICE_PNG 5 49 | #define GLE_DEVICE_X11 6 50 | #define GLE_DEVICE_EMF 7 51 | #define GLE_DEVICE_DUMMY 8 52 | #define GLE_DEVICE_CAIRO_PDF 9 53 | #define GLE_DEVICE_CAIRO_EPS 10 54 | #define GLE_DEVICE_CAIRO_PS 11 55 | #define GLE_DEVICE_CAIRO_SVG 12 56 | 57 | #define BITMAP_TYPE_USER 0 58 | #define BITMAP_TYPE_TIFF 1 59 | #define BITMAP_TYPE_GIF 2 60 | #define BITMAP_TYPE_PNG 3 61 | #define BITMAP_TYPE_JPEG 4 62 | #define BITMAP_TYPE_UNK 5 63 | 64 | #define CM_PER_INCH 2.54 65 | #define PS_POINTS_PER_INCH 72.0 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/gui/newfile.cpp: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | /******************************************************************** 23 | * newfile.cpp: The class implementation for the new file dialogue. * 24 | ********************************************************************/ 25 | 26 | #include 27 | #include "newfile.h" 28 | #include "qgle_definitions.h" 29 | 30 | NewFileBox::NewFileBox(QWidget *parent) 31 | : QDialog(parent) 32 | { 33 | // Set the window title and size 34 | setWindowTitle(tr("New Diagram")); 35 | resize(150,150); 36 | save = false; 37 | 38 | // A Spin box to set the width of the new drawing 39 | width = new QDoubleSpinBox; 40 | width->setRange(0.0,21.0); 41 | width->setValue(DEFAULT_NEW_SIZE); 42 | // A spin box to set the height of the new drawing 43 | height = new QDoubleSpinBox; 44 | height->setRange(0.0,29.7); 45 | height->setValue(DEFAULT_NEW_SIZE); 46 | 47 | // Create a layout and some push buttons 48 | cancelCmd = new QPushButton(tr("Cancel")); 49 | saveCmd = new QPushButton(tr("Save As")); 50 | okCmd = new QPushButton(tr("OK")); 51 | okCmd->setDefault(true); 52 | connect(cancelCmd, SIGNAL(clicked()), this, SLOT(reject())); 53 | connect(saveCmd, SIGNAL(clicked()), this, SLOT(saveClicked())); 54 | connect(okCmd, SIGNAL(clicked()), this, SLOT(accept())); 55 | 56 | // Layout the dialogue 57 | QVBoxLayout* main = new QVBoxLayout(); 58 | layout = new QGridLayout(); 59 | layout->addWidget(new QLabel("Width (cm):"),0,0,1,1); 60 | layout->addWidget(width,0,1,1,2); 61 | layout->addWidget(new QLabel("Height (cm):"),1,0,1,1); 62 | layout->addWidget(height,1,1,1,2); 63 | main->addLayout(layout); 64 | QHBoxLayout* butt = new QHBoxLayout(); 65 | butt->addStretch(1); 66 | butt->addWidget(cancelCmd); 67 | butt->addWidget(saveCmd); 68 | butt->addWidget(okCmd); 69 | main->addLayout(butt); 70 | setLayout(main); 71 | 72 | } 73 | 74 | // Return the selected sizes 75 | QSizeF NewFileBox::size() 76 | { 77 | return(QSizeF(width->value(), height->value())); 78 | } 79 | 80 | void NewFileBox::saveClicked() 81 | { 82 | save = true; 83 | accept(); 84 | } 85 | -------------------------------------------------------------------------------- /src/gui/circle.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GLECIRCLE_H 23 | #define _GLECIRCLE_H 24 | 25 | #include "drawingobject.h" 26 | 27 | //! Class describing a circle drawing object 28 | class GLECircle : public GLEDrawingObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | //! Enumeration of points used to describe a circle 35 | enum Points 36 | { 37 | CentrePoint, 38 | CircumferencePoint, 39 | Radius 40 | }; 41 | 42 | //! Constructor used for initialising variables and connections 43 | GLECircle(double resolution, QSize imageSize, GLEDrawingArea *area); 44 | 45 | //! Draw the circle on the provided painter 46 | void draw(QPainter *p); 47 | //! Return the shortest distance between a given point and the circle 48 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 49 | //! Set one of the enumerated points 50 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 51 | //! Find points where a line intersects the circle 52 | // If vertical = true, m contains 'x' 53 | QList intersections(double qtm, double qtc, bool vertical = false); 54 | QList intersections(QPointF qtp1, QPointF qtp2); 55 | QList intersections(QPointF qtp1, double angle); 56 | //! Is the point inside the object? 57 | bool isInside(QPointF p); 58 | void addRelativeOSnaps(QPointF p); 59 | 60 | QList getTangents(QPointF p); 61 | bool hasTangents(); 62 | QList getPerpendiculars(QPointF p); 63 | bool hasPerpendiculars(); 64 | void createOTracks(); 65 | 66 | //! Return the circle's bounding rectangle in Qt coordinates 67 | QRectF circleRect(); 68 | 69 | bool findScaleOrigin(const QPointF& pt, QPointF* origin, int handle); 70 | int supportedTransformMode(); 71 | void linearTransform(const GLELinearEquation& ex, const GLELinearEquation& ey); 72 | void moveBy(QPointF offset); 73 | void rotateBy(double radians); 74 | 75 | private slots: 76 | //! Update the painter path when the resolution or start/end points change 77 | void updateCircle(); 78 | void updateFromProperty(int property); 79 | 80 | }; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/fonts/LICENSE-FONTS.txt: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # # 3 | # GLE - Graphics Layout Engine # 4 | # # 5 | # Modified BSD License # 6 | # # 7 | # Copyright (C) 2009 GLE. # 8 | # # 9 | # Redistribution and use in source and binary forms, with or without # 10 | # modification, are permitted provided that the following conditions # 11 | # are met: # 12 | # # 13 | # 1. Redistributions of source code must retain the above copyright # 14 | # notice, this list of conditions and the following disclaimer. # 15 | # # 16 | # 2. Redistributions in binary form must reproduce the above # 17 | # copyright notice, this list of conditions and the following # 18 | # disclaimer in the documentation and/or other materials provided with # 19 | # the distribution. # 20 | # # 21 | # 3. The name of the author may not be used to endorse or promote # 22 | # products derived from this software without specific prior written # 23 | # permission. # 24 | # # 25 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR # 26 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # 27 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # 28 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # 29 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # 30 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # 31 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # 32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # 33 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # 34 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # 35 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 36 | # # 37 | ######################################################################## 38 | 39 | Missing: texcmsl 40 | texcmsl 41 | -> remove this? it has nog GLE file! 42 | 43 | Total: 68 44 | 45 | 1 Marker Font 46 | ------------- 47 | 48 | glemark 49 | 50 | -> License OK: AFM file says: "Gle Markers are free for all". 51 | GLE file is Modified BSD 52 | 53 | 11 TeX Fonts 54 | ------------ 55 | 56 | texcmb texcmex texcmitt texcmmi texcmr texcmss texcmssb texcmssi texcmsy texcmti texcmtt 57 | 58 | -> Created from TeX TFM files 59 | 60 | 18 Plotter Fonts 61 | ---------------- 62 | 63 | plba plcc plcg plci plcr plcs pldr plge plgg plgi plsa plsg plsr plss plsym1 plsym2 plti pltr 64 | 65 | -> HERSHEY font file using SPLITFONT.BAS 66 | 67 | 38 PostScript Fonts 68 | ------------------- 69 | 70 | psagb psagbo psagd psagdo psbd psbdi psbli psc pscb pscbo psco psh pshb pshbo pshc pshcb pshcbo pshcdo pshn pshnb pshnbo pshno psho psncsb psncsbi psncsi psncsr pspb pspbi pspi pspr pssym pstb pstbi psti pstr pszcmi pszd 71 | 72 | -> Copyright (c) 1984 Adobe Systems Incorporated. 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/manip/turbo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #if ( ! ( defined _WIN32 || defined EMXOS2 )) /* a.r. */ 6 | #include "vaxconio.h" 7 | #endif 8 | //#include "int32.h" 9 | #define MANIP 10 | 11 | //#define true (!false) 12 | //#define false 0 13 | #if ( ! ( defined _WIN32 || defined EMXOS2 )) /* a.r. */ 14 | getch() 15 | { 16 | return tt_inkey(); 17 | } 18 | #endif 19 | int32 coreleft(void) 20 | { 21 | return 4000000l; 22 | } 23 | #ifndef _WIN32 /* a.r. */ 24 | strlwr(char *s) 25 | { 26 | char *ss=s; 27 | while (*s!=0) {*s = tolower(*s); s++;} 28 | return ss; 29 | } 30 | #endif 31 | char *strupr(char *s) 32 | { 33 | char *ss=s; 34 | while (*s!=0) {*s = toupper(*s); s++;} 35 | return ss; 36 | } 37 | #if (!(defined _WIN32 || defined EMXOS2 )) /* a.r. */ 38 | unlink(char *filename) 39 | { 40 | delete(filename); 41 | } 42 | 43 | #include 44 | int find_context; 45 | static char wildstr[200]; 46 | static $DESCRIPTOR(str1,""); 47 | static $DESCRIPTOR(str2,""); 48 | static char rfile[200]; 49 | findfirst(char *wild, struct ffblk *ffblk, int zz) 50 | { 51 | int st; 52 | char *s; 53 | strcpy(wildstr,wild); 54 | strcat(wildstr,";"); 55 | str1.dsc$a_pointer = wildstr; str1.dsc$w_length = strlen(wildstr); 56 | str2.dsc$a_pointer = &rfile[0]; str2.dsc$w_length = 132; 57 | st = LIB$FIND_FILE(&str1,&str2,&find_context); 58 | if ((st & 1) != 1) { 59 | st = LIB$FIND_FILE_END(&find_context); 60 | if ((st & 1) != 1) LIB$SIGNAL(st); 61 | return true; 62 | } 63 | ffblk->ff_name = &rfile[0]; rfile[str2.dsc$w_length] = 0; 64 | s = strchr(ffblk->ff_name,' '); 65 | *s = 0; 66 | trim_file(ffblk->ff_name); 67 | return false; 68 | } 69 | findnext(struct ffblk *ffblk) 70 | { 71 | int st; 72 | char *s; 73 | st = LIB$FIND_FILE(&str1,&str2,&find_context); 74 | if ((st & 1) != 1) { 75 | st = LIB$FIND_FILE_END(&find_context); 76 | if ((st & 1) != 1) LIB$SIGNAL(st); 77 | return true; 78 | } 79 | ffblk->ff_name = &rfile[0]; rfile[str2.dsc$w_length] = 0; 80 | s = strchr(ffblk->ff_name,' '); 81 | if (s!=NULL) *s = 0; 82 | trim_file(ffblk->ff_name); 83 | return false; 84 | } 85 | #endif /* _WIN32 + EMXOS2 */ 86 | trim_file(char *s) 87 | { 88 | char *t; 89 | t = strchr(s,']'); 90 | if (t!=NULL) memcpy(s,t+1,strlen(t)); 91 | t = strchr(s,';'); 92 | if (s!=NULL) *t = 0; 93 | } 94 | 95 | #if (defined _WIN32 || defined EMXOS2 ) /* a.r. */ 96 | 97 | char *getsymbol(char *s) 98 | { 99 | static char ss[100]; 100 | ss[0] = 0; 101 | if ( getenv(s) != NULL) strcpy(ss,getenv(s)); 102 | return ss; 103 | } 104 | 105 | #else 106 | 107 | char *getsymbol(char *sym) 108 | { 109 | static char mystr[200],*s; 110 | int r; 111 | short teklen=80; 112 | $DESCRIPTOR(symname,sym); 113 | $DESCRIPTOR(tekval,mystr); 114 | #ifndef MANIP /* who knows ... */ 115 | mystr[0] = 0; 116 | #endif 117 | symname.dsc$w_length = strlen(sym); 118 | tekval.dsc$w_length = 80; 119 | r = lib$get_symbol(&symname,&tekval,&teklen,&1); 120 | mystr[teklen] = 0; 121 | loop1: s = strchr(mystr,'^'); 122 | if (s!=NULL) { 123 | *(s+1) = *(s+1) - 64; 124 | memmove(s,s+1,strlen(s+1)+1); 125 | goto loop1; 126 | } 127 | return mystr; 128 | } 129 | #endif 130 | 131 | -------------------------------------------------------------------------------- /src/manip/mscreen.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_MSCREEN_H 40 | #define INC_MSCREEN_H 41 | 42 | void delay(int i); 43 | void textattr(); 44 | bool abort_key(); 45 | bool kbhit(); 46 | void scr_gets(char *x); 47 | int clreol(); 48 | int cputs(const char *line); 49 | void delline(); 50 | int gotoxy(int x, int y); 51 | void insline(); 52 | void putch(int char_val); 53 | int scr_manip_refresh(); 54 | int scr_getch(); 55 | int scr_end(); 56 | void textbackground(int color_num); 57 | void textcolor(int colornum); 58 | int gettextinfo(struct text_info *r); 59 | void screen_save(); 60 | int screen_restore(); 61 | int w_message(char *s); 62 | int window(int left,int top, int right, int bottom); 63 | int clrscr(); 64 | void scr_dots(int i); 65 | int scr_left(int i); 66 | int scr_right(int i); 67 | int scr_savexy(); 68 | int scr_restorexy(); 69 | int scr_norm(); 70 | int scr_inv(); 71 | int scr_grey(); 72 | int scr_isblackwhite(); 73 | void scr_menubg(); 74 | void scr_menuval(); 75 | void scr_menuhi(); 76 | int vax_edt(char *s); 77 | void manip_scr_init(char * dummy); 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # -- qgle requires Qt6 3 | # 4 | set(CMAKE_AUTOMOC ON) 5 | set(CMAKE_AUTORCC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | find_package(Qt6 COMPONENTS 9 | Core 10 | Widgets 11 | Network 12 | Gui 13 | OpenGL 14 | OpenGLWidgets 15 | REQUIRED) 16 | 17 | if (WIN32) 18 | add_compile_definitions(_HAS_STD_BYTE=1) 19 | add_compile_options(/FS) 20 | endif() 21 | 22 | add_executable(qgle WIN32 MACOSX_BUNDLE 23 | about.cpp 24 | 3dviewer.cpp 25 | amove.cpp 26 | arc.cpp 27 | circle.cpp 28 | colourbutton.cpp 29 | colourpicker.cpp 30 | component.cpp 31 | consolewindow.cpp 32 | dialogues.cpp 33 | # downloader.cpp 34 | drawingobject.cpp 35 | ellipse.cpp 36 | fileinfo.cpp 37 | gledrawing.cpp 38 | grid.cpp 39 | line.cpp 40 | main.cpp 41 | mainwindow.cpp 42 | newfile.cpp 43 | objectblocks.cpp 44 | polararray.cpp 45 | propertyeditor.cpp 46 | propertymodel.cpp 47 | qgle_statics.cpp 48 | qgs.cpp 49 | qgslibloader.cpp 50 | serverthread.cpp 51 | settings.cpp 52 | settings_dialogue.cpp 53 | snapline.cpp 54 | text.cpp 55 | variantdelegate.cpp 56 | $<$:macspecific.cpp> 57 | qgle.qrc 58 | $<$:qgle.rc> 59 | ) 60 | if(EXTRA_GSLIB_SEARCH_LOCATION) 61 | target_compile_definitions(qgslibloader.cpp -DEXTRA_GSLIB_SEARCH_LOCATION="${EXTRA_GSLIB_SEARCH_LOCATION}") 62 | endif() 63 | # 64 | # - care must be taken with library order for Linux 65 | # 66 | # order matters: first static files (and libgle), then dynamic libraries 67 | list(APPEND QGLE_LIBRARIES 68 | gle-graphics_s 69 | ${ZLIB_LIBRARIES} 70 | ${PNG_LIBRARIES} 71 | ${PIXMAN_LIBRARIES} 72 | ) 73 | if(UNIX OR APPLE) 74 | # these come in QT on windows 75 | list(APPEND QGLE_LIBRARIES 76 | ${JPEG_LIBRARIES} 77 | TIFF::TIFF 78 | ) 79 | endif() 80 | 81 | list(APPEND QGLE_LIBRARIES 82 | Qt::Core 83 | Qt::Gui 84 | Qt::Network 85 | Qt::Widgets 86 | Qt::OpenGL 87 | Qt::OpenGLWidgets 88 | ${CAIRO_LIBRARIES} 89 | ${CMAKE_DL_LIBS} 90 | ) 91 | 92 | if(UNIX AND NOT APPLE) 93 | list(APPEND QGLE_LIBRARIES 94 | glut 95 | GLU 96 | GL 97 | ) 98 | endif() 99 | if(WIN32) 100 | list(APPEND QGLE_LIBRARIES 101 | msimg32.lib 102 | opengl32.lib 103 | glu32.lib 104 | ) 105 | endif() 106 | if(ZSTD_FOUND) 107 | list(APPEND QGLE_LIBRARIES 108 | zstd::libzstd_static 109 | ) 110 | endif() 111 | 112 | if(DEFLATE_FOUND) 113 | list(APPEND QGLE_LIBRARIES 114 | ${DEFLATE_LIBRARIES} 115 | ) 116 | endif() 117 | 118 | if(JBIG_FOUND) 119 | list(APPEND QGLE_LIBRARIES 120 | JBIG::JBIG 121 | ) 122 | endif() 123 | 124 | if(LibLZMA_FOUND) 125 | list(APPEND QGLE_LIBRARIES 126 | ${LIBLZMA_LIBRARIES} 127 | ) 128 | endif() 129 | 130 | if(POPPLER_FOUND) 131 | list(APPEND QGLE_LIBRARIES 132 | ${POPPLER_LIBRARIES_GLE} 133 | ) 134 | endif() 135 | 136 | target_link_libraries ( qgle LINK_PUBLIC 137 | ${QGLE_LIBRARIES} 138 | ) 139 | 140 | if(UNIX AND NOT APPLE) 141 | #target_link_options(qgle PUBLIC -no-pie) 142 | qt_import_plugins( qgle 143 | INCLUDE_BY_TYPE platforms 144 | ) 145 | endif() 146 | 147 | if(APPLE) 148 | #openGL is deprecated on macOS starting at 10.9; this silences the warning 149 | add_compile_definitions(Q_OS_APPLE) 150 | add_compile_options(-Wno-deprecated-declarations) 151 | target_link_libraries ( qgle LINK_PUBLIC 152 | lzma 153 | "-framework AppKit" 154 | "-framework GSS" 155 | "-framework IOKit" 156 | "-framework Security" 157 | "-framework Cocoa" 158 | "-framework OpenGL" 159 | "-framework SystemConfiguration" 160 | "-framework Carbon" 161 | ) 162 | endif() 163 | set_target_properties(qgle PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 164 | 165 | install(TARGETS qgle 166 | CONFIGURATIONS Release Debug 167 | RUNTIME 168 | BUNDLE DESTINATION bin # setting this to Applications causes problems with cpack 169 | ) 170 | -------------------------------------------------------------------------------- /src/gle/gle-block.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "basicconf.h" 3 | #include "cutils.h" 4 | #include "gle-block.h" 5 | #include "tokens/Tokenizer.h" 6 | #include "gle-interface/gle-interface.h" 7 | 8 | using namespace std; 9 | 10 | void GLEParserInitTokenizer(Tokenizer* tokens); 11 | 12 | GLEBlockInstance::GLEBlockInstance(GLEBlockBase* parent): 13 | m_parent(parent) 14 | { 15 | } 16 | 17 | GLEBlockInstance::~GLEBlockInstance() { 18 | } 19 | 20 | GLEBlockBase* GLEBlockInstance::getParent() { 21 | return m_parent; 22 | } 23 | 24 | GLEBlockBase::GLEBlockBase(const std::string& blockName, 25 | bool allowRecursiveBlocks): 26 | m_blockName(blockName), 27 | m_allowRecursiveBlocks(allowRecursiveBlocks) 28 | { 29 | } 30 | 31 | GLEBlockBase::~GLEBlockBase() { 32 | for (std::vector::iterator i(m_blockStack.begin()); i != m_blockStack.end(); ++i) { 33 | delete *i; 34 | } 35 | } 36 | 37 | void GLEBlockBase::beginExecuteBlock(GLESourceLine& sline, int *pcode, int *cp) { 38 | if (!allowRecursiveBlocks() && !m_blockStack.empty()) { 39 | g_throw_parser_error("recursive calls to '", getBlockName().c_str(), "' blocks not allowed"); 40 | } 41 | GLEBlockInstance* block = beginExecuteBlockImpl(sline, pcode, cp); 42 | m_blockStack.push_back(block); 43 | } 44 | 45 | void GLEBlockBase::executeLine(GLESourceLine& sline) { 46 | if (m_blockStack.empty()) { 47 | g_throw_parser_error("not in block '", getBlockName().c_str(), "'"); 48 | } else { 49 | m_blockStack.back()->executeLine(sline); 50 | } 51 | } 52 | 53 | void GLEBlockBase::endExecuteBlock() { 54 | if (m_blockStack.empty()) { 55 | g_throw_parser_error("not in block '", getBlockName().c_str(), "'"); 56 | } else { 57 | GLEBlockInstance* block = m_blockStack.back(); 58 | block->endExecuteBlock(); 59 | delete block; 60 | m_blockStack.pop_back(); 61 | } 62 | } 63 | 64 | bool GLEBlockBase::allowRecursiveBlocks() const { 65 | return m_allowRecursiveBlocks; 66 | } 67 | 68 | const std::string GLEBlockBase::getBlockName() const { 69 | return m_blockName; 70 | } 71 | 72 | GLEBlockWithSimpleKeywords::GLEBlockWithSimpleKeywords(const std::string& blockName, bool allowRecursiveBlocks): 73 | GLEBlockBase(blockName, allowRecursiveBlocks) 74 | { 75 | } 76 | 77 | GLEBlockWithSimpleKeywords::~GLEBlockWithSimpleKeywords() { 78 | } 79 | 80 | bool GLEBlockWithSimpleKeywords::checkLine(GLESourceLine& sline) { 81 | StringTokenizer tokens(sline.getCodeCStr()); 82 | GLEParserInitTokenizer(&tokens); 83 | if (tokens.has_more_tokens()) { 84 | const std::string token = tokens.next_token(); 85 | return m_keyWords.find(token) != m_keyWords.end(); 86 | } else { 87 | return false; 88 | } 89 | } 90 | 91 | void GLEBlockWithSimpleKeywords::addKeyWord(const char* keyword) { 92 | m_keyWords.insert(keyword); 93 | } 94 | 95 | void GLEBlockWithSimpleKeywords::addKeyWord(const std::string& keyword) { 96 | m_keyWords.insert(keyword); 97 | } 98 | 99 | GLEBlocks::GLEBlocks() { 100 | } 101 | 102 | GLEBlocks::~GLEBlocks() { 103 | for (std::map::iterator i(m_blocks.begin()); i != m_blocks.end(); ++i) { 104 | delete i->second; 105 | } 106 | } 107 | 108 | void GLEBlocks::addBlock(int blockType, GLEBlockBase* block) { 109 | std::map::iterator i(m_blocks.find(blockType)); 110 | CUtilsAssert(i == m_blocks.end()); 111 | m_blocks.insert(std::make_pair(blockType, block)); 112 | } 113 | 114 | GLEBlockBase* GLEBlocks::getBlock(int blockType) { 115 | std::map::iterator i(m_blocks.find(blockType)); 116 | CUtilsAssert(i != m_blocks.end()); 117 | return i->second; 118 | } 119 | 120 | GLEBlockBase* GLEBlocks::getBlockIfExists(int blockType) { 121 | std::map::iterator i(m_blocks.find(blockType)); 122 | if (i != m_blocks.end()) { 123 | return i->second; 124 | } else { 125 | return 0; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/gle/all.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INCLUDE_ALL 40 | #define INCLUDE_ALL 41 | 42 | #include "basicconf.h" 43 | #include "gle-interface/gle-base.h" 44 | 45 | #include 46 | #include 47 | 48 | #ifdef M_PI 49 | #define GLE_PI M_PI 50 | #else 51 | #define GLE_PI 3.14159265358979323846 52 | #endif 53 | // 54 | // -- define these constants for use in scripts 55 | // 56 | 57 | #if ( defined(__unix__) || defined(__APPLE__) ) && defined(HAVE_X11) 58 | #define ENABLE_GS_PREVIEW 59 | #endif 60 | 61 | // 62 | // -- containers 63 | // 64 | typedef std::vector< std::vector > _GlobalPCode; 65 | typedef std::vector< std::vector >::iterator _itGlobalPCode; 66 | typedef std::vector< std::vector >::const_iterator _citGlobalPCode; 67 | 68 | typedef std::vector _PCode; 69 | typedef std::vector::iterator _itPCode; 70 | typedef std::vector::const_iterator _citPCode; 71 | 72 | typedef std::vector _Tokens; 73 | typedef std::vector::iterator _itTokens; 74 | typedef std::vector::const_iterator _citTokens; 75 | 76 | #include "glepro.h" 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/manip/manip.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * * 3 | * GLE - Graphics Layout Engine * 4 | * * 5 | * Modified BSD License * 6 | * * 7 | * Copyright (C) 2009 GLE. * 8 | * * 9 | * Redistribution and use in source and binary forms, with or without * 10 | * modification, are permitted provided that the following conditions * 11 | * are met: * 12 | * * 13 | * 1. Redistributions of source code must retain the above copyright * 14 | * notice, this list of conditions and the following disclaimer. * 15 | * * 16 | * 2. Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the following * 18 | * disclaimer in the documentation and/or other materials provided with * 19 | * the distribution. * 20 | * * 21 | * 3. The name of the author may not be used to endorse or promote * 22 | * products derived from this software without specific prior written * 23 | * permission. * 24 | * * 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR * 26 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * 33 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * 35 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | * * 37 | ************************************************************************/ 38 | 39 | #ifndef INC_MANIP_H 40 | #define INC_MANIP_H 41 | 42 | void top_line(); 43 | void set_newxy(int x, int y); 44 | void window_norm(); 45 | void window_exit(); 46 | void set_colwidth(int n); 47 | void set_ncol(int n); 48 | void gle_abort(char *s); 49 | bool text_changed(); 50 | void text_save(void); 51 | void command_scroll_up(); 52 | int read_command(int *cmd,char *ans,char *ques); 53 | void fner_clear(void); 54 | void fnerx(char *s); 55 | void fnerxx(char *s); 56 | 57 | #if defined(NO_CYGWIN) 58 | #include 59 | #endif 60 | 61 | #if defined(__unix__) || defined(__APPLE__) || defined(_WIN32) || ( defined(__OS2__) && defined(__EMX__) ) 62 | void fner(const char* arg_list, ...); 63 | void printmess(const char* arg_list, ...); 64 | void wprintf(const char* arg_list, ...); 65 | #else 66 | void fner(va_list arg_list, ...); 67 | void printmess(va_list arg_list, ...); 68 | void wprintf(va_list arg_list, ...); 69 | #endif 70 | 71 | #ifdef _WIN32 72 | #define DLLEXPORT __declspec( dllexport ) 73 | #define DLLIMPORT __declspec( dllimport ) 74 | #else 75 | #define DLLEXPORT 76 | #define DLLIMPORT 77 | #endif 78 | 79 | #endif -------------------------------------------------------------------------------- /src/gui/ellipse.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * QGLE - A Graphical Interface to GLE * 3 | * Copyright (C) 2006 A. S. Budden & J. Struyf * 4 | * * 5 | * This program is free software; you can redistribute it and/or * 6 | * modify it under the terms of the GNU General Public License * 7 | * as published by the Free Software Foundation; either version 2 * 8 | * of the License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the Free Software * 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 18 | * * 19 | * Also add information on how to contact you by electronic and paper mail. * 20 | ***********************************************************************************/ 21 | 22 | #ifndef _GLEELLIPSE_H 23 | #define _GLEELLIPSE_H 24 | 25 | #include "drawingobject.h" 26 | 27 | //! Class describing a ellipse drawing object 28 | class GLEEllipse : public GLEDrawingObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | //! Enumeration of points used to describe a ellipse 35 | enum Points 36 | { 37 | 38 | CentrePoint, 39 | RadiusX, 40 | RadiusY, 41 | Angle, // RADIANS! 42 | BBoxCorner, // Used to automatically choose the corner 43 | BBoxCornerA, // These ignore the angle! 44 | BBoxCornerB 45 | }; 46 | 47 | //! Constructor used for initialising variables and connections 48 | GLEEllipse(double resolution, QSize imageSize, GLEDrawingArea *area); 49 | 50 | //! Draw the ellipse on the provided painter 51 | void draw(QPainter *p); 52 | //! Return the shortest distance between a given point and the ellipse 53 | double distanceToPoint(const QPointF& p, QPointF *nearestPoint); 54 | //! Set one of the enumerated points 55 | void setPoint(int pointChoice, const QPointF& p, bool update = true); 56 | //! Find points where a line intersects the ellipse 57 | // If vertical = true, m contains 'x' 58 | QList intersections(double qtm, double qtc, bool vertical = false); 59 | QList intersections(QPointF qtp1, QPointF qtp2); 60 | QList intersections(QPointF qtp1, double angle); 61 | //! Is the point inside the object? 62 | bool isInside(QPointF p); 63 | void addRelativeOSnaps(QPointF p); 64 | 65 | QList getTangents(QPointF p); 66 | bool hasTangents(); 67 | QList getPerpendiculars(QPointF p); 68 | bool hasPerpendiculars(); 69 | void createOTracks(); 70 | 71 | //! Return the ellipse's bounding rectangle in Qt coordinates 72 | QRectF ellipseRect(); 73 | 74 | int supportedTransformMode(); 75 | void linearTransform(const GLELinearEquation& ex, const GLELinearEquation& ey); 76 | void moveBy(QPointF offset); 77 | void rotateBy(double radians); 78 | 79 | private: 80 | void updateBBox(); 81 | void updateFromBBox(); 82 | void updateEquationParameters(); 83 | 84 | private slots: 85 | //! Update the painter path when the resolution or start/end points change 86 | void updateEllipse(); 87 | void updateFromProperty(int property); 88 | }; 89 | 90 | #endif 91 | --------------------------------------------------------------------------------