├── docs ├── cpml │ ├── cpml.types │ ├── cpml.hierarchy.fake │ ├── .gitignore │ ├── bookinfo.xml.in │ ├── meson.build │ ├── Makefile.am │ └── cpml-docs.xml ├── Makefile.am ├── adg │ ├── .gitignore │ ├── bookinfo.xml.in │ ├── meson.build │ └── Makefile.am └── docbook2txt.xsl ├── AUTHORS ├── demo ├── adg.ico ├── .gitignore ├── icons │ ├── adg-128.png │ ├── adg-16.png │ ├── adg-32.png │ ├── adg-48.png │ ├── adg-64.png │ ├── adg-arc.png │ ├── adg-curve.png │ ├── adg-browsing.png │ ├── adg-segment.png │ └── adg-intersection.png ├── adg-glade.in ├── meson.build ├── adg.manifest ├── adg.rc ├── demo.h └── Makefile.am ├── src ├── .gitignore ├── cpml │ ├── .gitignore │ ├── tests │ │ ├── .gitignore │ │ ├── meson.build │ │ ├── Makefile.am │ │ └── test-utils.c │ ├── cpml-1.pc.in │ ├── cpml-internal.h │ ├── cpml-utils.h │ ├── cpml-arc.h │ ├── cpml-utils.c │ ├── cpml-curve.h │ ├── cpml-gobject.h │ ├── meson.build │ ├── cpml-extents.h │ └── Makefile.am ├── adg │ ├── adg-marshal.genmarshal │ ├── .gitignore │ ├── adg-1.pc.in │ ├── adg-type-builtins.h.mkenums │ ├── tests │ │ ├── .gitignore │ │ ├── test-type-builtins.c │ │ ├── test-style.c │ │ ├── meson.build │ │ └── test-textual.c │ ├── adg-type-builtins.c.mkenums │ ├── adg-dash-private.h │ ├── adg-arrow-private.h │ ├── adg-hatch-private.h │ ├── adg-container-private.h │ ├── adg-dress-private.h │ ├── adg-stroke-private.h │ ├── adg-alignment-private.h │ ├── adg-fill-style-private.h │ ├── adg-ruled-fill-private.h │ ├── adg-pango-style-private.h │ ├── adg-color-style-private.h │ ├── adg-text-private.h │ ├── adg-marker-private.h │ ├── adg-toy-text-private.h │ ├── adg-edges-private.h │ ├── adg-trail-private.h │ ├── adg-gtk-layout-private.h │ ├── adg-logo-private.h │ ├── adg-title-block-private.h │ ├── adg-model-private.h │ ├── adg-gtk-area-private.h │ ├── adg-line-style-private.h │ ├── adg-table-style-private.h │ ├── adg-projection-private.h │ ├── adg-table-private.h │ ├── adg-canvas-private.h │ ├── adg-forward-declarations.h │ ├── adg-font-style-private.h │ ├── adg-entity-private.h │ ├── adg-param-dress.h │ ├── adg-gtk-utils.h │ ├── adg-rdim-private.h │ ├── adg-matrix.h │ ├── adg-path-private.h │ ├── adg-text.h │ ├── adg-dress.h │ ├── adg-toy-text.h │ ├── adg-dim-style-private.h │ ├── adg-dim-private.h │ ├── adg-hatch.h │ ├── adg-adim-private.h │ ├── adg-arrow.h │ ├── adg-cairo-fallback.c │ ├── adg-cairo-fallback.h │ ├── adg-pango-style.h │ ├── adg-stroke.h │ ├── adg-ldim-private.h │ ├── adg-gtk-layout.h │ ├── adg-text-internal.h │ ├── adg-logo.h │ ├── adg-point.h │ ├── adg-style.h │ ├── adg-edges.h │ ├── adg-fill-style.h │ ├── adg-table-row.h │ ├── adg-alignment.h │ └── adg-ruled-fill.h ├── Makefile.am ├── tests │ ├── meson.build │ └── Makefile.am ├── adg.xml ├── cpml.h ├── config.h.meson ├── adg.h.in └── meson.build ├── autotools ├── adg.ico ├── adg-header.bmp ├── adg-welcome.bmp ├── gschemas.compiled ├── settings.ini ├── minitheme-snapshot.tar.bz2 ├── hicolor-snapshot-0.11.tar.bz2 ├── Makefile.am.common ├── Custom.nsh.in ├── .gitignore ├── ntd.m4 ├── Locale.nsh ├── build-win └── Translations.nsh ├── artwork ├── adg-logo.xcf ├── adg-header.xcf └── adg-welcome.xcf ├── nodist ├── adg.xcf.bz2 ├── .gitignore ├── copyright ├── adg.mp ├── Dockerfile ├── Makefile ├── pre-commit └── overview.tex ├── po ├── POTFILES.skip ├── meson.build ├── .gitignore ├── LINGUAS ├── POTFILES.in └── ChangeLog ├── THANKS ├── .gitignore ├── meson_options.txt ├── .travis.yml ├── autogen.sh └── adg.doap /docs/cpml/cpml.types: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Nicola Fontana 2 | -------------------------------------------------------------------------------- /demo/adg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/adg.ico -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | /adg.h 2 | /config.h.in 3 | /config.h 4 | /stamp-h* 5 | -------------------------------------------------------------------------------- /autotools/adg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/adg.ico -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /adg-demo 2 | /adg-demo.ui 3 | /adg-glade 4 | /cpml-demo 5 | -------------------------------------------------------------------------------- /src/cpml/.gitignore: -------------------------------------------------------------------------------- 1 | /Cpml-1.0.gir 2 | /Cpml-1.0.typelib 3 | /cpml-1.pc 4 | -------------------------------------------------------------------------------- /artwork/adg-logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/artwork/adg-logo.xcf -------------------------------------------------------------------------------- /nodist/adg.xcf.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/nodist/adg.xcf.bz2 -------------------------------------------------------------------------------- /artwork/adg-header.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/artwork/adg-header.xcf -------------------------------------------------------------------------------- /demo/icons/adg-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-128.png -------------------------------------------------------------------------------- /demo/icons/adg-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-16.png -------------------------------------------------------------------------------- /demo/icons/adg-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-32.png -------------------------------------------------------------------------------- /demo/icons/adg-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-48.png -------------------------------------------------------------------------------- /demo/icons/adg-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-64.png -------------------------------------------------------------------------------- /demo/icons/adg-arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-arc.png -------------------------------------------------------------------------------- /artwork/adg-welcome.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/artwork/adg-welcome.xcf -------------------------------------------------------------------------------- /autotools/adg-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/adg-header.bmp -------------------------------------------------------------------------------- /autotools/adg-welcome.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/adg-welcome.bmp -------------------------------------------------------------------------------- /demo/icons/adg-curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-curve.png -------------------------------------------------------------------------------- /autotools/gschemas.compiled: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/gschemas.compiled -------------------------------------------------------------------------------- /demo/icons/adg-browsing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-browsing.png -------------------------------------------------------------------------------- /demo/icons/adg-segment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-segment.png -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | demo/adg-demo.ui 2 | demo/cpml-demo.ui 3 | demo/cpml-demo-gtk2.c 4 | _build/ 5 | -------------------------------------------------------------------------------- /src/adg/adg-marshal.genmarshal: -------------------------------------------------------------------------------- 1 | VOID:STRING,POINTER 2 | VOID:OBJECT,POINTER 3 | VOID:OBJECT,OBJECT 4 | -------------------------------------------------------------------------------- /autotools/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-icon-theme-name = MiniTheme 3 | gtk-font-name = Segoe UI 9 4 | -------------------------------------------------------------------------------- /demo/icons/adg-intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/demo/icons/adg-intersection.png -------------------------------------------------------------------------------- /autotools/minitheme-snapshot.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/minitheme-snapshot.tar.bz2 -------------------------------------------------------------------------------- /autotools/hicolor-snapshot-0.11.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntd/adg/HEAD/autotools/hicolor-snapshot-0.11.tar.bz2 -------------------------------------------------------------------------------- /docs/cpml/cpml.hierarchy.fake: -------------------------------------------------------------------------------- 1 | struct 2 | CpmlPair 3 | CpmlExtents 4 | CpmlSegment 5 | CpmlPrimitive 6 | CpmlArc 7 | CpmlCurve 8 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | SUBDIRS= cpml \ 4 | adg 5 | 6 | EXTRA_DIST= docbook2txt.xsl 7 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | preset: 'glib', 3 | args: [ '--default-domain=' + meson.project_name() ] 4 | ) 5 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | Andrey Ponomarenko 2 | For providing automatic API sanity check between releases: 3 | https://abi-laboratory.pro/index.php?view=timeline&l=adg 4 | -------------------------------------------------------------------------------- /src/cpml/tests/.gitignore: -------------------------------------------------------------------------------- 1 | /test-arc 2 | /test-curve 3 | /test-extents 4 | /test-gobject 5 | /test-pair 6 | /test-primitive 7 | /test-segment 8 | /test-utils 9 | -------------------------------------------------------------------------------- /demo/adg-glade.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | GLADE_CATALOG_PATH=@abs_src_builddir@/src/ \ 4 | GLADE_MODULE_PATH=@abs_top_builddir@/src/adg-gtk/.libs/ \ 5 | @GLADE3@ $@ 6 | -------------------------------------------------------------------------------- /src/adg/.gitignore: -------------------------------------------------------------------------------- 1 | /Adg-1.0.gir 2 | /Adg-1.0.typelib 3 | /adg-1.pc 4 | /adg-canvas.h 5 | /adg-marshal.c 6 | /adg-marshal.h 7 | /adg-type-builtins.c 8 | /adg-type-builtins.h 9 | -------------------------------------------------------------------------------- /nodist/.gitignore: -------------------------------------------------------------------------------- 1 | /adg.0 2 | /adg.log 3 | /baioca.pdf 4 | /desktop.png 5 | /handcraft.pdf 6 | /overview.pdf 7 | /saiot.pdf 8 | /web.png 9 | *.aux 10 | *.fdb_latexmk 11 | *.fls 12 | *.log 13 | *.mps 14 | -------------------------------------------------------------------------------- /po/.gitignore: -------------------------------------------------------------------------------- 1 | /*.gmo 2 | /*.mo 3 | /*.pot 4 | /Makevars.template 5 | /Rules-quot 6 | /boldquot.sed 7 | /en@boldquot.header 8 | /en@quot.header 9 | /insert-header.sin 10 | /Makefile.in.in 11 | /POTFILES 12 | /quot.sed 13 | /remove-potcdate.sed 14 | /remove-potcdate.sin 15 | /stamp-* 16 | -------------------------------------------------------------------------------- /autotools/Makefile.am.common: -------------------------------------------------------------------------------- 1 | srcdir=@srcdir@ 2 | abs_srcdir=@abs_srcdir@ 3 | top_srcdir=@top_srcdir@ 4 | abs_top_srcdir=@abs_top_srcdir@ 5 | builddir=@builddir@ 6 | abs_builddir=@abs_builddir@ 7 | abs_top_builddir=@abs_top_builddir@ 8 | pkgconfigdir=$(libdir)/pkgconfig 9 | 10 | include $(top_srcdir)/autotools/Makefile.am.gtester 11 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # TRANSLATORS: Please note that ADG has both po/ and po-properties/ 2 | # directories. If you add a new language in this file, please make 3 | # sure that both po/ and po-properties/ have .po files that correspond 4 | # to your language. If you only add one to po/, the build will break 5 | # in po-properties/. 6 | # Please keep this list sorted alphabetically. 7 | it 8 | -------------------------------------------------------------------------------- /autotools/Custom.nsh.in: -------------------------------------------------------------------------------- 1 | ; @configure_input@ 2 | 3 | !define PACKAGE_NAME "@PACKAGE@" 4 | !define PACKAGE_VERSION "@PACKAGE_VERSION@" 5 | !define PACKAGE_ARCH "@PACKAGE_ARCH@" 6 | !define SRCDIR "@abs_top_srcdir@" 7 | !define BUILDDIR "@abs_top_builddir@" 8 | !define PREFIX "@HOSTPREFIX@" 9 | !define GIRDIR "@INTROSPECTION_GIRDIR@" 10 | !define TYPELIBDIR "@INTROSPECTION_TYPELIBDIR@" 11 | -------------------------------------------------------------------------------- /docs/cpml/.gitignore: -------------------------------------------------------------------------------- 1 | # ./configure 2 | /bookinfo.xml 3 | 4 | # make 5 | /cpml-decl-list.txt 6 | /cpml-decl.txt 7 | /cpml-overrides.txt 8 | /cpml-sections.txt 9 | /cpml-undeclared.txt 10 | /cpml-undocumented.txt 11 | /cpml-unused.txt 12 | /cpml.actions 13 | /cpml.args 14 | /cpml.hierarchy 15 | /cpml.interfaces 16 | /cpml.prerequisites 17 | /cpml.signals 18 | /html/ 19 | /xml/ 20 | *.bak 21 | -------------------------------------------------------------------------------- /docs/adg/.gitignore: -------------------------------------------------------------------------------- 1 | # ./configure 2 | /bookinfo.xml 3 | 4 | # make 5 | /adg-decl-list.txt 6 | /adg-decl.txt 7 | /adg-overrides.txt 8 | /adg-sections.txt 9 | /adg-undeclared.txt 10 | /adg-undocumented.txt 11 | /adg-unused.txt 12 | /adg.actions 13 | /adg.args 14 | /adg.hierarchy 15 | /adg.interfaces 16 | /adg.prerequisites 17 | /adg.signals 18 | /adg.types 19 | /html/ 20 | /xml/ 21 | *.bak 22 | -------------------------------------------------------------------------------- /src/cpml/tests/meson.build: -------------------------------------------------------------------------------- 1 | cpml_tests = [ 2 | 'test-arc', 3 | 'test-curve', 4 | 'test-extents', 5 | 'test-gobject', 6 | 'test-pair', 7 | 'test-primitive', 8 | 'test-segment', 9 | 'test-utils', 10 | ] 11 | 12 | foreach test: cpml_tests 13 | e = executable(test, 14 | sources: '@0@.c'.format(test), 15 | dependencies: adgtest_dep 16 | ) 17 | test('cpml/' + test, e) 18 | endforeach 19 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | 4 | SUBDIRS= 5 | if HAVE_TEST_FRAMEWORK 6 | SUBDIRS+= tests 7 | endif 8 | SUBDIRS+= cpml \ 9 | adg 10 | 11 | 12 | if HAVE_GLADE 13 | adg_catalogdir= $(GLADE_CATALOGDIR) 14 | adg_catalog_DATA= adg.xml 15 | endif 16 | 17 | libadg_includedir= $(includedir)/adg-1 18 | libadg_include_DATA= adg.h \ 19 | cpml.h 20 | 21 | EXTRA_DIST= adg.h \ 22 | cpml.h \ 23 | adg.xml 24 | -------------------------------------------------------------------------------- /src/cpml/cpml-1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | datarootdir=@datarootdir@ 6 | datadir=@datadir@ 7 | girdir=${datadir}/gir-1.0 8 | typelibdir=${libdir}/girepository-1.0 9 | 10 | Name: CPML 11 | Description: Cairo Path Manipulation Library 12 | Version: @VERSION@ 13 | URL: http://adg.entidi.com 14 | 15 | Requires: @CPML_REQUIRES@ 16 | Libs: -L${libdir} -lcpml-1 17 | Cflags: -I${includedir}/adg-1 18 | -------------------------------------------------------------------------------- /src/adg/adg-1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | datarootdir=@datarootdir@ 6 | datadir=@datadir@ 7 | girdir=${datadir}/gir-1.0 8 | typelibdir=${libdir}/girepository-1.0 9 | 10 | Name: ADG 11 | Description: Automatic Drawing Generation, a GObject based cairo canvas 12 | Version: @VERSION@ 13 | URL: http://adg.entidi.com 14 | 15 | Requires: cpml-1 >= @VERSION@,@ADG_REQUIRES@ 16 | Libs: -L${libdir} -ladg-1 17 | Cflags: 18 | -------------------------------------------------------------------------------- /src/tests/meson.build: -------------------------------------------------------------------------------- 1 | adgtest_sources = files([ 2 | 'adg-test.h', 3 | 'adg-test.c', 4 | ]) 5 | 6 | adgtest_deps = [ 7 | cpml_dep, 8 | adg_dep, 9 | ] 10 | 11 | adgtest = library('adgtest', 12 | sources: adgtest_sources, 13 | dependencies: adgtest_deps, 14 | include_directories: src_directories 15 | ) 16 | 17 | adgtest_dep = declare_dependency( 18 | include_directories: include_directories('.'), 19 | dependencies: adgtest_deps, 20 | link_with: adgtest 21 | ) 22 | -------------------------------------------------------------------------------- /docs/adg/bookinfo.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | @PACKAGE_NAME@ reference manual 6 | 7 | for @PACKAGE_NAME@ @PACKAGE_VERSION@. 8 | The latest version of this document can be browsed online at 9 | @PACKAGE_URL@. 10 | 11 | 12 | -------------------------------------------------------------------------------- /nodist/copyright: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | error() { 4 | [ -n "$1" ] && printf "$1\n" > /dev/stderr 5 | cat < 2 | 4 | 5 | 8 | CPML reference manual 9 | 10 | for CPML @PACKAGE_VERSION@. 11 | The latest version of this document can be browsed online at 12 | @PACKAGE_URL@. 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/meson.build: -------------------------------------------------------------------------------- 1 | demo_cflags = [ 2 | '-DSRCDIR="' + meson.current_source_dir() + '"', 3 | '-DBUILDDIR="' + meson.current_build_dir() + '"', 4 | '-DPKGDATADIR="' + pkgdatadir + '"' 5 | ] 6 | 7 | cpml_demo = executable('cpml-demo', 8 | sources: [ 'cpml-demo.c', 'demo.c', 'demo.h' ], 9 | dependencies: adg_dep, 10 | c_args: demo_cflags, 11 | install: true 12 | ) 13 | 14 | adg_demo = executable('adg-demo', 15 | sources: [ 'adg-demo.c', 'demo.c', 'demo.h' ], 16 | dependencies: adg_dep, 17 | c_args: demo_cflags, 18 | install: true 19 | ) 20 | 21 | adg_demo_ui = configure_file( 22 | input: 'adg-demo.ui.in', 23 | output: '@BASENAME@', 24 | configuration: data, 25 | install_dir: pkgdatadir 26 | ) 27 | -------------------------------------------------------------------------------- /src/adg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/adg/tests/.gitignore: -------------------------------------------------------------------------------- 1 | /test-adim 2 | /test-alignment 3 | /test-arrow 4 | /test-canvas 5 | /test-color-style 6 | /test-container 7 | /test-dash 8 | /test-dim 9 | /test-dim-style 10 | /test-dress 11 | /test-edges 12 | /test-entity 13 | /test-fill-style 14 | /test-font-style 15 | /test-gtk-area 16 | /test-gtk-layout 17 | /test-gtk-utils 18 | /test-hatch 19 | /test-ldim 20 | /test-line-style 21 | /test-logo 22 | /test-marker 23 | /test-matrix 24 | /test-model 25 | /test-param-dress 26 | /test-pango-style 27 | /test-path 28 | /test-point 29 | /test-projection 30 | /test-rdim 31 | /test-ruled-fill 32 | /test-stroke 33 | /test-style 34 | /test-table 35 | /test-table-cell 36 | /test-table-row 37 | /test-table-style 38 | /test-text 39 | /test-textual 40 | /test-title-block 41 | /test-toy-text 42 | /test-trail 43 | /test-type-builtins 44 | /test-utils 45 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('pango', type: 'feature', 2 | description: 'Use pango for text rendering') 3 | 4 | option('gtk', type: 'combo', value: 'auto', 5 | choices: [ 'gtk2', 'gtk3', 'auto', 'no' ], 6 | description: 'Include GTK specific widgets') 7 | 8 | option('catalogdir', type: 'string', value: 'check', 9 | description: 'Where to install the glade catalogs (check,yes,no,/specific/path)') 10 | 11 | option('gtk-doc', type: 'feature', 12 | description: 'Build API reference with gtk-doc') 13 | 14 | option('gtkdocdir', type: 'string', value: '', 15 | description: 'Where to install gtk-doc html') 16 | 17 | option('introspection', type: 'feature', 18 | description: 'Enable introspection for this build') 19 | 20 | option('tests', type: 'feature', 21 | description: 'Enable GLib test framework') 22 | -------------------------------------------------------------------------------- /src/adg/adg-type-builtins.c.mkenums: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #include 3 | 4 | 5 | /*** END file-header ***/ 6 | /*** BEGIN file-production ***/ 7 | /* Enumerations from "@filename@" */ 8 | /*** END file-production ***/ 9 | /*** BEGIN value-header ***/ 10 | GType 11 | @enum_name@_get_type(void) 12 | { 13 | static GType etype = 0; 14 | if (G_UNLIKELY(etype == 0)) { 15 | static const G@Type@Value values[] = { 16 | /*** END value-header ***/ 17 | /*** BEGIN value-production ***/ 18 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 19 | /*** END value-production ***/ 20 | /*** BEGIN value-tail ***/ 21 | { 0, NULL, NULL } 22 | }; 23 | 24 | etype = g_@type@_register_static("@EnumName@", values); 25 | } 26 | 27 | return etype; 28 | } 29 | 30 | /*** END value-tail ***/ 31 | -------------------------------------------------------------------------------- /docs/cpml/meson.build: -------------------------------------------------------------------------------- 1 | bookinfo_xml = configure_file( 2 | input: 'bookinfo.xml.in', 3 | output: '@BASENAME@', 4 | configuration: data 5 | ) 6 | 7 | cpml_fixxref_args = [ 8 | '--html-dir=' + gtkdocdir, 9 | '--extra-dir=' + join_paths( 10 | cairo_dep.get_variable(pkgconfig: 'prefix'), 11 | 'share', 'gtk-doc', 'html', 'cairo' 12 | ), 13 | ] 14 | 15 | gnome.gtkdoc('cpml', 16 | namespace: 'cpml', 17 | src_dir: cpml_directories, 18 | ignore_headers: cpml_internal_names, 19 | dependencies: cpml_dep, 20 | main_xml: 'cpml-docs.xml', 21 | content_files: bookinfo_xml, 22 | scan_args: [ '--rebuild-sections' ], 23 | mkdb_args: [ '--default-includes=cpml.h' ], 24 | fixxref_args: cpml_fixxref_args, 25 | install_dir: 'cpml-' + metadata['api'] 26 | ) 27 | -------------------------------------------------------------------------------- /nodist/adg.mp: -------------------------------------------------------------------------------- 1 | % ADG logo in MetaPost 2 | 3 | u := 5mm; 4 | r1 := 4u; % Radius for D and G 5 | d1 := (1 - sind(30)) * r1; 6 | r2 := 4u; % Radius of video screen 7 | d2 := (1 - sind(45)) * r2; 8 | 9 | beginfig(0) 10 | 11 | linecap := rounded; 12 | linejoin := rounded; 13 | 14 | drawoptions(withpen pencircle scaled 3/2u); 15 | draw (4u, 6u) -- (12u, 14u) .. (16u, 10u) .. (12u, 6u) -- (12u, 14u); 16 | draw (20u, 10u + r1) .. (20u - r1, 10u) .. (20u, 10u - r1) -- 17 | (20u, 8u) -- (19u, 8u); 18 | draw (12u, 8u) -- (8u, 8u); 19 | 20 | drawoptions(withpen pencircle scaled 4/5u); 21 | draw (2u, 2u) -- (23u, 2u) -- (23u, 18u) -- (2u, 18u) -- cycle; 22 | draw (3u, 3u + r2) .. (3u + d2, 3u + d2) .. (3u + r2, 3u) -- 23 | (22u - r2, 3u) .. (22u - d2, 3u + d2) .. (22u, 3u + r2) -- 24 | (22u, 17u - r2) .. (22u - d2, 17u - d2) .. (22u - r2, 17u) -- 25 | (3u + r2, 17u) .. (3u + d2, 17u - d2) .. (3u, 17u - r2) -- 26 | cycle; 27 | 28 | endfig; 29 | 30 | end. 31 | -------------------------------------------------------------------------------- /autotools/.gitignore: -------------------------------------------------------------------------------- 1 | /.clangd 2 | /codeset.m4 3 | /compile 4 | /compile_commands.json 5 | /config.guess 6 | /config.rpath 7 | /config.sub 8 | /Custom.nsh 9 | /depcomp 10 | /extern-inline.m4 11 | /fcntl-o.m4 12 | /gettext.m4 13 | /glibc2.m4 14 | /glibc21.m4 15 | /gtk-doc.m4 16 | /iconv.m4 17 | /install-sh 18 | /intdiv0.m4 19 | /intl.m4 20 | /intldir.m4 21 | /intlmacosx.m4 22 | /intltool.m4 23 | /intmax.m4 24 | /inttypes-h.m4 25 | /inttypes-pri.m4 26 | /inttypes_h.m4 27 | /lcmessage.m4 28 | /lib-ld.m4 29 | /lib-link.m4 30 | /lib-prefix.m4 31 | /libtool.m4 32 | /lock.m4 33 | /longdouble.m4 34 | /longlong.m4 35 | /ltmain.sh 36 | /ltoptions.m4 37 | /ltsugar.m4 38 | /ltversion.m4 39 | /lt~obsolete.m4 40 | /missing 41 | /mkinstalldirs 42 | /nls.m4 43 | /po.m4 44 | /printf-posix.m4 45 | /progtest.m4 46 | /threadlib.m4 47 | /shave 48 | /shave-libtool 49 | /signed.m4 50 | /size_max.m4 51 | /stdint_h.m4 52 | /uintmax_t.m4 53 | /ulonglong.m4 54 | /visibility.m4 55 | /wchar_t.m4 56 | /wint_t.m4 57 | /xsize.m4 58 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | 5 | language: c 6 | 7 | os: linux 8 | dist: xenial 9 | 10 | compiler: 11 | - clang 12 | - gcc 13 | 14 | env: 15 | - GTK=gtk2 16 | - GTK=gtk3 17 | 18 | before_install: 19 | - sudo apt-get update -qq 20 | - sudo apt-get -y install -t xenial-backports ninja-build 21 | 22 | install: 23 | - sudo apt-get -qq install 24 | python3 python3-pip python3-setuptools python3-wheel 25 | libcairo2-dev libcairo-gobject2 26 | libgtk2.0-dev libgtk-3-dev gtk-doc-tools 27 | - sudo pip install cpp-coveralls 28 | - sudo pip3 install 'meson<0.57' 29 | 30 | script: 31 | - meson -Db_coverage=true -Dgtk=$GTK build && 32 | meson compile -C build && 33 | meson test -C build 34 | 35 | after_success: 36 | - if [ "$CC" = "gcc" ]; then 37 | coveralls -x c -e demo -e src/tests -e src/cpml/tests -e src/adg/tests --gcov-options '\-lp'; 38 | fi 39 | 40 | notifications: 41 | email: 42 | recipients: 43 | - ntd@entidi.it 44 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | demo/adg-demo.c 2 | demo/adg-demo.ui.in 3 | demo/cpml-demo.c 4 | demo/cpml-demo.ui 5 | demo/demo.c 6 | src/adg/adg-adim.c 7 | src/adg/adg-alignment.c 8 | src/adg/adg-arrow.c 9 | src/adg/adg-canvas.c 10 | src/adg/adg-color-style.c 11 | src/adg/adg-container.c 12 | src/adg/adg-dim.c 13 | src/adg/adg-dim-style.c 14 | src/adg/adg-dress.c 15 | src/adg/adg-edges.c 16 | src/adg/adg-entity.c 17 | src/adg/adg-fill-style.c 18 | src/adg/adg-font-style.c 19 | src/adg/adg-gtk-area.c 20 | src/adg/adg-gtk-layout.c 21 | src/adg/adg-hatch.c 22 | src/adg/adg-ldim.c 23 | src/adg/adg-line-style.c 24 | src/adg/adg-logo.c 25 | src/adg/adg-marker.c 26 | src/adg/adg-matrix.c 27 | src/adg/adg-model.c 28 | src/adg/adg-pango-style.c 29 | src/adg/adg-path.c 30 | src/adg/adg-point.c 31 | src/adg/adg-projection.c 32 | src/adg/adg-rdim.c 33 | src/adg/adg-ruled-fill.c 34 | src/adg/adg-stroke.c 35 | src/adg/adg-style.c 36 | src/adg/adg-table.c 37 | src/adg/adg-table-style.c 38 | src/adg/adg-textual.c 39 | src/adg/adg-title-block.c 40 | src/adg/adg-toy-text.c 41 | src/adg/adg-trail.c 42 | -------------------------------------------------------------------------------- /demo/adg.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ADG cairo canvas demo program 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /nodist/Dockerfile: -------------------------------------------------------------------------------- 1 | # Basic docker image for GitLab code integration. 2 | # 3 | # To create the image: 4 | # 5 | # docker image build -t registry.gitlab.com/libadg/adg:stretch . 6 | # 7 | # To interactively test the result: 8 | # 9 | # docker run -it registry.gitlab.com/libadg/adg:stretch /bin/bash 10 | # 11 | # To push the image to the GitLab registry: 12 | # 13 | # docker login registry.gitlab.com --username ... --password ... 14 | # docker push registry.gitlab.com/libadg/adg:stretch 15 | # docker logout registry.gitlab.com 16 | 17 | FROM debian:stretch 18 | 19 | USER root 20 | 21 | # Install any needed dependency. A recent meson is required, 22 | # so use `pip3` to install it instead of `apt-get` 23 | RUN apt-get update -qq && \ 24 | apt-get install -qq --no-install-suggests \ 25 | build-essential \ 26 | gcovr \ 27 | git \ 28 | gobject-introspection \ 29 | gtk-doc-tools \ 30 | libcairo2-dev \ 31 | libgirepository1.0-dev \ 32 | libgladeui-dev \ 33 | libgtk2.0-dev \ 34 | libgtk-3-dev \ 35 | libpango1.0-dev \ 36 | python3-pip && \ 37 | pip3 install meson ninja 38 | -------------------------------------------------------------------------------- /demo/adg.rc: -------------------------------------------------------------------------------- 1 | /* Borrowed from the GIMP and from Gnumeric: 2 | * I don't really know what I'm doing here... 3 | */ 4 | 5 | #include 6 | 7 | #define _QUOTE(x) #x 8 | #define QUOTE(x) _QUOTE(x) 9 | 10 | 11 | VS_VERSION_INFO VERSIONINFO 12 | FILEVERSION PACKAGE_VERSIONS 13 | PRODUCTVERSION PACKAGE_VERSIONS 14 | FILEFLAGSMASK 0 15 | FILEFLAGS 0 16 | FILEOS VOS__WINDOWS32 17 | FILETYPE VFT_APP 18 | FILESUBTYPE VFT2_UNKNOWN 19 | BEGIN 20 | BLOCK "StringFileInfo" 21 | BEGIN 22 | BLOCK "040904B0" 23 | BEGIN 24 | VALUE "CompanyName", "Nicola Fontana " 25 | VALUE "FileDescription", "ADG cairo canvas demo" 26 | VALUE "FileVersion", QUOTE(PACKAGE_VERSION) 27 | VALUE "InternalName", QUOTE(PACKAGE_NAME) 28 | VALUE "OriginalFilename", QUOTE(PACKAGE_NAME) ".exe" 29 | VALUE "ProductName", QUOTE(PACKAGE_NAME) 30 | VALUE "ProductVersion", QUOTE(PACKAGE_VERSION) 31 | VALUE "LegalCopyright", "Copyright (C) 2007-2022" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x409, 1200 37 | END 38 | END 39 | 40 | #include "winuser.h" 41 | 1 ICON "adg.ico" 42 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "adg.manifest" 43 | -------------------------------------------------------------------------------- /src/cpml/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | 4 | AM_CPPFLAGS= -I$(top_srcdir)/src/tests \ 5 | -I$(top_srcdir)/src 6 | AM_CFLAGS= $(ADG_CFLAGS) 7 | LDADD= $(top_builddir)/src/tests/libadgtest.la \ 8 | $(top_builddir)/src/adg/libadg-1.la \ 9 | $(top_builddir)/src/cpml/libcpml-1.la \ 10 | $(ADG_LIBS) 11 | 12 | 13 | TEST_PROGS+= test-utils$(EXEEXT) 14 | test_utils_SOURCES= test-utils.c 15 | 16 | TEST_PROGS+= test-pair$(EXEEXT) 17 | test_pair_SOURCES= test-pair.c 18 | 19 | TEST_PROGS+= test-extents$(EXEEXT) 20 | test_extents_SOURCES= test-extents.c 21 | 22 | TEST_PROGS+= test-segment$(EXEEXT) 23 | test_segment_SOURCES= test-segment.c 24 | 25 | TEST_PROGS+= test-primitive$(EXEEXT) 26 | test_primitive_SOURCES= test-primitive.c 27 | 28 | TEST_PROGS+= test-arc$(EXEEXT) 29 | test_arc_SOURCES= test-arc.c 30 | 31 | TEST_PROGS+= test-curve$(EXEEXT) 32 | test_curve_SOURCES= test-curve.c 33 | 34 | TEST_PROGS+= test-gobject$(EXEEXT) 35 | test_gobject_SOURCES= test-gobject.c 36 | 37 | 38 | # targets 39 | check_PROGRAMS= $(TEST_PROGS) 40 | 41 | 42 | # Possibly remove files created on test coverage builds 43 | mostlyclean-local: 44 | -rm -f *.gcda *gcno 45 | -------------------------------------------------------------------------------- /src/adg/adg-dash-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_DASH_PRIVATE_H__ 22 | #define __ADG_DASH_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | struct _AdgDash { 28 | gint num_dashes; 29 | gdouble *dashes; 30 | gdouble offset; 31 | }; 32 | 33 | G_END_DECLS 34 | 35 | 36 | #endif /* __ADG_DASH_PRIVATE_H__ */ 37 | -------------------------------------------------------------------------------- /src/adg/adg-arrow-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_ARROW_PRIVATE_H__ 22 | #define __ADG_ARROW_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgArrowPrivate AdgArrowPrivate; 28 | 29 | struct _AdgArrowPrivate { 30 | gdouble angle; 31 | }; 32 | 33 | G_END_DECLS 34 | 35 | 36 | #endif /* __ADG_ARROW_PRIVATE_H__ */ 37 | -------------------------------------------------------------------------------- /src/adg/adg-hatch-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_HATCH_PRIVATE_H__ 22 | #define __ADG_HATCH_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgHatchPrivate AdgHatchPrivate; 28 | 29 | struct _AdgHatchPrivate { 30 | AdgDress fill_dress; 31 | }; 32 | 33 | G_END_DECLS 34 | 35 | 36 | #endif /* __ADG_HATCH_PRIVATE_H__ */ 37 | -------------------------------------------------------------------------------- /src/adg/adg-container-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_CONTAINER_PRIVATE_H__ 22 | #define __ADG_CONTAINER_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgContainerPrivate AdgContainerPrivate; 28 | 29 | struct _AdgContainerPrivate { 30 | GSList *children; 31 | }; 32 | 33 | G_END_DECLS 34 | 35 | 36 | #endif /* __ADG_CONTAINER_PRIVATE_H__ */ 37 | -------------------------------------------------------------------------------- /src/adg/adg-dress-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_DRESS_PRIVATE_H__ 22 | #define __ADG_DRESS_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgDressPrivate AdgDressPrivate; 28 | 29 | struct _AdgDressPrivate { 30 | AdgStyle *fallback; 31 | GType ancestor_type; 32 | }; 33 | 34 | G_END_DECLS 35 | 36 | 37 | #endif /* __ADG_DRESS_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /src/adg/adg-stroke-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_STROKE_PRIVATE_H__ 22 | #define __ADG_STROKE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgStrokePrivate AdgStrokePrivate; 28 | 29 | struct _AdgStrokePrivate { 30 | AdgDress line_dress; 31 | AdgTrail *trail; 32 | }; 33 | 34 | G_END_DECLS 35 | 36 | 37 | #endif /* __ADG_STROKE_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /docs/adg/meson.build: -------------------------------------------------------------------------------- 1 | bookinfo_xml = configure_file( 2 | input: 'bookinfo.xml.in', 3 | output: '@BASENAME@', 4 | configuration: data 5 | ) 6 | 7 | adg_fixxref_args = cpml_fixxref_args + [ 8 | '--extra-dir=../cpml', 9 | ] 10 | if gtk_dep.found() 11 | adg_fixxref_args += [ 12 | '--extra-dir=' + join_paths( 13 | gtk_dep.get_variable(pkgconfig: 'prefix'), 14 | 'share', 'gtk-doc', 'html', 15 | use_gtk2 ? 'gtk2' : 'gtk3' 16 | ) 17 | ] 18 | endif 19 | if pangocairo_dep.found() 20 | adg_fixxref_args += [ 21 | '--extra-dir=' + join_paths( 22 | pangocairo_dep.get_variable(pkgconfig: 'prefix'), 23 | 'share', 'gtk-doc', 'html', 'pango' 24 | ) 25 | ] 26 | endif 27 | 28 | gnome.gtkdoc('adg', 29 | namespace: 'adg', 30 | src_dir: adg_directories, 31 | ignore_headers: adg_internal_names + [ 'adg-marshal.h', 'adg-cairo-fallback.h' ], 32 | dependencies: adg_dep, 33 | main_xml: 'adg-docs.xml', 34 | content_files: bookinfo_xml, 35 | scan_args: [ '--rebuild-types', '--rebuild-sections' ], 36 | mkdb_args: [ '--default-includes=adg.h' ], 37 | fixxref_args: adg_fixxref_args, 38 | install_dir: 'adg-' + metadata['api'] 39 | ) 40 | -------------------------------------------------------------------------------- /src/adg/adg-alignment-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_ALIGNMENT_PRIVATE_H__ 22 | #define __ADG_ALIGNMENT_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgAlignmentPrivate AdgAlignmentPrivate; 28 | 29 | struct _AdgAlignmentPrivate { 30 | CpmlPair factor; 31 | CpmlVector shift; 32 | }; 33 | 34 | G_END_DECLS 35 | 36 | 37 | #endif /* __ADG_ALIGNMENT_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /src/adg/adg-fill-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_FILL_STYLE_PRIVATE_H__ 22 | #define __ADG_FILL_STYLE_PRIVATE_H__ 23 | 24 | G_BEGIN_DECLS 25 | 26 | typedef struct _AdgFillStylePrivate AdgFillStylePrivate; 27 | 28 | struct _AdgFillStylePrivate { 29 | cairo_pattern_t *pattern; 30 | CpmlExtents extents; 31 | }; 32 | 33 | G_END_DECLS 34 | 35 | 36 | #endif /* __ADG_FILL_STYLE_PRIVATE_H__ */ 37 | -------------------------------------------------------------------------------- /src/cpml.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __CPML_H__ 22 | #define __CPML_H__ 23 | 24 | #include "cpml/cpml-utils.h" 25 | #include "cpml/cpml-pair.h" 26 | #include "cpml/cpml-extents.h" 27 | #include "cpml/cpml-segment.h" 28 | #include "cpml/cpml-primitive.h" 29 | #include "cpml/cpml-arc.h" 30 | #include "cpml/cpml-curve.h" 31 | 32 | #include 33 | #include "cpml/cpml-gobject.h" 34 | 35 | #endif /* __CPML_H__ */ 36 | -------------------------------------------------------------------------------- /src/adg/adg-ruled-fill-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_RULED_FILL_PRIVATE_H__ 22 | #define __ADG_RULED_FILL_PRIVATE_H__ 23 | 24 | G_BEGIN_DECLS 25 | 26 | typedef struct _AdgRuledFillPrivate AdgRuledFillPrivate; 27 | 28 | struct _AdgRuledFillPrivate { 29 | AdgDress line_dress; 30 | gdouble spacing; 31 | gdouble angle; 32 | }; 33 | 34 | G_END_DECLS 35 | 36 | 37 | #endif /* __ADG_RULED_FILL_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /src/cpml/cpml-internal.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* 21 | * This header is included by every .c files of the library to 22 | * enable the inclusion of the internal headers and initialize 23 | * some common stuff. 24 | */ 25 | 26 | #ifndef __CPML_INTERNAL_H__ 27 | #define __CPML_INTERNAL_H__ 28 | 29 | #define __CPML_H__ 30 | 31 | #include "cpml-utils.h" 32 | #include "cpml-pair.h" 33 | #include 34 | 35 | #endif /* __CPML_INTERNAL_H__ */ 36 | -------------------------------------------------------------------------------- /src/config.h.meson: -------------------------------------------------------------------------------- 1 | /* src/config.h 2 | * 3 | * This is a generated file. Please modify `src/config.h.meson`. 4 | */ 5 | 6 | /* Name of package */ 7 | #define PACKAGE "@PACKAGE_NAME@" 8 | 9 | /* Define to the full name of this package. */ 10 | #define PACKAGE_NAME "@PACKAGE_NAME@-@PACKAGE_API@" 11 | 12 | /* Define to the one symbol short name of this package. */ 13 | #define PACKAGE_TARNAME "@PACKAGE_NAME@" 14 | 15 | /* Define to the version of this package. */ 16 | #define PACKAGE_VERSION "@PACKAGE_VERSION@" 17 | 18 | /* Define to the full name and version of this package. */ 19 | #define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@" 20 | 21 | /* Define to the home page for this package. */ 22 | #define PACKAGE_URL "@PACKAGE_URL@" 23 | 24 | /* Define to the address where bug reports for this package should be sent. */ 25 | #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" 26 | 27 | /* Define to the domain used by gettext. */ 28 | #define GETTEXT_PACKAGE "@PACKAGE_NAME@-@PACKAGE_API@" 29 | 30 | /* Defined if GObject support in cairo is present. */ 31 | #mesondefine CAIRO_GOBJECT_ENABLED 32 | 33 | /* Defined if the GTK+2 support is enabled. */ 34 | #mesondefine GTK2_ENABLED 35 | 36 | /* Defined if the GTK+3 support is enabled. */ 37 | #mesondefine GTK3_ENABLED 38 | 39 | /* Defined if the pango support is enabled. */ 40 | #mesondefine PANGO_ENABLED 41 | -------------------------------------------------------------------------------- /src/adg/adg-pango-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_PANGO_STYLE_PRIVATE_H__ 22 | #define __ADG_PANGO_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgPangoStylePrivate AdgPangoStylePrivate; 28 | 29 | struct _AdgPangoStylePrivate { 30 | PangoFontDescription *font_description; 31 | gint spacing; 32 | }; 33 | 34 | G_END_DECLS 35 | 36 | 37 | #endif /* __ADG_PANGO_STYLE_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /src/adg/adg-color-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_COLOR_STYLE_PRIVATE_H__ 22 | #define __ADG_COLOR_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgColorStylePrivate AdgColorStylePrivate; 28 | 29 | struct _AdgColorStylePrivate { 30 | gdouble red; 31 | gdouble green; 32 | gdouble blue; 33 | gdouble alpha; 34 | }; 35 | 36 | G_END_DECLS 37 | 38 | 39 | #endif /* __ADG_COLOR_STYLE_PRIVATE_H__ */ 40 | -------------------------------------------------------------------------------- /src/adg/adg-text-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TEXT_PRIVATE_H__ 22 | #define __ADG_TEXT_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgTextPrivate AdgTextPrivate; 28 | 29 | struct _AdgTextPrivate { 30 | AdgDress font_dress; 31 | gchar *text; 32 | 33 | PangoLayout *layout; 34 | CpmlExtents raw_extents; 35 | }; 36 | 37 | G_END_DECLS 38 | 39 | 40 | #endif /* __ADG_TEXT_PRIVATE_H__ */ 41 | -------------------------------------------------------------------------------- /src/adg/adg-marker-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_MARKER_PRIVATE_H__ 22 | #define __ADG_MARKER_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgMarkerPrivate AdgMarkerPrivate; 28 | 29 | struct _AdgMarkerPrivate { 30 | AdgTrail *trail; 31 | guint n_segment; 32 | CpmlSegment *backup_segment; 33 | CpmlSegment segment; 34 | gdouble pos; 35 | gdouble size; 36 | AdgModel *model; 37 | }; 38 | 39 | G_END_DECLS 40 | 41 | 42 | #endif /* __ADG_MARKER_PRIVATE_H__ */ 43 | -------------------------------------------------------------------------------- /src/adg/adg-toy-text-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TOY_TEXT_PRIVATE_H__ 22 | #define __ADG_TOY_TEXT_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgToyTextPrivate AdgToyTextPrivate; 28 | 29 | struct _AdgToyTextPrivate { 30 | AdgDress font_dress; 31 | gchar *text; 32 | 33 | int num_glyphs; 34 | cairo_glyph_t *glyphs; 35 | 36 | cairo_scaled_font_t *font; 37 | }; 38 | 39 | G_END_DECLS 40 | 41 | 42 | #endif /* __ADG_TOY_TEXT_PRIVATE_H__ */ 43 | -------------------------------------------------------------------------------- /src/adg/adg-edges-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_EDGES_PRIVATE_H__ 22 | #define __ADG_EDGES_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgEdgesPrivate AdgEdgesPrivate; 28 | 29 | struct _AdgEdgesPrivate { 30 | AdgTrail *source; 31 | gdouble axis_angle; 32 | gdouble critical_angle; 33 | 34 | struct { 35 | cairo_path_t path; 36 | GArray *array; 37 | } cairo; 38 | }; 39 | 40 | G_END_DECLS 41 | 42 | 43 | #endif /* __ADG_EDGES_PRIVATE_H__ */ 44 | -------------------------------------------------------------------------------- /src/adg/adg-trail-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TRAIL_PRIVATE_H__ 22 | #define __ADG_TRAIL_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgTrailPrivate AdgTrailPrivate; 28 | 29 | struct _AdgTrailPrivate { 30 | cairo_path_t cairo_path; 31 | AdgTrailCallback callback; 32 | gpointer user_data; 33 | gdouble max_angle; 34 | 35 | gboolean in_construction; 36 | CpmlExtents extents; 37 | }; 38 | 39 | G_END_DECLS 40 | 41 | 42 | #endif /* __ADG_TRAIL_PRIVATE_H__ */ 43 | -------------------------------------------------------------------------------- /src/adg/adg-gtk-layout-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_GTK_LAYOUT_PRIVATE_H__ 22 | #define __ADG_GTK_LAYOUT_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgGtkLayoutPrivate AdgGtkLayoutPrivate; 28 | 29 | struct _AdgGtkLayoutPrivate { 30 | GtkAdjustment *hadjustment; 31 | GtkAdjustment *vadjustment; 32 | 33 | gboolean policy_stored; 34 | GtkPolicyType hpolicy, vpolicy; 35 | CpmlExtents viewport; 36 | }; 37 | 38 | G_END_DECLS 39 | 40 | 41 | #endif /* __ADG_GTK_LAYOUT_PRIVATE_H__ */ 42 | -------------------------------------------------------------------------------- /src/adg/adg-logo-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the 14 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 15 | * Boston, MA 02110-1301, USA. 16 | */ 17 | 18 | 19 | #ifndef __ADG_LOGO_PRIVATE_H__ 20 | #define __ADG_LOGO_PRIVATE_H__ 21 | 22 | 23 | G_BEGIN_DECLS 24 | 25 | typedef struct _AdgLogoClassPrivate AdgLogoClassPrivate; 26 | typedef struct _AdgLogoPrivate AdgLogoPrivate; 27 | 28 | struct _AdgLogoClassPrivate { 29 | AdgPath *symbol; 30 | AdgPath *screen; 31 | AdgPath *frame; 32 | CpmlExtents extents; 33 | }; 34 | 35 | struct _AdgLogoPrivate { 36 | AdgDress symbol_dress; 37 | AdgDress screen_dress; 38 | AdgDress frame_dress; 39 | }; 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* __ADG_LOGO_PRIVATE_H__ */ 45 | -------------------------------------------------------------------------------- /demo/demo.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* Needed for localization support */ 21 | #include 22 | 23 | /* Force the reinclusion of adg.h */ 24 | #undef __ADG_H__ 25 | 26 | 27 | #ifndef __DEMO_H__ 28 | #define __DEMO_H__ 29 | 30 | 31 | G_BEGIN_DECLS 32 | 33 | extern gboolean is_installed; 34 | extern gchar * basedir; 35 | 36 | 37 | void _demo_init (gint argc, 38 | gchar *argv[]); 39 | gchar * _demo_file (const gchar *file_name); 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* __DEMO_H__ */ 45 | -------------------------------------------------------------------------------- /src/adg/adg-title-block-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TITLE_BLOCK_PRIVATE_H__ 22 | #define __ADG_TITLE_BLOCK_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgTitleBlockPrivate AdgTitleBlockPrivate; 28 | 29 | struct _AdgTitleBlockPrivate { 30 | gchar *title; 31 | gchar *drawing; 32 | gchar *size; 33 | gchar *scale; 34 | gchar *author; 35 | gchar *date; 36 | AdgEntity *logo; 37 | AdgEntity *projection; 38 | }; 39 | 40 | G_END_DECLS 41 | 42 | 43 | #endif /* __ADG_TITLE_BLOCK_PRIVATE_H__ */ 44 | -------------------------------------------------------------------------------- /src/adg/adg-model-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_MODEL_PRIVATE_H__ 22 | #define __ADG_MODEL_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgModelPrivate AdgModelPrivate; 28 | typedef struct _AdgWrapperHelper AdgWrapperHelper; 29 | 30 | struct _AdgModelPrivate { 31 | GSList *dependencies; 32 | GHashTable *named_pairs; 33 | }; 34 | 35 | struct _AdgWrapperHelper { 36 | AdgNamedPairFunc callback; 37 | AdgModel *model; 38 | gpointer user_data; 39 | }; 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* __ADG_MODEL_PRIVATE_H__ */ 45 | -------------------------------------------------------------------------------- /src/adg/adg-gtk-area-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_GTK_AREA_PRIVATE_H__ 22 | #define __ADG_GTK_AREA_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgGtkAreaPrivate AdgGtkAreaPrivate; 28 | 29 | struct _AdgGtkAreaPrivate { 30 | AdgCanvas *canvas; 31 | gdouble factor; 32 | gboolean autozoom; 33 | cairo_matrix_t render_map; 34 | 35 | gboolean initialized; 36 | CpmlExtents extents; 37 | gdouble x_event, y_event; 38 | }; 39 | 40 | G_END_DECLS 41 | 42 | 43 | #endif /* __ADG_GTK_AREA_PRIVATE_H__ */ 44 | -------------------------------------------------------------------------------- /src/cpml/cpml-utils.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__CPML_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __CPML_UTILS_H__ 27 | #define __CPML_UTILS_H__ 28 | 29 | /* Required include files */ 30 | #include 31 | #include 32 | 33 | 34 | CAIRO_BEGIN_DECLS 35 | 36 | double cpml_angle (double angle); 37 | double cpml_angle_distance (double angle, 38 | double from); 39 | 40 | CAIRO_END_DECLS 41 | 42 | 43 | #endif /* __CPML_UTILS_H__ */ 44 | -------------------------------------------------------------------------------- /docs/cpml/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | DOC_MODULE= cpml 4 | DOC_MAIN_SGML_FILE= $(DOC_MODULE)-docs.xml 5 | DOC_SOURCE_DIR= $(abs_top_srcdir)/src/cpml 6 | SCANGOBJ_OPTIONS= 7 | SCAN_OPTIONS= --rebuild-sections 8 | MKDB_OPTIONS= --name-space=cpml \ 9 | --sgml-mode \ 10 | --output-format=xml \ 11 | --default-includes="$(DOC_MODULE)-1/$(DOC_MODULE).h" 12 | MKHTML_OPTIONS= 13 | FIXXREF_OPTIONS= $(EXTRA_DIR) 14 | HFILE_GLOB= $(top_srcdir)/src/cpml/*.h 15 | CFILE_GLOB= $(top_srcdir)/src/cpml/*.c 16 | IGNORE_HFILES= cpml.h \ 17 | cpml-internal.h \ 18 | cpml-introspection.h \ 19 | cpml-primitive-private.h \ 20 | test-internal.h 21 | HTML_IMAGES= 22 | content_files= 23 | expand_content_files= 24 | 25 | include $(top_srcdir)/autotools/Makefile.am.gtk-doc 26 | 27 | DISTCLEANFILES= $(DOC_MODULE)-sections.txt 28 | 29 | 30 | # Use an hand-crafted cpml.hierarchy file instead of an empty one. 31 | # By default gtk-doc does not allow to have a file name that matches 32 | # the type name to avoid id conflicts between the main section and 33 | # the struct subsection: this is only allowed for GBoxed and GObject 34 | # types. 35 | # I *absolutely* want to have file names that match the type names, 36 | # so using a fake cpml.hierarchy let gtk-doc treat the plain C 37 | # structs of CPML as GBoxed types. 38 | 39 | EXTRA_DIST+= cpml.hierarchy.fake 40 | 41 | scan-hook: 42 | $(AM_V_at)test -f cpml.hierarchy || \ 43 | cp $(abs_srcdir)/cpml.hierarchy.fake cpml.hierarchy 44 | -------------------------------------------------------------------------------- /src/adg/adg-line-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_LINE_STYLE_PRIVATE_H__ 22 | #define __ADG_LINE_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgLineStylePrivate AdgLineStylePrivate; 28 | 29 | struct _AdgLineStylePrivate { 30 | AdgDress color_dress; 31 | double width; 32 | cairo_line_cap_t cap; 33 | cairo_line_join_t join; 34 | double miter_limit; 35 | cairo_antialias_t antialias; 36 | AdgDash *dash; 37 | }; 38 | 39 | G_END_DECLS 40 | 41 | 42 | #endif /* __ADG_LINE_STYLE_PRIVATE_H__ */ 43 | -------------------------------------------------------------------------------- /src/adg/adg-table-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TABLE_STYLE_PRIVATE_H__ 22 | #define __ADG_TABLE_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgTableStylePrivate AdgTableStylePrivate; 28 | 29 | struct _AdgTableStylePrivate { 30 | AdgDress color_dress; 31 | AdgDress grid_dress; 32 | AdgDress frame_dress; 33 | AdgDress title_dress; 34 | AdgDress value_dress; 35 | gdouble row_height; 36 | CpmlPair cell_padding; 37 | CpmlPair cell_spacing; 38 | }; 39 | 40 | G_END_DECLS 41 | 42 | 43 | #endif /* __ADG_TABLE_STYLE_PRIVATE_H__ */ 44 | -------------------------------------------------------------------------------- /src/adg/tests/test-type-builtins.c: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #include 22 | #include 23 | 24 | 25 | int 26 | main(int argc, char *argv[]) 27 | { 28 | adg_test_init(&argc, &argv); 29 | 30 | adg_test_add_enum_checks("/adg/three-state/type/enum", ADG_TYPE_THREE_STATE); 31 | adg_test_add_enum_checks("/adg/transform-mode/type/enum", ADG_TYPE_TRANSFORM_MODE); 32 | adg_test_add_enum_checks("/adg/mix/type/enum", ADG_TYPE_MIX); 33 | adg_test_add_enum_checks("/adg/projection-scheme/type/enum", ADG_TYPE_PROJECTION_SCHEME); 34 | adg_test_add_enum_checks("/adg/dress/type/enum", ADG_TYPE_DRESS); 35 | 36 | return g_test_run(); 37 | } 38 | -------------------------------------------------------------------------------- /src/adg/adg-projection-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the 14 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 15 | * Boston, MA 02110-1301, USA. 16 | */ 17 | 18 | 19 | #ifndef __ADG_PROJECTION_PRIVATE_H__ 20 | #define __ADG_PROJECTION_PRIVATE_H__ 21 | 22 | 23 | G_BEGIN_DECLS 24 | 25 | typedef struct _AdgProjectionClassPrivate AdgProjectionClassPrivate; 26 | typedef struct _AdgProjectionPrivate AdgProjectionPrivate; 27 | 28 | struct _AdgProjectionClassPrivate { 29 | AdgProjectionScheme scheme; 30 | AdgPath *symbol; 31 | AdgPath *axis; 32 | CpmlExtents extents; 33 | }; 34 | 35 | struct _AdgProjectionPrivate { 36 | AdgDress symbol_dress; 37 | AdgDress axis_dress; 38 | AdgProjectionScheme scheme; 39 | }; 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* __ADG_PROJECTION_PRIVATE_H__ */ 45 | -------------------------------------------------------------------------------- /nodist/Makefile: -------------------------------------------------------------------------------- 1 | # Silent rules. By default the build is silent: 2 | # use "make V=1" to run in verbose mode. 3 | V=0 4 | 5 | DOC=$(DOC_$(V)) 6 | DOC_0=@echo " DOC " $@; 7 | DOC_1= 8 | 9 | RM=$(RM_$(V)) 10 | RM_0=@echo " RM " $@; 11 | RM_1= 12 | 13 | TEX2PDF=$(TEX2PDF_$(V)) 14 | TEX2PDF_0=$(TEX2PDF_1) -silent -quiet > /dev/null 15 | TEX2PDF_1=latexmk -rules- -lualatex -pdf 16 | 17 | MP2MPS=$(MP2MPS_$(V)) 18 | MP2MPS_0=$(MP2MPS_1) > /dev/null 19 | MP2MPS_1=mpost -interaction=batchmode 20 | 21 | CLEAN=$(CLEAN_$(V)) 22 | CLEAN_0=$(CLEAN_1) -silent 23 | CLEAN_1=latexmk -C 24 | 25 | CONVERT=convert -flatten -density 150 -quality 90 26 | 27 | 28 | all: overview.pdf handcraft.pdf baioca.pdf saiot.pdf desktop.png web.png 29 | 30 | overview.pdf: overview.tex symbols-0.mps ALWAYS_OUTDATED 31 | $(DOC)$(TEX2PDF) overview.tex 32 | 33 | handcraft.pdf: handcraft.tex ALWAYS_OUTDATED 34 | $(DOC)$(TEX2PDF) handcraft.tex 35 | 36 | baioca.pdf: baioca.tex ALWAYS_OUTDATED 37 | $(DOC)$(TEX2PDF) baioca.tex 38 | 39 | saiot.pdf: saiot.tex ALWAYS_OUTDATED 40 | $(DOC)$(TEX2PDF) saiot.tex 41 | 42 | symbols-0.mps: symbols.mp 43 | $(DOC)$(MP2MPS) symbols.mp 44 | 45 | desktop.png: overview.pdf 46 | $(DOC)$(CONVERT) overview.pdf[0] desktop.png 47 | 48 | web.png: overview.pdf 49 | $(DOC)$(CONVERT) overview.pdf[1] web.png 50 | 51 | clean: 52 | $(RM)$(CLEAN) ; \ 53 | rm -f *.mps symbols.log desktop.png web.png 54 | 55 | 56 | # ALWAYS_OUTDATED is a dummy phony target needed to force the build: 57 | # latexmk is the one that will take care of the dependencies. 58 | .PHONY: all clean ALWAYS_OUTDATED 59 | -------------------------------------------------------------------------------- /docs/cpml/cpml-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | ]> 7 | 8 | 9 | 10 | 11 | Core reference 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Path constructs 20 | 21 | 22 | 23 | Special primitives 24 | 25 | 26 | 27 | 28 | 29 | 30 | Index 31 | 32 | 33 | 34 | 35 | Index of deprecated symbols 36 | 37 | 38 | 39 | 40 | Index of new symbols in 1.0 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/adg/adg-table-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_TABLE_PRIVATE_H__ 22 | #define __ADG_TABLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgProxyData AdgProxyData; 28 | typedef struct _AdgTablePrivate AdgTablePrivate; 29 | 30 | struct _AdgProxyData { 31 | guint signal_id; 32 | GQuark detail; 33 | va_list var_args; 34 | }; 35 | 36 | struct _AdgTablePrivate { 37 | AdgDress table_dress; 38 | gboolean has_frame; 39 | 40 | AdgTableStyle *table_style; 41 | AdgStroke *grid; 42 | AdgStroke *frame; 43 | GSList *rows; 44 | GHashTable *cell_names; 45 | }; 46 | 47 | G_END_DECLS 48 | 49 | 50 | #endif /* __ADG_TABLE_PRIVATE_H__ */ 51 | -------------------------------------------------------------------------------- /src/adg/adg-canvas-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_CANVAS_PRIVATE_H__ 22 | #define __ADG_CANVAS_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgCanvasPrivate AdgCanvasPrivate; 28 | 29 | struct _AdgCanvasPrivate { 30 | CpmlPair size; 31 | gdouble factor; 32 | gchar **scales; 33 | AdgDress background_dress; 34 | AdgDress frame_dress; 35 | AdgTitleBlock *title_block; 36 | gdouble top_margin, right_margin, bottom_margin, left_margin; 37 | gboolean has_frame; 38 | gdouble top_padding, right_padding, bottom_padding, left_padding; 39 | }; 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* __ADG_CANVAS_PRIVATE_H__ */ 45 | -------------------------------------------------------------------------------- /src/adg/tests/test-style.c: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #include 22 | #include 23 | 24 | 25 | static void 26 | _adg_method_clone(void) 27 | { 28 | AdgStyleClass *klass; 29 | 30 | /* Just check that the default implementation is adg_object_clone */ 31 | klass = g_type_class_ref(ADG_TYPE_STYLE); 32 | g_assert_true(G_CALLBACK(klass->clone) == G_CALLBACK(adg_object_clone)); 33 | g_type_class_unref(klass); 34 | } 35 | 36 | 37 | int 38 | main(int argc, char *argv[]) 39 | { 40 | adg_test_init(&argc, &argv); 41 | 42 | adg_test_add_object_checks("/adg/style/type/object", ADG_TYPE_STYLE); 43 | 44 | g_test_add_func("/adg/style/method/clone", _adg_method_clone); 45 | 46 | return g_test_run(); 47 | } 48 | -------------------------------------------------------------------------------- /src/adg/tests/meson.build: -------------------------------------------------------------------------------- 1 | adg_tests = [ 2 | 'test-adim', 3 | 'test-alignment', 4 | 'test-arrow', 5 | 'test-canvas', 6 | 'test-color-style', 7 | 'test-container', 8 | 'test-dash', 9 | 'test-dim-style', 10 | 'test-dim', 11 | 'test-dress', 12 | 'test-edges', 13 | 'test-entity', 14 | 'test-fill-style', 15 | 'test-font-style', 16 | 'test-hatch', 17 | 'test-ldim', 18 | 'test-line-style', 19 | 'test-logo', 20 | 'test-marker', 21 | 'test-matrix', 22 | 'test-model', 23 | 'test-param-dress', 24 | 'test-path', 25 | 'test-point', 26 | 'test-projection', 27 | 'test-rdim', 28 | 'test-ruled-fill', 29 | 'test-stroke', 30 | 'test-style', 31 | 'test-table-cell', 32 | 'test-table-row', 33 | 'test-table-style', 34 | 'test-table', 35 | 'test-text', 36 | 'test-textual', 37 | 'test-title-block', 38 | 'test-toy-text', 39 | 'test-trail', 40 | 'test-type-builtins', 41 | 'test-utils', 42 | ] 43 | 44 | if pangocairo_dep.found() 45 | adg_tests += [ 46 | 'test-pango-style', 47 | ] 48 | endif 49 | 50 | if gtk_dep.found() and gtk_dep.version().version_compare('<3.10.8') 51 | adg_tests += [ 52 | 'test-gtk-area', 53 | 'test-gtk-layout', 54 | 'test-gtk-utils', 55 | ] 56 | endif 57 | 58 | adg_tests_cflags = [ 59 | '-DSRCDIR="' + meson.current_source_dir() + '"' 60 | ] 61 | 62 | foreach test: adg_tests 63 | e = executable(test, 64 | sources: '@0@.c'.format(test), 65 | c_args: adg_tests_cflags, 66 | dependencies: adgtest_dep 67 | ) 68 | test('adg/' + test, e) 69 | endforeach 70 | -------------------------------------------------------------------------------- /autotools/ntd.m4: -------------------------------------------------------------------------------- 1 | # ntd.m4 - Collection of autoconf snippets. 2 | # 3 | # Copyright (C) 2012 Nicola Fontana 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2 of the License, or (at your option) any later version. 9 | # 10 | # This library 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 GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the 17 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | dnl NTD_UNEXPAND(PACKAGE,VARIABLE,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) 21 | dnl Get the unexpanded value VARIABLE in PACKAGE by using pkg-config. 22 | dnl The result is returned in the NTD_UNEXPANDED shell variable. 23 | AC_DEFUN([NTD_UNEXPAND],[ 24 | NTD_UNEXPANDED="$(${PKG_CONFIG} \ 25 | --define-variable=prefix='${prefix}' \ 26 | --define-variable=exec_prefix='${exec_prefix}' \ 27 | --define-variable=libdir='${libdir}' \ 28 | --define-variable=bindir='${bindir}' \ 29 | --define-variable=datarootdir='${datarootdir}' \ 30 | --define-variable=datadir='${datadir}' \ 31 | --define-variable=includedir='${includedir}' \ 32 | --variable=[$2] [$1])" 33 | 34 | if test "x$NTD_UNEXPANDED" != "x"; then 35 | m4_default([$3], [:]) 36 | m4_ifvaln([$4], [else 37 | $4])dnl 38 | fi]) 39 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Run this to generate the configuration scripts after a fresh 4 | # repository clone/checkout. 5 | # 6 | # USAGE: ./autogen.sh [--verbose] 7 | # 8 | # where --verbose shows stdout and stderr of every command (by 9 | # default they are redirect to /dev/null). 10 | # 11 | # This script does *not* call configure (as usually done in other 12 | # projects) because this would prevent VPATH builds. 13 | 14 | arg1=$1 15 | 16 | step() { 17 | printf "$1... " 18 | 19 | if test "$arg1" = --verbose; then 20 | eval $2 21 | else 22 | eval $2 >/dev/null 2>&1 23 | fi 24 | result=$? 25 | 26 | if test "$result" = "0"; then 27 | printf "\033[32mok\033[0m\n" 28 | else 29 | printf "\033[31mfailed\033[0m\n ** \"$2\" returned $result\n" 30 | exit $result 31 | fi 32 | } 33 | 34 | 35 | srcdir=`dirname $0` 36 | test -z "$srcdir" && srcdir=. 37 | 38 | step "Checking for top-level adg directory" \ 39 | "test -f '$srcdir/configure.ac' -a -f '$srcdir/src/adg.h.in'" 40 | 41 | cd "$srcdir" 42 | 43 | step "Creating dummy ChangeLog, if needed" \ 44 | "test -f './ChangeLog' || touch './ChangeLog'" 45 | 46 | # autoreconf interaction with libtool has been broken for ages: 47 | # explicitly calling libtoolize seems to avoid some problem 48 | step "Calling libtoolize" \ 49 | "libtoolize --automake" 50 | 51 | # GNU gettext seems to have timestamp problems with git: 52 | # https://bugzilla.gnome.org/show_bug.cgi?id=661128 53 | step "Making adg.pot look older" \ 54 | "touch -t 200001010000 po/adg.pot" 55 | 56 | step "Regenerating autotools files" \ 57 | "autoreconf -isf -Wall" 58 | 59 | 60 | printf "Now run \033[1m./configure\033[0m to customize your building\n" 61 | -------------------------------------------------------------------------------- /src/adg/adg-forward-declarations.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_FORWARD_DECLARATIONS_H__ 27 | #define __ADG_FORWARD_DECLARATIONS_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | /* Forward declarations are kept in a separate file so it can be 33 | * easily skipped by gtkdoc-scan: gtk-doc is inclined to mess up 34 | * sections when forward declarations are used. 35 | */ 36 | 37 | /* Needed by adg-entity.h */ 38 | typedef struct _AdgCanvas AdgCanvas; 39 | typedef struct _AdgStyle AdgStyle; 40 | typedef struct _AdgPoint AdgPoint; 41 | 42 | /* Needed by adg-table.h */ 43 | typedef struct _AdgTableRow AdgTableRow; 44 | typedef struct _AdgTableCell AdgTableCell; 45 | 46 | G_END_DECLS 47 | 48 | 49 | #endif /* __ADG_FORWARD_DECLARATIONS_H__ */ 50 | -------------------------------------------------------------------------------- /src/adg/adg-font-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_FONT_STYLE_PRIVATE_H__ 22 | #define __ADG_FONT_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgFontStylePrivate AdgFontStylePrivate; 28 | 29 | struct _AdgFontStylePrivate { 30 | AdgDress color_dress; 31 | gchar *family; 32 | cairo_font_slant_t slant; 33 | cairo_font_weight_t weight; 34 | gdouble size; 35 | cairo_antialias_t antialias; 36 | cairo_subpixel_order_t subpixel_order; 37 | cairo_hint_style_t hint_style; 38 | cairo_hint_metrics_t hint_metrics; 39 | 40 | cairo_font_face_t *face; 41 | cairo_scaled_font_t *font; 42 | }; 43 | 44 | G_END_DECLS 45 | 46 | 47 | #endif /* __ADG_FONT_STYLE_PRIVATE_H__ */ 48 | -------------------------------------------------------------------------------- /src/adg/adg-entity-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_ENTITY_PRIVATE_H__ 22 | #define __ADG_ENTITY_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgEntityPrivate AdgEntityPrivate; 28 | 29 | struct _AdgEntityPrivate { 30 | gboolean floating; 31 | AdgEntity *parent; 32 | cairo_matrix_t global_map; 33 | cairo_matrix_t local_map; 34 | AdgMix local_mix; 35 | GHashTable *hash_styles; 36 | 37 | struct { 38 | gboolean is_defined; 39 | cairo_matrix_t matrix; 40 | } global; 41 | 42 | struct { 43 | gboolean is_defined; 44 | cairo_matrix_t matrix; 45 | } local; 46 | 47 | CpmlExtents extents; 48 | }; 49 | 50 | G_END_DECLS 51 | 52 | 53 | #endif /* __ADG_ENTITY_PRIVATE_H__ */ 54 | -------------------------------------------------------------------------------- /src/adg/adg-param-dress.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_PARAM_DRESS_H__ 27 | #define __ADG_PARAM_DRESS_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_PARAM_DRESS (adg_param_dress_get_type()) 33 | #define ADG_IS_PARAM_DRESS(pspec) (G_TYPE_CHECK_INSTANCE_TYPE((pspec), ADG_TYPE_PARAM_DRESS)) 34 | 35 | 36 | GType adg_param_dress_get_type (void); 37 | GParamSpec * adg_param_spec_dress (const gchar *name, 38 | const gchar *nick, 39 | const gchar *blurb, 40 | AdgDress dress, 41 | GParamFlags flags); 42 | 43 | G_END_DECLS 44 | 45 | 46 | #endif /* __ADG_PARAM_DRESS_H__ */ 47 | -------------------------------------------------------------------------------- /autotools/Locale.nsh: -------------------------------------------------------------------------------- 1 | ; Helper script to handle ADG l10n files. 2 | ; 3 | ; ADG - Automatic Drawing Generation 4 | ; Copyright (C) 2015 Nicola Fontana 5 | ; 6 | ; This file is free software; you can redistribute it and/or 7 | ; modify it under the terms of the GNU Lesser General Public 8 | ; License as published by the Free Software Foundation; either 9 | ; version 2 of the License, or (at your option) any later version. 10 | ; 11 | ; This library is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | ; Lesser General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU Lesser General Public 17 | ; License along with this library; if not, write to the 18 | ; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | ; Boston, MA 02110-1301, USA. 20 | 21 | !macro FileLocale LOCALE 22 | SetOutPath "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES" 23 | File /oname=adg.mo "${SRCDIR}/po/${LOCALE}.gmo" 24 | File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/glib20.mo" 25 | File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gdk-pixbuf.mo" 26 | File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gtk30.mo" 27 | File "${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/gtk30-properties.mo" 28 | !macroend 29 | 30 | !macro DeleteLocale LOCALE 31 | Delete "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES\adg.mo" 32 | Delete "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES\gtk30-properties.mo" 33 | Delete "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES\gtk30.mo" 34 | Delete "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES\gdk-pixbuf.mo" 35 | Delete "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES\glib20.mo" 36 | RMDir "$INSTDIR\share\locale\${LOCALE}\LC_MESSAGES" 37 | RMDir "$INSTDIR\share\locale\${LOCALE}" 38 | !macroend 39 | -------------------------------------------------------------------------------- /src/adg/adg-gtk-utils.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_GTK_UTILS_H__ 27 | #define __ADG_GTK_UTILS_H__ 28 | 29 | #define ADG_GTK_MODIFIERS (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK) 30 | 31 | 32 | G_BEGIN_DECLS 33 | 34 | #if GTK_CHECK_VERSION(2, 14, 0) 35 | #else 36 | GdkWindow * gtk_widget_get_window (GtkWidget *widget); 37 | #endif 38 | 39 | #if GTK_CHECK_VERSION(2, 20, 0) 40 | #else 41 | gboolean gtk_widget_get_realized (GtkWidget *widget); 42 | #endif 43 | 44 | void adg_gtk_window_hide_here (GtkWindow *window); 45 | void adg_gtk_toggle_button_sensitivize 46 | (GtkToggleButton*toggle_button, 47 | GtkWidget *widget); 48 | void adg_gtk_use_default_icons (const gchar *dir); 49 | 50 | G_END_DECLS 51 | 52 | 53 | #endif /* __ADG_GTK_UTILS_H__ */ 54 | -------------------------------------------------------------------------------- /src/cpml/cpml-arc.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__CPML_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __CPML_ARC_H__ 27 | #define __CPML_ARC_H__ 28 | 29 | 30 | CAIRO_BEGIN_DECLS 31 | 32 | int cpml_arc_info (const CpmlPrimitive *arc, 33 | CpmlPair *center, 34 | double *r, 35 | double *start, 36 | double *end); 37 | void cpml_arc_to_cairo (const CpmlPrimitive *arc, 38 | cairo_t *cr); 39 | void cpml_arc_to_curves (const CpmlPrimitive *arc, 40 | CpmlSegment *segment, 41 | size_t n_curves); 42 | 43 | CAIRO_END_DECLS 44 | 45 | 46 | #endif /* __CPML_ARC_H__ */ 47 | -------------------------------------------------------------------------------- /nodist/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by git-commit with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message if 6 | # it wants to stop the commit. 7 | # 8 | # To enable this hook, make this file executable. 9 | 10 | # This is slightly modified from Andrew Morton's Perfect Patch. 11 | # Lines you introduce should not have trailing whitespace. 12 | # Also check for an indentation that has SP before a TAB. 13 | 14 | if git-rev-parse --verify HEAD 2>/dev/null 15 | then 16 | git-diff-index -p -M --cached HEAD -- 17 | else 18 | # NEEDSWORK: we should produce a diff with an empty tree here 19 | # if we want to do the same verification for the initial import. 20 | : 21 | fi | 22 | perl -e ' 23 | my $found_bad = 0; 24 | my $filename; 25 | my $reported_filename = ""; 26 | my $lineno; 27 | sub bad_line { 28 | my ($why, $line) = @_; 29 | if (!$found_bad) { 30 | print STDERR "*\n"; 31 | print STDERR "* You have some suspicious patch lines:\n"; 32 | print STDERR "*\n"; 33 | $found_bad = 1; 34 | } 35 | if ($reported_filename ne $filename) { 36 | print STDERR "* In $filename\n"; 37 | $reported_filename = $filename; 38 | } 39 | print STDERR "* $why (line $lineno)\n"; 40 | print STDERR "$filename:$lineno:$line\n"; 41 | } 42 | while (<>) { 43 | if (m|^diff --git a/(.*) b/\1$|) { 44 | $filename = $1; 45 | next; 46 | } 47 | if (/^@@ -\S+ \+(\d+)/) { 48 | $lineno = $1 - 1; 49 | next; 50 | } 51 | if (/^ /) { 52 | $lineno++; 53 | next; 54 | } 55 | if (s/^\+//) { 56 | $lineno++; 57 | chomp; 58 | if (/\s$/) { 59 | bad_line("trailing whitespace", $_); 60 | } 61 | if (/^\s* \t/) { 62 | bad_line("indent SP followed by a TAB", $_); 63 | } 64 | if (/^([<>])\1{6} |^={7}$/) { 65 | bad_line("unresolved merge conflict", $_); 66 | } 67 | } 68 | } 69 | exit($found_bad); 70 | ' 71 | -------------------------------------------------------------------------------- /po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2015-03-05 Nicola Fontana 2 | 3 | make update-po 4 | 5 | 2014-12-30 Nicola Fontana 6 | 7 | * Makefile.in.in: Removed, autogenerated by gettext. 8 | * boldquot.sed: Removed, autogenerated by gettext. 9 | * en@boldquot.header: Removed, autogenerated by gettext. 10 | * en@quot.header: Removed, autogenerated by gettext. 11 | * insert-header.sin: Removed, autogenerated by gettext. 12 | * quot.sed: Removed, autogenerated by gettext. 13 | * remove-potcdate.sin: Removed, autogenerated by gettext. 14 | * Rules-quot: Removed, autogenerated by gettext. 15 | 16 | 2014-12-29 Nicola Fontana 17 | 18 | * Makevars: New file. 19 | * LINGUAS: New file. 20 | 21 | 2014-12-29 gettextize 22 | 23 | * Makefile.in.in: Upgrade to gettext-0.19.3. 24 | * boldquot.sed: New file, from gettext-0.19.3. 25 | * en@boldquot.header: New file, from gettext-0.19.3. 26 | * en@quot.header: New file, from gettext-0.19.3. 27 | * insert-header.sin: New file, from gettext-0.19.3. 28 | * quot.sed: New file, from gettext-0.19.3. 29 | * remove-potcdate.sin: New file, from gettext-0.19.3. 30 | * Rules-quot: New file, from gettext-0.19.3. 31 | 32 | 2013-02-15 Nicola Fontana 33 | 34 | * it.po: updated italian translations. 35 | 36 | 2011-01-08 Nicola Fontana 37 | 38 | * it.po: updated italian translations. 39 | 40 | 2010-12-08 Nicola Fontana 41 | 42 | * it.po: updated italian translations. 43 | * POTFILES.skip: New file. 44 | 45 | 2006-07-05 gettextize 46 | 47 | * Makefile.in.in: New file, from gettext-0.14.3. 48 | * Rules-quot: New file, from gettext-0.14.3. 49 | * boldquot.sed: New file, from gettext-0.14.3. 50 | * en@boldquot.header: New file, from gettext-0.14.3. 51 | * en@quot.header: New file, from gettext-0.14.3. 52 | * insert-header.sin: New file, from gettext-0.14.3. 53 | * quot.sed: New file, from gettext-0.14.3. 54 | * remove-potcdate.sin: New file, from gettext-0.14.3. 55 | * POTFILES.in: New file. 56 | -------------------------------------------------------------------------------- /src/adg/adg-rdim-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_RDIM_PRIVATE_H__ 22 | #define __ADG_RDIM_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* 28 | * The cairo.data array is structured in the following way: 29 | * 30 | * [0] = MOVE_TO 31 | * [1] = baseline start 32 | * [2] = LINE_TO 33 | * [3] = baseline end 34 | * [4] = MOVE_TO 35 | * [5] = outside line start 36 | * [6] = LINE_TO 37 | * [7] = outside line end 38 | */ 39 | 40 | typedef struct _AdgRDimPrivate AdgRDimPrivate; 41 | 42 | struct _AdgRDimPrivate { 43 | AdgTrail *trail; 44 | AdgMarker *marker; 45 | 46 | gdouble radius; 47 | gdouble angle; 48 | 49 | struct { 50 | CpmlPair base; 51 | } point; 52 | 53 | struct { 54 | CpmlPair base; 55 | } shift; 56 | 57 | struct { 58 | cairo_matrix_t global_map; 59 | } quote; 60 | 61 | struct { 62 | cairo_path_t path; 63 | cairo_path_data_t data[8]; 64 | } cairo; 65 | }; 66 | 67 | G_END_DECLS 68 | 69 | 70 | #endif /* __ADG_RDIM_PRIVATE_H__ */ 71 | -------------------------------------------------------------------------------- /src/adg/adg-matrix.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_MATRIX_H__ 27 | #define __ADG_MATRIX_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | const cairo_matrix_t * 33 | adg_matrix_identity (void); 34 | const cairo_matrix_t * 35 | adg_matrix_null (void); 36 | void adg_matrix_copy (cairo_matrix_t *matrix, 37 | const cairo_matrix_t *src); 38 | cairo_matrix_t *adg_matrix_dup (const cairo_matrix_t *matrix); 39 | gboolean adg_matrix_equal (const cairo_matrix_t *matrix1, 40 | const cairo_matrix_t *matrix2); 41 | gboolean adg_matrix_normalize (cairo_matrix_t *matrix); 42 | void adg_matrix_transform (cairo_matrix_t *matrix, 43 | const cairo_matrix_t *transformation, 44 | AdgTransformMode mode); 45 | void adg_matrix_dump (const cairo_matrix_t *matrix); 46 | 47 | G_END_DECLS 48 | 49 | 50 | #endif /* __ADG_MATRIX_H__ */ 51 | -------------------------------------------------------------------------------- /src/adg/adg-path-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_PATH_PRIVATE_H__ 22 | #define __ADG_PATH_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgNamedPair AdgNamedPair; 28 | typedef enum _AdgAction AdgAction; 29 | typedef struct _AdgOperation AdgOperation; 30 | typedef struct _AdgPathPrivate AdgPathPrivate; 31 | 32 | struct _AdgNamedPair { 33 | const gchar *name; 34 | CpmlPair pair; 35 | }; 36 | 37 | enum _AdgAction { 38 | ADG_ACTION_NONE, 39 | ADG_ACTION_CHAMFER, 40 | ADG_ACTION_FILLET 41 | }; 42 | 43 | struct _AdgOperation{ 44 | AdgAction action; 45 | 46 | union { 47 | struct { 48 | gdouble delta1, delta2; 49 | } chamfer; 50 | struct { 51 | gdouble radius; 52 | } fillet; 53 | } data; 54 | 55 | }; 56 | 57 | struct _AdgPathPrivate { 58 | gboolean cp_is_valid; 59 | CpmlPair cp; 60 | 61 | struct { 62 | cairo_path_t path; 63 | GArray *array; 64 | } cairo; 65 | 66 | CpmlPrimitive last; 67 | CpmlPrimitive over; 68 | AdgOperation operation; 69 | }; 70 | 71 | G_END_DECLS 72 | 73 | 74 | #endif /* __ADG_PATH_PRIVATE_H__ */ 75 | -------------------------------------------------------------------------------- /src/adg/adg-text.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_TEXT_H__ 27 | #define __ADG_TEXT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_TEXT (adg_text_get_type()) 33 | #define ADG_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_TEXT, AdgText)) 34 | #define ADG_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_TEXT, AdgTextClass)) 35 | #define ADG_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_TEXT)) 36 | #define ADG_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_TEXT)) 37 | #define ADG_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_TEXT, AdgTextClass)) 38 | 39 | typedef struct _AdgText AdgText; 40 | typedef struct _AdgTextClass AdgTextClass; 41 | 42 | struct _AdgText { 43 | /*< private >*/ 44 | AdgEntity parent; 45 | }; 46 | 47 | struct _AdgTextClass { 48 | /*< private >*/ 49 | AdgEntityClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_text_get_type (void); 54 | AdgText * adg_text_new (const gchar *text); 55 | 56 | G_END_DECLS 57 | 58 | 59 | #endif /* __ADG_TEXT_H__ */ 60 | -------------------------------------------------------------------------------- /src/adg/adg-dress.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_DRESS_H__ 27 | #define __ADG_DRESS_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_VALUE_HOLDS_DRESS(value) (G_TYPE_CHECK_VALUE_TYPE((value), ADG_TYPE_DRESS)) 33 | 34 | 35 | AdgDress adg_dress_from_name (const gchar *name); 36 | gboolean adg_dress_set (AdgDress *dress, 37 | AdgDress src); 38 | gboolean adg_dress_are_related (AdgDress dress1, 39 | AdgDress dress2); 40 | const gchar * adg_dress_get_name (AdgDress dress); 41 | GType adg_dress_get_ancestor_type (AdgDress dress); 42 | void adg_dress_set_fallback (AdgDress dress, 43 | AdgStyle *fallback); 44 | AdgStyle * adg_dress_get_fallback (AdgDress dress); 45 | gboolean adg_dress_style_is_compatible (AdgDress dress, 46 | AdgStyle *style); 47 | 48 | G_END_DECLS 49 | 50 | 51 | #endif /* __ADG_DRESS_H__ */ 52 | -------------------------------------------------------------------------------- /demo/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | AM_CPPFLAGS= -I$(top_srcdir)/src \ 4 | -I$(top_builddir)/src \ 5 | -DPKGDATADIR='"$(pkgdatadir)"' \ 6 | -DSRCDIR='"$(abs_srcdir)"' \ 7 | -DBUILDDIR='"$(abs_builddir)"' 8 | 9 | # On Windows, do not spawn the command prompt window (shown by default) 10 | # by setting a flag in the PE header of the executables 11 | if OS_WINDOWS 12 | AM_CFLAGS= -mwindows 13 | endif 14 | 15 | 16 | bin_PROGRAMS= adg-demo \ 17 | cpml-demo 18 | 19 | adg_demo_SOURCES= adg-demo.c \ 20 | demo.c \ 21 | demo.h 22 | adg_demo_CFLAGS= $(CPML_CFLAGS) \ 23 | $(ADG_CFLAGS) 24 | adg_demo_LDADD= $(CPML_LIBS) \ 25 | $(top_builddir)/src/cpml/libcpml-1.la \ 26 | $(ADG_LIBS) \ 27 | $(top_builddir)/src/adg/libadg-1.la 28 | 29 | # The CPML demo program uses the ADG library only marginally for 30 | # looking up the ui file (adg_find_file()) and for i18n. 31 | cpml_demo_SOURCES= cpml-demo.c \ 32 | demo.c \ 33 | demo.h 34 | cpml_demo_CFLAGS= $(CPML_CFLAGS) \ 35 | $(ADG_CFLAGS) 36 | cpml_demo_LDADD= $(CPML_LIBS) \ 37 | $(top_builddir)/src/cpml/libcpml-1.la \ 38 | $(ADG_LIBS) \ 39 | $(top_builddir)/src/adg/libadg-1.la 40 | 41 | 42 | if OS_WINDOWS 43 | %.rc.o: adg.manifest 44 | $(AM_V_GEN)$(WINDRES) \ 45 | --define PACKAGE_NAME="$*" \ 46 | --define PACKAGE_VERSION="$(PACKAGE_VERSION)" \ 47 | --define PACKAGE_VERSIONS=`echo $(PACKAGE_VERSION) | tr . ,` \ 48 | $(srcdir)/adg.rc $@ 49 | 50 | adg_demo_LDADD+= adg-demo.rc.o 51 | cpml_demo_LDADD+= cpml-demo.rc.o 52 | endif 53 | 54 | 55 | 56 | nodist_pkgdata_DATA= adg-demo.ui 57 | dist_pkgdata_DATA= cpml-demo.ui 58 | 59 | iconsdir= $(pkgdatadir)/icons 60 | dist_icons_DATA= icons/adg-16.png \ 61 | icons/adg-32.png \ 62 | icons/adg-48.png \ 63 | icons/adg-64.png \ 64 | icons/adg-128.png \ 65 | icons/adg-arc.png \ 66 | icons/adg-browsing.png \ 67 | icons/adg-curve.png \ 68 | icons/adg-intersection.png \ 69 | icons/adg-segment.png 70 | 71 | 72 | EXTRA_DIST= adg-demo.ui.in \ 73 | adg.rc \ 74 | adg.ico \ 75 | adg.manifest 76 | 77 | 78 | # Possibly remove files created by 'make coverage' 79 | mostlyclean-local: 80 | -rm -f *.gcda *.gcno 81 | -------------------------------------------------------------------------------- /docs/docbook2txt.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | () 37 | 38 | 39 | ------------------------------------------------------------------ 40 | 41 | ------------------------------------------------------------------ 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/adg/adg-toy-text.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_TOY_TEXT_H__ 27 | #define __ADG_TOY_TEXT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_TOY_TEXT (adg_toy_text_get_type()) 33 | #define ADG_TOY_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_TOY_TEXT, AdgToyText)) 34 | #define ADG_TOY_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_TOY_TEXT, AdgToyTextClass)) 35 | #define ADG_IS_TOY_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_TOY_TEXT)) 36 | #define ADG_IS_TOY_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_TOY_TEXT)) 37 | #define ADG_TOY_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_TOY_TEXT, AdgToyTextClass)) 38 | 39 | typedef struct _AdgToyText AdgToyText; 40 | typedef struct _AdgToyTextClass AdgToyTextClass; 41 | 42 | struct _AdgToyText { 43 | /*< private >*/ 44 | AdgEntity parent; 45 | }; 46 | 47 | struct _AdgToyTextClass { 48 | /*< private >*/ 49 | AdgEntityClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_toy_text_get_type (void); 54 | AdgToyText * adg_toy_text_new (const gchar *text); 55 | 56 | G_END_DECLS 57 | 58 | 59 | #endif /* __ADG_TOY_TEXT_H__ */ 60 | -------------------------------------------------------------------------------- /src/adg/adg-dim-style-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_DIM_STYLE_PRIVATE_H__ 22 | #define __ADG_DIM_STYLE_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgMarkerData AdgMarkerData; 28 | typedef struct _AdgDimStylePrivate AdgDimStylePrivate; 29 | 30 | struct _AdgMarkerData { 31 | GType type; 32 | guint n_properties; 33 | const char **names; 34 | GValue *values; 35 | }; 36 | 37 | struct _AdgDimStylePrivate { 38 | AdgMarkerData marker1; 39 | AdgMarkerData marker2; 40 | AdgDress color_dress; 41 | AdgDress value_dress; 42 | AdgDress min_dress; 43 | AdgDress max_dress; 44 | AdgDress line_dress; 45 | AdgDress marker_dress; 46 | gdouble from_offset; 47 | gdouble to_offset; 48 | gdouble beyond; 49 | gdouble baseline_spacing; 50 | gdouble limits_spacing; 51 | CpmlPair quote_shift; 52 | CpmlPair limits_shift; 53 | gchar *number_format; 54 | gchar *number_arguments; 55 | gchar *number_tag; 56 | gint decimals; 57 | gint rounding; 58 | }; 59 | 60 | G_END_DECLS 61 | 62 | 63 | #endif /* __ADG_DIM_STYLE_PRIVATE_H__ */ 64 | -------------------------------------------------------------------------------- /src/adg/adg-dim-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_DIM_PRIVATE_H__ 22 | #define __ADG_DIM_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | typedef struct _AdgDimPrivate AdgDimPrivate; 28 | typedef struct _AdgDimReplaceData AdgDimReplaceData; 29 | 30 | struct _AdgDimPrivate { 31 | AdgDress dim_dress; 32 | AdgPoint *ref1; 33 | AdgPoint *ref2; 34 | AdgPoint *pos; 35 | gdouble level; 36 | AdgThreeState outside; 37 | AdgThreeState detached; 38 | gchar *value; 39 | gchar *min; 40 | gchar *max; 41 | 42 | AdgDimStyle *dim_style; 43 | 44 | struct { 45 | AdgAlignment *entity; 46 | AdgTextual *value; 47 | AdgTextual *min; 48 | AdgTextual *max; 49 | } quote; 50 | 51 | struct { 52 | gboolean computed; 53 | gchar *notice; 54 | } geometry; 55 | }; 56 | 57 | struct _AdgDimReplaceData { 58 | AdgDimStyle *dim_style; 59 | gdouble value; 60 | const gchar *format; 61 | const gchar *argument; 62 | AdgThreeState valorized; 63 | /* Just for conveniency */ 64 | GRegex *regex; 65 | }; 66 | 67 | G_END_DECLS 68 | 69 | 70 | #endif /* __ADG_DIM_PRIVATE_H__ */ 71 | -------------------------------------------------------------------------------- /src/cpml/cpml-utils.c: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | /** 22 | * SECTION:cpml-utils 23 | * @Section_Id:utilities 24 | * @title: Utilities 25 | * @short_description: Assorted macros and functions 26 | * 27 | * Collection of macros and functions that do not fit inside any other topic. 28 | * 29 | * Since: 1.0 30 | **/ 31 | 32 | 33 | #include "cpml-internal.h" 34 | #include 35 | 36 | 37 | /** 38 | * cpml_angle: 39 | * @angle: an angle in radians 40 | * 41 | * Normalizes @angle, that is returns the equivalent radians value 42 | * between the range M_PI (inclusive) 43 | * and -M_PI (exclusive). 44 | * 45 | * Returns: an equivalent value in radians 46 | * 47 | * Since: 1.0 48 | **/ 49 | double 50 | cpml_angle(double angle) 51 | { 52 | while (angle > M_PI) 53 | angle -= M_PI * 2; 54 | 55 | while (angle <= -M_PI) 56 | angle += M_PI * 2; 57 | 58 | return angle; 59 | } 60 | 61 | /** 62 | * cpml_angle_distance: 63 | * @angle: first angle in radians 64 | * @from: second angle in radians 65 | * 66 | * Computes the distance between the two given angles. The returned 67 | * distance is always positive and is never greater than M_PI. 68 | * 69 | * Returns: the distance in radians 70 | * 71 | * Since: 1.0 72 | **/ 73 | double 74 | cpml_angle_distance(double angle, double from) 75 | { 76 | double delta = cpml_angle(from - angle); 77 | return fabs(delta); 78 | } 79 | -------------------------------------------------------------------------------- /src/cpml/cpml-curve.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__CPML_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __CPML_CURVE_H__ 27 | #define __CPML_CURVE_H__ 28 | 29 | typedef enum { 30 | CPML_CURVE_OFFSET_ALGORITHM_NONE, 31 | CPML_CURVE_OFFSET_ALGORITHM_DEFAULT, 32 | CPML_CURVE_OFFSET_ALGORITHM_GEOMETRICAL, 33 | CPML_CURVE_OFFSET_ALGORITHM_HANDCRAFT, 34 | CPML_CURVE_OFFSET_ALGORITHM_BAIOCA, 35 | } CpmlCurveOffsetAlgorithm; 36 | 37 | CAIRO_BEGIN_DECLS 38 | 39 | CpmlCurveOffsetAlgorithm 40 | cpml_curve_offset_algorithm (CpmlCurveOffsetAlgorithm new_algorithm); 41 | void cpml_curve_put_pair_at_time (const CpmlPrimitive *curve, 42 | double t, 43 | CpmlPair *pair); 44 | void cpml_curve_put_vector_at_time (const CpmlPrimitive *curve, 45 | double t, 46 | CpmlVector *vector); 47 | void cpml_curve_put_offset_at_time (const CpmlPrimitive *curve, 48 | double t, 49 | double offset, 50 | CpmlPair *pair); 51 | 52 | CAIRO_END_DECLS 53 | 54 | 55 | #endif /* __CPML_CURVE_H__ */ 56 | -------------------------------------------------------------------------------- /autotools/build-win: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Builds a windows installer on a UNIX system. It depends 4 | # on a lot of stuff such as wine, a proper MinGW toolchain 5 | # and my GTK2/3 cross-compiled environment found at 6 | # http://github.com/ntd/aur-fedora-mingw 7 | # 8 | # It supersedes the old configure scripts still distributed 9 | # (build/configure-win32 and build/configure-win64) by 10 | # properly cross-compiling the ADG project with 11 | # gobject-introspection enabled. 12 | # 13 | # It accepts an optional argument for specifying the target 14 | # architecture. Use "win32" (or omit the argument altogether) 15 | # for a 32 bit build, use "win64" for a 64 bit build. 16 | 17 | case "$1" in 18 | 19 | "win32" | "") 20 | arch=i686-w64-mingw32 21 | ;; 22 | 23 | "win64") 24 | arch=x86_64-w64-mingw32 25 | ;; 26 | 27 | *) 28 | echo "Invalid argument" 29 | echo "Usage: $0 [win32|win64]" 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # This script only works in the root dir or in a VPATH build 35 | # one level under the root dir 36 | if [ -x ./configure ]; then 37 | tardir=. 38 | elif [ -x ../configure ]; then 39 | tardir=.. 40 | fi 41 | 42 | # Step 1: cross-build ADG for $arch 43 | # Execute the scripts inside a subshell so there will be 44 | # no visible environment changes from outside. 45 | ( 46 | # The configure scripts provided by the aur-fedora-mingw 47 | # found at http://github.com/ntd/aur-fedora-mingw are intended to 48 | # be used from makepkg: let us adapt them for external usage 49 | CHOST=$($tardir/build/config.guess) 50 | srcdir="$TMPDIR" 51 | [ -z "$srcdir" ] && srcdir=/tmp 52 | srcdir="$srcdir/$(whoami)/adg-wine" 53 | mkdir -p "$srcdir" 54 | 55 | # Source the wrapper so the environment set by the configure script 56 | # is retained for the next make call 57 | MINGW_EXTRA_CFLAGS='-mwindows' 58 | source /usr/bin/$arch-configure "$tardir" \ 59 | --prefix= \ 60 | --enable-shared \ 61 | --enable-static \ 62 | --enable-pango \ 63 | --disable-gtk-doc \ 64 | --with-gtk=gtk3 \ 65 | --enable-introspection \ 66 | --disable-test-framework \ 67 | "$@" 68 | 69 | make -j 70 | ) 71 | 72 | # Step 2: create the installer 73 | # Force empty flags because the cached ones are intended for to be 74 | # consumed by step 1 (cross-build), not by step 2 (straight build). 75 | make -j installer CPPFLAGS= CFLAGS= LDFLAGS= 76 | -------------------------------------------------------------------------------- /src/adg/adg-hatch.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_HATCH_H__ 27 | #define __ADG_HATCH_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_HATCH (adg_hatch_get_type()) 33 | #define ADG_HATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_HATCH, AdgHatch)) 34 | #define ADG_HATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_HATCH, AdgHatchClass)) 35 | #define ADG_IS_HATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_HATCH)) 36 | #define ADG_IS_HATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_HATCH)) 37 | #define ADG_HATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_HATCH, AdgHatchClass)) 38 | 39 | typedef struct _AdgHatch AdgHatch; 40 | typedef struct _AdgHatchClass AdgHatchClass; 41 | 42 | struct _AdgHatch { 43 | /*< private >*/ 44 | AdgStroke parent; 45 | }; 46 | 47 | struct _AdgHatchClass { 48 | /*< private >*/ 49 | AdgStrokeClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_hatch_get_type (void); 54 | 55 | AdgHatch * adg_hatch_new (AdgTrail *trail); 56 | 57 | void adg_hatch_set_fill_dress (AdgHatch *hatch, 58 | AdgDress dress); 59 | AdgDress adg_hatch_get_fill_dress (AdgHatch *hatch); 60 | 61 | G_END_DECLS 62 | 63 | 64 | #endif /* __ADG_HATCH_H__ */ 65 | -------------------------------------------------------------------------------- /src/adg.h.in: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_H__ 22 | #define __ADG_H__ 23 | 24 | #include 25 | 26 | #include "adg/adg-forward-declarations.h" 27 | #include "adg/adg-cairo-fallback.h" 28 | #include "adg/adg-enums.h" 29 | #include "adg/adg-type-builtins.h" 30 | #include "adg/adg-utils.h" 31 | #include "adg/adg-matrix.h" 32 | #include "adg/adg-entity.h" 33 | #include "adg/adg-model.h" 34 | #include "adg/adg-trail.h" 35 | #include "adg/adg-path.h" 36 | #include "adg/adg-edges.h" 37 | #include "adg/adg-point.h" 38 | #include "adg/adg-marker.h" 39 | #include "adg/adg-dash.h" 40 | #include "adg/adg-style.h" 41 | #include "adg/adg-color-style.h" 42 | #include "adg/adg-line-style.h" 43 | #include "adg/adg-font-style.h" 44 | #include "adg/adg-table-style.h" 45 | #include "adg/adg-dim-style.h" 46 | #include "adg/adg-fill-style.h" 47 | #include "adg/adg-ruled-fill.h" 48 | #include "adg/adg-param-dress.h" 49 | #include "adg/adg-dress.h" 50 | #include "adg/adg-stroke.h" 51 | #include "adg/adg-hatch.h" 52 | #include "adg/adg-textual.h" 53 | #include "adg/adg-toy-text.h" 54 | #include "adg/adg-logo.h" 55 | #include "adg/adg-projection.h" 56 | #include "adg/adg-container.h" 57 | #include "adg/adg-alignment.h" 58 | #include "adg/adg-table.h" 59 | #include "adg/adg-table-row.h" 60 | #include "adg/adg-table-cell.h" 61 | #include "adg/adg-title-block.h" 62 | #include "adg/adg-arrow.h" 63 | #include "adg/adg-dim.h" 64 | #include "adg/adg-ldim.h" 65 | #include "adg/adg-rdim.h" 66 | #include "adg/adg-adim.h" 67 | #include "adg/adg-canvas.h" 68 | @ADG_H_ADDITIONAL@ 69 | 70 | #endif /* __ADG_H__ */ 71 | -------------------------------------------------------------------------------- /src/cpml/tests/test-utils.c: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | static void 27 | _cpml_behavior_angle(void) 28 | { 29 | adg_assert_isapprox(0, cpml_angle(0)); 30 | adg_assert_isapprox(0, cpml_angle(2 * M_PI)); 31 | adg_assert_isapprox(M_PI, cpml_angle(M_PI)); 32 | adg_assert_isapprox(M_PI, cpml_angle(3 * M_PI)); 33 | adg_assert_isapprox(M_PI, cpml_angle(-M_PI)); 34 | adg_assert_isapprox(M_PI, cpml_angle(-3 * M_PI)); 35 | adg_assert_isapprox(-M_PI + 1, cpml_angle(-3 * M_PI + 1)); 36 | } 37 | 38 | static void 39 | _cpml_behavior_angle_distance(void) 40 | { 41 | adg_assert_isapprox(0, cpml_angle_distance(0, 0)); 42 | adg_assert_isapprox(0, cpml_angle_distance(M_PI, M_PI)); 43 | adg_assert_isapprox(0, cpml_angle_distance(M_PI, 3 * M_PI)); 44 | adg_assert_isapprox(0, cpml_angle_distance(M_PI, -M_PI)); 45 | adg_assert_isapprox(0, cpml_angle_distance(2 * M_PI, 0)); 46 | adg_assert_isapprox(0, cpml_angle_distance(-2 * M_PI, 0)); 47 | adg_assert_isapprox(M_PI, cpml_angle_distance(0, M_PI)); 48 | adg_assert_isapprox(M_PI, cpml_angle_distance(M_PI, 0)); 49 | adg_assert_isapprox(M_PI, cpml_angle_distance(2 * M_PI, M_PI)); 50 | adg_assert_isapprox(M_PI, cpml_angle_distance(0, -M_PI)); 51 | } 52 | 53 | 54 | int 55 | main(int argc, char *argv[]) 56 | { 57 | adg_test_init(&argc, &argv); 58 | 59 | g_test_add_func("/cpml/utils/behavior/angle", _cpml_behavior_angle); 60 | g_test_add_func("/cpml/utils/behavior/angle-distance", _cpml_behavior_angle_distance); 61 | 62 | return g_test_run(); 63 | } 64 | -------------------------------------------------------------------------------- /src/adg/adg-adim-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_ADIM_PRIVATE_H__ 22 | #define __ADG_ADIM_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* 28 | * The cairo.data array is structured in the following way: 29 | * 30 | * [0] = MOVE_TO 31 | * [1] = arc start 32 | * [2] = ARC_TO 33 | * [3] = arc middle 34 | * [4] = arc end 35 | * [5] = MOVE_TO 36 | * [6] = first extension line start 37 | * [7] = LINE_TO 38 | * [8] = first extension line end 39 | * [9] = MOVE_TO 40 | * [10] = second extension line start 41 | * [11] = LINE_TO 42 | * [12] = second extension line end 43 | */ 44 | 45 | typedef struct _AdgADimPrivate AdgADimPrivate; 46 | 47 | struct _AdgADimPrivate { 48 | AdgPoint *org1; 49 | AdgPoint *org2; 50 | gboolean has_extension1; 51 | gboolean has_extension2; 52 | 53 | AdgTrail *trail; 54 | AdgMarker *marker1; 55 | AdgMarker *marker2; 56 | 57 | gdouble angle1, angle2; 58 | 59 | struct { 60 | CpmlPair base1, base12, base2; 61 | } point; 62 | 63 | struct { 64 | CpmlPair from1, from2; 65 | CpmlPair base1, base12, base2; 66 | CpmlPair to1, to2; 67 | } shift; 68 | 69 | struct { 70 | cairo_matrix_t global_map; 71 | } quote; 72 | 73 | struct { 74 | cairo_path_t path; 75 | cairo_path_data_t data[13]; 76 | } cairo; 77 | }; 78 | 79 | G_END_DECLS 80 | 81 | 82 | #endif /* __ADG_ADIM_PRIVATE_H__ */ 83 | -------------------------------------------------------------------------------- /src/adg/adg-arrow.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_ARROW_H__ 27 | #define __ADG_ARROW_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_ARROW (adg_arrow_get_type()) 33 | #define ADG_ARROW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_ARROW, AdgArrow)) 34 | #define ADG_ARROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_ARROW, AdgArrowClass)) 35 | #define ADG_IS_ARROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_ARROW)) 36 | #define ADG_IS_ARROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_ARROW)) 37 | #define ADG_ARROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_ARROW, AdgArrowClass)) 38 | 39 | typedef struct _AdgArrow AdgArrow; 40 | typedef struct _AdgArrowClass AdgArrowClass; 41 | 42 | struct _AdgArrow { 43 | /*< private >*/ 44 | AdgMarker parent; 45 | }; 46 | 47 | struct _AdgArrowClass { 48 | /*< private >*/ 49 | AdgMarkerClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_arrow_get_type (void); 54 | 55 | AdgArrow * adg_arrow_new (void); 56 | AdgArrow * adg_arrow_new_with_trail (AdgTrail *trail, 57 | gdouble pos); 58 | void adg_arrow_set_angle (AdgArrow *arrow, 59 | gdouble angle); 60 | gdouble adg_arrow_get_angle (AdgArrow *arrow); 61 | 62 | G_END_DECLS 63 | 64 | 65 | #endif /* __ADG_ARROW_H__ */ 66 | -------------------------------------------------------------------------------- /src/adg/adg-cairo-fallback.c: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #include "adg-internal.h" 22 | #include 23 | #include 24 | 25 | #include "adg-cairo-fallback.h" 26 | 27 | 28 | #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 14, 0) 29 | 30 | void 31 | cairo_surface_set_device_scale(cairo_surface_t *surface, 32 | double x_scale, double y_scale) 33 | { 34 | } 35 | 36 | #endif /* cairo < 1.14.0 */ 37 | 38 | 39 | #ifdef ADG_MISSING_GBOXED_MATRIX 40 | 41 | GType 42 | cairo_gobject_matrix_get_type(void) 43 | { 44 | static GType matrix_type = 0; 45 | 46 | if (G_UNLIKELY(matrix_type == 0)) 47 | matrix_type = g_boxed_type_register_static("CairoMatrix", 48 | (GBoxedCopyFunc) cairo_gobject_cairo_matrix_copy, 49 | g_free); 50 | 51 | return matrix_type; 52 | } 53 | 54 | cairo_matrix_t * 55 | cairo_gobject_cairo_matrix_copy(const cairo_matrix_t *matrix) 56 | { 57 | return cpml_memdup(matrix, sizeof(cairo_matrix_t)); 58 | } 59 | 60 | #endif /* ADG_MISSING_GBOXED_MATRIX */ 61 | 62 | 63 | #ifdef ADG_MISSING_GBOXED_PATTERN 64 | 65 | GType 66 | cairo_gobject_pattern_get_type(void) 67 | { 68 | static GType pattern_type = 0; 69 | 70 | if (G_UNLIKELY(pattern_type == 0)) 71 | pattern_type = g_boxed_type_register_static("CairoPattern", 72 | (GBoxedCopyFunc) cairo_pattern_reference, 73 | (GBoxedFreeFunc) cairo_pattern_destroy); 74 | 75 | return pattern_type; 76 | } 77 | 78 | #endif /* ADG_MISSING_GBOXED_PATTERN */ 79 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | src_directories = include_directories('.') 2 | 3 | 4 | # Populate the configuration data table 5 | data = configuration_data({ 6 | 'PACKAGE_NAME': meson.project_name(), 7 | 'PACKAGE_VERSION': meson.project_version(), 8 | 'PACKAGE_API': metadata['api'], 9 | 'PACKAGE_URL': metadata['homepage'], 10 | 'PACKAGE_BUGREPORT': metadata['tracker'], 11 | }) 12 | 13 | adg_h_additional = [] 14 | adg_canvas_h_additional = [] 15 | 16 | if pangocairo_dep.found() 17 | data.set('PANGO_ENABLED', 1) 18 | adg_h_additional += [ 19 | '#include ', 20 | '#include "adg/adg-text.h"', 21 | '#include "adg/adg-pango-style.h"', 22 | ] 23 | endif 24 | 25 | if gtk_dep.found() 26 | data.set(use_gtk2 ? 'GTK2_ENABLED' : 'GTK3_ENABLED', 1) 27 | adg_h_additional += [ 28 | '#include ', 29 | '#include "adg/adg-gtk-utils.h"', 30 | '#include "adg/adg-gtk-area.h"', 31 | '#include "adg/adg-gtk-layout.h"', 32 | ] 33 | adg_canvas_h_additional += [ 34 | '#include ', 35 | '', 36 | 'void adg_canvas_set_paper (AdgCanvas *canvas,', 37 | ' const gchar *paper_name,', 38 | ' GtkPageOrientation orientation);', 39 | 'void adg_canvas_set_page_setup (AdgCanvas *canvas,', 40 | ' GtkPageSetup *page_setup);', 41 | 'GtkPageSetup * adg_canvas_get_page_setup (AdgCanvas *canvas);', 42 | ] 43 | endif 44 | 45 | if introspection_dep.found() 46 | data.set('CAIRO_GOBJECT_ENABLED', 1) 47 | endif 48 | 49 | data.set('ADG_H_ADDITIONAL', '\n'.join(adg_h_additional)) 50 | data.set('ADG_CANVAS_H_ADDITIONAL', '\n'.join(adg_canvas_h_additional)) 51 | 52 | 53 | # Define or generate main header files 54 | config_h = configure_file( 55 | input: 'config.h.meson', 56 | output: '@BASENAME@', 57 | configuration: data 58 | ) 59 | 60 | cpml_h = files('cpml.h')[0] 61 | 62 | install_headers(cpml_h, subdir: 'adg-1') 63 | 64 | adg_h = configure_file( 65 | input: 'adg.h.in', 66 | output: '@BASENAME@', 67 | configuration: data, 68 | install_dir: includedir 69 | ) 70 | 71 | if catalogdir != '' 72 | install_data('adg.xml', install_dir: catalogdir) 73 | endif 74 | 75 | subdir('cpml') 76 | subdir('adg') 77 | 78 | if testing.found() 79 | subdir('tests') 80 | subdir('cpml/tests') 81 | subdir('adg/tests') 82 | endif 83 | -------------------------------------------------------------------------------- /src/adg/adg-cairo-fallback.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_CAIRO_FALLBACK_H__ 22 | #define __ADG_CAIRO_FALLBACK_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | 28 | /* Provide some GObject wrappers around cairo_matrix_t and cairo_pattern_t 29 | * if cairo-gobject support has not been provided by cairo itself or 30 | * if the cairo version is too old to provide them. */ 31 | 32 | 33 | #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 14, 0) 34 | #warning "Media scaling with adg_canvas_set_factor() not supported" 35 | 36 | void cairo_surface_set_device_scale (cairo_surface_t *surface, 37 | double x_scale, 38 | double y_scale); 39 | 40 | #endif /* cairo < 1.14.0 */ 41 | 42 | 43 | #ifndef CAIRO_GOBJECT_TYPE_MATRIX 44 | 45 | #define ADG_MISSING_GBOXED_MATRIX 1 46 | #define CAIRO_GOBJECT_TYPE_MATRIX (cairo_gobject_matrix_get_type()) 47 | 48 | GType cairo_gobject_matrix_get_type 49 | (void); 50 | cairo_matrix_t *cairo_gobject_cairo_matrix_copy 51 | (const cairo_matrix_t *matrix); 52 | 53 | #endif /* CAIRO_GOBJECT_TYPE_MATRIX */ 54 | 55 | 56 | #ifndef CAIRO_GOBJECT_TYPE_PATTERN 57 | 58 | #define ADG_MISSING_GBOXED_PATTERN 1 59 | #define CAIRO_GOBJECT_TYPE_PATTERN (cairo_gobject_pattern_get_type()) 60 | 61 | GType cairo_gobject_pattern_get_type (void); 62 | cairo_pattern_t * 63 | cairo_gobject_cairo_pattern_copy (const cairo_pattern_t *pattern); 64 | 65 | #endif /* CAIRO_GOBJECT_TYPE_PATTERN */ 66 | 67 | 68 | G_END_DECLS 69 | 70 | 71 | #endif /* __ADG_CAIRO_FALLBACK_H__ */ 72 | -------------------------------------------------------------------------------- /src/cpml/cpml-gobject.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__CPML_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __CPML_GOBJECT_H__ 27 | #define __CPML_GOBJECT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | /* See https://nvd.nist.gov/vuln/detail/CVE-2021-27219 */ 33 | #if GLIB_CHECK_VERSION(2, 68, 0) 34 | #define cpml_memdup g_memdup2 35 | #else 36 | #define cpml_memdup g_memdup 37 | #endif 38 | 39 | #define CPML_TYPE_PAIR (cpml_pair_get_type()) 40 | GType cpml_pair_get_type (void); 41 | CpmlPair * cpml_pair_dup (const CpmlPair *pair); 42 | 43 | #define CPML_TYPE_PRIMITIVE_TYPE (cpml_primitive_type_get_type()) 44 | GType cpml_primitive_type_get_type(void); 45 | 46 | #define CPML_TYPE_PRIMITIVE (cpml_primitive_get_type()) 47 | GType cpml_primitive_get_type (void); 48 | CpmlPrimitive * cpml_primitive_dup (const CpmlPrimitive *primitive); 49 | CpmlPrimitive * cpml_primitive_deep_dup (const CpmlPrimitive *primitive); 50 | 51 | #define CPML_TYPE_SEGMENT (cpml_segment_get_type()) 52 | GType cpml_segment_get_type (void); 53 | CpmlSegment * cpml_segment_dup (const CpmlSegment *segment); 54 | CpmlSegment * cpml_segment_deep_dup (const CpmlSegment *segment); 55 | 56 | #define CPML_TYPE_CURVE_OFFSET_ALGORITHM \ 57 | (cpml_curve_offset_algorithm_get_type()) 58 | GType cpml_curve_offset_algorithm_get_type 59 | (void); 60 | 61 | G_END_DECLS 62 | 63 | 64 | #endif /* __CPML_GOBJECT_H__ */ 65 | -------------------------------------------------------------------------------- /src/adg/adg-pango-style.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_PANGO_STYLE__ 27 | #define __ADG_PANGO_STYLE__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_PANGO_STYLE (adg_pango_style_get_type()) 33 | #define ADG_PANGO_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_PANGO_STYLE, AdgPangoStyle)) 34 | #define ADG_PANGO_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_PANGO_STYLE, AdgPangoStyleClass)) 35 | #define ADG_IS_PANGO_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_PANGO_STYLE)) 36 | #define ADG_IS_PANGO_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_PANGO_STYLE)) 37 | #define ADG_PANGO_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_PANGO_STYLE, AdgPangoStyleClass)) 38 | 39 | 40 | typedef struct _AdgPangoStyle AdgPangoStyle; 41 | typedef struct _AdgPangoStyleClass AdgPangoStyleClass; 42 | 43 | struct _AdgPangoStyle { 44 | /*< private >*/ 45 | AdgFontStyle parent; 46 | }; 47 | 48 | struct _AdgPangoStyleClass { 49 | /*< private >*/ 50 | AdgFontStyleClass parent_class; 51 | }; 52 | 53 | 54 | GType adg_pango_style_get_type (void); 55 | AdgPangoStyle * adg_pango_style_new (void); 56 | PangoFontDescription * 57 | adg_pango_style_get_description (AdgPangoStyle *pango_style); 58 | gint adg_pango_style_get_spacing (AdgPangoStyle *pango_style); 59 | void adg_pango_style_set_spacing (AdgPangoStyle *pango_style, 60 | gint spacing); 61 | 62 | 63 | G_END_DECLS 64 | 65 | 66 | #endif /* __ADG_PANGO_STYLE_H__ */ 67 | -------------------------------------------------------------------------------- /src/adg/adg-stroke.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_STROKE_H__ 27 | #define __ADG_STROKE_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_STROKE (adg_stroke_get_type()) 33 | #define ADG_STROKE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_STROKE, AdgStroke)) 34 | #define ADG_STROKE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_STROKE, AdgStrokeClass)) 35 | #define ADG_IS_STROKE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_STROKE)) 36 | #define ADG_IS_STROKE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_STROKE)) 37 | #define ADG_STROKE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_STROKE, AdgStrokeClass)) 38 | 39 | typedef struct _AdgStroke AdgStroke; 40 | typedef struct _AdgStrokeClass AdgStrokeClass; 41 | 42 | struct _AdgStroke { 43 | /*< private >*/ 44 | AdgEntity parent; 45 | }; 46 | 47 | struct _AdgStrokeClass { 48 | /*< private >*/ 49 | AdgEntityClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_stroke_get_type (void); 54 | 55 | AdgStroke * adg_stroke_new (AdgTrail *trail); 56 | 57 | void adg_stroke_set_line_dress (AdgStroke *stroke, 58 | AdgDress dress); 59 | AdgDress adg_stroke_get_line_dress (AdgStroke *stroke); 60 | void adg_stroke_set_trail (AdgStroke *stroke, 61 | AdgTrail *trail); 62 | AdgTrail * adg_stroke_get_trail (AdgStroke *stroke); 63 | 64 | G_END_DECLS 65 | 66 | 67 | #endif /* __ADG_STROKE_H__ */ 68 | -------------------------------------------------------------------------------- /src/cpml/meson.build: -------------------------------------------------------------------------------- 1 | cpml_directories = include_directories('.') 2 | 3 | 4 | cpml_c_files = files([ 5 | 'cpml-arc.c', 6 | 'cpml-curve.c', 7 | 'cpml-extents.c', 8 | 'cpml-gobject.c', 9 | 'cpml-line.c', 10 | 'cpml-pair.c', 11 | 'cpml-primitive.c', 12 | 'cpml-segment.c', 13 | 'cpml-utils.c', 14 | ]) 15 | 16 | cpml_h_files = files([ 17 | 'cpml-arc.h', 18 | 'cpml-curve.h', 19 | 'cpml-extents.h', 20 | 'cpml-gobject.h', 21 | 'cpml-pair.h', 22 | 'cpml-primitive.h', 23 | 'cpml-segment.h', 24 | 'cpml-utils.h', 25 | ]) 26 | 27 | cpml_internal_names = [ 28 | 'cpml-internal.h', 29 | 'cpml-primitive-private.h', 30 | ] 31 | 32 | 33 | cpml_internal_files = files(cpml_internal_names) 34 | 35 | # Build the CPML library 36 | cpml_deps = [ 37 | m_dep, 38 | gobject_dep, 39 | cairogobject_dep, 40 | cairo_dep, 41 | ] 42 | 43 | cpml_soversion = '@0@.@1@.@2@'.format( 44 | cpml_current - cpml_age, 45 | cpml_age, 46 | cpml_revision 47 | ) 48 | 49 | cpml = library('cpml-1', 50 | sources: cpml_c_files + cpml_h_files + cpml_internal_files, 51 | dependencies: cpml_deps, 52 | version: cpml_soversion, 53 | install: true 54 | ) 55 | 56 | cpml_dep = declare_dependency( 57 | dependencies: cpml_deps, 58 | link_with: cpml, 59 | include_directories: src_directories 60 | ) 61 | 62 | install_headers(cpml_h_files, subdir: 'adg-1/cpml') 63 | 64 | 65 | # pkg-config support for CPML library 66 | pkgconfig.generate(cpml, 67 | name: 'CPML', 68 | filebase: 'cpml-1', 69 | description: 'Cairo Path Manipulation Library', 70 | url: metadata['homepage'], 71 | subdirs: pkg, 72 | version: meson.project_version() 73 | ) 74 | 75 | 76 | # GObject introspection support for CPML library 77 | if introspection_dep.found() 78 | cpml_gir_args = [ '--quiet' ] 79 | # --source-top-dirs only available on recent gobject-introspection 80 | if introspection_dep.version().version_compare('>=1.59.1') 81 | cpml_gir_args += [ 82 | '--sources-top-dirs=' + meson.current_source_dir(), 83 | '--sources-top-dirs=' + meson.current_build_dir(), 84 | ] 85 | endif 86 | cpml_gir = gnome.generate_gir(cpml, 87 | sources: [ cpml_h ] + cpml_h_files + cpml_c_files, 88 | namespace: 'Cpml', 89 | nsversion: metadata['api'], 90 | identifier_prefix: 'Cpml', 91 | symbol_prefix: 'cpml', 92 | includes: [ 'cairo-1.0' ], 93 | header: 'cpml.h', 94 | install: true, 95 | extra_args: cpml_gir_args 96 | ) 97 | endif 98 | -------------------------------------------------------------------------------- /src/adg/adg-ldim-private.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __ADG_LDIM_PRIVATE_H__ 22 | #define __ADG_LDIM_PRIVATE_H__ 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* 28 | * The cairo.data array is structured in the following way: 29 | * 30 | * [0] = MOVE_TO 31 | * [1] = baseline start 32 | * [2] = LINE_TO 33 | * [3] = baseline end 34 | * [4] = MOVE_TO 35 | * [5] = first outside line start 36 | * [6] = LINE_TO 37 | * [7] = first outside line end 38 | * [8] = MOVE_TO 39 | * [9] = second outside line end 40 | * [10] = LINE_TO 41 | * [11] = second outside line start 42 | * [12] = MOVE_TO 43 | * [13] = first extension line start 44 | * [14] = LINE_TO 45 | * [15] = first extension line end 46 | * [16] = MOVE_TO 47 | * [17] = second extension line start 48 | * [18] = LINE_TO 49 | * [19] = second extension line end 50 | */ 51 | 52 | typedef struct _AdgLDimPrivate AdgLDimPrivate; 53 | 54 | struct _AdgLDimPrivate { 55 | double direction; 56 | gboolean has_extension1; 57 | gboolean has_extension2; 58 | 59 | AdgTrail *trail; 60 | AdgMarker *marker1; 61 | AdgMarker *marker2; 62 | 63 | struct { 64 | gboolean is_arranged; 65 | CpmlPair base1, base2; 66 | gdouble distance; 67 | } geometry; 68 | 69 | struct { 70 | gboolean is_arranged; 71 | CpmlPair from, base, to; 72 | } shift; 73 | 74 | struct { 75 | cairo_matrix_t global_map; 76 | } quote; 77 | 78 | struct { 79 | cairo_path_t path; 80 | cairo_path_data_t data[20]; 81 | } cairo; 82 | }; 83 | 84 | G_END_DECLS 85 | 86 | 87 | #endif /* __ADG_LDIM_PRIVATE_H__ */ 88 | -------------------------------------------------------------------------------- /adg.doap: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | adg 8 | 9 | 10 | Automatic Drawing Generation (ADG for short) is a non-interactive canvas 11 | for generating technical drawings. 12 | 13 | 14 | 15 | Automatic Drawing Generation is GObject-based library that provides 16 | a non-interactive cairo canvas specifically designed for generating 17 | technical drawings. 18 | 19 | If you want to develop an application that needs to show and print 20 | drawings where some data changes but the overall design is always the 21 | same, the ADG library can be quite useful. A typical example would 22 | be the technical office of a manufacturing industry. 23 | 24 | 25 | 26 | 27 | 28 | Developers 29 | C 30 | GTK+ 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Nicola Fontana 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/cpml/cpml-extents.h: -------------------------------------------------------------------------------- 1 | /* CPML - Cairo Path Manipulation Library 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__CPML_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __CPML_EXTENTS_H__ 27 | #define __CPML_EXTENTS_H__ 28 | 29 | 30 | CAIRO_BEGIN_DECLS 31 | 32 | typedef struct _CpmlExtents CpmlExtents; 33 | 34 | struct _CpmlExtents { 35 | /*< public >*/ 36 | int is_defined; 37 | CpmlPair org; 38 | CpmlVector size; 39 | }; 40 | 41 | 42 | void cpml_extents_copy (CpmlExtents *extents, 43 | const CpmlExtents *src); 44 | void cpml_extents_from_cairo_text (CpmlExtents *extents, 45 | const cairo_text_extents_t 46 | *cairo_extents); 47 | int cpml_extents_equal (const CpmlExtents *extents, 48 | const CpmlExtents *src); 49 | void cpml_extents_add (CpmlExtents *extents, 50 | const CpmlExtents *src); 51 | void cpml_extents_pair_add (CpmlExtents *extents, 52 | const CpmlPair *src); 53 | int cpml_extents_is_inside (const CpmlExtents *extents, 54 | const CpmlExtents *src); 55 | int cpml_extents_pair_is_inside (const CpmlExtents *extents, 56 | const CpmlPair *src); 57 | void cpml_extents_transform (CpmlExtents *extents, 58 | const cairo_matrix_t *matrix); 59 | 60 | CAIRO_END_DECLS 61 | 62 | 63 | #endif /* __CPML_EXTENTS_H__ */ 64 | -------------------------------------------------------------------------------- /docs/adg/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | DOC_MODULE= adg 4 | DOC_MAIN_SGML_FILE= $(DOC_MODULE)-docs.xml 5 | DOC_SOURCE_DIR= $(top_srcdir)/src/adg 6 | SCANGOBJ_OPTIONS= 7 | SCAN_OPTIONS= --rebuild-types \ 8 | --rebuild-sections 9 | MKDB_OPTIONS= --name-space=adg \ 10 | --sgml-mode \ 11 | --output-format=xml \ 12 | --default-includes="$(DOC_MODULE)-1/$(DOC_MODULE).h" 13 | MKHTML_OPTIONS= 14 | FIXXREF_OPTIONS= --extra-dir=$(top_builddir)/docs/cpml/html \ 15 | $(EXTRADIR) 16 | HFILE_GLOB= $(DOC_SOURCE_DIR)/*.h 17 | EXTRA_HFILES= $(ADG_CANVAS_H) 18 | CFILE_GLOB= $(DOC_SOURCE_DIR)/*.c 19 | IGNORE_HFILES= adg.h \ 20 | adg-adim-private.h \ 21 | adg-alignment-private.h \ 22 | adg-arrow-private.h \ 23 | adg-cairo-fallback.h \ 24 | adg-canvas-private.h \ 25 | adg-color-style-private.h \ 26 | adg-container-private.h \ 27 | adg-dash-private.h \ 28 | adg-dim-private.h \ 29 | adg-dim-style-private.h \ 30 | adg-dress-private.h \ 31 | adg-edges-private.h \ 32 | adg-entity-private.h \ 33 | adg-fill-style-private.h \ 34 | adg-font-style-private.h \ 35 | adg-forward-declarations.h \ 36 | adg-gtk-area-private.h \ 37 | adg-gtk-layout-private.h \ 38 | adg-hatch-private.h \ 39 | adg-internal.h \ 40 | adg-introspection.h \ 41 | adg-ldim-private.h \ 42 | adg-line-style-private.h \ 43 | adg-logo-private.h \ 44 | adg-marker-private.h \ 45 | adg-marshal.h \ 46 | adg-matrix-fallback.h \ 47 | adg-model-private.h \ 48 | adg-pango-style-private.h \ 49 | adg-path-private.h \ 50 | adg-projection-private.h \ 51 | adg-rdim-private.h \ 52 | adg-ruled-fill-private.h \ 53 | adg-stroke-private.h \ 54 | adg-table-private.h \ 55 | adg-table-style-private.h \ 56 | adg-text-private.h \ 57 | adg-title-block-private.h \ 58 | adg-toy-text-private.h \ 59 | adg-trail-private.h \ 60 | adg-type-builtins.h \ 61 | test-internal.h 62 | HTML_IMAGES= 63 | content_files= CONTRIBUTING.xml \ 64 | HACKING.xml \ 65 | NEWS.xml \ 66 | README.xml \ 67 | TODO.xml 68 | expand_content_files= 69 | 70 | GTKDOC_CFLAGS= -I$(top_srcdir)/src \ 71 | $(CAIRO_CFLAGS) \ 72 | $(CAIRO_GOBJECT_CFLAGS) \ 73 | $(GOBJECT2_CFLAGS) 74 | GTKDOC_LIBS= $(top_builddir)/src/adg/libadg-1.la \ 75 | $(top_builddir)/src/cpml/libcpml-1.la 76 | 77 | if HAVE_GTK2 78 | GTKDOC_CFLAGS+= $(GTK2_CFLAGS) 79 | GTKDOC_LIBS+= $(GTK2_LIBS) 80 | endif 81 | 82 | if HAVE_PANGO 83 | GTKDOC_CFLAGS+= $(PANGO_CFLAGS) 84 | GTKDOC_LIBS+= $(PANGO_LIBS) 85 | endif 86 | 87 | GTKDOC_LIBS+= $(CAIRO_LIBS) \ 88 | $(CAIRO_GOBJECT_LIBS) \ 89 | $(GOBJECT2_LIBS) 90 | 91 | include $(top_srcdir)/autotools/Makefile.am.gtk-doc 92 | 93 | DISTCLEANFILES= $(DOC_MODULE)-sections.txt \ 94 | $(DOC_MODULE).types 95 | 96 | EXTRA_DIST+= $(content_files) 97 | -------------------------------------------------------------------------------- /src/adg/adg-gtk-layout.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_GTK_LAYOUT_H__ 27 | #define __ADG_GTK_LAYOUT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_GTK_TYPE_LAYOUT (adg_gtk_layout_get_type()) 33 | #define ADG_GTK_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_GTK_TYPE_LAYOUT, AdgGtkLayout)) 34 | #define ADG_GTK_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_GTK_TYPE_LAYOUT, AdgGtkLayoutClass)) 35 | #define ADG_GTK_IS_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_GTK_TYPE_LAYOUT)) 36 | #define ADG_GTK_IS_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_GTK_TYPE_LAYOUT)) 37 | #define ADG_GTK_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_GTK_TYPE_LAYOUT, AdgGtkLayoutClass)) 38 | 39 | typedef struct _AdgGtkLayout AdgGtkLayout; 40 | typedef struct _AdgGtkLayoutClass AdgGtkLayoutClass; 41 | 42 | struct _AdgGtkLayout { 43 | /*< private >*/ 44 | AdgGtkArea parent; 45 | }; 46 | 47 | struct _AdgGtkLayoutClass { 48 | /*< private >*/ 49 | AdgGtkAreaClass parent_class; 50 | }; 51 | 52 | 53 | GType adg_gtk_layout_get_type (void); 54 | 55 | GtkWidget * adg_gtk_layout_new (void); 56 | GtkWidget * adg_gtk_layout_new_with_canvas (AdgCanvas *canvas); 57 | void adg_gtk_layout_set_hadjustment (AdgGtkLayout *layout, 58 | GtkAdjustment *hadjustment); 59 | GtkAdjustment * adg_gtk_layout_get_hadjustment (AdgGtkLayout *layout); 60 | void adg_gtk_layout_set_vadjustment (AdgGtkLayout *layout, 61 | GtkAdjustment *vadjustment); 62 | GtkAdjustment * adg_gtk_layout_get_vadjustment (AdgGtkLayout *layout); 63 | 64 | 65 | G_END_DECLS 66 | 67 | 68 | #endif /* __ADG_GTK_LAYOUT_H__ */ 69 | -------------------------------------------------------------------------------- /src/adg/adg-text-internal.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /** 21 | * SECTION:adg-text-internal 22 | * @Section_Id:adg-text-internal 23 | * @title: AdgBestText and AdgBestFontStyle 24 | * @short_description: Fake types for text renderdering 25 | * 26 | * The `adg-text-internal.h` helper header provides: 27 | * 28 | * - an internal proxy type (`AdgBestFontStyle`) that resolves to 29 | * #AdgFontStyle or #AdgPangoStyle, depending on wheter or not 30 | * the pango support has been compiled; 31 | * - an internal proxy type (`AdgBestText`) that resolves to 32 | * #AdgToyText or #AdgText, depending on wheter or not the pango 33 | * support has been compiled; 34 | * 35 | * Since: 1.0 36 | **/ 37 | 38 | /** 39 | * ADG_TYPE_BEST_TEXT: 40 | * 41 | * A GType identifier that resolves to the best available text entity, 42 | * i.e. ADG_TYPE_TEXT (if the Pango support has been enabled) or 43 | * or ADG_TYPE_TOY_TEXT. 44 | * 45 | * Since: 1.0 46 | **/ 47 | 48 | /** 49 | * ADG_TYPE_BEST_FONT_STYLE: 50 | * 51 | * A GType identifier that resolves to the best available font style, 52 | * i.e. ADG_TYPE_PANGO_STYLE (if the Pango support has been enabled) 53 | * or ADG_TYPE_FONT_STYLE. 54 | * 55 | * Since: 1.0 56 | **/ 57 | 58 | #ifndef __ADG_TEXT_INTERNAL_H__ 59 | #define __ADG_TEXT_INTERNAL_H__ 60 | 61 | 62 | #include "adg-textual.h" 63 | #include "adg-entity.h" 64 | #include "adg-toy-text.h" 65 | #include "adg-style.h" 66 | #include "adg-font-style.h" 67 | 68 | 69 | #ifdef PANGO_ENABLED 70 | 71 | #include 72 | #include "adg-text.h" 73 | #include "adg-pango-style.h" 74 | 75 | #define ADG_TYPE_BEST_TEXT ADG_TYPE_TEXT 76 | #define ADG_TYPE_BEST_FONT_STYLE ADG_TYPE_PANGO_STYLE 77 | 78 | #else /* ! PANGO_ENABLED */ 79 | 80 | #define ADG_TYPE_BEST_TEXT ADG_TYPE_TOY_TEXT 81 | #define ADG_TYPE_BEST_FONT_STYLE ADG_TYPE_FONT_STYLE 82 | 83 | #endif /* PANGO_ENABLED */ 84 | 85 | 86 | #endif /* __ADG_TEXT_INTERNAL_H__ */ 87 | -------------------------------------------------------------------------------- /src/cpml/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/autotools/Makefile.am.common 2 | 3 | 4 | if HAVE_TEST_FRAMEWORK 5 | SUBDIRS= tests 6 | endif 7 | 8 | 9 | AM_CFLAGS= $(CPML_CFLAGS) 10 | AM_CPPFLAGS= -I$(top_srcdir)/src \ 11 | -I$(top_builddir)/src 12 | 13 | 14 | # file groups 15 | h_sources= cpml-arc.h \ 16 | cpml-curve.h \ 17 | cpml-extents.h \ 18 | cpml-pair.h \ 19 | cpml-primitive.h \ 20 | cpml-segment.h \ 21 | cpml-utils.h 22 | built_h_sources= 23 | private_h_sources= cpml-internal.h \ 24 | cpml-primitive-private.h 25 | built_private_h_sources= 26 | c_sources= cpml-arc.c \ 27 | cpml-curve.c \ 28 | cpml-extents.c \ 29 | cpml-line.c \ 30 | cpml-pair.c \ 31 | cpml-primitive.c \ 32 | cpml-segment.c \ 33 | cpml-utils.c 34 | built_c_sources= 35 | EXTRA_DIST= cpml-1.pc.in 36 | 37 | # targets 38 | BUILT_SOURCES= $(built_h_sources) \ 39 | $(built_private_h_sources) \ 40 | $(built_c_sources) 41 | CLEANFILES= $(built_h_sources) \ 42 | $(built_private_h_sources) \ 43 | $(built_c_sources) 44 | 45 | pkgconfig_DATA= cpml-1.pc 46 | 47 | cpml_includedir= $(includedir)/adg-1/cpml 48 | cpml_include_DATA= $(h_sources) \ 49 | $(built_h_sources) 50 | 51 | lib_LTLIBRARIES= libcpml-1.la 52 | libcpml_1_la_SOURCES= $(h_sources) \ 53 | $(private_h_sources) \ 54 | $(c_sources) 55 | nodist_libcpml_1_la_SOURCES= $(built_h_sources) \ 56 | $(built_private_h_sources) \ 57 | $(built_c_sources) 58 | libcpml_1_la_LDFLAGS= -no-undefined \ 59 | -version-info $(CPML_LT_VERSION) 60 | libcpml_1_la_LIBADD= $(CPML_LIBS) 61 | 62 | 63 | ## GObject introspection 64 | 65 | -include $(INTROSPECTION_MAKEFILE) 66 | INTROSPECTION_GIRS= 67 | INTROSPECTION_SCANNER_ARGS= 68 | INTROSPECTION_COMPILER_ARGS= 69 | 70 | if HAVE_INTROSPECTION 71 | 72 | Cpml-1.0.gir: libcpml-1.la 73 | 74 | INTROSPECTION_GIRS+= Cpml-1.0.gir 75 | Cpml_1_0_gir_LIBS= libcpml-1.la 76 | Cpml_1_0_gir_INCLUDES= cairo-1.0 77 | Cpml_1_0_gir_FILES= ../cpml.h \ 78 | $(h_sources) \ 79 | $(c_sources) 80 | Cpml_1_0_gir_SCANNERFLAGS= $(AM_CPPFLAGS) \ 81 | --c-include="cpml.h" \ 82 | --warn-all 83 | girdir= $(ADG_GIRDIR) 84 | dist_gir_DATA= $(INTROSPECTION_GIRS) 85 | typelibdir= $(ADG_TYPELIBDIR) 86 | typelib_DATA= Cpml-1.0.typelib 87 | CLEANFILES+= $(dist_gir_DATA) \ 88 | $(typelib_DATA) 89 | 90 | endif 91 | 92 | 93 | # Although actually GObject wrappers are always compiled, 94 | # this feature can be easily made optional if needed. 95 | 96 | h_sources+= cpml-gobject.h 97 | c_sources+= cpml-gobject.c 98 | 99 | 100 | coverage: 101 | $(GCOV) $(srcdir)/*.c -s $(srcdir) -o .libs 102 | 103 | # Possibly remove files created by 'make coverage' 104 | mostlyclean-local: 105 | -rm -f *.gcov 106 | 107 | .PHONY: coverage 108 | -------------------------------------------------------------------------------- /src/adg/adg-logo.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_LOGO_H__ 27 | #define __ADG_LOGO_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_LOGO (adg_logo_get_type()) 33 | #define ADG_LOGO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_LOGO, AdgLogo)) 34 | #define ADG_LOGO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_LOGO, AdgLogoClass)) 35 | #define ADG_IS_LOGO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_LOGO)) 36 | #define ADG_IS_LOGO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_LOGO)) 37 | #define ADG_LOGO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_LOGO, AdgLogoClass)) 38 | 39 | typedef struct _AdgLogo AdgLogo; 40 | typedef struct _AdgLogoClass AdgLogoClass; 41 | 42 | struct _AdgLogo { 43 | /*< private >*/ 44 | AdgEntity parent; 45 | }; 46 | 47 | struct _AdgLogoClass { 48 | /*< private >*/ 49 | AdgEntityClass parent_class; 50 | gpointer data_class; 51 | }; 52 | 53 | 54 | GType adg_logo_get_type (void); 55 | 56 | AdgLogo * adg_logo_new (void); 57 | 58 | void adg_logo_set_symbol_dress (AdgLogo *logo, 59 | AdgDress dress); 60 | AdgDress adg_logo_get_symbol_dress (AdgLogo *logo); 61 | void adg_logo_set_screen_dress (AdgLogo *logo, 62 | AdgDress dress); 63 | AdgDress adg_logo_get_screen_dress (AdgLogo *logo); 64 | void adg_logo_set_frame_dress (AdgLogo *logo, 65 | AdgDress dress); 66 | AdgDress adg_logo_get_frame_dress (AdgLogo *logo); 67 | 68 | G_END_DECLS 69 | 70 | 71 | #endif /* __ADG_LOGO_H__ */ 72 | -------------------------------------------------------------------------------- /src/adg/adg-point.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_POINT_H__ 27 | #define __ADG_POINT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_POINT (adg_point_get_type()) 33 | 34 | 35 | GType adg_point_get_type (void); 36 | 37 | AdgPoint * adg_point_new (void); 38 | AdgPoint * adg_point_dup (const AdgPoint *src); 39 | void adg_point_destroy (AdgPoint *point); 40 | void adg_point_copy (AdgPoint *point, 41 | const AdgPoint *src); 42 | void adg_point_set_pair (AdgPoint *point, 43 | const CpmlPair *pair); 44 | void adg_point_set_pair_explicit (AdgPoint *point, 45 | gdouble x, 46 | gdouble y); 47 | void adg_point_set_pair_from_model (AdgPoint *point, 48 | AdgModel *model, 49 | const gchar *name); 50 | void adg_point_invalidate (AdgPoint *point); 51 | void adg_point_unset (AdgPoint *point); 52 | gboolean adg_point_update (AdgPoint *point); 53 | CpmlPair * adg_point_get_pair (AdgPoint *point); 54 | AdgModel * adg_point_get_model (const AdgPoint *point); 55 | const gchar * adg_point_get_name (const AdgPoint *point); 56 | gboolean adg_point_equal (const AdgPoint *point1, 57 | const AdgPoint *point2); 58 | 59 | G_END_DECLS 60 | 61 | 62 | #endif /* __ADG_POINT_H__ */ 63 | -------------------------------------------------------------------------------- /src/adg/adg-style.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_STYLE_H__ 27 | #define __ADG_STYLE_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_STYLE (adg_style_get_type()) 33 | #define ADG_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_STYLE, AdgStyle)) 34 | #define ADG_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_STYLE, AdgStyleClass)) 35 | #define ADG_IS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_STYLE)) 36 | #define ADG_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_STYLE)) 37 | #define ADG_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_STYLE, AdgStyleClass)) 38 | 39 | 40 | typedef struct _AdgStyleClass AdgStyleClass; 41 | 42 | struct _AdgStyle { 43 | /*< private >*/ 44 | GObject parent; 45 | }; 46 | 47 | struct _AdgStyleClass { 48 | /*< private >*/ 49 | GObjectClass parent_class; 50 | 51 | /*< public >*/ 52 | /* Virtual table */ 53 | AdgStyle * (*clone) (AdgStyle *style); 54 | 55 | /* Signals */ 56 | void (*invalidate) (AdgStyle *style); 57 | void (*apply) (AdgStyle *style, 58 | AdgEntity *entity, 59 | cairo_t *cr); 60 | }; 61 | 62 | 63 | GType adg_style_get_type (void); 64 | 65 | AdgStyle * adg_style_clone (AdgStyle *style); 66 | void adg_style_invalidate (AdgStyle *style); 67 | void adg_style_apply (AdgStyle *style, 68 | AdgEntity *entity, 69 | cairo_t *cr); 70 | 71 | G_END_DECLS 72 | 73 | 74 | #endif /* __ADG_STYLE_H__ */ 75 | -------------------------------------------------------------------------------- /src/adg/adg-edges.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_EDGES_H__ 27 | #define __ADG_EDGES_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_EDGES (adg_edges_get_type()) 33 | #define ADG_EDGES(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_EDGES, AdgEdges)) 34 | #define ADG_EDGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_EDGES, AdgEdgesClass)) 35 | #define ADG_IS_EDGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_EDGES)) 36 | #define ADG_IS_EDGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_EDGES)) 37 | #define ADG_EDGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_EDGES, AdgEdgesClass)) 38 | 39 | 40 | typedef struct _AdgEdges AdgEdges; 41 | typedef struct _AdgEdgesClass AdgEdgesClass; 42 | 43 | struct _AdgEdges { 44 | /*< private >*/ 45 | AdgTrail parent; 46 | }; 47 | 48 | struct _AdgEdgesClass { 49 | /*< private >*/ 50 | AdgTrailClass parent_class; 51 | }; 52 | 53 | 54 | GType adg_edges_get_type (void); 55 | AdgEdges * adg_edges_new (void); 56 | AdgEdges * adg_edges_new_with_source (AdgTrail *source); 57 | 58 | void adg_edges_set_source (AdgEdges *edges, 59 | AdgTrail *source); 60 | AdgTrail * adg_edges_get_source (AdgEdges *edges); 61 | void adg_edges_set_axis_angle (AdgEdges *edges, 62 | gdouble angle); 63 | gdouble adg_edges_get_axis_angle (AdgEdges *edges); 64 | void adg_edges_set_critical_angle (AdgEdges *edges, 65 | gdouble angle); 66 | gdouble adg_edges_get_critical_angle (AdgEdges *edges); 67 | 68 | G_END_DECLS 69 | 70 | 71 | #endif /* __ADG_EDGES_H__ */ 72 | -------------------------------------------------------------------------------- /src/adg/tests/test-textual.c: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #include 22 | #include 23 | 24 | #define ADG_TYPE_DUMMY (adg_dummy_get_type()) 25 | 26 | 27 | typedef GObject AdgDummy; 28 | typedef GObjectClass AdgDummyClass; 29 | 30 | static void 31 | adg_dummy_class_init(AdgDummyClass *klass) 32 | { 33 | } 34 | 35 | static void 36 | _adg_dummy_iface_init(AdgTextualIface *iface) 37 | { 38 | iface->set_font_dress = NULL; 39 | iface->get_font_dress = NULL; 40 | iface->set_text = NULL; 41 | iface->dup_text = NULL; 42 | iface->text_changed = NULL; 43 | } 44 | 45 | static void 46 | adg_dummy_init(AdgDummy *dummy) 47 | { 48 | } 49 | 50 | G_DEFINE_TYPE_WITH_CODE(AdgDummy, adg_dummy, G_TYPE_OBJECT, 51 | G_IMPLEMENT_INTERFACE(ADG_TYPE_TEXTUAL, 52 | _adg_dummy_iface_init)) 53 | 54 | 55 | static void 56 | _adg_behavior_misc(void) 57 | { 58 | AdgDummy *dummy = g_object_new(ADG_TYPE_DUMMY, NULL); 59 | 60 | /* Ensure NULL virtual methods do not crash the process */ 61 | adg_textual_set_font_dress(ADG_TEXTUAL(dummy), ADG_DRESS_TABLE); 62 | g_assert_cmpint(adg_textual_get_font_dress(ADG_TEXTUAL(dummy)), ==, ADG_DRESS_UNDEFINED); 63 | adg_textual_set_text(ADG_TEXTUAL(dummy), "dummy"); 64 | g_assert_null(adg_textual_dup_text(ADG_TEXTUAL(dummy))); 65 | 66 | g_object_unref(dummy); 67 | } 68 | 69 | static void 70 | _adg_method_text_changed(void) 71 | { 72 | AdgDummy *dummy = g_object_new(ADG_TYPE_DUMMY, NULL); 73 | 74 | adg_test_signal(dummy, "text-changed"); 75 | adg_textual_text_changed(ADG_TEXTUAL(dummy), "old text"); 76 | g_assert_true(adg_test_signal_check(TRUE)); 77 | 78 | g_object_unref(dummy); 79 | } 80 | 81 | 82 | int 83 | main(int argc, char *argv[]) 84 | { 85 | adg_test_init(&argc, &argv); 86 | 87 | g_test_add_func("/adg/textual/behavior/misc", _adg_behavior_misc); 88 | 89 | g_test_add_func("/adg/textual/method/text-changed", _adg_method_text_changed); 90 | 91 | return g_test_run(); 92 | } 93 | -------------------------------------------------------------------------------- /src/adg/adg-fill-style.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_FILL_STYLE_H__ 27 | #define __ADG_FILL_STYLE_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_FILL_STYLE (adg_fill_style_get_type()) 33 | #define ADG_FILL_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_FILL_STYLE, AdgFillStyle)) 34 | #define ADG_FILL_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_FILL_STYLE, AdgFillStyleClass)) 35 | #define ADG_IS_FILL_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_FILL_STYLE)) 36 | #define ADG_IS_FILL_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_FILL_STYLE)) 37 | #define ADG_FILL_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_FILL_STYLE, AdgFillStyleClass)) 38 | 39 | 40 | typedef struct _AdgFillStyle AdgFillStyle; 41 | typedef struct _AdgFillStyleClass AdgFillStyleClass; 42 | 43 | struct _AdgFillStyle { 44 | /*< private >*/ 45 | AdgStyle parent; 46 | }; 47 | 48 | struct _AdgFillStyleClass { 49 | /*< private >*/ 50 | AdgStyleClass parent_class; 51 | 52 | /*< public >*/ 53 | /* Virtual table */ 54 | void (*set_extents) (AdgFillStyle *fill_style, 55 | const CpmlExtents *extents); 56 | }; 57 | 58 | 59 | GType adg_fill_style_get_type (void); 60 | void adg_fill_style_set_pattern (AdgFillStyle *fill_style, 61 | cairo_pattern_t *pattern); 62 | cairo_pattern_t * adg_fill_style_get_pattern (AdgFillStyle *fill_style); 63 | void adg_fill_style_set_extents (AdgFillStyle *fill_style, 64 | const CpmlExtents *extents); 65 | const CpmlExtents *adg_fill_style_get_extents (AdgFillStyle *fill_style); 66 | 67 | G_END_DECLS 68 | 69 | 70 | #endif /* __ADG_FILL_STYLE_H__ */ 71 | -------------------------------------------------------------------------------- /src/adg/adg-table-row.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_TABLE_ROW_H__ 27 | #define __ADG_TABLE_ROW_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_TABLE_ROW (adg_table_row_get_type()) 33 | 34 | 35 | GType adg_table_row_get_type (void); 36 | 37 | AdgTableRow * adg_table_row_dup (const AdgTableRow *src); 38 | AdgTableRow * adg_table_row_new (AdgTable *table); 39 | AdgTableRow * adg_table_row_new_before (AdgTableRow *before_row); 40 | void adg_table_row_free (AdgTableRow *table_row); 41 | void adg_table_row_insert (AdgTableRow *table_row, 42 | AdgTableCell *table_cell, 43 | AdgTableCell *before_cell); 44 | void adg_table_row_remove (AdgTableRow *table_row, 45 | AdgTableCell *table_cell); 46 | void adg_table_row_foreach (AdgTableRow *table_row, 47 | GCallback callback, 48 | gpointer user_data); 49 | AdgTable * adg_table_row_get_table (AdgTableRow *table_row); 50 | void adg_table_row_set_height (AdgTableRow *table_row, 51 | gdouble height); 52 | gdouble adg_table_row_get_height (AdgTableRow *table_row); 53 | const CpmlExtents * 54 | adg_table_row_get_extents (AdgTableRow *table_row); 55 | const CpmlPair *adg_table_row_size_request (AdgTableRow *table_row); 56 | const CpmlExtents * 57 | adg_table_row_arrange (AdgTableRow *table_row, 58 | const CpmlExtents *layout); 59 | 60 | G_END_DECLS 61 | 62 | 63 | #endif /* __ADG_TABLE_ROW_H__ */ 64 | -------------------------------------------------------------------------------- /src/adg/adg-alignment.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_ALIGNMENT_H__ 27 | #define __ADG_ALIGNMENT_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_ALIGNMENT (adg_alignment_get_type()) 33 | #define ADG_ALIGNMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_ALIGNMENT, AdgAlignment)) 34 | #define ADG_ALIGNMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_ALIGNMENT, AdgAlignmentClass)) 35 | #define ADG_IS_ALIGNMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_ALIGNMENT)) 36 | #define ADG_IS_ALIGNMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_ALIGNMENT)) 37 | #define ADG_ALIGNMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_ALIGNMENT, AdgAlignmentClass)) 38 | 39 | 40 | typedef struct _AdgAlignment AdgAlignment; 41 | typedef struct _AdgAlignmentClass AdgAlignmentClass; 42 | 43 | struct _AdgAlignment { 44 | /*< private >*/ 45 | AdgContainer parent; 46 | }; 47 | 48 | struct _AdgAlignmentClass { 49 | /*< private >*/ 50 | AdgContainerClass parent_class; 51 | }; 52 | 53 | 54 | GType adg_alignment_get_type (void); 55 | 56 | AdgAlignment * adg_alignment_new (const CpmlPair *factor); 57 | AdgAlignment * adg_alignment_new_explicit (gdouble x_factor, 58 | gdouble y_factor); 59 | 60 | void adg_alignment_set_factor (AdgAlignment *alignment, 61 | const CpmlPair *factor); 62 | void adg_alignment_set_factor_explicit 63 | (AdgAlignment *alignment, 64 | gdouble x_factor, 65 | gdouble y_factor); 66 | const CpmlPair *adg_alignment_get_factor (AdgAlignment *alignment); 67 | 68 | G_END_DECLS 69 | 70 | 71 | #endif /* __ADG_ALIGNMENT_H__ */ 72 | -------------------------------------------------------------------------------- /nodist/overview.tex: -------------------------------------------------------------------------------- 1 | \documentclass[tikz=true,border=12pt]{standalone} 2 | 3 | % Set some useful default 4 | \tikzset{% 5 | font=\sffamily\scriptsize, 6 | shorten >= 5, 7 | shorten <= 5, 8 | every label/.style={ 9 | label distance=20 10 | }, 11 | every path/.style={ 12 | very thick, 13 | >=stealth 14 | }, 15 | every label/.style={ 16 | font=\sffamily\small 17 | } 18 | } 19 | 20 | \begin{document} 21 | \begin{tikzpicture}[node distance=150] 22 | 23 | \node[label=APPLICATION] (gear) 24 | {\includegraphics[scale=0.2]{symbols-9}}; 25 | \node[below of=gear, label=below:DATABASE] (database) 26 | {\includegraphics[scale=0.2]{symbols-1}}; 27 | \node[right of=gear, label=ADG CANVAS] (adg) 28 | {\includegraphics[scale=0.2]{symbols-8}}; 29 | \node[below of=adg, label=below:WORKSTATION] (workstation) 30 | {\includegraphics[scale=0.2]{symbols-7}}; 31 | \node[right of=adg, label=DRAWING FILE] (sheet) 32 | {\includegraphics[scale=0.2]{symbols-3}}; 33 | \node[below of=sheet] (printer) 34 | {\includegraphics[scale=0.2]{symbols-2}}; 35 | 36 | \draw [<->] (gear) -- (database); 37 | \draw [<->, shorten <= -5, shorten >= 8] (gear) -- (workstation); 38 | \draw [->] (gear) -- (adg); 39 | \draw [->] (adg) -- node[above=-2] {PDF or PS} node[below=-2]{BACKEND} (sheet); 40 | \draw [->] (adg) -- node[right=-2, align=left] {XLIB\\BACKEND} (workstation); 41 | \draw [->] (sheet) -- (printer); 42 | 43 | \node[yshift=60] at (adg) 44 | {Overview of a typical \textbf{desktop} application}; 45 | 46 | \end{tikzpicture} 47 | \begin{tikzpicture}[node distance=120] 48 | 49 | \node[label=APPLICATION] (gear) 50 | {\includegraphics[scale=0.2]{symbols-9}}; 51 | \node[below of=gear, label=below:DATABASE] (database) 52 | {\includegraphics[scale=0.2]{symbols-1}}; 53 | \node[right of=gear, label=ADG CANVAS] (adg) 54 | {\includegraphics[scale=0.2]{symbols-8}}; 55 | \node[below of=adg, label=below:SERVER] (server) 56 | {\includegraphics[scale=0.2]{symbols-0}}; 57 | \node[right of=adg, label=DRAWING FILE] (sheet) 58 | {\includegraphics[scale=0.2]{symbols-3}}; 59 | \node[right of=server] (cloud) 60 | {\includegraphics[scale=0.2]{symbols-5}}; 61 | \node[right of=cloud] (workstation) 62 | {\includegraphics[scale=0.2]{symbols-7}}; 63 | \node[above of=workstation] (laptop) 64 | {\includegraphics[scale=0.2]{symbols-4}}; 65 | \node[below of=workstation] (tablet) 66 | {\includegraphics[scale=0.2]{symbols-6}}; 67 | 68 | \draw [<->] (gear) -- (database); 69 | \draw [<->, shorten <= -5] (gear) -- (server); 70 | \draw [->] (gear) -- (adg); 71 | \draw [->] (adg) -- node[above=-2] {PNG or PDF} node[below=-2]{BACKEND} (sheet); 72 | \draw [->] (sheet) -- (cloud); 73 | \draw [<->] (server) -- node[above=-2] {HTML} (cloud); 74 | \draw [<->] (cloud) -- (laptop); 75 | \draw [<->] (cloud) -- (tablet); 76 | \draw [<->] (cloud) -- (workstation); 77 | 78 | \node[xshift=75, yshift=60] at (adg) 79 | {Overview of a typical \textbf{web} application}; 80 | 81 | \end{tikzpicture} 82 | \end{document} 83 | -------------------------------------------------------------------------------- /src/adg/adg-ruled-fill.h: -------------------------------------------------------------------------------- 1 | /* ADG - Automatic Drawing Generation 2 | * Copyright (C) 2007-2022 Nicola Fontana 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #if !defined(__ADG_H__) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | 26 | #ifndef __ADG_RULED_FILL_H__ 27 | #define __ADG_RULED_FILL_H__ 28 | 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define ADG_TYPE_RULED_FILL (adg_ruled_fill_get_type()) 33 | #define ADG_RULED_FILL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_RULED_FILL, AdgRuledFill)) 34 | #define ADG_RULED_FILL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_RULED_FILL, AdgRuledFillClass)) 35 | #define ADG_IS_RULED_FILL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_RULED_FILL)) 36 | #define ADG_IS_RULED_FILL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_RULED_FILL)) 37 | #define ADG_RULED_FILL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_RULED_FILL, AdgRuledFillClass)) 38 | 39 | 40 | typedef struct _AdgRuledFill AdgRuledFill; 41 | typedef struct _AdgRuledFillClass AdgRuledFillClass; 42 | 43 | struct _AdgRuledFill { 44 | /*< private >*/ 45 | AdgFillStyle parent; 46 | }; 47 | 48 | struct _AdgRuledFillClass { 49 | /*< private >*/ 50 | AdgFillStyleClass parent_class; 51 | }; 52 | 53 | 54 | GType adg_ruled_fill_get_type (void); 55 | AdgRuledFill * adg_ruled_fill_new (void); 56 | void adg_ruled_fill_set_line_dress (AdgRuledFill *ruled_fill, 57 | AdgDress dress); 58 | AdgDress adg_ruled_fill_get_line_dress (AdgRuledFill *ruled_fill); 59 | void adg_ruled_fill_set_spacing (AdgRuledFill *ruled_fill, 60 | gdouble spacing); 61 | gdouble adg_ruled_fill_get_spacing (AdgRuledFill *ruled_fill); 62 | void adg_ruled_fill_set_angle (AdgRuledFill *ruled_fill, 63 | gdouble angle); 64 | gdouble adg_ruled_fill_get_angle (AdgRuledFill *ruled_fill); 65 | 66 | G_END_DECLS 67 | 68 | 69 | #endif /* __ADG_RULED_FILL_H__ */ 70 | -------------------------------------------------------------------------------- /autotools/Translations.nsh: -------------------------------------------------------------------------------- 1 | ; Translations for adg.nsi script. 2 | ; 3 | ; ADG - Automatic Drawing Generation 4 | ; Copyright (C) 2015 Nicola Fontana 5 | ; 6 | ; This file is free software; you can redistribute it and/or 7 | ; modify it under the terms of the GNU Lesser General Public 8 | ; License as published by the Free Software Foundation; either 9 | ; version 2 of the License, or (at your option) any later version. 10 | ; 11 | ; This library is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | ; Lesser General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU Lesser General Public 17 | ; License along with this library; if not, write to the 18 | ; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | ; Boston, MA 02110-1301, USA. 20 | 21 | LangString TITLE_SecBase ${LANG_ENGLISH} "ADG canvas" 22 | LangString TITLE_SecBase ${LANG_ITALIAN} "Canvas ADG" 23 | 24 | LangString DESC_SecBase ${LANG_ENGLISH} "Base installation for running the demo program." 25 | LangString DESC_SecBase ${LANG_ITALIAN} "Installazione di base per eseguire il programma dimostrativo." 26 | 27 | LangString TITLE_SecLanguages ${LANG_ENGLISH} "Support for languages" 28 | LangString TITLE_SecLanguages ${LANG_ITALIAN} "Supporto lingue" 29 | 30 | LangString DESC_SecLanguages ${LANG_ENGLISH} "Enable support for languages other than english." 31 | LangString DESC_SecLanguages ${LANG_ITALIAN} "Abilitazione del supporto a lingue diverse dall'inglese." 32 | 33 | LangString TITLE_SecDocumentation ${LANG_ENGLISH} "Developer documentation" 34 | LangString TITLE_SecDocumentation ${LANG_ITALIAN} "Documentazione di sviluppo" 35 | 36 | LangString DESC_SecDocumentation ${LANG_ENGLISH} "Install reference manuals for both CPML and ADG libraries." 37 | LangString DESC_SecDocumentation ${LANG_ITALIAN} "Installare i manuali di riferimento delle librerie CPML e ADG." 38 | 39 | LangString TITLE_SecHTML ${LANG_ENGLISH} "HTML format" 40 | LangString TITLE_SecHTML ${LANG_ITALIAN} "Formato HTML" 41 | 42 | LangString DESC_SecHTML ${LANG_ENGLISH} "Install manuals in HTML format. This is the better supported option." 43 | LangString DESC_SecHTML ${LANG_ITALIAN} "Installare i manuali in formato HTML. Questa è l'opzione supportata meglio." 44 | 45 | LangString TITLE_SecPDF ${LANG_ENGLISH} "PDF documentation" 46 | LangString TITLE_SecPDF ${LANG_ITALIAN} "Documentazione PDF" 47 | 48 | LangString DESC_SecPDF ${LANG_ENGLISH} "Install manuals in PDF format." 49 | LangString DESC_SecPDF ${LANG_ITALIAN} "Installare i manuali in formato PDF." 50 | 51 | LangString TITLE_SecLua ${LANG_ENGLISH} "Lua support" 52 | LangString TITLE_SecLua ${LANG_ITALIAN} "Supporto Lua" 53 | 54 | LangString DESC_SecLua ${LANG_ENGLISH} "Include Lua language support for interactive development." 55 | LangString DESC_SecLua ${LANG_ITALIAN} "Includere il supporto al linguaggio Lua per sviluppo interattivo." 56 | 57 | --------------------------------------------------------------------------------