[dia] Add Sozi presentation objects.
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Add Sozi presentation objects.
- Date: Sun, 11 Jan 2015 20:14:26 +0000 (UTC)
commit bf63ab2925d2b4939ec03954e8f829333aef74e8
Author: Paul Chavent <paul chavent fnac net>
Date: Sat Jan 10 23:42:08 2015 +0100
Add Sozi presentation objects.
See objects/Sozi/readme.txt for details.
Signed-off-by: Hans Breuer <hans breuer org>
configure.ac | 13 +
lib/libdia.def | 1 +
objects/Makefile.am | 2 +-
objects/Sozi/Makefile.am | 25 +
objects/Sozi/pixmaps/sozi-frame.xpm | 196 +++++++
objects/Sozi/pixmaps/sozi-media.xpm | 214 ++++++++
objects/Sozi/readme.txt | 50 ++
objects/Sozi/sozi-frame.c | 688 +++++++++++++++++++++++
objects/Sozi/sozi-media.c | 505 +++++++++++++++++
objects/Sozi/sozi-object.c | 622 +++++++++++++++++++++
objects/Sozi/sozi-object.h | 141 +++++
objects/Sozi/sozi-player.h | 355 ++++++++++++
objects/Sozi/sozi.c | 47 ++
objects/makefile.msc | 12 +-
samples/Sozi/sozi-clip-test.dia | 358 ++++++++++++
samples/Sozi/sozi-tutorial-complete-layers.dia | 695 ++++++++++++++++++++++++
sheets/Makefile.am | 2 +-
sheets/Sozi.sheet.in | 13 +
18 files changed, 3936 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index df09fd7..92945a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,6 +203,18 @@ AC_SUBST(XSLT_DIR)
AC_SUBST(XSLT_LIBS)
AC_SUBST(XSLT_CFLAGS)
+# Find where are the sozi.version, sozi.js and sozi.css files
+AC_ARG_WITH(sozi-path,
+ [ --with-sozi-path=DIR Specify where to find the optional sozi player
+ (default=DATAROOTDIR/sozi)],
+ SOZI_PATH=$withval,
+ SOZI_PATH=$prefix/share/sozi)
+AC_CHECK_FILE($SOZI_PATH/sozi.version,have_sozi_version=yes,have_sozi_version=no)
+#AC_CHECK_FILE($SOZI_PATH/sozi.js,have_sozi_js=yes,have_sozi_js=no)
+#AC_CHECK_FILE($SOZI_PATH/sozi.css,have_sozi_css=yes,have_sozi_css=no)
+AM_CONDITIONAL(WITH_SOZI_PATH, test "$have_sozi_version" = yes)
+AC_SUBST(SOZI_PATH)
+
# Figure out a prefix for where to find libxslt at runtime.
AC_ARG_WITH(xslt-prefix,
AC_HELP_STRING([--with-xslt-prefix=DIR],[Specify where to find the optional XSLT libraries
@@ -654,6 +666,7 @@ objects/SADT/Makefile
objects/standard/Makefile
objects/UML/Makefile
objects/Database/Makefile
+objects/Sozi/Makefile
shapes/Makefile
shapes/Assorted/Makefile
shapes/BPMN/Makefile
diff --git a/lib/libdia.def b/lib/libdia.def
index 81d19c6..8d9b5b9 100644
--- a/lib/libdia.def
+++ b/lib/libdia.def
@@ -577,6 +577,7 @@ EXPORTS
object_substitute
object_toggle_prop
object_unconnect
+ object_unconnect_all
orthconn_add_segment
orthconn_can_add_segment
diff --git a/objects/Makefile.am b/objects/Makefile.am
index 880b1fa..89a1ac4 100644
--- a/objects/Makefile.am
+++ b/objects/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = standard network UML ER FS flowchart custom custom_lines GRAFCET \
- chronogram SADT Misc Istar Jackson KAOS AADL Database
+ chronogram SADT Misc Istar Jackson KAOS AADL Database Sozi
EXTRA_DIST = \
makefile.msc objects.def
diff --git a/objects/Sozi/Makefile.am b/objects/Sozi/Makefile.am
new file mode 100644
index 0000000..27e21b2
--- /dev/null
+++ b/objects/Sozi/Makefile.am
@@ -0,0 +1,25 @@
+## Process this file with automake to produce Makefile.in
+
+pkglib_LTLIBRARIES = libsozi_objects.la
+libsozi_objects_la_SOURCES = \
+ sozi.c \
+ sozi-object.c \
+ sozi-frame.c \
+ sozi-media.c
+
+if WITH_SOZI_PATH
+libsozi_objects_la_CFLAGS = -DSOZI_PATH="\"$(SOZI_PATH)\""
+endif
+
+libsozi_objects_la_LDFLAGS = -export-dynamic -module -avoid-version $(NO_UNDEFINED)
+
+libsozi_objects_la_LIBADD = $(top_builddir)/lib/libdia.la
+
+AM_CPPFLAGS = -I$(top_srcdir)/intl -I$(srcdir)/../../lib \
+ $(DEBUG_FLAGS) $(GTK_CFLAGS)
+
+EXTRA_DIST = \
+ pixmaps/sozi-frame.xpm
+
+
+
diff --git a/objects/Sozi/pixmaps/sozi-frame.xpm b/objects/Sozi/pixmaps/sozi-frame.xpm
new file mode 100644
index 0000000..92df25b
--- /dev/null
+++ b/objects/Sozi/pixmaps/sozi-frame.xpm
@@ -0,0 +1,196 @@
+/* XPM */
+static const char * sozi_frame_xpm[] = {
+"22 22 171 2",
+" c #FFFFFF",
+". c #FEFEFE",
+"+ c #FDFDFD",
+"@ c #F7F7F8",
+"# c #D2D2D2",
+"$ c #939393",
+"% c #8A8A8A",
+"& c #BEBEBE",
+"* c #F2F2F2",
+"= c #FCFCFC",
+"- c #F3F3F3",
+"; c #FBFBFB",
+"> c #FEFEFF",
+", c #FCFCFB",
+"' c #FAF4F1",
+") c #FAF1EB",
+"! c #F8F5F2",
+"~ c #BFBFBF",
+"{ c #E4E4E4",
+"] c #F1F1F1",
+"^ c #ADADAD",
+"/ c #F5F5F5",
+"( c #BEBABE",
+"_ c #99909A",
+": c #EDEAED",
+"< c #ECDCD2",
+"[ c #C3682D",
+"} c #C64500",
+"| c #98562A",
+"1 c #BBB6B2",
+"2 c #F8F8F9",
+"3 c #FBFCFB",
+"4 c #FBFCFC",
+"5 c #E8BC9E",
+"6 c #F55A00",
+"7 c #F05F00",
+"8 c #E4BCA1",
+"9 c #F3F8FC",
+"0 c #F6F6F6",
+"a c #DCDCDC",
+"b c #CACACA",
+"c c #CDCDCD",
+"d c #CBCBC9",
+"e c #D8D8D7",
+"f c #FBFBFC",
+"g c #E7B99A",
+"h c #F25600",
+"i c #DD7A39",
+"j c #E7DDD6",
+"k c #D0D0D0",
+"l c #C8C8C8",
+"m c #989898",
+"n c #CACBCC",
+"o c #A3A298",
+"p c #BFB483",
+"q c #EEE8D1",
+"r c #FBFBFA",
+"s c #FAFBFC",
+"t c #E6BA9E",
+"u c #EB5400",
+"v c #ECA372",
+"w c #F8FBFD",
+"x c #ECECEC",
+"y c #FBFCFE",
+"z c #D3D1C7",
+"A c #DDB617",
+"B c #C4A423",
+"C c #EFECE1",
+"D c #FBFDFF",
+"E c #E5C3AD",
+"F c #DD5A03",
+"G c #E8AD85",
+"H c #F9FFFF",
+"I c #E6E6E6",
+"J c #E9E9EA",
+"K c #CFCECD",
+"L c #DEBF2D",
+"M c #C99E00",
+"N c #EDE9D1",
+"O c #E4D5CC",
+"P c #AE6636",
+"Q c #E2BCA3",
+"R c #FFFFFE",
+"S c #E5E5E5",
+"T c #C8C8C9",
+"U c #D9DBE5",
+"V c #DBBD39",
+"W c #B79A21",
+"X c #EDEADF",
+"Y c #ECEAE9",
+"Z c #A98C7A",
+"` c #D3B8A6",
+" . c #E3E3E3",
+".. c #C7C7C7",
+"+. c #F1F3FC",
+"@. c #A5965C",
+"#. c #BDB496",
+"$. c #BEBBB8",
+"%. c #B3ACA7",
+"&. c #E9E7E7",
+"*. c #B6B4B4",
+"=. c #92939A",
+"-. c #DFDFE3",
+";. c #ADAEAF",
+">. c #CCCDCE",
+",. c #7D898D",
+"'. c #DCDBDA",
+"). c #EDEDED",
+"!. c #DADADA",
+"~. c #9B9B9B",
+"{. c #DEDEDE",
+"]. c #FFFEFE",
+"^. c #B4CBD2",
+"/. c #389CB5",
+"(. c #6E9CA8",
+"_. c #DDDDDD",
+":. c #EAEAEA",
+"<. c #CECECE",
+"[. c #B6B6B6",
+"}. c #E7E7E7",
+"|. c #B2D0D8",
+"1. c #1BB6DE",
+"2. c #00A7D3",
+"3. c #82AFBB",
+"4. c #EEEEEE",
+"5. c #999999",
+"6. c #F0F0F0",
+"7. c #E0E0E0",
+"8. c #F9FCFC",
+"9. c #1194B5",
+"0. c #00CEFF",
+"a. c #23BAE1",
+"b. c #C3D0D4",
+"c. c #D4D4D4",
+"d. c #FAFCFC",
+"e. c #2E8FA8",
+"f. c #00BDEF",
+"g. c #3AB4D3",
+"h. c #F8F2F1",
+"i. c #EBEBEB",
+"j. c #C6C6C6",
+"k. c #A8A8A8",
+"l. c #F4F4F4",
+"m. c #DBE7EB",
+"n. c #6894A0",
+"o. c #6C8288",
+"p. c #A3A1A0",
+"q. c #949494",
+"r. c #8F8F8F",
+"s. c #E2E2E2",
+"t. c #BABABA",
+"u. c #CBCACA",
+"v. c #9A9898",
+"w. c #F3F2F1",
+"x. c #E9E9E9",
+"y. c #E8E8E8",
+"z. c #F9F9F9",
+"A. c #F7F7F7",
+"B. c #A9A9A9",
+"C. c #C1C1C1",
+"D. c #D7D7D7",
+"E. c #F7F6F6",
+"F. c #FAFAFA",
+"G. c #5F5F5F",
+"H. c #B2B2B2",
+"I. c #F8F8F8",
+"J. c #D8D8D8",
+"K. c #909090",
+"L. c #7D7D7D",
+"M. c #858585",
+"N. c #B4B4B4",
+" . . . . . + + . . . . . ",
+" . @ # $ % & * . = - ; . ",
+" > , ' ) ! ~ { ] ^ / ( _ : ",
+" < [ } | 1 2 . . * ~ 3 . . ",
+" 4 5 6 7 8 9 = . 0 a b c ; d e > . ",
+" f g h i j . 0 k l m n o p q r . . ",
+" s t u v w . x y z A B C > . ",
+" D E F G H . . = I J K L M N ",
+" O P Q R . S T U V W X > ",
+" . Y Z ` > . . + # 2 ",
+" R $.%. . . . . &.*.c =.-. ",
+" . n ;.= . . >.,.'.a ). . . ",
+" . !.~.{. . . ].^./.(. . # _. ",
+" . :.<.[.}. . + |.1.2.3. 4...5.= ",
+" * 6.c 7.+ 8.9.0.a.b. . 6.<.+ ",
+" . c.7.# - . . d.e.f.g.h. ",
+" . i.j.k.l. > m.n.o.p.$ q.r.s.. ",
+" . . I & t.0 ; ] u.v.w.).x.x.y.z.. . ",
+" . + A.B.c C.<.D.E. . . ",
+"F.G.H.i.I. 4.C./ z.; ; . . ",
+". / J.~ K.L.M.N.l.. . . ",
+" . . + + + . . . . . "};
diff --git a/objects/Sozi/pixmaps/sozi-media.xpm b/objects/Sozi/pixmaps/sozi-media.xpm
new file mode 100644
index 0000000..4430086
--- /dev/null
+++ b/objects/Sozi/pixmaps/sozi-media.xpm
@@ -0,0 +1,214 @@
+/* XPM */
+static const char * sozi_media_xpm[] = {
+"22 22 189 2",
+" c None",
+". c #000000",
+"+ c #030303",
+"@ c #060606",
+"# c #050505",
+"$ c #040404",
+"% c #EBEBEB",
+"& c #5D5D5D",
+"* c #6C6C6C",
+"= c #ECECEC",
+"- c #E3E3E3",
+"; c #1C1C1C",
+"> c #989898",
+", c #888888",
+"' c #6E6E6E",
+") c #0A0A0A",
+"! c #DDDDDD",
+"~ c #A6A6A6",
+"{ c #212121",
+"] c #EAEAEA",
+"^ c #595959",
+"/ c #6A6A6A",
+"( c #E7E1DF",
+"_ c #DED6D1",
+": c #1B1A1A",
+"< c #A5A5A5",
+"[ c #CCCCCC",
+"} c #070707",
+"| c #D3D3D3",
+"1 c #151315",
+"2 c #D6D3D6",
+"3 c #FFFFFF",
+"4 c #FBFCFC",
+"5 c #E8BC9E",
+"6 c #F55A00",
+"7 c #F05F00",
+"8 c #E4BCA1",
+"9 c #F3F8FC",
+"0 c #FCFCFC",
+"a c #FEFEFE",
+"b c #F6F6F6",
+"c c #DCDCDC",
+"d c #CACACA",
+"e c #CDCDCD",
+"f c #FBFBFB",
+"g c #CBCBC9",
+"h c #D8D8D7",
+"i c #FEFEFF",
+"j c #F7F7F7",
+"k c #FDFDFD",
+"l c #FBFBFC",
+"m c #E7B99A",
+"n c #F25600",
+"o c #DD7A39",
+"p c #E7DDD6",
+"q c #D0D0D0",
+"r c #C8C8C8",
+"s c #CACBCC",
+"t c #A3A298",
+"u c #BFB483",
+"v c #EEE8D1",
+"w c #FBFBFA",
+"x c #FAFBFC",
+"y c #E6BA9E",
+"z c #EB5400",
+"A c #ECA372",
+"B c #F8FBFD",
+"C c #FBFCFE",
+"D c #D3D1C7",
+"E c #DDB617",
+"F c #C4A423",
+"G c #EFECE1",
+"H c #FBFDFF",
+"I c #E5C3AD",
+"J c #DD5A03",
+"K c #E8AD85",
+"L c #F9FFFF",
+"M c #E6E6E6",
+"N c #E9E9EA",
+"O c #CFCECD",
+"P c #DEBF2D",
+"Q c #C99E00",
+"R c #EDE9D1",
+"S c #E4D5CC",
+"T c #AE6636",
+"U c #E2BCA3",
+"V c #FFFFFE",
+"W c #E5E5E5",
+"X c #C8C8C9",
+"Y c #D9DBE5",
+"Z c #DBBD39",
+"` c #B79A21",
+" . c #EDEADF",
+".. c #ECEAE9",
+"+. c #A98C7A",
+"@. c #D3B8A6",
+"#. c #C7C7C7",
+"$. c #F1F3FC",
+"%. c #A5965C",
+"&. c #BDB496",
+"*. c #F8F8F9",
+"=. c #BEBBB8",
+"-. c #B3ACA7",
+";. c #E9E7E7",
+">. c #B6B4B4",
+",. c #92939A",
+"'. c #DFDFE3",
+"). c #ADAEAF",
+"!. c #CCCDCE",
+"~. c #7D898D",
+"{. c #DCDBDA",
+"]. c #EDEDED",
+"^. c #DADADA",
+"/. c #9B9B9B",
+"(. c #DEDEDE",
+"_. c #FFFEFE",
+":. c #B4CBD2",
+"<. c #389CB5",
+"[. c #6E9CA8",
+"}. c #D2D2D2",
+"|. c #CECECE",
+"1. c #B6B6B6",
+"2. c #E7E7E7",
+"3. c #B2D0D8",
+"4. c #1BB6DE",
+"5. c #00A7D3",
+"6. c #82AFBB",
+"7. c #EEEEEE",
+"8. c #999999",
+"9. c #F2F2F2",
+"0. c #F0F0F0",
+"a. c #E0E0E0",
+"b. c #F9FCFC",
+"c. c #1194B5",
+"d. c #00CEFF",
+"e. c #23BAE1",
+"f. c #C3D0D4",
+"g. c #D4D4D4",
+"h. c #F3F3F3",
+"i. c #FAFCFC",
+"j. c #2E8FA8",
+"k. c #00BDEF",
+"l. c #3AB4D3",
+"m. c #F8F2F1",
+"n. c #C6C6C6",
+"o. c #A8A8A8",
+"p. c #F4F4F4",
+"q. c #DBE7EB",
+"r. c #6894A0",
+"s. c #6C8288",
+"t. c #A3A1A0",
+"u. c #939393",
+"v. c #949494",
+"w. c #8F8F8F",
+"x. c #E2E2E2",
+"y. c #BEBEBE",
+"z. c #BABABA",
+"A. c #F1F1F1",
+"B. c #CBCACA",
+"C. c #9A9898",
+"D. c #F3F2F1",
+"E. c #E9E9E9",
+"F. c #E8E8E8",
+"G. c #F9F9F9",
+"H. c #181818",
+"I. c #2D2D2D",
+"J. c #2C2C2C",
+"K. c #ACACAC",
+"L. c #1F1F1F",
+"M. c #AAAAAA",
+"N. c #ADADAD",
+"O. c #242424",
+"P. c #3C3C3C",
+"Q. c #9D9D9D",
+"R. c #8B8B8B",
+"S. c #AFAFAF",
+"T. c #AEAEAE",
+"U. c #5A5A5A",
+"V. c #474747",
+"W. c #909090",
+"X. c #7D7D7D",
+"Y. c #3A3A3A",
+"Z. c #B4B4B4",
+"`. c #101010",
+" + c #F8F8F8",
+".+ c #0C0C0C",
+"++ c #080808",
+"@+ c #0D0D0D",
+"#+ c #010101",
+". + @ + . . @ # . . . # $ . . . # $ . . $ @ ",
+"% & . * = - ; . > , ' . ) ! % ~ . { - ] ^ . ",
+"% & . / ( _ : . < = [ . } | % ~ . 1 2 ] ^ . ",
+". . . . . . . . . . . . . . . . . . . . . . ",
+"3 3 4 5 6 7 8 9 0 a 3 b c d e f g h 3 i j k ",
+"3 3 l m n o p 3 3 3 a b q r > s t u v w a a ",
+"3 3 x y z A B 3 3 3 a 3 3 3 = C D E F G i a ",
+"3 3 H I J K L 3 3 a 3 a 3 0 M N O P Q R 3 3 ",
+"3 3 3 S T U 3 V 3 3 3 3 a 3 W X Y Z ` .3 i ",
+"3 a 3 + 3 i a 3 3 3 a 3 - #.$.%.&.*.3 3 ",
+"3 3 V 3 =.-.3 a 3 a 3 a a 3 ;.>.e ,.'.3 3 3 ",
+"3 3 a 3 s ).0 3 a 3 a 3 3 3 !.~.{.c ].3 a a ",
+"3 a 3 3 ^./.(.3 a 3 3 a _.:.<.[.3 a }.! 3 3 ",
+"3 3 a 3 ] |.1.2.3 a 3 k 3.4.5.6.3 3 7.#.8.0 ",
+"3 3 3 3 9.0.e a.k 3 3 b.c.d.e.f.3 a 3 0.|.k ",
+"3 3 3 3 a g.a.}.h.a a i.j.k.l.m.3 3 3 3 3 3 ",
+"3 3 a 3 3 % n.o.p.3 3 i q.r.s.t.u.v.w.x.a 3 ",
+"3 a 3 3 a 3 M y.z.b f A.B.C.D.].E.E.F.G.p.f ",
+". . . . . . . . . . . . . . . H.I.I.I.I.J.J.",
+"K.L.. { M.N.O.. P.M.Q.. . R.S., . # < T.U.. ",
+"a S.. V.W.X.Y.. Z.a 3 `.@ a 3 +. .+3 3 | . ",
+".+. # . ++++. # . @++ @ @ . @+. @ # #+.+. @ "};
diff --git a/objects/Sozi/readme.txt b/objects/Sozi/readme.txt
new file mode 100644
index 0000000..c1e287a
--- /dev/null
+++ b/objects/Sozi/readme.txt
@@ -0,0 +1,50 @@
+This is a front end for the integration of the Sozi player (see [1])
+to the Dia's SVG exports. Sozi is a zooming UI for presentation, a
+bit like Prezi. Some examples of Sozi presentations are available on
+the page [2].
+
+This implementation supports Sozi strictly less than 14. The old
+(<=13) "API" can be found at [3], but will probably be obsolete when
+you will read this doc.
+
+Additional information can be found on the Sozi web site, particularly
+helps about the usage of the player [4].
+
+The implementation splits in several files :
+
+sozi-object : the base object that control placement of the object.
+sozi-frame : the frame that represent a view of the presentation.
+sozi-media : a video or audio to insert in the presentation
+sozi-player : the minified javascript/css code of the Sozi player,
+ generated from the Sozi source code, taken from the
+ commit of the Sep 22, 2014 [5].
+
+As an alternative to the embedded Sozi player version, you can provide
+your own Sozi player with the "--with-sozi-path" configure option that
+should point to a path containing the Sozi player files (sozi.version,
+sozi.js, sozi.css, ...).
+
+Some issues still need to be addressed to improve this module:
+- the problem of the frame title/sequence display :
+ - should we display something ?
+ - what : sequence number, title, both ?
+ - should it be editable in interactive rendering ?
+ - placement : inside, outside ?
+ - size : dynamic re-sizing ?
+- the problem of the frame title/sequence management :
+ - the automatic sequence numbering is screwed after frame
+ deletion or undo command.
+ - is the automatic sequence management the good solution ?
+ - how to redraw all objects after changing sequence numbering ?
+- display a preview of the media ?
+
+
+[1] http://sozi.baierouge.fr/
+[2] http://sozi.wikidot.com/presentations
+[3] https://web.archive.org/web/20130527164221/http://sozi.baierouge.fr/wiki/en:format
+[4] http://sozi.baierouge.fr/pages/40-play.html
+[5] https://github.com/senshu/Sozi/commit/e6598642ae6f06e87b689839fb0229ccf1f1130c
+
+
+
+
diff --git a/objects/Sozi/sozi-frame.c b/objects/Sozi/sozi-frame.c
new file mode 100644
index 0000000..7c9a706
--- /dev/null
+++ b/objects/Sozi/sozi-frame.c
@@ -0,0 +1,688 @@
+/* -*- c-basic-offset:4; -*- */
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1999 Alexander Larsson
+ *
+ * Sozi objects support
+ * Copyright (C) 2015 Paul Chavent
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* standard libs*/
+#include <assert.h>
+
+/* xpath for searching in the svg doc */
+#include <libxml/xpath.h>
+
+/* dia stuff */
+#include "object.h"
+#include "diarenderer.h"
+#include "diasvgrenderer.h"
+#include "properties.h"
+
+/* FIXME : legal dia stuff ? */
+#include "prop_inttypes.h"
+#include "propinternals.h"
+
+/* sozi stuff */
+#include "pixmaps/sozi-frame.xpm"
+#include "sozi-object.h"
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+typedef enum
+{
+ TRANSITION_LINEAR ,
+ TRANSITION_ACCELERATE ,
+ TRANSITION_STRONG_ACCELERATE ,
+ TRANSITION_DECELERATE ,
+ TRANSITION_STRONG_DECELERATE ,
+ TRANSITION_ACCELERATE_DECELERATE ,
+ TRANSITION_STRONG_ACCELERATE_DECELERATE,
+ TRANSITION_DECELERATE_ACCELERATE ,
+ TRANSITION_STRONG_DECELERATE_ACCELERATE,
+ TRANSITION_IMMEDIATE_BEGINNING ,
+ TRANSITION_IMMEDIATE_END ,
+ TRANSITION_IMMEDIATE_MIDDLE ,
+} TransitionProfileType;
+
+static const gchar * TransitionProfileDescr [] =
+{
+ "linear",
+ "accelerate",
+ "strong-accelerate",
+ "decelerate",
+ "strong-decelerate",
+ "accelerate-decelerate",
+ "strong-accelerate-decelerate",
+ "decelerate-accelerate",
+ "strong-decelerate-accelerate",
+ "immediate-beginning",
+ "immediate-end",
+ "immediate-middle",
+};
+
+typedef struct _SoziFrame
+{
+ /* sozi object inheritance */
+
+ SoziObject sozi_object;
+
+ /* sozi frame specific stuff */
+
+ int old_sequence; /* internal sequence numbering managment */
+ int sequence; /* final sequence number */
+
+ gchar * title;
+ gboolean hide;
+ gboolean clip;
+ gboolean timeout_enable;
+ int timeout_ms;
+ TransitionProfileType transition_profile;
+ int transition_duration_ms;
+
+} SoziFrame;
+
+/******************************************************************************
+ * Dia object type operations
+ *****************************************************************************/
+
+static DiaObject * sozi_frame_create(Point *startpoint,
+ void *user_data,
+ Handle **handle1,
+ Handle **handle2);
+static DiaObject * sozi_frame_load(ObjectNode obj_node, int version, DiaContext *ctx);
+
+static ObjectTypeOps sozi_frame_type_ops =
+{
+ (CreateFunc) sozi_frame_create, /* create */
+ (LoadFunc) sozi_frame_load, /* load (== object_load_using_properties ?) */
+ (SaveFunc) object_save_using_properties, /* save */
+ (GetDefaultsFunc) NULL,
+ (ApplyDefaultsFunc) NULL,
+};
+
+DiaObjectType sozi_frame_type =
+{
+ "Sozi - Frame", /* name */
+ 0, /* version */
+ sozi_frame_xpm, /* pixmap */
+ &sozi_frame_type_ops, /* ops */
+ NULL, /* pixmap_file */
+ 0 /* default_user_data */
+};
+
+/******************************************************************************
+ * Dia object operations
+ *****************************************************************************/
+
+static DiaObject * sozi_frame_copy(SoziFrame *sozi_frame);
+
+static void sozi_frame_destroy(SoziFrame *sozi_frame);
+
+static void sozi_frame_select(SoziFrame *sozi_frame, Point *clicked_point,
+ DiaRenderer *interactive_renderer);
+
+static void sozi_frame_draw(SoziFrame *sozi_frame, DiaRenderer *renderer);
+
+static real sozi_frame_distance_from(SoziFrame *sozi_frame, Point *point);
+
+static ObjectChange* sozi_frame_move(SoziFrame *sozi_frame, Point *to);
+
+static ObjectChange* sozi_frame_move_handle(SoziFrame *sozi_frame, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers);
+static GtkWidget * sozi_frame_get_properties(SoziFrame *sozi_frame, gboolean is_default);
+
+static PropDescription * sozi_frame_describe_props(SoziFrame *sozi_frame);
+
+static void sozi_frame_get_props(SoziFrame *sozi_frame, GPtrArray *props);
+
+static void sozi_frame_set_props(SoziFrame *sozi_frame, GPtrArray *props);
+
+
+static ObjectOps sozi_frame_ops =
+{
+ (DestroyFunc) sozi_frame_destroy,
+ (DrawFunc) sozi_frame_draw,
+ (DistanceFunc) sozi_frame_distance_from,
+ (SelectFunc) sozi_frame_select,
+ (CopyFunc) sozi_frame_copy,
+ (MoveFunc) sozi_frame_move,
+ (MoveHandleFunc) sozi_frame_move_handle,
+ (GetPropertiesFunc) sozi_frame_get_properties,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) 0,
+ (DescribePropsFunc) sozi_frame_describe_props,
+ (GetPropsFunc) sozi_frame_get_props,
+ (SetPropsFunc) sozi_frame_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
+
+/******************************************************************************
+ * Functions for managing Sozi frame sequencing
+ *****************************************************************************/
+
+struct sequence_pair
+{
+ int old;
+ int new;
+};
+
+static void
+sozi_frames_reorder(gpointer data, gpointer user_data)
+{
+ /* see object.h for the description of the object structure */
+ DiaObject *dia_object = (DiaObject *)data;
+ if(strcmp(dia_object->type->name, sozi_frame_type.name) == 0) {
+ SoziFrame *sozi_frame = (SoziFrame *)dia_object;
+ struct sequence_pair * seq_pair = (struct sequence_pair *)user_data;
+ int this_seq = sozi_frame->sequence;
+ if((seq_pair->new <= this_seq) && (this_seq < seq_pair->old)) {
+ /* fprintf(stdout, "old value %d ++ new value %d\n", sozi_frame->sequence, sozi_frame->sequence
+ 1); */
+ sozi_frame->sequence++;
+ sozi_frame->old_sequence = sozi_frame->sequence;
+ /* FIXME : not sure it's the good way to redraw an object */
+ /* sozi_frame_draw(sozi_frame); */
+ }
+ else if((seq_pair->old < this_seq) && (this_seq <= seq_pair->new)) {
+ /* fprintf(stdout, "old value %d -- new value %d\n", sozi_frame->sequence, sozi_frame->sequence
- 1); */
+ sozi_frame->sequence--;
+ sozi_frame->old_sequence = sozi_frame->sequence;
+ /* FIXME : not sure it's the good way to redraw an object */
+ /* sozi_frame_draw(sozi_frame); */
+ }
+ }
+}
+
+static void
+sozi_frames_count(gpointer data, gpointer user_data)
+{
+ /* see object.h for the description of the object structure */
+ DiaObject *dia_object = (DiaObject *)data;
+ if(strcmp(dia_object->type->name, sozi_frame_type.name) == 0) {
+ SoziFrame *sozi_frame = (SoziFrame *)dia_object;
+ /* only object with old_sequence different of zero should be
+ taken into account */
+ if(sozi_frame->sequence) {
+ int * counter = (int *)user_data;
+ *counter = *counter + 1;
+ }
+ }
+}
+
+static void
+sozi_frame_update(SoziFrame *sozi_frame)
+{
+ char legend[32];
+ int nb_char;
+
+ /* fprintf(stdout, "sozi_frame_update\n"); */
+
+ /* probably editing default configuration or loading object
+ -> do not care */
+ if(!sozi_frame->sozi_object.dia_object.parent_layer) {
+ return;
+ }
+
+ /* fprintf(stdout, "sozi_frame_update : before : sequence = %d, old_sequence = %d\n",
sozi_frame->sequence, sozi_frame->old_sequence); */
+
+ /*
+ sequence managment
+ We use exemples of data_foreach_object of diagramdata.h
+ */
+ if(!sozi_frame->sequence) {
+ /* this condition is true iif the object have just been created */
+ int frames_count = 0;
+ /* trig COUNTING of all frames */
+ data_foreach_object(layer_get_parent_diagram(sozi_frame->sozi_object.dia_object.parent_layer),
sozi_frames_count, &frames_count);
+ /* initialize the current sequence number */
+ /* fprintf(stdout, "seq must be initialized after object creation (%d frames)\n", frames_count); */
+ sozi_frame->sequence = frames_count + 1;
+ }
+ else if(sozi_frame->old_sequence &&
+ (sozi_frame->old_sequence != sozi_frame->sequence)) {
+ /* this condition is true iif the object's sequence number
+ have just been changed (in sozi_frame_set_props for instance) */
+ struct sequence_pair seq_pair;
+ seq_pair.old = sozi_frame->old_sequence;
+ seq_pair.new = sozi_frame->sequence;
+ /* fprintf(stdout, "seq %d has changed to %d\n", sozi_frame->old_sequence, sozi_frame->sequence); */
+ /* temporary revert to the old sequence number for avoiding twins */
+ sozi_frame->sequence = sozi_frame->old_sequence;
+ /* trig REORDERING of all frames */
+ data_foreach_object(layer_get_parent_diagram(sozi_frame->sozi_object.dia_object.parent_layer),
sozi_frames_reorder, &seq_pair);
+ /* restore the current sequence number */
+ sozi_frame->sequence = seq_pair.new;
+ }
+ /* register the current sequence number */
+ sozi_frame->old_sequence = sozi_frame->sequence;
+
+ /* fprintf(stdout, "sozi_frame_update : after : sequence = %d, old_sequence = %d\n",
sozi_frame->sequence, sozi_frame->old_sequence); */
+
+ /* update legend */
+ nb_char = g_snprintf(legend, sizeof(legend), "#%d : %s", sozi_frame->sequence, sozi_frame->title);
+ if(sizeof(legend) < nb_char)
+ {
+ legend[sizeof(legend) - 1] = 0;
+ legend[sizeof(legend) - 2] = '.';
+ legend[sizeof(legend) - 3] = '.';
+ legend[sizeof(legend) - 4] = '.';
+ }
+ text_set_string(sozi_frame->sozi_object.legend.text, legend);
+}
+
+/******************************************************************************
+ * Functions for managing the Sozi object life managment (init, copy, kill)
+ *****************************************************************************/
+
+static void
+sozi_frame_init(SoziFrame *sozi_frame)
+{
+ /* it will be initialized later, only if the object is placed on a */
+ /* sheet, see sozi_frame_update here under */
+ sozi_frame->old_sequence = 0;
+ sozi_frame->sequence = 0;
+
+ if(sozi_frame->title == NULL) {
+ sozi_frame->title = g_strdup("frame title");
+ }
+
+ /* the sozi defaults can be found in Sozi/player/js/document.js */
+ sozi_frame->hide = TRUE;
+ sozi_frame->clip = TRUE;
+ sozi_frame->timeout_enable = FALSE;
+ sozi_frame->timeout_ms = 5000;
+ sozi_frame->transition_profile = TRANSITION_LINEAR;
+ sozi_frame->transition_duration_ms = 1000;
+}
+
+static void
+sozi_frame_kill(SoziFrame *sozi_frame)
+{
+ if(sozi_frame->title != NULL) {
+ g_free(sozi_frame->title);
+ }
+}
+
+/******************************************************************************
+ * Functions that implement the Dia fops
+ *****************************************************************************/
+
+static DiaObject *
+sozi_frame_create(Point *startpoint,
+ void *user_data,
+ Handle **handle1,
+ Handle **handle2)
+{
+ SoziFrame *sozi_frame;
+
+ sozi_frame = g_new0(SoziFrame, 1);
+
+ /* init dia object */
+ sozi_frame->sozi_object.dia_object.type = &sozi_frame_type;
+ sozi_frame->sozi_object.dia_object.ops = &sozi_frame_ops;
+
+ /* init sozi object : that is also the place where the dia object
+ * geometry (position, handles, ...) will be initialized
+ */
+ sozi_object_init(&sozi_frame->sozi_object, startpoint);
+
+ /* init sozi frame */
+ sozi_frame_init(sozi_frame);
+
+ /* update sozi object geometry */
+ sozi_object_update(&sozi_frame->sozi_object);
+
+ /* handle are not used */
+ *handle1 = NULL;
+ *handle2 = NULL;
+
+ return &sozi_frame->sozi_object.dia_object;
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static DiaObject *
+sozi_frame_load(ObjectNode obj_node, int version, DiaContext *ctx)
+{
+ DiaObject * obj;
+ obj = object_load_using_properties(&sozi_frame_type, obj_node, version, ctx);
+ /* sync sequence numbers since the object should not trig neither
+ count neither reorder (see sozi_frame_update) */
+ ((SoziFrame *)(obj))->old_sequence = ((SoziFrame *)(obj))->sequence;
+ return obj;
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static DiaObject *
+sozi_frame_copy(SoziFrame *sozi_frame)
+{
+ DiaObject * obj;
+ obj = object_copy_using_properties((DiaObject *)sozi_frame);
+ /* reset the sequence number so it can trigger the count (see
+ sozi_frame_update) */
+ ((SoziFrame *)(obj))->sequence = 0;
+ ((SoziFrame *)(obj))->old_sequence = 0;
+ return obj;
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_frame_destroy(SoziFrame *sozi_frame)
+{
+ /* kill sozi frame */
+ sozi_frame_kill(sozi_frame);
+
+ /* kill sozi object */
+ sozi_object_kill(&sozi_frame->sozi_object);
+
+ /* do NOT free sozi_frame, caller will take care about that */
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_frame_select(SoziFrame *sozi_frame, Point *clicked_point,
+ DiaRenderer *interactive_renderer)
+{
+ /* this callback will be called the first time the object is
+ placed on the sheet, it allows to initialize the object */
+ sozi_frame_update(sozi_frame);
+ /* this one will update the legend */
+ sozi_object_update(&sozi_frame->sozi_object);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_frame_draw_svg(SoziFrame *sozi_frame, DiaSvgRenderer *svg_renderer)
+{
+ static unsigned refid_cnt = 0;
+ xmlNs *sozi_name_space;
+ xmlNodePtr root;
+ xmlNodePtr node;
+ xmlNodePtr rect;
+ /* buffers for storing attributes */
+ gchar * refid;
+ gchar * sequence;
+ gchar * timeout_ms;
+ gchar * transition_duration_ms;
+ const gchar * transition_profile;
+
+ /* format attributes */
+
+ refid = g_strdup_printf("sozi_frame_%d", refid_cnt++);
+ sequence = g_strdup_printf("%d", sozi_frame->sequence);
+ timeout_ms = g_strdup_printf("%d", sozi_frame->timeout_ms);
+ transition_duration_ms = g_strdup_printf("%d", sozi_frame->transition_duration_ms);
+ transition_profile = (sozi_frame->transition_profile <
sizeof(TransitionProfileDescr)/sizeof(TransitionProfileDescr[0]))?(TransitionProfileDescr[sozi_frame->transition_profile]):(TransitionProfileDescr[0]);
+
+ /* draw the sozi base object and get a reference to the sozi
+ namespace and document root */
+
+ sozi_object_draw_svg(&sozi_frame->sozi_object, svg_renderer, refid, &sozi_name_space, &root, &rect);
+
+ assert(sozi_name_space != NULL);
+
+ /* add a "custom" frame for sozi */
+
+ node = xmlNewChild(root, sozi_name_space, (const xmlChar *)"frame", NULL);
+ xmlSetProp(node, (const xmlChar *)"sozi:refid" , (const xmlChar *)refid);
+ xmlSetProp(node, (const xmlChar *)"sozi:title" , (const xmlChar *)sozi_frame->title);
+ xmlSetProp(node, (const xmlChar *)"sozi:sequence" , (const xmlChar *)sequence);
+ xmlSetProp(node, (const xmlChar *)"sozi:hide" , (const xmlChar
*)((sozi_frame->hide)?"true":"false"));
+ xmlSetProp(node, (const xmlChar *)"sozi:clip" , (const xmlChar
*)((sozi_frame->clip)?"true":"false"));
+ xmlSetProp(node, (const xmlChar *)"sozi:show-in-frame-list" , (const xmlChar *)"true");
+ xmlSetProp(node, (const xmlChar *)"sozi:timeout-enable" , (const xmlChar
*)((sozi_frame->timeout_enable)?"true":"false"));
+ xmlSetProp(node, (const xmlChar *)"sozi:timeout-ms" , (const xmlChar *)timeout_ms);
+ xmlSetProp(node, (const xmlChar *)"sozi:transition-duration-ms" , (const xmlChar
*)transition_duration_ms);
+ xmlSetProp(node, (const xmlChar *)"sozi:transition-zoom-percent", (const xmlChar *)"0");
+ xmlSetProp(node, (const xmlChar *)"sozi:transition-profile" , (const xmlChar *)transition_profile);
+ xmlSetProp(node, (const xmlChar *)"sozi:transition-path-hide" , (const xmlChar *)"true");
+
+ /* free resources */
+ g_free(refid);
+ g_free(sequence);
+ g_free(timeout_ms);
+ g_free(transition_duration_ms);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+#define DIA_IS_INTERACTIVE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_INTERACTIVE_RENDERER))
+
+static void
+sozi_frame_draw(SoziFrame *sozi_frame, DiaRenderer *renderer)
+{
+
+ if (DIA_IS_SVG_RENDERER(renderer)) {
+ sozi_frame_draw_svg(sozi_frame, DIA_SVG_RENDERER (renderer));
+ }
+ else if(DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer) ||
+ !sozi_frame->hide) {
+ DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
+
+ renderer_ops->set_linewidth(renderer, SOZI_OBJECT_LINE_WIDTH);
+ renderer_ops->set_linecaps(renderer, LINECAPS_BUTT);
+ renderer_ops->set_linejoin(renderer, LINEJOIN_MITER);
+ renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID, 0);
+
+ renderer_ops->draw_polygon(renderer, sozi_frame->sozi_object.corners, 4, NULL, &color_black);
+
+ if(sozi_frame->sozi_object.legend.disp == TRUE) {
+ text_draw(sozi_frame->sozi_object.legend.text, renderer);
+ }
+ }
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static real
+sozi_frame_distance_from(SoziFrame *sozi_frame, Point *point)
+{
+ return distance_polygon_point(sozi_frame->sozi_object.corners, 4, SOZI_OBJECT_LINE_WIDTH, point);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static ObjectChange*
+sozi_frame_move(SoziFrame *sozi_frame, Point *to)
+{
+ return sozi_object_move(&sozi_frame->sozi_object, to);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static ObjectChange*
+sozi_frame_move_handle(SoziFrame *sozi_frame, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers)
+{
+ return sozi_object_move_handle(&sozi_frame->sozi_object, handle,
+ to, cp, reason, modifiers);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static PropEnumData prop_aspect_data[] =
+{
+ { N_("Free") , ASPECT_FREE },
+ { N_("Fixed") , ASPECT_FIXED },
+ { NULL, 0 }
+};
+
+static PropEnumData prop_transition_profile_data[] =
+{
+ { N_("Constant speed") , TRANSITION_LINEAR },
+ { N_("Speed up") , TRANSITION_ACCELERATE },
+ { N_("Speed up (strong)") , TRANSITION_STRONG_ACCELERATE },
+ { N_("Speed down") , TRANSITION_DECELERATE },
+ { N_("Speed down (strong)") , TRANSITION_STRONG_DECELERATE },
+ { N_("Speed up, then down") , TRANSITION_ACCELERATE_DECELERATE },
+ { N_("Speed up, then down (strong)"), TRANSITION_STRONG_ACCELERATE_DECELERATE},
+ { N_("Speed down, then up") , TRANSITION_DECELERATE_ACCELERATE },
+ { N_("Speed down, then up (strong)"), TRANSITION_STRONG_DECELERATE_ACCELERATE},
+ { N_("Immediate (beginning)") , TRANSITION_IMMEDIATE_BEGINNING },
+ { N_("Immediate (end)") , TRANSITION_IMMEDIATE_END },
+ { N_("Immediate (middle)") , TRANSITION_IMMEDIATE_MIDDLE },
+ { NULL, 0 }
+};
+
+static PropDescription sozi_frame_props[] =
+{
+ OBJECT_COMMON_PROPERTIES,
+
+ PROP_STD_NOTEBOOK_BEGIN,
+
+ PROP_NOTEBOOK_PAGE("geometry",0,N_("Geometry")),
+ { "x" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center x") , NULL, NULL },
+ { "y" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center y") , NULL, NULL },
+ { "width" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Width") , NULL, NULL },
+ { "height" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Height") , NULL, NULL },
+ { "angle" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Angle (deg)") , NULL, NULL },
+ { "aspect" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Aspect ratio") , NULL,
prop_aspect_data },
+ { "scale_from_center", PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Scale from center"), NULL, NULL },
+
+ PROP_NOTEBOOK_PAGE("legend",0,N_("Legend")),
+ { "legend_disp" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Legend is visible"), NULL, NULL},
+ { "legend" , PROP_TYPE_TEXT , 0 , NULL , NULL, NULL},
+ PROP_STD_TEXT_ALIGNMENT,
+ PROP_STD_TEXT_FONT,
+ PROP_STD_TEXT_HEIGHT,
+ PROP_STD_TEXT_COLOUR,
+
+ PROP_NOTEBOOK_PAGE("sozi",0,N_("Sozi")),
+ { "frame_sequence" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame sequence")
, NULL, NULL },
+ { "frame_title" , PROP_TYPE_STRING, PROP_FLAG_VISIBLE, N_("Frame title")
, NULL, NULL },
+ { "frame_hide" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame hide")
, NULL, NULL },
+ { "frame_clip" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame clip")
, NULL, NULL },
+ { "frame_timeout_enable" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame timeout enable")
, NULL, NULL },
+ { "frame_timeout_ms" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame timeout (ms)")
, NULL, NULL },
+ { "frame_transition_profile" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Frame transition profile")
, NULL, prop_transition_profile_data},
+ { "frame_transition_duration_ms" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame transition duration
(ms)") , NULL, NULL },
+ PROP_STD_NOTEBOOK_END,
+
+ PROP_DESC_END
+};
+
+static PropOffset sozi_frame_offsets[] =
+{
+ OBJECT_COMMON_PROPERTIES_OFFSETS,
+
+ PROP_OFFSET_STD_NOTEBOOK_BEGIN,
+
+ PROP_OFFSET_NOTEBOOK_PAGE("geometry"),
+ { "x" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.center.x)
},
+ { "y" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.center.y)
},
+ { "width" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.width)
},
+ { "height" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.height)
},
+ { "angle" , PROP_TYPE_INT , offsetof(SoziFrame, sozi_object.angle)
},
+ { "aspect" , PROP_TYPE_ENUM , offsetof(SoziFrame, sozi_object.aspect)
},
+ { "scale_from_center" , PROP_TYPE_BOOL , offsetof(SoziFrame, sozi_object.scale_from_center)
},
+
+ PROP_OFFSET_NOTEBOOK_PAGE("legend"),
+ { "legend_disp" , PROP_TYPE_BOOL , offsetof(SoziFrame, sozi_object.legend.disp)
},
+ { "legend" , PROP_TYPE_TEXT , offsetof(SoziFrame, sozi_object.legend.text)
},
+ { "text_alignment" , PROP_TYPE_ENUM , offsetof(SoziFrame,
sozi_object.legend.attrs.alignment) },
+ { "text_font" , PROP_TYPE_FONT , offsetof(SoziFrame, sozi_object.legend.attrs.font)
},
+ { PROP_STDNAME_TEXT_HEIGHT, PROP_STDTYPE_TEXT_HEIGHT, offsetof(SoziFrame,
sozi_object.legend.attrs.height) },
+ { "text_colour" , PROP_TYPE_COLOUR , offsetof(SoziFrame,
sozi_object.legend.attrs.color) },
+
+ PROP_OFFSET_NOTEBOOK_PAGE("sozi"),
+ { "frame_sequence" , PROP_TYPE_INT , offsetof(SoziFrame, sequence) },
+ { "frame_title" , PROP_TYPE_STRING , offsetof(SoziFrame, title) },
+ { "frame_hide" , PROP_TYPE_BOOL , offsetof(SoziFrame, hide) },
+ { "frame_clip" , PROP_TYPE_BOOL , offsetof(SoziFrame, clip) },
+ { "frame_timeout_enable" , PROP_TYPE_BOOL , offsetof(SoziFrame, timeout_enable) },
+ { "frame_timeout_ms" , PROP_TYPE_INT , offsetof(SoziFrame, timeout_ms) },
+ { "frame_transition_profile" , PROP_TYPE_ENUM , offsetof(SoziFrame, transition_profile) },
+ { "frame_transition_duration_ms" , PROP_TYPE_INT , offsetof(SoziFrame, transition_duration_ms) },
+
+ PROP_OFFSET_STD_NOTEBOOK_END,
+
+ {NULL}
+};
+
+static GtkWidget *
+sozi_frame_get_properties(SoziFrame *sozi_frame, gboolean is_default)
+{
+ DiaObject * dia_object = &sozi_frame->sozi_object.dia_object;
+ GtkWidget * widget = object_create_props_dialog(dia_object, is_default);
+
+ /* the following code allow to set the range of the "frame sequence" property */
+ /* see propdialogs.c for reference code with PropWidgetAssoc */
+ PropDialog *dialog = prop_dialog_from_widget(widget);
+ guint i;
+ for (i = 0; i < dialog->prop_widgets->len; ++i) {
+ PropWidgetAssoc *pwa = &g_array_index(dialog->prop_widgets,
+ PropWidgetAssoc, i);
+ if(pwa) {
+ if (strcmp(pwa->prop->descr->name, "frame_sequence") == 0) {
+ if(GTK_IS_SPIN_BUTTON(pwa->widget)) {
+ int count = 0;
+ data_foreach_object(layer_get_parent_diagram(dia_object->parent_layer),
sozi_frames_count, &count);
+
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(pwa->widget), 1, count);
+ }
+ }
+ }
+ }
+ return widget;
+}
+
+static PropDescription *
+sozi_frame_describe_props(SoziFrame *sozi_frame)
+{
+ if (sozi_frame_props[0].quark == 0)
+ prop_desc_list_calculate_quarks(sozi_frame_props);
+ return sozi_frame_props;
+}
+
+static void
+sozi_frame_get_props(SoziFrame *sozi_frame, GPtrArray *props)
+{
+ text_get_attributes(sozi_frame->sozi_object.legend.text, &sozi_frame->sozi_object.legend.attrs);
+ object_get_props_from_offsets(&sozi_frame->sozi_object.dia_object, sozi_frame_offsets, props);
+}
+
+static void
+sozi_frame_set_props(SoziFrame *sozi_frame, GPtrArray *props)
+{
+ object_set_props_from_offsets(&sozi_frame->sozi_object.dia_object, sozi_frame_offsets, props);
+ apply_textattr_properties(props, sozi_frame->sozi_object.legend.text, "legend" ,
&sozi_frame->sozi_object.legend.attrs);
+ sozi_frame_update(sozi_frame);
+ sozi_object_update(&sozi_frame->sozi_object);
+}
diff --git a/objects/Sozi/sozi-media.c b/objects/Sozi/sozi-media.c
new file mode 100644
index 0000000..600f0a8
--- /dev/null
+++ b/objects/Sozi/sozi-media.c
@@ -0,0 +1,505 @@
+/* -*- c-basic-offset:4; -*- */
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1999 Alexander Larsson
+ *
+ * Sozi objects support
+ * Copyright (C) 2015 Paul Chavent
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* standard libs*/
+#include <assert.h>
+
+/* xpath for searching in the svg doc */
+#include <libxml/xpath.h>
+
+/* dia stuff */
+#include "object.h"
+#include "diarenderer.h"
+#include "diasvgrenderer.h"
+#include "properties.h"
+
+/* sozi stuff */
+#include "pixmaps/sozi-media.xpm"
+#include "sozi-object.h"
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+typedef enum
+{
+ MEDIA_TYPE_UNDEFINED ,
+ MEDIA_TYPE_VIDEO_MP4 ,
+ MEDIA_TYPE_VIDEO_WEBM,
+ MEDIA_TYPE_VIDEO_OGG ,
+ MEDIA_TYPE_AUDIO_MPEG,
+ MEDIA_TYPE_AUDIO_OGG ,
+ MEDIA_TYPE_AUDIO_WAV ,
+} MediaType;
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+typedef struct _SoziMedia
+{
+ /* sozi object inheritance */
+
+ SoziObject sozi_object;
+
+ /* sozi media specific stuff */
+
+ MediaType type;
+ gchar * file;
+
+ int start_frame;
+ int stop_frame;
+
+} SoziMedia;
+
+/******************************************************************************
+ * Dia object type operations
+ *****************************************************************************/
+
+static DiaObject * sozi_media_create(Point *startpoint,
+ void *user_data,
+ Handle **handle1,
+ Handle **handle2);
+static DiaObject * sozi_media_load(ObjectNode obj_node, int version, DiaContext *ctx);
+
+static ObjectTypeOps sozi_media_type_ops =
+{
+ (CreateFunc) sozi_media_create, /* create */
+ (LoadFunc) sozi_media_load, /* load (== object_load_using_properties ?) */
+ (SaveFunc) object_save_using_properties, /* save */
+ (GetDefaultsFunc) NULL,
+ (ApplyDefaultsFunc) NULL,
+};
+
+DiaObjectType sozi_media_type =
+{
+ "Sozi - Media", /* name */
+ 0, /* version */
+ sozi_media_xpm, /* pixmap */
+ &sozi_media_type_ops, /* ops */
+ NULL, /* pixmap_file */
+ 0 /* default_user_data */
+};
+
+/******************************************************************************
+ * Dia object operations
+ *****************************************************************************/
+
+static void sozi_media_destroy(SoziMedia *sozi_media);
+
+static void sozi_media_draw(SoziMedia *sozi_media, DiaRenderer *renderer);
+
+static real sozi_media_distance_from(SoziMedia *sozi_media, Point *point);
+
+static void sozi_media_select(SoziMedia *sozi_media, Point *clicked_point,
+ DiaRenderer *interactive_renderer);
+
+static ObjectChange* sozi_media_move(SoziMedia *sozi_media, Point *to);
+
+static ObjectChange* sozi_media_move_handle(SoziMedia *sozi_media, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers);
+
+static PropDescription * sozi_media_describe_props(SoziMedia *sozi_media);
+
+static void sozi_media_get_props(SoziMedia *sozi_media, GPtrArray *props);
+
+static void sozi_media_set_props(SoziMedia *sozi_media, GPtrArray *props);
+
+
+static ObjectOps sozi_media_ops =
+{
+ (DestroyFunc) sozi_media_destroy,
+ (DrawFunc) sozi_media_draw,
+ (DistanceFunc) sozi_media_distance_from,
+ (SelectFunc) sozi_media_select,
+ (CopyFunc) object_copy_using_properties,
+ (MoveFunc) sozi_media_move,
+ (MoveHandleFunc) sozi_media_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) 0,
+ (DescribePropsFunc) sozi_media_describe_props,
+ (GetPropsFunc) sozi_media_get_props,
+ (SetPropsFunc) sozi_media_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
+
+/******************************************************************************
+ * Functions for managing Sozi media
+ *****************************************************************************/
+
+static void
+sozi_media_update(SoziMedia *sozi_media)
+{
+ char legend[32];
+ int nb_char;
+
+ /* update legend */
+ nb_char = g_snprintf(legend, sizeof(legend), "%s", sozi_media->file);
+ if(sizeof(legend) < nb_char)
+ {
+ legend[sizeof(legend) - 1] = 0;
+ legend[sizeof(legend) - 2] = '.';
+ legend[sizeof(legend) - 3] = '.';
+ legend[sizeof(legend) - 4] = '.';
+ }
+ text_set_string(sozi_media->sozi_object.legend.text, legend);
+}
+
+/******************************************************************************
+ * Functions for managing the Sozi object life managment (init, copy, kill)
+ *****************************************************************************/
+
+static void
+sozi_media_init(SoziMedia *sozi_media)
+{
+ sozi_media->type = MEDIA_TYPE_UNDEFINED;
+ if(sozi_media->file == NULL) {
+ sozi_media->file = g_strdup("");
+ }
+}
+
+static void
+sozi_media_kill(SoziMedia *sozi_media)
+{
+ if(sozi_media->file != NULL) {
+ g_free(sozi_media->file);
+ }
+}
+
+/******************************************************************************
+ * Functions that implement the Dia fops
+ *****************************************************************************/
+
+static DiaObject *
+sozi_media_create(Point *startpoint,
+ void *user_data,
+ Handle **handle1,
+ Handle **handle2)
+{
+ SoziMedia *sozi_media;
+
+ sozi_media = g_new0(SoziMedia, 1);
+
+ /* init dia object */
+ sozi_media->sozi_object.dia_object.type = &sozi_media_type;
+ sozi_media->sozi_object.dia_object.ops = &sozi_media_ops;
+
+ /* init sozi object : that is also the place where the dia object
+ * geometry (position, handles, ...) will be initialized
+ */
+ sozi_object_init(&sozi_media->sozi_object, startpoint);
+
+ /* init sozi media */
+ sozi_media_init(sozi_media);
+
+ /* update sozi object geometry */
+ sozi_object_update(&sozi_media->sozi_object);
+
+ /* handle are not used */
+ *handle1 = NULL;
+ *handle2 = NULL;
+
+ return &sozi_media->sozi_object.dia_object;
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_media_destroy(SoziMedia *sozi_media)
+{
+ /* kill sozi media */
+ sozi_media_kill(sozi_media);
+
+ /* kill sozi object */
+ sozi_object_kill(&sozi_media->sozi_object);
+
+ /* do NOT free sozi_media, caller will take care about that */
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_media_draw_svg(SoziMedia *sozi_media, DiaSvgRenderer *svg_renderer)
+{
+ xmlNs *sozi_name_space;
+ xmlNodePtr root;
+ xmlNodePtr node;
+ xmlNodePtr rect;
+ /* buffers for storing attributes */
+ gchar * type;
+ gchar * src;
+ gchar * start_frame;
+ gchar * stop_frame;
+
+ /* format attributes */
+
+ switch(sozi_media->type) {
+ case MEDIA_TYPE_VIDEO_MP4 : type = g_strdup("video/mp4" ); break;
+ case MEDIA_TYPE_VIDEO_WEBM: type = g_strdup("video/webm"); break;
+ case MEDIA_TYPE_VIDEO_OGG : type = g_strdup("video/ogg" ); break;
+ case MEDIA_TYPE_AUDIO_MPEG: type = g_strdup("audio/mpeg"); break;
+ case MEDIA_TYPE_AUDIO_OGG : type = g_strdup("audio/ogg" ); break;
+ case MEDIA_TYPE_AUDIO_WAV : type = g_strdup("audio/wav" ); break;
+ default: return;
+ }
+ src = g_strdup(sozi_media->file);
+ start_frame = g_strdup_printf("%d", sozi_media->start_frame);
+ stop_frame = g_strdup_printf("%d", sozi_media->stop_frame);
+
+ /* draw the sozi base object and get a reference to the sozi
+ namespace and document root */
+
+ sozi_object_draw_svg(&sozi_media->sozi_object, svg_renderer, 0, &sozi_name_space, &root, &rect);
+
+ assert(sozi_name_space != NULL);
+
+ /* add a "custom" media for sozi */
+
+ switch(sozi_media->type) {
+ case MEDIA_TYPE_VIDEO_MP4 :
+ case MEDIA_TYPE_VIDEO_WEBM:
+ case MEDIA_TYPE_VIDEO_OGG :
+ node = xmlNewChild(rect, sozi_name_space, (const xmlChar *)"video", NULL);
+ break;
+ case MEDIA_TYPE_AUDIO_MPEG:
+ case MEDIA_TYPE_AUDIO_OGG :
+ case MEDIA_TYPE_AUDIO_WAV :
+ node = xmlNewChild(rect, sozi_name_space, (const xmlChar *)"audio", NULL);
+ break;
+ default: node = 0;
+ }
+
+ xmlSetProp(node, (const xmlChar *)"sozi:type" , (const xmlChar *)type);
+ xmlSetProp(node, (const xmlChar *)"sozi:src" , (const xmlChar *)src);
+ xmlSetProp(node, (const xmlChar *)"sozi:start-frame" , (const xmlChar *)start_frame);
+ xmlSetProp(node, (const xmlChar *)"sozi-stop-frame" , (const xmlChar *)stop_frame);
+
+ /* free resources */
+ g_free(type);
+ g_free(src);
+ g_free(start_frame);
+ g_free(stop_frame);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+#define DIA_IS_INTERACTIVE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_INTERACTIVE_RENDERER))
+
+static void
+sozi_media_draw(SoziMedia *sozi_media, DiaRenderer *renderer)
+{
+
+ if (DIA_IS_SVG_RENDERER(renderer)) {
+ sozi_media_draw_svg(sozi_media, DIA_SVG_RENDERER (renderer));
+ }
+ else if(DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer)) {
+ DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
+
+ renderer_ops->set_linewidth(renderer, SOZI_OBJECT_LINE_WIDTH);
+ renderer_ops->set_linecaps(renderer, LINECAPS_BUTT);
+ renderer_ops->set_linejoin(renderer, LINEJOIN_MITER);
+ renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID, 0);
+
+ renderer_ops->draw_polygon(renderer, sozi_media->sozi_object.corners, 4, NULL, &color_black);
+
+ if(sozi_media->sozi_object.legend.disp == TRUE) {
+ text_draw(sozi_media->sozi_object.legend.text, renderer);
+ }
+ }
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static real
+sozi_media_distance_from(SoziMedia *sozi_media, Point *point)
+{
+ return distance_polygon_point(sozi_media->sozi_object.corners, 4, SOZI_OBJECT_LINE_WIDTH, point);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static void
+sozi_media_select(SoziMedia *sozi_media, Point *clicked_point,
+ DiaRenderer *interactive_renderer)
+{
+ /* this callback will be called the first time the object is
+ placed on the sheet, it allows to initialize the object */
+ sozi_media_update(sozi_media);
+ sozi_object_update(&sozi_media->sozi_object);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static ObjectChange*
+sozi_media_move(SoziMedia *sozi_media, Point *to)
+{
+ return sozi_object_move(&sozi_media->sozi_object, to);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static ObjectChange*
+sozi_media_move_handle(SoziMedia *sozi_media, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers)
+{
+ return sozi_object_move_handle(&sozi_media->sozi_object, handle,
+ to, cp, reason, modifiers);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+static DiaObject *
+sozi_media_load(ObjectNode obj_node, int version, DiaContext *ctx)
+{
+ return object_load_using_properties(&sozi_media_type, obj_node, version, ctx);
+}
+
+/******************************************************************************
+ *
+ *****************************************************************************/
+
+static PropEnumData prop_aspect_data[] =
+{
+ { N_("Free") , ASPECT_FREE },
+ { N_("Fixed") , ASPECT_FIXED },
+ { NULL, 0 }
+};
+
+static PropEnumData prop_media_type_data[] =
+{
+ { N_("undefined") , MEDIA_TYPE_UNDEFINED },
+ { N_("video/mp4") , MEDIA_TYPE_VIDEO_MP4 },
+ { N_("video/webm") , MEDIA_TYPE_VIDEO_WEBM },
+ { N_("video/ogg") , MEDIA_TYPE_VIDEO_OGG },
+ { N_("audio/mpeg") , MEDIA_TYPE_AUDIO_MPEG },
+ { N_("audio/ogg") , MEDIA_TYPE_AUDIO_OGG },
+ { N_("audio/wav") , MEDIA_TYPE_AUDIO_WAV },
+ { NULL, 0 }
+};
+
+static PropDescription sozi_media_props[] =
+{
+ OBJECT_COMMON_PROPERTIES,
+
+ PROP_STD_NOTEBOOK_BEGIN,
+
+ PROP_NOTEBOOK_PAGE("geometry",0,N_("Geometry")),
+ { "x" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center x") , NULL, NULL },
+ { "y" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center y") , NULL, NULL },
+ { "width" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Width") , NULL, NULL },
+ { "height" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Height") , NULL, NULL },
+ { "angle" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Angle (deg)") , NULL, NULL },
+ { "aspect" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Aspect ratio") , NULL,
prop_aspect_data },
+ { "scale_from_center", PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Scale from center"), NULL, NULL },
+
+ PROP_NOTEBOOK_PAGE("legend",0,N_("Legend")),
+ { "legend_disp" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Legend is visible"), NULL, NULL},
+ { "legend" , PROP_TYPE_TEXT , 0 , NULL , NULL, NULL},
+ PROP_STD_TEXT_ALIGNMENT,
+ PROP_STD_TEXT_FONT,
+ PROP_STD_TEXT_HEIGHT,
+ PROP_STD_TEXT_COLOUR,
+
+ PROP_NOTEBOOK_PAGE("sozi",0,N_("Sozi")),
+ { "media_type" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Media type") , NULL, prop_media_type_data},
+ { "media_file" , PROP_TYPE_FILE , PROP_FLAG_VISIBLE, N_("Media file") , NULL, NULL },
+ { "start_frame", PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Start frame"), NULL, NULL },
+ { "stop_frame" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Stop frame") , NULL, NULL },
+
+ PROP_STD_NOTEBOOK_END,
+
+ PROP_DESC_END
+};
+
+static PropOffset sozi_media_offsets[] =
+{
+ OBJECT_COMMON_PROPERTIES_OFFSETS,
+
+ PROP_OFFSET_STD_NOTEBOOK_BEGIN,
+
+ PROP_OFFSET_NOTEBOOK_PAGE("geometry"),
+ { "x" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.center.x)
},
+ { "y" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.center.y)
},
+ { "width" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.width)
},
+ { "height" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.height)
},
+ { "angle" , PROP_TYPE_INT , offsetof(SoziMedia, sozi_object.angle)
},
+ { "aspect" , PROP_TYPE_ENUM , offsetof(SoziMedia, sozi_object.aspect)
},
+ { "scale_from_center" , PROP_TYPE_BOOL , offsetof(SoziMedia, sozi_object.scale_from_center)
},
+
+ PROP_OFFSET_NOTEBOOK_PAGE("legend"),
+ { "legend_disp" , PROP_TYPE_BOOL , offsetof(SoziMedia, sozi_object.legend.disp)
},
+ { "legend" , PROP_TYPE_TEXT , offsetof(SoziMedia, sozi_object.legend.text)
},
+ { "text_alignment" , PROP_TYPE_ENUM , offsetof(SoziMedia,
sozi_object.legend.attrs.alignment) },
+ { "text_font" , PROP_TYPE_FONT , offsetof(SoziMedia, sozi_object.legend.attrs.font)
},
+ { PROP_STDNAME_TEXT_HEIGHT, PROP_STDTYPE_TEXT_HEIGHT, offsetof(SoziMedia,
sozi_object.legend.attrs.height) },
+ { "text_colour" , PROP_TYPE_COLOUR , offsetof(SoziMedia,
sozi_object.legend.attrs.color) },
+
+ PROP_OFFSET_NOTEBOOK_PAGE("sozi"),
+ { "media_type" , PROP_TYPE_ENUM , offsetof(SoziMedia, type)
},
+ { "media_file" , PROP_TYPE_FILE , offsetof(SoziMedia, file)
},
+ { "start_frame" , PROP_TYPE_INT , offsetof(SoziMedia, start_frame)
},
+ { "stop_frame" , PROP_TYPE_INT , offsetof(SoziMedia, stop_frame)
},
+
+ PROP_OFFSET_STD_NOTEBOOK_END,
+
+ {NULL}
+};
+
+static PropDescription *
+sozi_media_describe_props(SoziMedia *sozi_media)
+{
+ if (sozi_media_props[0].quark == 0)
+ prop_desc_list_calculate_quarks(sozi_media_props);
+ return sozi_media_props;
+}
+
+static void
+sozi_media_get_props(SoziMedia *sozi_media, GPtrArray *props)
+{
+ text_get_attributes(sozi_media->sozi_object.legend.text, &sozi_media->sozi_object.legend.attrs);
+ object_get_props_from_offsets(&sozi_media->sozi_object.dia_object, sozi_media_offsets, props);
+}
+
+static void
+sozi_media_set_props(SoziMedia *sozi_media, GPtrArray *props)
+{
+ object_set_props_from_offsets(&sozi_media->sozi_object.dia_object, sozi_media_offsets, props);
+ apply_textattr_properties(props, sozi_media->sozi_object.legend.text, "legend" ,
&sozi_media->sozi_object.legend.attrs);
+ sozi_media_update(sozi_media);
+ sozi_object_update(&sozi_media->sozi_object);
+}
diff --git a/objects/Sozi/sozi-object.c b/objects/Sozi/sozi-object.c
new file mode 100644
index 0000000..9c5a633
--- /dev/null
+++ b/objects/Sozi/sozi-object.c
@@ -0,0 +1,622 @@
+/* -*- c-basic-offset:4; -*- */
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1999 Alexander Larsson
+ *
+ * Sozi objects support
+ * Copyright (C) 2015 Paul Chavent
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* standard libs*/
+#include <assert.h>
+#include <math.h>
+
+/* xpath for searching in the svg doc (xmlDocGetRootElement) */
+#include <libxml/xpath.h>
+
+/* dia stuff */
+#include "diarenderer.h"
+
+/* sozi stuff */
+#include "sozi-player.h"
+#include "sozi-object.h"
+
+/******************************************************************************
+ * unit square
+ *****************************************************************************/
+static const Handle default_handles[4] =
+{
+ {HANDLE_RESIZE_NW, HANDLE_MAJOR_CONTROL, { 0, 0}, HANDLE_NONCONNECTABLE, NULL},
+ {HANDLE_RESIZE_SW, HANDLE_MAJOR_CONTROL, { 0, 1}, HANDLE_NONCONNECTABLE, NULL},
+ {HANDLE_RESIZE_SE, HANDLE_MAJOR_CONTROL, { 1, 1}, HANDLE_NONCONNECTABLE, NULL},
+ {HANDLE_RESIZE_NE, HANDLE_MAJOR_CONTROL, { 1, 0}, HANDLE_NONCONNECTABLE, NULL},
+};
+
+/******************************************************************************
+ * FUNCTIONS FOR MANAGING ACCESS TO THE SVG SOZI PLAYER ENGINE
+ *****************************************************************************/
+
+/**
+ * Test the presence of the sozi player in an svg document.
+ * @param[in] doc the svg document
+ * @param[in] sozi_elem the sozi player identification string that will
+ * probably be "//script[ id='sozi-script']"
+ * @return 1 if the sozi player has been found, 0 otherwise.
+ */
+static int
+sozi_player_is_present(xmlDocPtr doc, const xmlChar *sozi_elem)
+{
+ xmlXPathContextPtr context;
+ xmlXPathObjectPtr result;
+
+ context = xmlXPathNewContext(doc);
+ if(context == NULL) {
+ fprintf(stderr, "sozi-object : error in xmlXPathNewContext\n");
+ return 0;
+ }
+
+ result = xmlXPathEvalExpression(sozi_elem, context);
+ xmlXPathFreeContext(context);
+ if(result == NULL) {
+ fprintf(stderr, "sozi-object : error in xmlXPathEvalExpression\n");
+ return 0;
+ }
+
+ if(xmlXPathNodeSetIsEmpty(result->nodesetval)) {
+ xmlXPathFreeObject(result);
+ return 0;
+ }
+
+ xmlXPathFreeObject(result);
+ return 1;
+}
+
+/**
+ * Retreive the sozi player.
+ * @param[out] sozi_version_ptr sozi version placeholder
+ * @param[out] sozi_js_ptr sozi player placeholder
+ * @param[out] sozi_extras_media_js_ptr sozi player media extension placeholder
+ * @param[out] sozi_css_ptr sozi stylesheet placeholder
+ */
+static void
+sozi_player_get(gchar **sozi_version_ptr, gchar **sozi_js_ptr, gchar **sozi_extras_media_js_ptr, gchar
**sozi_css_ptr)
+{
+#if defined(SOZI_PATH)
+ /* try to get sozi engine from SOZI_PATH */
+ int i;
+ struct
+ {
+ const gchar * filename;
+ gchar ** data;
+ } external_sozi[3] =
+ {
+ { SOZI_PATH"/sozi.version" , sozi_version_ptr },
+ { SOZI_PATH"/sozi.js" , sozi_js_ptr },
+ { SOZI_PATH"/extras/sozi_extras_media.js" , sozi_extras_media_js_ptr },
+ { SOZI_PATH"/sozi.css" , sozi_css_ptr }
+ };
+
+ for (i = 0; i < 3; i++) {
+ GError * err = 0;
+ if (!g_file_get_contents(external_sozi[i].filename,
+ external_sozi[i].data,
+ NULL,
+ &err)) {
+ g_warning("sozi-object : unable to read file \"%s\" : %s",
+ external_sozi[i].filename,
+ err->message);
+ g_error_free (err);
+ while(i--) {
+ g_free (*external_sozi[i].data);
+ }
+ break;
+ }
+ }
+
+ if(i == 3) {
+ /* that's ok, don't need to go further */
+ return;
+ }
+
+#else /* defined(SOZI_PATH) */
+ g_warning("sozi-object : use builtin player");
+#endif /* defined(SOZI_PATH) */
+
+ /* if SOZI_PATH isn't defined, fallback to the player that comes with dia sources */
+ *sozi_version_ptr = g_strdup((const gchar *)sozi_version);
+ *sozi_js_ptr = g_strdup((const gchar *)sozi_min_js);
+ *sozi_extras_media_js_ptr = g_strdup((const gchar *)sozi_extras_media_min_js);
+ *sozi_css_ptr = g_strdup((const gchar *)sozi_min_css);
+
+#if defined(SOZI_PATH)
+ g_warning("sozi-object : use sozi player version '%s'", *sozi_version_ptr);
+#endif /* defined(SOZI_PATH) */
+}
+
+/******************************************************************************
+ * FUNCTIONS FOR MANAGING THE SOZI OBJECT INIT AND UPDATE
+ *****************************************************************************/
+
+void
+sozi_object_init(SoziObject *sozi_object, Point *center)
+{
+ DiaObject *dia_object;
+ int i;
+
+ dia_object = &sozi_object->dia_object;
+
+ dia_object->position = *center;
+
+ /* dia_object->bounding_box will be set in sozi_object_update */
+
+ dia_object->num_handles = 4;
+ if(dia_object->handles == NULL) {
+ dia_object->handles = g_new0(Handle *, 4);
+ }
+
+ for (i = 0; i < 4; i++) {
+ if(dia_object->handles[i] == NULL) {
+ dia_object->handles[i] = g_new0(Handle, 1);
+ }
+ *dia_object->handles[i] = default_handles[i];
+ }
+
+ dia_object->num_connections = 1;
+ if(dia_object->connections == NULL) {
+ dia_object->connections = g_new0(ConnectionPoint *, 1);
+ }
+
+ if(dia_object->connections[0] == NULL) {
+ dia_object->connections[0] = g_new0(ConnectionPoint, 1);
+ }
+ dia_object->connections[0]->object = dia_object;
+ dia_object->connections[0]->directions = DIR_ALL;
+
+ /* dia_object->bounding_box will be set in sozi_object_update */
+
+ sozi_object->center = *center;
+ sozi_object->width = 4;
+ sozi_object->height = 3;
+ sozi_object->angle = 0;
+ sozi_object->aspect = ASPECT_FIXED;
+ sozi_object->scale_from_center = FALSE;
+
+ /* sozi_object->cos_angle will be set in sozi_object_update */
+ /* sozi_object->sin_angle will be set in sozi_object_update */
+ /* sozi_object->m will be set in sozi_object_update */
+
+ /* sozi_object->corners are set in sozi_object_update */
+
+ sozi_object->legend.disp = TRUE;
+ sozi_object->legend.text = new_text_default(center, &color_black, ALIGN_LEFT);
+ text_get_attributes(sozi_object->legend.text, &sozi_object->legend.attrs);
+}
+
+void
+sozi_object_kill(SoziObject *sozi_object)
+{
+ int i;
+
+ text_destroy(sozi_object->legend.text);
+
+ object_unconnect_all(&sozi_object->dia_object);
+
+ for (i = 0; i < 1; i++) {
+ if(sozi_object->dia_object.connections[i] != NULL) {
+ g_free(sozi_object->dia_object.connections[i]);
+ }
+ }
+
+ for (i = 0; i < 4; i++) {
+ if(sozi_object->dia_object.handles[i] != NULL) {
+ g_free(sozi_object->dia_object.handles[i]);
+ }
+ }
+
+ if (sozi_object->dia_object.connections) {
+ g_free(sozi_object->dia_object.connections);
+ sozi_object->dia_object.connections = NULL;
+ }
+
+ if (sozi_object->dia_object.handles) {
+ g_free(sozi_object->dia_object.handles);
+ sozi_object->dia_object.handles = NULL;
+ }
+
+ if (sozi_object->dia_object.meta) {
+ g_hash_table_destroy (sozi_object->dia_object.meta);
+ sozi_object->dia_object.meta = NULL;
+ }
+}
+
+void
+sozi_object_update(SoziObject *sozi_object)
+{
+ DiaObject *dia_object;
+ int i;
+ Point legend_pos;
+ Rectangle legend_bb;
+
+ dia_object = &sozi_object->dia_object;
+
+ dia_object->position = sozi_object->center;
+
+ dia_object->bounding_box.left = G_MAXFLOAT;
+ dia_object->bounding_box.top = G_MAXFLOAT;
+ dia_object->bounding_box.right = -G_MAXFLOAT;
+ dia_object->bounding_box.bottom = -G_MAXFLOAT;
+
+ /* angle */
+ if(sozi_object->angle < -180) {
+ sozi_object->angle += 360.0;
+ }
+ if(180 < sozi_object->angle) {
+ sozi_object->angle -= 360;
+ }
+ sozi_object->cos_angle = cos(sozi_object->angle * M_PI / 180.0);
+ sozi_object->sin_angle = sin(sozi_object->angle * M_PI / 180.0);
+
+ /*
+ *
+ * translate(center.x,center.y) . rotate(angle) . scale(width,height) . translate(-0.5,-0.5)
+ *
+ * m
+ * =
+ * | 1 0 x | . | cos(a) -sin(a) 0 | . | w 0 0 | . | 1 0 -0.5 |
+ * | 0 1 y | | sin(a) cos(a) 0 | | 0 h 0 | | 0 1 -0.5 |
+ * | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |
+ * =
+ * | w*cos(a) -h*sin(a) x-0.5*w*cos(a)+0.5*h*sin(a) |
+ * | w*sin(a) h*cos(a) y-0.5*w*sin(a)-0.5*h*cos(a) |
+ * | 0 0 1 |
+ */
+ sozi_object->m[0] = sozi_object->width * sozi_object->cos_angle ;
+ sozi_object->m[1] = -sozi_object->height * sozi_object->sin_angle ;
+ sozi_object->m[2] = sozi_object->center.x - 0.5 * sozi_object->width * sozi_object->cos_angle + 0.5 *
sozi_object->height * sozi_object->sin_angle;
+ sozi_object->m[3] = sozi_object->width * sozi_object->sin_angle ;
+ sozi_object->m[4] = sozi_object->height * sozi_object->cos_angle ;
+ sozi_object->m[5] = sozi_object->center.y - 0.5 * sozi_object->width * sozi_object->sin_angle - 0.5 *
sozi_object->height * sozi_object->cos_angle;
+
+ for (i = 0; i < 4; i++) {
+
+ sozi_object->corners[i].x = sozi_object->m[0] * default_handles[i].pos.x + sozi_object->m[1] *
default_handles[i].pos.y + sozi_object->m[2];
+ sozi_object->corners[i].y = sozi_object->m[3] * default_handles[i].pos.x + sozi_object->m[4] *
default_handles[i].pos.y + sozi_object->m[5];
+
+ dia_object->handles[i]->pos = sozi_object->corners[i];
+
+ if(sozi_object->corners[i].x < dia_object->bounding_box.left) {
+ dia_object->bounding_box.left = sozi_object->corners[i].x - SOZI_OBJECT_LINE_WIDTH;
+ }
+ if(dia_object->bounding_box.right < sozi_object->corners[i].x) {
+ dia_object->bounding_box.right = sozi_object->corners[i].x + SOZI_OBJECT_LINE_WIDTH;
+ }
+ if(sozi_object->corners[i].y < dia_object->bounding_box.top) {
+ dia_object->bounding_box.top = sozi_object->corners[i].y - SOZI_OBJECT_LINE_WIDTH;
+ }
+ if(dia_object->bounding_box.bottom < sozi_object->corners[i].y) {
+ dia_object->bounding_box.bottom = sozi_object->corners[i].y + SOZI_OBJECT_LINE_WIDTH;
+ }
+ }
+
+ dia_object->connections[0]->pos = sozi_object->corners[0];
+
+ /* setup legend appearence */
+ legend_pos = sozi_object->corners[0];
+ legend_pos.y += text_get_ascent(sozi_object->legend.text);
+ text_set_position(sozi_object->legend.text, &legend_pos);
+
+ /* final bounding / enclosing box with legend */
+ text_calc_boundingbox(sozi_object->legend.text, &legend_bb);
+ rectangle_union(&dia_object->bounding_box, &legend_bb);
+}
+
+/******************************************************************************
+ * FUNCTIONS FOR MANAGING THE SOZI OBJECT RENDERING
+ *****************************************************************************/
+
+void
+sozi_object_draw_svg(SoziObject *sozi_object, DiaSvgRenderer *svg_renderer, gchar * refid, xmlNs
**p_sozi_name_space, xmlNodePtr * p_root, xmlNodePtr * p_rect)
+{
+ static xmlNs * sozi_name_space = NULL;
+ xmlNodePtr root;
+ xmlNodePtr node;
+ /* for managing sozi player implantation */
+ gchar * sozi_version;
+ gchar * sozi_js;
+ gchar * sozi_extras_media_js;
+ gchar * sozi_css;
+ xmlChar * escaped;
+ /* buffers for storing attributes */
+ gchar * x;
+ gchar * y;
+ gchar * width;
+ gchar * height;
+ gchar * transform;
+ gchar * style;
+ gchar dtostr_buf[6][G_ASCII_DTOSTR_BUF_SIZE];
+# define dtostr(n,d) g_ascii_formatd(dtostr_buf[(n)], sizeof(dtostr_buf[(n)]), "%g", (d))
+
+ root = xmlDocGetRootElement(svg_renderer->doc);
+
+ /* check that the sozi namespace, scripts and style are present */
+
+ if (!sozi_player_is_present(svg_renderer->doc, (const xmlChar*) "//script[ id='sozi-script']")) {
+
+ sozi_player_get(&sozi_version, &sozi_js, &sozi_extras_media_js, &sozi_css);
+
+ sozi_name_space = xmlNewNs(root, (const xmlChar *)"http://sozi.baierouge.fr", (const xmlChar
*)"sozi");
+
+ node = xmlNewChild(root, NULL, (const xmlChar *)"script", NULL);
+ xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-script");
+ xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version);
+ escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_js);
+ xmlNodeSetContent(node, escaped);
+ xmlFree(escaped);
+
+ node = xmlNewChild(root, NULL, (const xmlChar *)"script", NULL);
+ xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-extras-media-script");
+ xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version);
+ escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_extras_media_js);
+ xmlNodeSetContent(node, escaped);
+ xmlFree(escaped);
+
+ node = xmlNewChild(root, NULL, (const xmlChar *)"style", NULL);
+ xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-style");
+ xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version);
+ escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_css);
+ xmlNodeSetContent(node, escaped);
+ xmlFree(escaped);
+
+ g_free(sozi_version);
+ g_free(sozi_js);
+ g_free(sozi_css);
+ }
+
+ assert(sozi_name_space != NULL);
+
+ /* format attributes */
+
+#if 0 /* pure transformation */
+
+ x = g_strdup_printf("0");
+ y = g_strdup_printf("0");
+ /* FIXME : see Sozi/player/js/display.js
+ * exports.CameraState::setAtElement :
+ * the properties of the objects are based
+ * on the geometrical properties of the rectangle
+ * => this makes 1:1 ratio rectangles...
+ */
+ width = g_strdup_printf("1");
+ height = g_strdup_printf("1");
+ transform = g_strdup_printf("matrix(%s,%s,%s,%s,%s,%s)",
+ /* svg has colomn-major order, we use row-major order */
+ dtostr(0, sozi_object->m[0] * svg_renderer->scale),
+ dtostr(1, sozi_object->m[3] * svg_renderer->scale),
+ dtostr(2, sozi_object->m[1] * svg_renderer->scale),
+ dtostr(3, sozi_object->m[4] * svg_renderer->scale),
+ dtostr(4, sozi_object->m[2] * svg_renderer->scale),
+ dtostr(5, sozi_object->m[5] * svg_renderer->scale));
+ /* FIXME : Scaling problem on stroke width :
http://dev.w3.org/SVG/modules/vectoreffects/master/SVGVectorEffects.html */
+ style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:%s",
+ dtostr(0, 0.1 / svg_renderer->scale));
+
+#elif 0 /* decompose transformation */
+
+ x = g_strdup_printf("0");
+ y = g_strdup_printf("0");
+ /* FIXME : see Sozi/player/js/display.js
+ * exports.CameraState::setAtElement :
+ * the properties of the objects are based
+ * on the geometrical properties of the rectangle
+ * => this makes 1:1 ratio rectangles...
+ */
+ width = g_strdup_printf("1");
+ height = g_strdup_printf("1");
+ transform = g_strdup_printf("scale(%s,%s),translate(%s,%s),rotate(%s),scale(%s,%s),translate(-0.5,-0.5)",
+ dtostr(0, svg_renderer->scale),
+ dtostr(1, svg_renderer->scale),
+ dtostr(2, sozi_object->center.x),
+ dtostr(3, sozi_object->center.y),
+ dtostr(4, sozi_object->angle),
+ dtostr(5, sozi_object->width),
+ dtostr(6, sozi_object->height));
+ /* FIXME : Scaling problem on stroke width :
http://dev.w3.org/SVG/modules/vectoreffects/master/SVGVectorEffects.html */
+ style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:%s",
+ dtostr(0, 0.1 / svg_renderer->scale));
+
+#else /* no apply scale to transformation : best compromise */
+
+ x = g_strdup_printf("%s", dtostr(0, sozi_object->corners[0].x * svg_renderer->scale));
+ y = g_strdup_printf("%s", dtostr(0, sozi_object->corners[0].y * svg_renderer->scale));
+ width = g_strdup_printf("%s", dtostr(0, sozi_object->width * svg_renderer->scale));
+ height = g_strdup_printf("%s", dtostr(0, sozi_object->height * svg_renderer->scale));
+ transform = g_strdup_printf("rotate(%s,%s,%s)",
+ dtostr(0, sozi_object->angle),
+ dtostr(1, sozi_object->corners[0].x * svg_renderer->scale),
+ dtostr(2, sozi_object->corners[0].y * svg_renderer->scale));
+
+ style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:0.1");
+
+#endif
+
+ /* add a "classic" rectangle to the svg document */
+
+ node = xmlNewChild(svg_renderer->root, svg_renderer->svg_name_space, (const xmlChar *)"rect", NULL);
+
+ if (refid) {
+ xmlSetProp(node, (const xmlChar *)"id" , (xmlChar *)refid);
+ }
+ xmlSetProp(node, (const xmlChar *)"x" , (xmlChar *)x);
+ xmlSetProp(node, (const xmlChar *)"y" , (xmlChar *)y);
+ xmlSetProp(node, (const xmlChar *)"width" , (xmlChar *)width);
+ xmlSetProp(node, (const xmlChar *)"height" , (xmlChar *)height);
+ xmlSetProp(node, (const xmlChar *)"transform", (xmlChar *)transform);
+ xmlSetProp(node, (const xmlChar *)"style" , (xmlChar *)style);
+
+ /* free resources */
+ g_free(x);
+ g_free(y);
+ g_free(width);
+ g_free(height);
+ g_free(transform);
+ g_free(style);
+
+ /* provide results */
+ *p_sozi_name_space = sozi_name_space;
+ *p_root = root;
+ *p_rect = node;
+
+# undef dtostr
+}
+
+/******************************************************************************
+ * FUNCTIONS FOR MANAGING THE OBJECT GRABBING AND SCALLING
+ *****************************************************************************/
+
+ObjectChange*
+sozi_object_move(SoziObject *sozi_object, Point *to)
+{
+ sozi_object->center = *to;
+
+ sozi_object_update(sozi_object);
+
+ return NULL;
+}
+
+ObjectChange*
+sozi_object_move_handle(SoziObject *sozi_object, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers)
+{
+ if(reason == HANDLE_MOVE_USER) {
+
+ if(modifiers & MODIFIER_SHIFT) {
+ /* rotate object around its center */
+ Point p1;
+ Point p2;
+
+ /* p1 is the vector from the center to the old position of the handle */
+ p1 = handle->pos;
+ point_sub(&p1, &sozi_object->center);
+ /* p2 is the vector from the center to the new position of the handle */
+ p2 = *to;
+ point_sub(&p2, &sozi_object->center);
+
+ /*
+ p1 . p2 = ||p1|| ||p2|| cos(delta)
+ p1 ^ p2 = ||p1|| ||p2|| sin(delta)
+ tan(delta) = (p1 ^ p2) / p1 . p2
+ */
+ sozi_object->angle += (180.0 / M_PI * atan2(p1.x * p2.y - p1.y * p2.x, p1.x * p2.x + p1.y *
p2.y));
+ }
+ else {
+ /* scale object */
+ DiaObject * dia_object;
+ unsigned i;
+
+ Point diagonal;
+
+ real ratio;
+ real width;
+ real height;
+
+ /* find the current handle */
+ dia_object = &sozi_object->dia_object;
+ for(i = 0; i < 4; i++) {
+ if(dia_object->handles[i] == handle) {
+ break;
+ }
+ }
+ assert(i < 4);
+
+ if(sozi_object->scale_from_center) {
+ /* scale object from its center */
+
+ /* diagonal is the vector from the center to the new handle pos */
+ diagonal = *to;
+ point_sub(&diagonal, &sozi_object->center);
+ /* ratio is the old ratio */
+ ratio = sozi_object->width / sozi_object->height;
+ /* dot product with the unit lenght vector that hold the width axe */
+ width = 2 * fabs(diagonal.x * sozi_object->cos_angle +
+ diagonal.y * sozi_object->sin_angle);
+ /* cross product with the unit lenght vector that hold the width axe */
+ height = 2 * fabs(diagonal.x * sozi_object->sin_angle -
+ diagonal.y * sozi_object->cos_angle);
+ /* compute the new size */
+ if(sozi_object->aspect == ASPECT_FREE) {
+ sozi_object->width = width;
+ sozi_object->height = height;
+ }
+ else {
+ sozi_object->width = (((height * ratio) < width)?width:(height * ratio));
+ sozi_object->height = (((width / ratio) < height)?height:(width / ratio));
+ }
+ }
+ else {
+ /* scale object from oposite handle */
+
+ /* go to the oposite handle */
+ i = (i + 2) % 4;
+
+ /* diagonal is the vector from the oposite handle to the new handle pos */
+ diagonal = *to;
+ point_sub(&diagonal, &dia_object->handles[i]->pos);
+ /* ratio is the old ratio */
+ ratio = sozi_object->width / sozi_object->height;
+ /* dot product with the unit lenght vector that hold the width axe */
+ width = fabs(diagonal.x * sozi_object->cos_angle +
+ diagonal.y * sozi_object->sin_angle);
+ /* cross product with the unit lenght vector that hold the width axe */
+ height = fabs(diagonal.x * sozi_object->sin_angle -
+ diagonal.y * sozi_object->cos_angle);
+ /* compute the new size */
+ if(sozi_object->aspect == ASPECT_FREE) {
+ sozi_object->width = width;
+ sozi_object->height = height;
+ }
+ else {
+ sozi_object->width = (((height * ratio) < width)?width:(height * ratio));
+ sozi_object->height = (((width / ratio) < height)?height:(width / ratio));
+ }
+ /* compute the new position */
+ if(sozi_object->aspect == ASPECT_FREE) {
+ sozi_object->center.x = 0.5 * (dia_object->handles[i]->pos.x + to->x);
+ sozi_object->center.y = 0.5 * (dia_object->handles[i]->pos.y + to->y);
+ }
+ else {
+ /* FIXME : in FIXED aspect the behavior isn't userfriendly */
+ static const real coefs [4][4] =
+ {
+ { 0.5,-0.5, 0.5, 0.5},
+ { 0.5, 0.5, 0.5,-0.5},
+ {-0.5, 0.5,-0.5,-0.5},
+ {-0.5,-0.5,-0.5, 0.5},
+ };
+ sozi_object->center.x = dia_object->handles[i]->pos.x +
+ coefs[i][0] * sozi_object->width * sozi_object->cos_angle +
+ coefs[i][1] * sozi_object->height * sozi_object->sin_angle;
+ sozi_object->center.y = dia_object->handles[i]->pos.y +
+ coefs[i][2] * sozi_object->width * sozi_object->sin_angle +
+ coefs[i][3] * sozi_object->height * sozi_object->cos_angle;
+ }
+ }
+ }
+ sozi_object_update(sozi_object);
+ }
+
+ return NULL;
+}
diff --git a/objects/Sozi/sozi-object.h b/objects/Sozi/sozi-object.h
new file mode 100644
index 0000000..67b5ee9
--- /dev/null
+++ b/objects/Sozi/sozi-object.h
@@ -0,0 +1,141 @@
+/* -*- c-basic-offset:4; -*- */
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1999 Alexander Larsson
+ *
+ * Sozi objects support
+ * Copyright (C) 2015 Paul Chavent
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#ifndef SOZI_OBJECT_H
+#define SOZI_OBJECT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* dia stuff */
+#include "object.h"
+#include "diasvgrenderer.h"
+#include "text.h"
+
+/**
+ * Common properties defines
+ */
+#define SOZI_OBJECT_LINE_WIDTH 0.01
+
+/**
+ * A Sozi object is represented with a box with
+ * free or fixed aspect ratio.
+ */
+typedef enum
+{
+ ASPECT_FREE,
+ ASPECT_FIXED
+} AspectType;
+
+/**
+ * Manage Sozi objects placement.
+ *
+ * This object hold the base geometry that manage
+ * other Sozi objects (frame,media, ...) placement.
+ *
+ * Could inherit struct _Element instead of DiaObject ?
+ *
+ * \extends _DiaObject
+ *
+ */
+typedef struct _SoziObject
+{
+ /* dia object inheritance */
+
+ DiaObject dia_object;
+
+ /* geometry of the object */
+
+ Point center;
+ real width;
+ real height;
+ int angle; /* in degree , positive from x axis to y axis */
+ AspectType aspect;
+ gboolean scale_from_center;
+
+ /* geometry of the object : internal stuff */
+
+ real cos_angle;
+ real sin_angle;
+
+ real m[6]; /* transformation matrix of the unit square */
+
+ Point corners[4]; /* corners of the object */
+
+ /* interactive rendering appearence */
+
+ struct
+ {
+ gboolean disp;
+ Text * text;
+ TextAttributes attrs;
+ } legend;
+
+} SoziObject;
+
+/**
+ * Initialize an already *allocated* object.
+ * @param[in] sozi_object pointer to object
+ * @param[in] center initial position of the object
+ */
+void sozi_object_init(SoziObject *sozi_object, Point *center);
+
+/**
+ * Cleanup the object.
+ * @param[in] sozi_object pointer to object
+ */
+void sozi_object_kill(SoziObject *sozi_object);
+
+/**
+ * Update the object.
+ * @param[in] sozi_object pointer to object
+ */
+void sozi_object_update(SoziObject *sozi_object);
+
+/**
+ * Helper function for the dia's DrawFunc
+ * @param[in] sozi_object pointer to object
+ * @param[in] svg_renderer
+ * @param[in] refif string describing the refid of the object
+ * @param[out] p_sozi_name_space a pointer to the sozi namespace pointer
+ * @param[out] p_root a pointer to the root element
+ * @param[out] p_rect a pointer to the sozi rect element
+ */
+void sozi_object_draw_svg(SoziObject *sozi_object, DiaSvgRenderer *svg_renderer, gchar * refid, xmlNs
**p_sozi_name_space, xmlNodePtr * p_root, xmlNodePtr * p_rect);
+
+/**
+ * Helper function for the dia's MoveFunc
+ * @param[in] sozi_object pointer to object
+ * @param[in] to destination point pointer
+ */
+ObjectChange* sozi_object_move(SoziObject *sozi_object, Point *to);
+
+/**
+ * Helper function for the dia's MoveHandleFunc
+ * @param[in] sozi_object pointer to object
+ * ...
+ */
+ObjectChange* sozi_object_move_handle(SoziObject *sozi_object, Handle *handle,
+ Point *to, ConnectionPoint *cp,
+ HandleMoveReason reason, ModifierKeys modifiers);
+
+#endif /* SOZI_OBJECT_H */
diff --git a/objects/Sozi/sozi-player.h b/objects/Sozi/sozi-player.h
new file mode 100644
index 0000000..83ce6a0
--- /dev/null
+++ b/objects/Sozi/sozi-player.h
@@ -0,0 +1,355 @@
+#ifndef SOZI_PLAYER_H
+#define SOZI_PLAYER_H
+
+static const char sozi_min_js[] =
+"function namespace(b,d,a){var c=b;d.split(\".\").forEach(function(e){if(typeof c[e"
+"]===\"undefined\"){c[e]={}}c=c[e]});if(a){a(c,b)}return c}namespace(this,\"sozi.eve"
+"nts\",function(b){var a={};b.listen=function(c,d){if(!a.hasOwnProperty(c)){a[c]=["
+"]}a[c].push(d)};b.fire=function(d){var c=Array.prototype.slice.call(arguments,1)"
+";if(a.hasOwnProperty(d)){a[d].forEach(function(e){e.apply(null,c)})}}});namespac"
+"e(this,\"sozi.proto\",function(a){a.Object={installConstructors:function(){functio"
+"n b(){}b.prototype=this;this.instance=function(){var c=new b();c.construct.apply"
+"(c,arguments);return c};this.subtype=function(d){var c=new b();c.augment(d);c.in"
+"stallConstructors();return c}},construct:function(){},augment:function(c){for(va"
+"r b in c){if(c.hasOwnProperty(b)){this[b]=c[b]}}return this},bind:function(c){va"
+"r b=this;return function(){return c.apply(b,arguments)}}};a.Object.installConstr"
+"uctors()});namespace(this,\"sozi.actions\",function(A,g){var u=namespace(g,\"sozi.p"
+"layer\");var v=namespace(g,\"sozi.display\");var n=g.document;var o=0;var w=1;var t"
+"=1.05;var y=5;var m=5;var r=false;var i=0;var h=0;function a(C,B,D){u.stop();v.v"
+"iewPorts.player.zoom(C>0?t:1/t,B,D)}function x(B){u.stop();v.viewPorts.player.ro"
+"tate(B>0?y:-y)}function s(){if(sozi.framelist.isVisible()){sozi.framelist.hide()"
+";u.restart()}else{u.stop();sozi.framelist.show()}}function d(B){return v.viewPor"
+"ts.player.contains(B.clientX,B.clientY)}function f(B){if(!d(B)){return}if(B.butt"
+"on===o){n.documentElement.addEventListener(\"mousemove\",q,false);r=false;i=B.clie"
+"ntX;h=B.clientY}else{if(B.button===w){s()}}B.stopPropagation();B.preventDefault("
+")}function q(B){if(!d(B)){return}u.stop();if(!r&&(Math.abs(B.clientX-i)>m||Math."
+"abs(B.clientY-h)>m)){r=true}if(r){sozi.events.fire(\"sozi.player.cleanup\");v.view"
+"Ports.player.drag(B.clientX-i,B.clientY-h);i=B.clientX;h=B.clientY}B.stopPropaga"
+"tion()}function c(B){if(!d(B)){return}if(B.button===o){n.documentElement.removeE"
+"ventListener(\"mousemove\",q,false)}B.stopPropagation();B.preventDefault()}functio"
+"n p(B){if(!d(B)){return}u.moveToPrevious();B.stopPropagation();B.preventDefault("
+")}function e(B){if(!d(B)){return}if(!r&&B.button!==w){u.moveToNext()}B.stopPropa"
+"gation();B.preventDefault()}function j(B){if(!d(B)){return}if(!B){B=g.event}var "
+"C=0;if(B.wheelDelta){C=B.wheelDelta}else{if(B.detail){C=-B.detail}}if(C!==0){if("
+"B.shiftKey){x(C)}else{a(C,B.clientX,B.clientY)}}B.stopPropagation();B.preventDef"
+"ault()}function l(B){if(B.altKey||B.ctrlKey||B.metaKey){return}switch(B.charCode"
+"||B.which){case 43:a(1,g.innerWidth/2,g.innerHeight/2);break;case 45:a(-1,g.inne"
+"rWidth/2,g.innerHeight/2);break;case 61:u.moveToCurrent();break;case 70:case 102"
+":u.showAll();break;case 84:case 116:s();break;case 82:x(-1);break;case 114:x(1);"
+"break;default:return}B.stopPropagation();B.preventDefault()}function b(B){if(B.a"
+"ltKey||B.ctrlKey||B.metaKey){return}switch(B.keyCode){case 36:if(B.shiftKey){u.j"
+"umpToFirst()}else{u.moveToFirst()}break;case 35:if(B.shiftKey){u.jumpToLast()}el"
+"se{u.moveToLast()}break;case 38:case 33:case 37:if(B.shiftKey){u.jumpToPrevious("
+")}else{u.moveToPrevious()}break;case 40:case 34:case 39:case 13:case 32:if(B.shi"
+"ftKey){u.jumpToNext()}else{u.moveToNext()}break;default:return}B.stopPropagation"
+"();B.preventDefault()}function z(B){B.stopPropagation()}function k(){var C=n.get"
+"ElementsByTagName(\"a\");for(var D=0;D<C.length;D+=1){C[D].addEventListener(\"click"
+"\",z,false);C[D].addEventListener(\"contextmenu\",z,false)}var B=n.documentElement;"
+"B.addEventListener(\"click\",e,false);B.addEventListener(\"mousedown\",f,false);B.ad"
+"dEventListener(\"mouseup\",c,false);B.addEventListener(\"contextmenu\",p,false);B.ad"
+"dEventListener(\"DOMMouseScroll\",j,false);g.onmousewheel=j;B.addEventListener(\"ke"
+"ypress\",l,false);B.addEventListener(\"keydown\",b,false)}sozi.events.listen(\"sozi."
+"display.ready\",k)});namespace(this,\"sozi.animation\",function(d,g){var h=g.mozReq"
+"uestAnimationFrame||g.webkitRequestAnimationFrame||g.msRequestAnimationFrame||g."
+"oRequestAnimationFrame;var k=function(){return g.performance&&g.performance.now?"
+"g.performance.now():Date.now()};d.setAnimationFrameHandlers=function(l,m){h=l;k="
+"m};var i=40;var c;var j=[];function e(){if(j.length>0){if(h){h(e)}j.forEach(func"
+"tion(l){l.step(k())})}else{if(!h){g.clearInterval(c)}}}function b(){if(h){h(e)}e"
+"lse{c=g.setInterval(function(){e(k())},i)}}function a(l){j.push(l);if(j.length=="
+"=1){b()}}function f(l){j.splice(j.indexOf(l),1)}d.Animator=sozi.proto.Object.sub"
+"type({construct:function(){this.durationMs=0;this.data=null;this.initialTime=0;t"
+"his.started=false},start:function(l,m){this.durationMs=l;this.data=m;this.initia"
+"lTime=k();this.onStep(0);if(!this.started){this.started=true;a(this)}},stop:func"
+"tion(){if(this.started){f(this);this.started=false}},step:function(m){var l=m-th"
+"is.initialTime;if(l>=this.durationMs){this.stop();this.onStep(1);this.onDone()}e"
+"lse{this.onStep(l/this.durationMs)}},onStep:function(l){},onDone:function(){}});"
+"d.profiles={linear:function(l){return l},accelerate:function(l){return Math.pow("
+"l,3)},\"strong-accelerate\":function(l){return Math.pow(l,5)},decelerate:function("
+"l){return 1-Math.pow(1-l,3)},\"strong-decelerate\":function(l){return 1-Math.pow(1"
+"-l,5)},\"accelerate-decelerate\":function(l){var m=l<=0.5?l:1-l,n=Math.pow(2*m,3)/"
+"2;return l<=0.5?n:1-n},\"strong-accelerate-decelerate\":function(l){var m=l<=0.5?l"
+":1-l,n=Math.pow(2*m,5)/2;return l<=0.5?n:1-n},\"decelerate-accelerate\":function(l"
+"){var m=l<=0.5?l:1-l,n=(1-Math.pow(1-2*m,2))/2;return l<=0.5?n:1-n},\"strong-dece"
+"lerate-accelerate\":function(l){var m=l<=0.5?l:1-l,n=(1-Math.pow(1-2*m,3))/2;retu"
+"rn l<=0.5?n:1-n},\"immediate-beginning\":function(l){return 1},\"immediate-end\":fun"
+"ction(l){return l===1?1:0},\"immediate-middle\":function(l){return l>=0.5?1:0}}});"
+"namespace(this,\"sozi.display\",function(c,g){var f=\"http://www.w3.org/2000/svg\";v"
+"ar b=\"http://www.w3.org/1999/xlink\";var i=g.document;var k;var h;var j;c.viewPor"
+"ts={};var e;c.CameraState=sozi.proto.Object.subtype({construct:function(){this.c"
+"x=this.cy=0;this.width=this.height=1;this.angle=0;this.clipped=true;this.transit"
+"ionZoomPercent=0;this.transitionProfile=sozi.animation.profiles.linear;this.tran"
+"sitionPath=null},setCenter:function(l,m){this.cx=l;this.cy=m;return this},setSiz"
+"e:function(m,l){this.width=m;this.height=l;return this},setClipped:function(l){t"
+"his.clipped=l;return this},setAngle:function(l){this.angle=(l+180)%360-180;retur"
+"n this},setRawAngle:function(l){this.angle=l;return this},setTransitionZoomPerce"
+"nt:function(l){this.transitionZoomPercent=l;return this},setTransitionProfile:fu"
+"nction(l){this.transitionProfile=l;return this},setTransitionPath:function(l){th"
+"is.transitionPath=l;return this},setAtElement:function(p){var s,o,t,m;if(p.nodeN"
+"ame===\"rect\"){s=p.x.baseVal.value;o=p.y.baseVal.value;t=p.width.baseVal.value;m="
+"p.height.baseVal.value}else{var q=p.getBBox();s=q.x;o=q.y;t=q.width;m=q.height}v"
+"ar n=i.documentElement.createSVGPoint();n.x=s+t/2;n.y=o+m/2;var r=p.getCTM();n=n"
+".matrixTransform(r);var l=Math.sqrt(r.a*r.a+r.b*r.b);return this.setCenter(n.x,n"
+".y).setSize(t*l,m*l).setAngle(Math.atan2(r.b,r.a)*180/Math.PI)},setAtState:funct"
+"ion(l){return this.setCenter(l.cx,l.cy).setSize(l.width,l.height).setAngle(l.ang"
+"le).setClipped(l.clipped).setTransitionZoomPercent(l.transitionZoomPercent).setT"
+"ransitionProfile(l.transitionProfile).setTransitionPath(l.transitionPath)},inter"
+"polatableAttributes:[\"width\",\"height\",\"angle\"],interpolate:function(n,o,t,v,r){v"
+"ar p=1-t;for(var q=0;q<this.interpolatableAttributes.length;q+=1){var s=this.int"
+"erpolatableAttributes[q];this[s]=o[s]*t+n[s]*p}var l=r?n.transitionPath:o.transi"
+"tionPath;if(v&&l){var x=l.getTotalLength();if(r){var m=l.getPointAtLength(x);var"
+" u=l.getPointAtLength(0);var w=l.getPointAtLength(x*p)}else{var m=l.getPointAtLe"
+"ngth(0);var u=l.getPointAtLength(x);var w=l.getPointAtLength(x*t)}this.cx=w.x+(o"
+".cx-u.x)*t+(n.cx-m.x)*p;this.cy=w.y+(o.cy-u.y)*t+(n.cy-m.y)*p}else{this.cx=o.cx*"
+"t+n.cx*p;this.cy=o.cy*t+n.cy*p}}});c.Camera=c.CameraState.subtype({construct:fun"
+"ction(n,o){c.CameraState.construct.call(this);this.viewPort=n;this.svgClipRect=i"
+".createElementNS(f,\"rect\");var m=i.createElementNS(f,\"clipPath\");m.setAttribute("
+"\"id\",\"sozi-clip-path-\"+n.id+\"-\"+o);m.appendChild(this.svgClipRect);n.svgGroup.ap"
+"pendChild(m);var l=i.createElementNS(f,\"g\");l.setAttribute(\"clip-path\",\"url(#soz"
+"i-clip-path-\"+n.id+\"-\"+o+\")\");n.svgGroup.appendChild(l);if(n.isPrimary){this.svg"
+"Layer=i.createElementNS(f,\"g\");this.svgLayer.appendChild(i.getElementById(o))}el"
+"se{this.svgLayer=i.createElementNS(f,\"use\");this.svgLayer.setAttributeNS(b,\"href"
+"\",\"#\"+o)}l.appendChild(this.svgLayer)},setAtState:function(l){return c.CameraSta"
+"te.setAtState.call(this,l).update()},getScale:function(){return Math.min(this.vi"
+"ewPort.width/this.width,this.viewPort.height/this.height)},rotate:function(l){re"
+"turn this.setAngle(this.angle+l).update()},zoom:function(m,l,n){return this.setS"
+"ize(this.width/m,this.height/m).drag((1-m)*(l-this.viewPort.width/2),(1-m)*(n-th"
+"is.viewPort.height/2))},drag:function(m,l){var q=this.getScale();var o=this.angl"
+"e*Math.PI/180;var n=Math.sin(o);var p=Math.cos(o);return this.setCenter(this.cx-"
+"(m*p-l*n)/q,this.cy-(m*n+l*p)/q).setClipped(false).update()},update:function(){v"
+"ar q=this.getScale();var n=this.width*q;var m=this.height*q;var l=(this.viewPort"
+".width-n)/2;var r=(this.viewPort.height-m)/2;this.svgClipRect.setAttribute(\"x\",t"
+"his.clipped?l:0);this.svgClipRect.setAttribute(\"y\",this.clipped?r:0);this.svgCli"
+"pRect.setAttribute(\"width\",this.clipped?n:this.viewPort.width);this.svgClipRect."
+"setAttribute(\"height\",this.clipped?m:this.viewPort.height);var p=-this.cx+this.w"
+"idth/2+l/q;var o=-this.cy+this.height/2+r/q;this.svgLayer.setAttribute(\"transfor"
+"m\",\"scale(\"+q+\")translate(\"+p+\",\"+o+\")rotate(\"+(-this.angle)+\",\"+this.cx+\",\"+thi"
+"s.cy+\")\");return this}});c.ViewPort=sozi.proto.Object.subtype({construct:functio"
+"n(n,m,l){this.id=n;c.viewPorts[n]=this;this.isPrimary=!!l;if(this.isPrimary){if("
+"e){throw\"Failed to create a primary viewport. A primary viewport already exists."
+"\"}else{e=this}}this.svgGroup=i.createElementNS(f,\"g\");this.svgGroup.setAttribute"
+"(\"class\",\"sozi-viewport\");this.svgGroup.setAttribute(\"id\",\"sozi-viewport-\"+n);i."
+"documentElement.appendChild(this.svgGroup);this.setLocation(0,0).setSize(g.inner"
+"Width,g.innerHeight);this.cameras={};m.forEach(function(o){this.cameras[o]=c.Cam"
+"era.instance(this,o)},this)},setSize:function(m,l){this.width=m;this.height=l;re"
+"turn this},setLocation:function(l,m){this.x=l;this.y=m;return this},contains:fun"
+"ction(l,m){return l>=this.x&&l<this.x+this.width&&m>=this.y&&m<this.y+this.heigh"
+"t},getDocumentState:function(){var m=c.CameraState.instance().setCenter(k.x+k.wi"
+"dth/2,k.y+k.height/2).setSize(k.width,k.height).setClipped(false);var l={};for(v"
+"ar n in this.cameras){l[n]=m}return l},update:function(){this.svgGroup.setAttrib"
+"ute(\"transform\",\"translate(\"+this.x+\",\"+this.y+\")\");for(var l in this.cameras){t"
+"his.cameras[l].update()}return this},showFrame:function(l){for(var m in l.states"
+"){this.cameras[m].setAtState(l.states[m])}return this},drag:function(m,l){for(va"
+"r n in this.cameras){this.cameras[n].drag(m,l)}return this},zoom:function(m,l,o)"
+"{for(var n in this.cameras){this.cameras[n].zoom(m,l,o)}return this},rotate:func"
+"tion(l){for(var m in this.cameras){this.cameras[m].rotate(l)}return this},onWind"
+"owResize:function(m,l){this.setLocation(this.x*m,this.y*l).setSize(this.width*m,"
+"this.height*l).update()}});function d(){var l=i.documentElement;k=l.getBBox();h="
+"g.innerWidth;j=g.innerHeight;l.setAttribute(\"width\",h);l.setAttribute(\"height\",j"
+");sozi.events.fire(\"sozi.display.ready\")}function a(){var l=i.documentElement;l."
+"setAttribute(\"width\",g.innerWidth);l.setAttribute(\"height\",g.innerHeight);for(va"
+"r m in c.viewPorts){c.viewPorts[m].onWindowResize(g.innerWidth/h,g.innerHeight/j"
+")}h=g.innerWidth;j=g.innerHeight}sozi.events.listen(\"sozi.document.ready\",d);g.a"
+"ddEventListener(\"resize\",a,false)});namespace(this,\"sozi.document\",function(c,e)"
+"{var g=e.document;var b=\"http://sozi.baierouge.fr\";var d={title:\"Untitled\",seque"
+"nce:\"0\",hide:\"true\",clip:\"true\",\"show-in-frame-list\":\"true\",\"timeout-enable\":\"fa"
+"lse\",\"timeout-ms\":\"5000\",\"transition-duration-ms\":\"1000\",\"transition-zoom-percen"
+"t\":\"0\",\"transition-profile\":\"linear\",\"transition-path-hide\":\"true\"};var h=[\"g\",\""
+"image\",\"path\",\"rect\",\"circle\",\"ellipse\",\"line\",\"polyline\",\"polygon\",\"text\",\"clip"
+"path\"];c.frames=[];c.idLayerList=[];function j(l,k){return l.getAttributeNS(b,k)"
+"||d[k]}function i(o,p,k){var l=o.states[p]=o.states[p]||sozi.display.CameraState"
+".instance();if(typeof l.transitionZoomPercent===\"undefined\"||k.hasAttributeNS(b,"
+"\"transition-zoom-percent\")){l.setTransitionZoomPercent(parseInt(j(k,\"transition-"
+"zoom-percent\"),10))}if(typeof l.transitionProfile===\"undefined\"||k.hasAttributeN"
+"S(b,\"transition-profile\")){l.setTransitionProfile(sozi.animation.profiles[j(k,\"t"
+"ransition-profile\")])}if(typeof l.transitionPath===\"undefined\"||k.hasAttributeNS"
+"(b,\"transition-path\")){var n=g.getElementById(k.getAttributeNS(b,\"transition-pat"
+"h\"));if(n&&n.nodeName===\"path\"){l.setTransitionPath(n);if(j(k,\"transition-path-h"
+"ide\")===\"true\"){n.style.visibility=\"hidden\"}}}if(k.hasAttributeNS(b,\"refid\")){va"
+"r m=g.getElementById(k.getAttributeNS(b,\"refid\"));if(m){l.setAtElement(m);if(j(k"
+",\"hide\")===\"true\"){m.style.visibility=\"hidden\"}}}if(k.hasAttributeNS(b,\"clip\")){"
+"l.setClipped(j(k,\"clip\")===\"true\")}}function a(){var l=[];var p=g.getElementsByT"
+"agNameNS(b,\"layer\");for(var n=0;n<p.length;n+=1){var s=p[n].getAttributeNS(b,\"gr"
+"oup\");if(s&&l.indexOf(s)===-1){l.push(s)}}var r=g.documentElement;var o=\"http://"
+"www.w3.org/2000/svg\";var q=g.createElementNS(o,\"g\");var k=Array.prototype.slice."
+"call(r.childNodes);k.forEach(function(u,t){if(!u.getAttribute){r.removeChild(u)}"
+"else{if(l.indexOf(u.getAttribute(\"id\"))!==-1){if(q.firstChild){q.setAttribute(\"i"
+"d\",\"sozi-wrapper-\"+t);c.idLayerList.push(\"sozi-wrapper-\"+t);r.insertBefore(q,u);"
+"q=g.createElementNS(o,\"g\")}c.idLayerList.push(u.getAttribute(\"id\"))}else{if(h.in"
+"dexOf(u.localName.toLowerCase())!==-1){r.removeChild(u);q.appendChild(u)}}}});if"
+"(q.firstChild){q.setAttribute(\"id\",\"sozi-wrapper-\"+k.length);c.idLayerList.push("
+"\"sozi-wrapper-\"+k.length);r.appendChild(q)}var m=Array.prototype.slice.call(g.ge"
+"tElementsByTagNameNS(b,\"frame\"));m.sort(function(u,t){var w=parseInt(j(u,\"sequen"
+"ce\"),10);var v=parseInt(j(t,\"sequence\"),10);return w-v});m.forEach(function(v,u)"
+"{var x={id:v.getAttribute(\"id\"),title:j(v,\"title\"),showInFrameList:j(v,\"show-in-"
+"frame-list\")===\"true\",sequence:parseInt(j(v,\"sequence\"),10),timeoutEnable:j(v,\"t"
+"imeout-enable\")===\"true\",timeoutMs:parseInt(j(v,\"timeout-ms\"),10),transitionDura"
+"tionMs:parseInt(j(v,\"transition-duration-ms\"),10),states:{}};c.idLayerList.forEa"
+"ch(function(A){if(u===0||A.search(\"sozi-wrapper-[0-9]+\")!==-1){i(x,A,v)}else{var"
+" z=x.states[A]=sozi.display.CameraState.instance();var y=c.frames[c.frames.lengt"
+"h-1].states[A];z.setAtState(y)}});var t=Array.prototype.slice.call(v.getElements"
+"ByTagNameNS(b,\"layer\"));t.forEach(function(y){var z=y.getAttributeNS(b,\"group\");"
+"if(z&&c.idLayerList.indexOf(z)!==-1){i(x,z,y)}});for(var w in x.states){if(x.sta"
+"tes.hasOwnProperty(w)){c.frames.push(x);break}}})}c.getFrameIndexForId=function("
+"l){for(var k=0;k<c.frames.length;k+=1){if(c.frames[k].id===l){return k}}return -"
+"1};function f(){g.documentElement.removeAttribute(\"viewBox\");a();sozi.events.fir"
+"e(\"sozi.document.ready\")}e.addEventListener(\"load\",f,false)});namespace(this,\"so"
+"zi.framelist\",function(u,k){var o=k.document;var c=5;var i;var p;var j=0;var h;v"
+"ar s;var b;var v;var w;var t;var e=300;var f=\"decelerate\";var a=\"http://www.w3.o"
+"rg/2000/svg\";function n(z){var x=z.relatedTarget,y=o.documentElement;while(x&&x!"
+"==i&&x!==y){x=x.parentNode}if(x!==i){u.hide();sozi.player.restart();z.stopPropag"
+"ation()}}function r(y){var x=p.getCTM().f;if(x<=-k.innerHeight/2){x+=k.innerHeig"
+"ht/2}else{if(x<0){x=0}}p.setAttribute(\"transform\",\"translate(0,\"+x+\")\");y.stopPr"
+"opagation()}function d(y){var x=p.getCTM().f;if(x+j>=k.innerHeight*3/2){x-=k.inn"
+"erHeight/2}else{if(x+j>k.innerHeight+2*c){x=k.innerHeight-j-4*c}}p.setAttribute("
+"\"transform\",\"translate(0,\"+x+\")\");y.stopPropagation()}function g(x){return funct"
+"ion(y){sozi.player.previewFrame(x);y.stopPropagation()}}function l(x){x.stopProp"
+"agation()}function q(){i=o.createElementNS(a,\"g\");i.setAttribute(\"id\",\"sozi-toc\""
+");o.documentElement.appendChild(i);p=o.createElementNS(a,\"g\");i.appendChild(p);v"
+"ar y=o.createElementNS(a,\"rect\");y.setAttribute(\"id\",\"sozi-toc-background\");y.se"
+"tAttribute(\"x\",c);y.setAttribute(\"y\",c);y.setAttribute(\"rx\",c);y.setAttribute(\"r"
+"y\",c);y.addEventListener(\"click\",l,false);y.addEventListener(\"mousedown\",l,false"
+");y.addEventListener(\"mouseout\",n,false);p.appendChild(y);var A=0;sozi.document."
+"frames.forEach(function(D,E){if(D.showInFrameList){var C=o.createElementNS(a,\"te"
+"xt\");C.appendChild(o.createTextNode(D.title));C.setAttribute(\"id\",\"sozi-toc-\"+D."
+"id);p.appendChild(C);if(E===sozi.player.currentFrameIndex){C.setAttribute(\"class"
+"\",\"sozi-toc-current\")}var B=C.getBBox().width;j+=C.getBBox().height;if(B>A){A=B}"
+"C.setAttribute(\"x\",2*c);C.setAttribute(\"y\",j+c);C.addEventListener(\"click\",g(E),"
+"false);C.addEventListener(\"mousedown\",l,false)}});var x=o.createElementNS(a,\"pat"
+"h\");x.setAttribute(\"class\",\"sozi-toc-arrow\");x.setAttribute(\"d\",\"M\"+(A+3*c)+\",\"+"
+"(5*c)+\" l\"+(4*c)+\",0 l-\"+(2*c)+\",-\"+(3*c)+\" z\");x.addEventListener(\"click\",r,fal"
+"se);x.addEventListener(\"mousedown\",l,false);i.appendChild(x);var z=o.createEleme"
+"ntNS(a,\"path\");z.setAttribute(\"class\",\"sozi-toc-arrow\");z.setAttribute(\"d\",\"M\"+("
+"A+3*c)+\",\"+(7*c)+\" l\"+(4*c)+\",0 l-\"+(2*c)+\",\"+(3*c)+\" z\");z.addEventListener(\"cl"
+"ick\",d,false);z.addEventListener(\"mousedown\",l,false);i.appendChild(z);y.setAttr"
+"ibute(\"width\",A+7*c);y.setAttribute(\"height\",j+2*c);h=-A-9*c;s=0;w=v=h;i.setAttr"
+"ibute(\"transform\",\"translate(\"+h+\",0)\");t=sozi.animation.Animator.instance().aug"
+"ment({onStep:function(B){var D=sozi.animation.profiles[f](B),C=1-D;w=v*D+b*C;i.s"
+"etAttribute(\"transform\",\"translate(\"+w+\",0)\")}})}function m(x){var y=Array.proto"
+"type.slice.call(o.getElementsByClassName(\"sozi-toc-current\"));y.forEach(function"
+"(A){A.removeAttribute(\"class\")});var z=sozi.document.frames[x];if(z.showInFrameL"
+"ist){o.getElementById(\"sozi-toc-\"+z.id).setAttribute(\"class\",\"sozi-toc-current\")"
+"}}u.show=function(){o.documentElement.appendChild(i);b=w;v=s;t.start(e)};u.hide="
+"function(){b=w;v=h;t.start(e)};u.isVisible=function(){return v===s};sozi.events."
+"listen(\"sozi.player.ready\",q);sozi.events.listen(\"sozi.player.cleanup\",u.hide);s"
+"ozi.events.listen(\"sozi.player.framechange\",m)});namespace(this,\"sozi.framenumbe"
+"r\",function(a,d){var g=d.document;var e;var k,i;var f;var b=\"http://www.w3.org/2"
+"000/svg\";function h(){var m=k.getBBox(),n=Math.max(m.width,m.height)*0.75,l=n*1."
+"25;f.setAttribute(\"r\",n);e.setAttribute(\"transform\",\"translate(\"+l+\",\"+l+\")\")}fu"
+"nction c(){e=g.createElementNS(b,\"g\");k=g.createElementNS(b,\"text\");f=g.createEl"
+"ementNS(b,\"circle\");e.setAttribute(\"id\",\"sozi-framenumber\");f.setAttribute(\"cx\","
+"0);f.setAttribute(\"cy\",0);e.appendChild(f);i=g.createTextNode(sozi.player.curren"
+"tFrameIndex+1);k.setAttribute(\"text-anchor\",\"middle\");k.setAttribute(\"dominant-b"
+"aseline\",\"central\");k.setAttribute(\"x\",0);k.setAttribute(\"y\",0);k.appendChild(i)"
+";e.appendChild(k);g.documentElement.appendChild(e);h()}function j(l){i.nodeValue"
+"=l+1}sozi.events.listen(\"sozi.player.ready\",c);sozi.events.listen(\"sozi.player.f"
+"ramechange\",j)});namespace(this,\"sozi.links\",function(c,e){var b=\"http://www.w3."
+"org/2000/svg\";var a=\"http://www.w3.org/1999/xlink\";function f(g){return function"
+"(h){sozi.player.moveToFrame(g);h.preventDefault();h.stopPropagation()}}function "
+"d(){var h=e.document.getElementsByTagNameNS(b,\"a\");for(var j=0;j<h.length;j+=1){"
+"var g=h[j].getAttributeNS(a,\"href\");if(g&&g[0]===\"#\"){h[j].addEventListener(\"cli"
+"ck\",f(sozi.location.getFrameIndexForHash(g)),false)}}}sozi.events.listen(\"sozi.d"
+"ocument.ready\",d)});namespace(this,\"sozi.location\",function(a,d){var b=false;a.g"
+"etFrameIndex=function(){return a.getFrameIndexForHash(d.location.hash)};a.getFra"
+"meIndexForHash=function(g){var h=g?g.slice(1):\"1\";var f;if(/^[0-9]+$/.test(h)){f"
+"=parseInt(h,10)-1}else{f=sozi.document.getFrameIndexForId(h)}if(f<0){return 0}el"
+"se{if(f>=sozi.document.frames.length){return sozi.document.frames.length-1}else{"
+"return f}}};function e(){var f=a.getFrameIndex();if(!b){sozi.player.moveToFrame("
+"f)}b=false}function c(f){b=true;d.location.hash=\"#\"+sozi.document.frames[f].id}d"
+".addEventListener(\"hashchange\",e,false);sozi.events.listen(\"sozi.player.framecha"
+"nge\",c)});namespace(this,\"sozi.player\",function(d,g){var l;var c;var i;var e=500"
+";var n=-10;var j=\"linear\";var f=0;d.currentFrameIndex=0;var k=false;var m=false;"
+"function h(){if(sozi.document.frames[d.currentFrameIndex].timeoutEnable){m=true;"
+"var o=(d.currentFrameIndex+1)%sozi.document.frames.length;i=g.setTimeout(functio"
+"n(){d.moveToFrame(o)},sozi.document.frames[d.currentFrameIndex].timeoutMs)}}d.st"
+"artFromIndex=function(o){k=true;m=false;f=o;d.currentFrameIndex=o;l.showFrame(so"
+"zi.document.frames[o]);h()};d.restart=function(){d.startFromIndex(d.currentFrame"
+"Index)};d.stop=function(){c.stop();if(m){g.clearTimeout(i);m=false}k=false;f=d.c"
+"urrentFrameIndex};function b(o,y,w){var z={ss:((o<0)?Math.max(y,w):Math.min(y,w)"
+")*(100-o)/100,ts:0.5,k:0};if(o!==0){var s=y-w;var r=y-z.ss;var q=w-z.ss;if(s!==0"
+"){var p=Math.sqrt(r*q);var x=(r-p)/s;var t=(r+p)/s;z.ts=(x>0&&x<=1)?x:t}z.k=r/z."
+"ts/z.ts}return z}d.jumpToFrame=function(o){d.stop();sozi.events.fire(\"sozi.playe"
+"r.cleanup\");f=o;d.currentFrameIndex=o;l.showFrame(sozi.document.frames[o]);sozi."
+"events.fire(\"sozi.player.framechange\",o)};d.getAnimationData=function(o,q,s,p,v,"
+"t){var r={};for(var w in o){r[w]={initialState:sozi.display.CameraState.instance"
+"(),finalState:sozi.display.CameraState.instance(),useTransitionPath:v,reverseTra"
+"nsitionPath:t};r[w].profile=p||q[w].transitionProfile;r[w].initialState.setAtSta"
+"te(o[w]);if(q.hasOwnProperty(w)){r[w].finalState.setAtState(q[w])}else{r[w].fina"
+"lState.setAtState(o[w])}if(r[w].finalState.angle-r[w].initialState.angle>180){r["
+"w].finalState.setRawAngle(r[w].finalState.angle-360)}else{if(r[w].finalState.ang"
+"le-r[w].initialState.angle<-180){r[w].initialState.setRawAngle(r[w].initialState"
+".angle-360)}}var u=s||q[w].transitionZoomPercent;if(u&&q.hasOwnProperty(w)){r[w]"
+".zoomWidth=b(u,o[w].width,q[w].width);r[w].zoomHeight=b(u,o[w].height,q[w].heigh"
+"t)}}return r};d.previewFrame=function(o){d.currentFrameIndex=o;c.start(e,d.getAn"
+"imationData(l.cameras,sozi.document.frames[o].states,n,sozi.animation.profiles[j"
+"]),false,false);sozi.events.fire(\"sozi.player.framechange\",o)};d.moveToFrame=fun"
+"ction(r){if(m){g.clearTimeout(i);m=false}var q,t,s,p,o;if(r===(d.currentFrameInd"
+"ex-1)%sozi.document.frames.length){q=sozi.document.frames[d.currentFrameIndex].t"
+"ransitionDurationMs;t=undefined;s=undefined;p=true;o=true}else{if(r===(d.current"
+"FrameIndex+1)%sozi.document.frames.length){q=sozi.document.frames[r].transitionD"
+"urationMs;t=undefined;s=undefined;p=true;o=false}else{q=e;t=n;s=sozi.animation.p"
+"rofiles[j];p=false;o=false}}sozi.events.fire(\"sozi.player.cleanup\");k=true;d.cur"
+"rentFrameIndex=r;c.start(q,d.getAnimationData(l.cameras,sozi.document.frames[r]."
+"states,t,s,p,o));sozi.events.fire(\"sozi.player.framechange\",r)};d.jumpToFirst=fu"
+"nction(){d.jumpToFrame(0)};d.moveToFirst=function(){d.moveToFrame(0)};d.jumpToPr"
+"evious=function(){var o=d.currentFrameIndex;if(!c.started||f<=d.currentFrameInde"
+"x){o-=1}if(o>=0){d.jumpToFrame(o)}};d.moveToPrevious=function(){for(var o=d.curr"
+"entFrameIndex-1;o>=0;o-=1){var p=sozi.document.frames[o];if(!p.timeoutEnable||p."
+"timeoutMs!==0){d.moveToFrame(o);break}}};d.jumpToNext=function(){var o=d.current"
+"FrameIndex;if(!c.started||f>=d.currentFrameIndex){o+=1}if(o<sozi.document.frames"
+".length){d.jumpToFrame(o)}};d.moveToNext=function(){if(d.currentFrameIndex<sozi."
+"document.frames.length-1||sozi.document.frames[d.currentFrameIndex].timeoutEnabl"
+"e){d.moveToFrame((d.currentFrameIndex+1)%sozi.document.frames.length)}};d.jumpTo"
+"Last=function(){d.jumpToFrame(sozi.document.frames.length-1)};d.moveToLast=funct"
+"ion(){d.moveToFrame(sozi.document.frames.length-1)};d.moveToCurrent=function(){d"
+".moveToFrame(d.currentFrameIndex)};d.showAll=function(){d.stop();sozi.events.fir"
+"e(\"sozi.player.cleanup\");c.start(e,d.getAnimationData(l.cameras,l.getDocumentSta"
+"te(),n,sozi.animation.profiles[j],false,false))};function a(){l=sozi.display.Vie"
+"wPort.instance(\"player\",sozi.document.idLayerList,true);d.startFromIndex(sozi.lo"
+"cation.getFrameIndex());g.setTimeout(l.bind(l.update),1);sozi.events.fire(\"sozi."
+"player.ready\")}d.onAnimationStep=function(o,q){for(var s in q){var p=l.cameras[s"
+"];p.interpolate(q[s].initialState,q[s].finalState,q[s].profile(o),q[s].useTransi"
+"tionPath,q[s].reverseTransitionPath);var r;if(q[s].zoomWidth&&q[s].zoomWidth.k!="
+"=0){r=o-q[s].zoomWidth.ts;p.width=q[s].zoomWidth.k*r*r+q[s].zoomWidth.ss}if(q[s]"
+".zoomHeight&&q[s].zoomHeight.k!==0){r=o-q[s].zoomHeight.ts;p.height=q[s].zoomHei"
+"ght.k*r*r+q[s].zoomHeight.ss}p.setClipped(q[s].finalState.clipped)}l.update()};c"
+"=sozi.animation.Animator.instance().augment({onStep:function(o){d.onAnimationSte"
+"p(o,this.data)},onDone:function(){for(var o in this.data){l.cameras[o].setAtStat"
+"e(this.data[o].finalState)}l.update();f=d.currentFrameIndex;if(k){h()}}});sozi.e"
+"vents.listen(\"sozi.display.ready\",a)});";
+
+static const char sozi_extras_media_min_js[] =
+"this.addEventListener(\"load\",function(){var h=\"http://www.w3.org/2000/svg\",l=\"ht"
+"tp://sozi.baierouge.fr\",s=\"http://www.w3.org/1999/xhtml\",m=this,o=m.document,q=["
+"],r,e,d,c,p,a,g,f,b;function n(i){i.stopPropagation()}function t(i,j,k){sozi.eve"
+"nts.listen(\"sozi.player.framechange\",function(u){var v=sozi.document.frames[u].i"
+"d;if(v===j){i.play()}else{if(v===k){i.pause()}}})}q.push(o.getElementsByTagNameN"
+"S(l,\"video\"));q.push(o.getElementsByTagNameNS(l,\"audio\"));r=[];for(c=0;c<q.lengt"
+"h;c+=1){for(e=0;e<q[c].length;e+=1){p=q[c][e].parentNode;b=o.createElementNS(s,\""
+"source\");b.setAttribute(\"type\",q[c][e].getAttributeNS(l,\"type\"));b.setAttribute("
+"\"src\",q[c][e].getAttributeNS(l,\"src\"));for(d=0;d<r.length;d+=1){if(r[d].rect===p"
+"){break}}if(d===r.length){p.setAttribute(\"visibility\",\"hidden\");f=o.createElemen"
+"tNS(s,q[c][e].localName);f.setAttribute(\"controls\",\"controls\");if(q[c][e].localN"
+"ame===\"video\"){f.setAttribute(\"width\",p.getAttribute(\"width\"));f.setAttribute(\"h"
+"eight\",p.getAttribute(\"height\"))}f.addEventListener(\"click\",n,false);f.addEventL"
+"istener(\"contextmenu\",n,false);g=o.createElementNS(s,\"html\");g.appendChild(f);a="
+"o.createElementNS(h,\"foreignObject\");a.setAttribute(\"x\",p.getAttribute(\"x\"));a.s"
+"etAttribute(\"y\",p.getAttribute(\"y\"));a.setAttribute(\"width\",p.getAttribute(\"widt"
+"h\"));a.setAttribute(\"height\",p.getAttribute(\"height\"));a.appendChild(g);p.parent"
+"Node.insertBefore(a,p.nextSibling);if(q[c][e].hasAttributeNS(l,\"start-frame\")){t"
+"(f,q[c][e].getAttributeNS(l,\"start-frame\"),q[c][e].getAttributeNS(l,\"stop-frame\""
+"))}r.push({rect:q[c][e].parentNode,htmlMedia:f})}r[d].htmlMedia.appendChild(b)}}"
+"},false);";
+
+static const char sozi_min_css[] =
+"#sozi-toc text{fill:#eff;font-family:Verdana,sans-serif;font-size:12pt}#sozi-toc"
+" text:hover{fill:#0cf;cursor:pointer}#sozi-toc text.sozi-toc-current{fill:#fa4}#"
+"sozi-toc-background{stroke:#222;stroke-opacity:.1;stroke-width:10;fill:#222;fill"
+"-opacity:.9}.sozi-toc-arrow{fill:#eff;fill-opacity:.75;stroke:none}.sozi-toc-arr"
+"ow:hover{fill:#0cf}#sozi-framenumber circle{stroke:#222;stroke-opacity:.1;stroke"
+"-width:4;fill:#222;fill-opacity:.9}#sozi-framenumber text{fill:#eff;font-family:"
+"Verdana,sans-serif;font-size:12pt}";
+
+static const char sozi_version[] =
+"14.09-13143300";
+
+#endif /* SOZI_PLAYER_H */
diff --git a/objects/Sozi/sozi.c b/objects/Sozi/sozi.c
new file mode 100644
index 0000000..5ec4dce
--- /dev/null
+++ b/objects/Sozi/sozi.c
@@ -0,0 +1,47 @@
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1998 Alexander Larsson
+ *
+ * Sozi objects support
+ * Copyright (C) 2014 Paul Chavent
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "object.h"
+
+#include "intl.h"
+#include "plug-ins.h"
+
+extern DiaObjectType sozi_frame_type;
+extern DiaObjectType sozi_media_type;
+
+DIA_PLUGIN_CHECK_INIT
+
+PluginInitResult
+dia_plugin_init(PluginInfo *info)
+{
+ if (!dia_plugin_info_init(info, "Sozi",_("Sozi presentation objects"),
+ NULL, NULL))
+ return DIA_PLUGIN_INIT_ERROR;
+
+ object_register_type(&sozi_frame_type);
+ object_register_type(&sozi_media_type);
+
+ return DIA_PLUGIN_INIT_OK;
+}
diff --git a/objects/makefile.msc b/objects/makefile.msc
index 0ac96bf..286d846 100644
--- a/objects/makefile.msc
+++ b/objects/makefile.msc
@@ -2,7 +2,7 @@
PLUGINS = aadl chronogram custom er flowchart fs grafcet \
Istar Jackson Kaos misc network sadt standard uml \
- Database custom_lines
+ Database Sozi custom_lines
#outdated: labels
@@ -115,6 +115,16 @@ OBJECTS = \
PKG_LINK = $(PKG_LINK)
!ENDIF
+!IFDEF OBJ_Sozi
+OBJECTS = \
+ sozi.obj \
+ sozi-frame.obj \
+ sozi-media.obj \
+ sozi-object.obj
+PKG_LINK = $(PKG_LINK) $(LIBXML2_LIBS) \
+ $(GTK2_LIBS)
+!ENDIF
+
!IFDEF OBJ_eml
OBJECTS = \
dbox.obj \
diff --git a/samples/Sozi/sozi-clip-test.dia b/samples/Sozi/sozi-clip-test.dia
new file mode 100644
index 0000000..40980e9
--- /dev/null
+++ b/samples/Sozi/sozi-clip-test.dia
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+ <dia:diagramdata>
+ <dia:attribute name="background">
+ <dia:color val="#ffffffff"/>
+ </dia:attribute>
+ <dia:attribute name="pagebreak">
+ <dia:color val="#000099ff"/>
+ </dia:attribute>
+ <dia:attribute name="paper">
+ <dia:composite type="paper">
+ <dia:attribute name="name">
+ <dia:string>#Letter#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="tmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="bmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="lmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="rmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="is_portrait">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="scaling">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="fitto">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="grid">
+ <dia:composite type="grid">
+ <dia:attribute name="dynamic">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="width_x">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="width_y">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_x">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_y">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:composite type="color"/>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#d8e5e5ff"/>
+ </dia:attribute>
+ <dia:attribute name="guides">
+ <dia:composite type="guides">
+ <dia:attribute name="hguides"/>
+ <dia:attribute name="vguides"/>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="display">
+ <dia:composite type="display">
+ <dia:attribute name="antialiased">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="snap-to-grid">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="snap-to-object">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="show-grid">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="show-connection-points">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:diagramdata>
+ <dia:layer name="Background" visible="true" connectable="true" active="true">
+ <dia:object type="Standard - Polygon" version="0" id="O0">
+ <dia:attribute name="obj_pos">
+ <dia:point val="7.71064,7.04681"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="7.38042,5.00225;12.7387,9.09137"/>
+ </dia:attribute>
+ <dia:attribute name="poly_points">
+ <dia:point val="7.71064,7.04681"/>
+ <dia:point val="9.27661,6.8017"/>
+ <dia:point val="8.4936,5.82128"/>
+ <dia:point val="9.7464,6.43404"/>
+ <dia:point val="10.0596,5.20851"/>
+ <dia:point val="10.3727,6.43404"/>
+ <dia:point val="11.6255,5.82128"/>
+ <dia:point val="10.8425,6.8017"/>
+ <dia:point val="12.4085,7.04681"/>
+ <dia:point val="10.8425,7.29191"/>
+ <dia:point val="11.6255,8.27234"/>
+ <dia:point val="10.3727,7.65957"/>
+ <dia:point val="10.0596,8.88511"/>
+ <dia:point val="9.7464,7.65957"/>
+ <dia:point val="8.4936,8.27234"/>
+ <dia:point val="9.27661,7.29191"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.10212765957446809"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Polygon" version="0" id="O1">
+ <dia:attribute name="obj_pos">
+ <dia:point val="3.6766,7.84683"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="3.62554,6.43405;5.77021,8.57872"/>
+ </dia:attribute>
+ <dia:attribute name="poly_points">
+ <dia:point val="3.6766,7.84683"/>
+ <dia:point val="3.6766,7.16594"/>
+ <dia:point val="4.35745,7.16594"/>
+ <dia:point val="4.35745,6.48511"/>
+ <dia:point val="5.0383,6.48511"/>
+ <dia:point val="5.0383,7.16594"/>
+ <dia:point val="5.71915,7.16594"/>
+ <dia:point val="5.71915,7.84683"/>
+ <dia:point val="5.0383,7.84683"/>
+ <dia:point val="5.0383,8.52766"/>
+ <dia:point val="4.35745,8.52766"/>
+ <dia:point val="4.35745,7.84683"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.10212765957446809"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Polygon" version="0" id="O2">
+ <dia:attribute name="obj_pos">
+ <dia:point val="8.98723,2.75745"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="8.91502,1.66395;11.102,3.85094"/>
+ </dia:attribute>
+ <dia:attribute name="poly_points">
+ <dia:point val="8.98723,2.75745"/>
+ <dia:point val="9.27901,2.46565"/>
+ <dia:point val="9.27901,2.02796"/>
+ <dia:point val="9.71673,2.02796"/>
+ <dia:point val="10.0085,1.73617"/>
+ <dia:point val="10.3003,2.02796"/>
+ <dia:point val="10.738,2.02796"/>
+ <dia:point val="10.738,2.46565"/>
+ <dia:point val="11.0298,2.75745"/>
+ <dia:point val="10.738,3.04924"/>
+ <dia:point val="10.738,3.48693"/>
+ <dia:point val="10.3003,3.48693"/>
+ <dia:point val="10.0085,3.77872"/>
+ <dia:point val="9.71673,3.48693"/>
+ <dia:point val="9.27901,3.48693"/>
+ <dia:point val="9.27901,3.04924"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.10212765957446809"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Sozi - Frame" version="0" id="O3">
+ <dia:attribute name="obj_pos">
+ <dia:point val="12.25,6.325"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="4.69,2.74;19.81,9.91"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="x">
+ <dia:real val="12.250000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="y">
+ <dia:real val="6.3250000000000002"/>
+ </dia:attribute>
+ <dia:attribute name="width">
+ <dia:real val="15.100000000000001"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="7.1500000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="angle">
+ <dia:int val="0"/>
+ </dia:attribute>
+ <dia:attribute name="aspect">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="scale_from_center">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="legend_disp">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="legend">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##1 : frame#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="4.7,3.345"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="frame_sequence">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="frame_title">
+ <dia:string>#frame#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="frame_hide">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="frame_clip">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_enable">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_ms">
+ <dia:int val="5000"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_profile">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_duration_ms">
+ <dia:int val="1000"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O4">
+ <dia:attribute name="obj_pos">
+ <dia:point val="14,5.05"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="14,4.455;19.085,7.6"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#the outside
+part of those
+shape shouldn't
+be visible#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="14,5.05"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Arc" version="0" id="O5">
+ <dia:attribute name="obj_pos">
+ <dia:point val="15.9,7.95"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="5.74433,7.52288;15.926,9.70077"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="15.9,7.95"/>
+ <dia:point val="5.7703,7.54885"/>
+ </dia:attribute>
+ <dia:attribute name="curve_distance">
+ <dia:real val="-1.9218580617030492"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.05000000074505806"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="1" to="O1" connection="24"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Arc" version="0" id="O6">
+ <dia:attribute name="obj_pos">
+ <dia:point val="16.15,4.3"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="10.8516,2.67997;16.1803,4.33034"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="16.15,4.3"/>
+ <dia:point val="10.8819,2.97681"/>
+ </dia:attribute>
+ <dia:attribute name="curve_distance">
+ <dia:real val="0.35109460505000434"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.05000000074505806"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="1" to="O2" connection="32"/>
+ </dia:connections>
+ </dia:object>
+ </dia:layer>
+</dia:diagram>
diff --git a/samples/Sozi/sozi-tutorial-complete-layers.dia b/samples/Sozi/sozi-tutorial-complete-layers.dia
new file mode 100644
index 0000000..b51d494
--- /dev/null
+++ b/samples/Sozi/sozi-tutorial-complete-layers.dia
@@ -0,0 +1,695 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+ <dia:diagramdata>
+ <dia:attribute name="background">
+ <dia:color val="#ffffffff"/>
+ </dia:attribute>
+ <dia:attribute name="pagebreak">
+ <dia:color val="#000099ff"/>
+ </dia:attribute>
+ <dia:attribute name="paper">
+ <dia:composite type="paper">
+ <dia:attribute name="name">
+ <dia:string>#Letter#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="tmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="bmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="lmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="rmargin">
+ <dia:real val="2.5399999618530273"/>
+ </dia:attribute>
+ <dia:attribute name="is_portrait">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="scaling">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="fitto">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="grid">
+ <dia:composite type="grid">
+ <dia:attribute name="dynamic">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="width_x">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="width_y">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_x">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_y">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:composite type="color"/>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#d8e5e5ff"/>
+ </dia:attribute>
+ <dia:attribute name="guides">
+ <dia:composite type="guides">
+ <dia:attribute name="hguides"/>
+ <dia:attribute name="vguides"/>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="display">
+ <dia:composite type="display">
+ <dia:attribute name="antialiased">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="snap-to-grid">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="snap-to-object">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="show-grid">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="show-connection-points">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:diagramdata>
+ <dia:layer name="Background" visible="true" connectable="true">
+ <dia:object type="Standard - Beziergon" version="0" id="O0">
+ <dia:attribute name="obj_pos">
+ <dia:point val="2.0094,9.33686"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="1.03497,8.41749;11.9087,17.8212"/>
+ </dia:attribute>
+ <dia:attribute name="bez_points">
+ <dia:point val="2.0094,9.33686"/>
+ <dia:point val="3.67597,7.51163"/>
+ <dia:point val="11.6386,8.57107"/>
+ <dia:point val="11.8997,11.0594"/>
+ <dia:point val="12.1609,13.5477"/>
+ <dia:point val="6.30133,19.7177"/>
+ <dia:point val="3.50928,17.2484"/>
+ <dia:point val="0.797517,14.85"/>
+ <dia:point val="0.342829,11.162"/>
+ </dia:attribute>
+ <dia:attribute name="corner_types">
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:attribute name="line_color">
+ <dia:color val="#ff6600ff"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.0010011641443538998"/>
+ </dia:attribute>
+ <dia:attribute name="inner_color">
+ <dia:color val="#ff6600ff"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Beziergon" version="0" id="O1">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4.22411,0.76579"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="1.73616,0.762159;7.91506,6.2939"/>
+ </dia:attribute>
+ <dia:attribute name="bez_points">
+ <dia:point val="4.22411,0.76579"/>
+ <dia:point val="5.64927,0.642147"/>
+ <dia:point val="8.62423,4.2153"/>
+ <dia:point val="7.75982,5.37715"/>
+ <dia:point val="6.89532,6.5391"/>
+ <dia:point val="1.98121,6.86869"/>
+ <dia:point val="1.76066,4.72249"/>
+ <dia:point val="1.54643,2.63807"/>
+ <dia:point val="2.79883,0.889534"/>
+ </dia:attribute>
+ <dia:attribute name="corner_types">
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:attribute name="line_color">
+ <dia:color val="#ddafe9ff"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.0010011641443538998"/>
+ </dia:attribute>
+ <dia:attribute name="inner_color">
+ <dia:color val="#ddafe9ff"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Beziergon" version="0" id="O2">
+ <dia:attribute name="obj_pos">
+ <dia:point val="9.34967,23.3697"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="9.23625,12.3391;22.535,27.62"/>
+ </dia:attribute>
+ <dia:attribute name="bez_points">
+ <dia:point val="9.34967,23.3697"/>
+ <dia:point val="8.27833,20.0668"/>
+ <dia:point val="15.1025,11.079"/>
+ <dia:point val="18.3225,12.4883"/>
+ <dia:point val="21.5424,13.8977"/>
+ <dia:point val="25.0074,25.3385"/>
+ <dia:point val="20.0527,27.0328"/>
+ <dia:point val="15.2404,28.6786"/>
+ <dia:point val="10.421,26.6724"/>
+ </dia:attribute>
+ <dia:attribute name="corner_types">
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:attribute name="line_color">
+ <dia:color val="#ffcc00ff"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.0010011641443538998"/>
+ </dia:attribute>
+ <dia:attribute name="inner_color">
+ <dia:color val="#ffcc00ff"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Beziergon" version="0" id="O3">
+ <dia:attribute name="obj_pos">
+ <dia:point val="35.8762,20.9047"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="23.4,5.16355;41.4764,20.9881"/>
+ </dia:attribute>
+ <dia:attribute name="bez_points">
+ <dia:point val="35.8762,20.9047"/>
+ <dia:point val="31.88,21.9304"/>
+ <dia:point val="21.7272,13.1713"/>
+ <dia:point val="23.6373,9.45712"/>
+ <dia:point val="25.5474,5.743"/>
+ <dia:point val="39.372,2.48231"/>
+ <dia:point val="41.0141,8.48358"/>
+ <dia:point val="42.6089,14.3126"/>
+ <dia:point val="39.8726,19.8791"/>
+ </dia:attribute>
+ <dia:attribute name="corner_types">
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:attribute name="line_color">
+ <dia:color val="#00ccffff"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.0010011641443538998"/>
+ </dia:attribute>
+ <dia:attribute name="inner_color">
+ <dia:color val="#00ccffff"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O4">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4.6,3.7"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="3.70125,2.05625;5.49875,5.34375"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#1#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="3.5321847480686248"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="4.6,4.67875"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O5">
+ <dia:attribute name="obj_pos">
+ <dia:point val="5.9,12.95"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="5.00125,11.3063;6.79875,14.5938"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#2#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="3.5321847480686248"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="5.9,13.9288"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O6">
+ <dia:attribute name="obj_pos">
+ <dia:point val="16.45,21.3625"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="15.5512,19.7188;17.3487,23.0063"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#3#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="3.5321847480686248"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="16.45,22.3412"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O7">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33.25,12.2"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="32.3513,10.5563;34.1487,13.8438"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#4#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="3.5321847480686248"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="33.25,13.1788"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ </dia:layer>
+ <dia:layer name="Sozi" visible="true" connectable="true" active="true">
+ <dia:object type="Sozi - Frame" version="0" id="O8">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4.83689,3.9539"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="0.49,-0.144176;12.7938,8.05198"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="x">
+ <dia:real val="4.8368887106105847"/>
+ </dia:attribute>
+ <dia:attribute name="y">
+ <dia:real val="3.953901623377714"/>
+ </dia:attribute>
+ <dia:attribute name="width">
+ <dia:real val="6.0885762356124022"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="6.953687819240038"/>
+ </dia:attribute>
+ <dia:attribute name="angle">
+ <dia:int val="111"/>
+ </dia:attribute>
+ <dia:attribute name="aspect">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="scale_from_center">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="legend_disp">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="legend">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##1 : purple#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="9.17378,2.9528"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="frame_sequence">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="frame_title">
+ <dia:string>#purple#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="frame_hide">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_clip">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_enable">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_ms">
+ <dia:int val="5000"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_profile">
+ <dia:enum val="9"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_duration_ms">
+ <dia:int val="1000"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Sozi - Frame" version="0" id="O9">
+ <dia:attribute name="obj_pos">
+ <dia:point val="6.45837,12.6431"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="-0.99556,5.57629;13.9123,19.71"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="x">
+ <dia:real val="6.4583688375909283"/>
+ </dia:attribute>
+ <dia:attribute name="y">
+ <dia:real val="12.643144578810967"/>
+ </dia:attribute>
+ <dia:attribute name="width">
+ <dia:real val="10.328227726194189"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="11.789506279330688"/>
+ </dia:attribute>
+ <dia:attribute name="angle">
+ <dia:int val="67"/>
+ </dia:attribute>
+ <dia:attribute name="aspect">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="scale_from_center">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="legend_disp">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="legend">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##2 : orange#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="9.86674,6.18129"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="frame_sequence">
+ <dia:int val="2"/>
+ </dia:attribute>
+ <dia:attribute name="frame_title">
+ <dia:string>#orange#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="frame_hide">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_clip">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_enable">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_ms">
+ <dia:int val="5000"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_profile">
+ <dia:enum val="8"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_duration_ms">
+ <dia:int val="4000"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Sozi - Frame" version="0" id="O10">
+ <dia:attribute name="obj_pos">
+ <dia:point val="16.2253,19.9172"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="8.06947,11.0118;24.3811,28.8225"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="x">
+ <dia:real val="16.225268207101003"/>
+ </dia:attribute>
+ <dia:attribute name="y">
+ <dia:real val="19.91716554243725"/>
+ </dia:attribute>
+ <dia:attribute name="width">
+ <dia:real val="13.992806630147285"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="15.796188994319914"/>
+ </dia:attribute>
+ <dia:attribute name="angle">
+ <dia:int val="9"/>
+ </dia:attribute>
+ <dia:attribute name="aspect">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="scale_from_center">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="legend_disp">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="legend">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##3 : yellow#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="10.5505,11.6168"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="frame_sequence">
+ <dia:int val="3"/>
+ </dia:attribute>
+ <dia:attribute name="frame_title">
+ <dia:string>#yellow#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="frame_hide">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_clip">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_enable">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_ms">
+ <dia:int val="5000"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_profile">
+ <dia:enum val="6"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_duration_ms">
+ <dia:int val="4000"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Sozi - Frame" version="0" id="O11">
+ <dia:attribute name="obj_pos">
+ <dia:point val="32.4929,12.1225"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="21.2089,2.13318;43.7769,22.1118"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="x">
+ <dia:real val="32.492894760028236"/>
+ </dia:attribute>
+ <dia:attribute name="y">
+ <dia:real val="12.122508567288529"/>
+ </dia:attribute>
+ <dia:attribute name="width">
+ <dia:real val="16.490360886728233"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="19.764601636825244"/>
+ </dia:attribute>
+ <dia:attribute name="angle">
+ <dia:int val="-79"/>
+ </dia:attribute>
+ <dia:attribute name="aspect">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="scale_from_center">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="legend_disp">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="legend">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##4 : blue#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="21.2189,18.9256"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="frame_sequence">
+ <dia:int val="4"/>
+ </dia:attribute>
+ <dia:attribute name="frame_title">
+ <dia:string>#blue#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="frame_hide">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_clip">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_enable">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="frame_timeout_ms">
+ <dia:int val="5000"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_profile">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ <dia:attribute name="frame_transition_duration_ms">
+ <dia:int val="4000"/>
+ </dia:attribute>
+ </dia:object>
+ </dia:layer>
+</dia:diagram>
diff --git a/sheets/Makefile.am b/sheets/Makefile.am
index 77f929c..8bb1b77 100644
--- a/sheets/Makefile.am
+++ b/sheets/Makefile.am
@@ -13,7 +13,7 @@ sheet_in_files = \
ciscotelephony.sheet.in Cybernetics.sheet.in IsometricMap.sheet.in \
Istar.sheet.in Jackson.sheet.in KAOS.sheet.in ChemEng.sheet.in \
AADL.sheet.in Gane_and_Sarson.sheet.in BPMN.sheet.in \
- Lights.sheet.in Database.sheet.in Shape_Design.sheet.in
+ Lights.sheet.in Database.sheet.in Sozi.sheet.in Shape_Design.sheet.in
SHEETS = $(sheet_in_files:.sheet.in=.sheet)
diff --git a/sheets/Sozi.sheet.in b/sheets/Sozi.sheet.in
new file mode 100644
index 0000000..a4da3da
--- /dev/null
+++ b/sheets/Sozi.sheet.in
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?> <!-- -*- xml -*- -->
+<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
+ <_name>Sozi</_name>
+ <_description>Objects to do Sozi (zooming ui) presentations</_description>
+ <contents>
+ <object name="Sozi - Frame">
+ <_description>Sozi frame</_description>
+ </object>
+ <object name="Sozi - Media">
+ <_description>Sozi media</_description>
+ </object>
+ </contents>
+</sheet>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]