作図ソフト dia の改良版
Revision | bf63ab2925d2b4939ec03954e8f829333aef74e8 (tree) |
---|---|
Zeit | 2015-01-12 05:11:54 |
Autor | Paul Chavent <paul.chavent@fnac...> |
Commiter | Hans Breuer |
Add Sozi presentation objects.
See objects/Sozi/readme.txt for details.
Signed-off-by: Hans Breuer <hans@breuer.org>
@@ -203,6 +203,18 @@ AC_SUBST(XSLT_DIR) | ||
203 | 203 | AC_SUBST(XSLT_LIBS) |
204 | 204 | AC_SUBST(XSLT_CFLAGS) |
205 | 205 | |
206 | +# Find where are the sozi.version, sozi.js and sozi.css files | |
207 | +AC_ARG_WITH(sozi-path, | |
208 | + [ --with-sozi-path=DIR Specify where to find the optional sozi player | |
209 | + (default=DATAROOTDIR/sozi)], | |
210 | + SOZI_PATH=$withval, | |
211 | + SOZI_PATH=$prefix/share/sozi) | |
212 | +AC_CHECK_FILE($SOZI_PATH/sozi.version,have_sozi_version=yes,have_sozi_version=no) | |
213 | +#AC_CHECK_FILE($SOZI_PATH/sozi.js,have_sozi_js=yes,have_sozi_js=no) | |
214 | +#AC_CHECK_FILE($SOZI_PATH/sozi.css,have_sozi_css=yes,have_sozi_css=no) | |
215 | +AM_CONDITIONAL(WITH_SOZI_PATH, test "$have_sozi_version" = yes) | |
216 | +AC_SUBST(SOZI_PATH) | |
217 | + | |
206 | 218 | # Figure out a prefix for where to find libxslt at runtime. |
207 | 219 | AC_ARG_WITH(xslt-prefix, |
208 | 220 | AC_HELP_STRING([--with-xslt-prefix=DIR],[Specify where to find the optional XSLT libraries |
@@ -654,6 +666,7 @@ objects/SADT/Makefile | ||
654 | 666 | objects/standard/Makefile |
655 | 667 | objects/UML/Makefile |
656 | 668 | objects/Database/Makefile |
669 | +objects/Sozi/Makefile | |
657 | 670 | shapes/Makefile |
658 | 671 | shapes/Assorted/Makefile |
659 | 672 | shapes/BPMN/Makefile |
@@ -577,6 +577,7 @@ EXPORTS | ||
577 | 577 | object_substitute |
578 | 578 | object_toggle_prop |
579 | 579 | object_unconnect |
580 | + object_unconnect_all | |
580 | 581 | |
581 | 582 | orthconn_add_segment |
582 | 583 | orthconn_can_add_segment |
@@ -1,7 +1,7 @@ | ||
1 | 1 | ## Process this file with automake to produce Makefile.in |
2 | 2 | |
3 | 3 | SUBDIRS = standard network UML ER FS flowchart custom custom_lines GRAFCET \ |
4 | - chronogram SADT Misc Istar Jackson KAOS AADL Database | |
4 | + chronogram SADT Misc Istar Jackson KAOS AADL Database Sozi | |
5 | 5 | |
6 | 6 | EXTRA_DIST = \ |
7 | 7 | makefile.msc objects.def |
@@ -0,0 +1,25 @@ | ||
1 | +## Process this file with automake to produce Makefile.in | |
2 | + | |
3 | +pkglib_LTLIBRARIES = libsozi_objects.la | |
4 | +libsozi_objects_la_SOURCES = \ | |
5 | + sozi.c \ | |
6 | + sozi-object.c \ | |
7 | + sozi-frame.c \ | |
8 | + sozi-media.c | |
9 | + | |
10 | +if WITH_SOZI_PATH | |
11 | +libsozi_objects_la_CFLAGS = -DSOZI_PATH="\"$(SOZI_PATH)\"" | |
12 | +endif | |
13 | + | |
14 | +libsozi_objects_la_LDFLAGS = -export-dynamic -module -avoid-version $(NO_UNDEFINED) | |
15 | + | |
16 | +libsozi_objects_la_LIBADD = $(top_builddir)/lib/libdia.la | |
17 | + | |
18 | +AM_CPPFLAGS = -I$(top_srcdir)/intl -I$(srcdir)/../../lib \ | |
19 | + $(DEBUG_FLAGS) $(GTK_CFLAGS) | |
20 | + | |
21 | +EXTRA_DIST = \ | |
22 | + pixmaps/sozi-frame.xpm | |
23 | + | |
24 | + | |
25 | + |
@@ -0,0 +1,196 @@ | ||
1 | +/* XPM */ | |
2 | +static const char * sozi_frame_xpm[] = { | |
3 | +"22 22 171 2", | |
4 | +" c #FFFFFF", | |
5 | +". c #FEFEFE", | |
6 | +"+ c #FDFDFD", | |
7 | +"@ c #F7F7F8", | |
8 | +"# c #D2D2D2", | |
9 | +"$ c #939393", | |
10 | +"% c #8A8A8A", | |
11 | +"& c #BEBEBE", | |
12 | +"* c #F2F2F2", | |
13 | +"= c #FCFCFC", | |
14 | +"- c #F3F3F3", | |
15 | +"; c #FBFBFB", | |
16 | +"> c #FEFEFF", | |
17 | +", c #FCFCFB", | |
18 | +"' c #FAF4F1", | |
19 | +") c #FAF1EB", | |
20 | +"! c #F8F5F2", | |
21 | +"~ c #BFBFBF", | |
22 | +"{ c #E4E4E4", | |
23 | +"] c #F1F1F1", | |
24 | +"^ c #ADADAD", | |
25 | +"/ c #F5F5F5", | |
26 | +"( c #BEBABE", | |
27 | +"_ c #99909A", | |
28 | +": c #EDEAED", | |
29 | +"< c #ECDCD2", | |
30 | +"[ c #C3682D", | |
31 | +"} c #C64500", | |
32 | +"| c #98562A", | |
33 | +"1 c #BBB6B2", | |
34 | +"2 c #F8F8F9", | |
35 | +"3 c #FBFCFB", | |
36 | +"4 c #FBFCFC", | |
37 | +"5 c #E8BC9E", | |
38 | +"6 c #F55A00", | |
39 | +"7 c #F05F00", | |
40 | +"8 c #E4BCA1", | |
41 | +"9 c #F3F8FC", | |
42 | +"0 c #F6F6F6", | |
43 | +"a c #DCDCDC", | |
44 | +"b c #CACACA", | |
45 | +"c c #CDCDCD", | |
46 | +"d c #CBCBC9", | |
47 | +"e c #D8D8D7", | |
48 | +"f c #FBFBFC", | |
49 | +"g c #E7B99A", | |
50 | +"h c #F25600", | |
51 | +"i c #DD7A39", | |
52 | +"j c #E7DDD6", | |
53 | +"k c #D0D0D0", | |
54 | +"l c #C8C8C8", | |
55 | +"m c #989898", | |
56 | +"n c #CACBCC", | |
57 | +"o c #A3A298", | |
58 | +"p c #BFB483", | |
59 | +"q c #EEE8D1", | |
60 | +"r c #FBFBFA", | |
61 | +"s c #FAFBFC", | |
62 | +"t c #E6BA9E", | |
63 | +"u c #EB5400", | |
64 | +"v c #ECA372", | |
65 | +"w c #F8FBFD", | |
66 | +"x c #ECECEC", | |
67 | +"y c #FBFCFE", | |
68 | +"z c #D3D1C7", | |
69 | +"A c #DDB617", | |
70 | +"B c #C4A423", | |
71 | +"C c #EFECE1", | |
72 | +"D c #FBFDFF", | |
73 | +"E c #E5C3AD", | |
74 | +"F c #DD5A03", | |
75 | +"G c #E8AD85", | |
76 | +"H c #F9FFFF", | |
77 | +"I c #E6E6E6", | |
78 | +"J c #E9E9EA", | |
79 | +"K c #CFCECD", | |
80 | +"L c #DEBF2D", | |
81 | +"M c #C99E00", | |
82 | +"N c #EDE9D1", | |
83 | +"O c #E4D5CC", | |
84 | +"P c #AE6636", | |
85 | +"Q c #E2BCA3", | |
86 | +"R c #FFFFFE", | |
87 | +"S c #E5E5E5", | |
88 | +"T c #C8C8C9", | |
89 | +"U c #D9DBE5", | |
90 | +"V c #DBBD39", | |
91 | +"W c #B79A21", | |
92 | +"X c #EDEADF", | |
93 | +"Y c #ECEAE9", | |
94 | +"Z c #A98C7A", | |
95 | +"` c #D3B8A6", | |
96 | +" . c #E3E3E3", | |
97 | +".. c #C7C7C7", | |
98 | +"+. c #F1F3FC", | |
99 | +"@. c #A5965C", | |
100 | +"#. c #BDB496", | |
101 | +"$. c #BEBBB8", | |
102 | +"%. c #B3ACA7", | |
103 | +"&. c #E9E7E7", | |
104 | +"*. c #B6B4B4", | |
105 | +"=. c #92939A", | |
106 | +"-. c #DFDFE3", | |
107 | +";. c #ADAEAF", | |
108 | +">. c #CCCDCE", | |
109 | +",. c #7D898D", | |
110 | +"'. c #DCDBDA", | |
111 | +"). c #EDEDED", | |
112 | +"!. c #DADADA", | |
113 | +"~. c #9B9B9B", | |
114 | +"{. c #DEDEDE", | |
115 | +"]. c #FFFEFE", | |
116 | +"^. c #B4CBD2", | |
117 | +"/. c #389CB5", | |
118 | +"(. c #6E9CA8", | |
119 | +"_. c #DDDDDD", | |
120 | +":. c #EAEAEA", | |
121 | +"<. c #CECECE", | |
122 | +"[. c #B6B6B6", | |
123 | +"}. c #E7E7E7", | |
124 | +"|. c #B2D0D8", | |
125 | +"1. c #1BB6DE", | |
126 | +"2. c #00A7D3", | |
127 | +"3. c #82AFBB", | |
128 | +"4. c #EEEEEE", | |
129 | +"5. c #999999", | |
130 | +"6. c #F0F0F0", | |
131 | +"7. c #E0E0E0", | |
132 | +"8. c #F9FCFC", | |
133 | +"9. c #1194B5", | |
134 | +"0. c #00CEFF", | |
135 | +"a. c #23BAE1", | |
136 | +"b. c #C3D0D4", | |
137 | +"c. c #D4D4D4", | |
138 | +"d. c #FAFCFC", | |
139 | +"e. c #2E8FA8", | |
140 | +"f. c #00BDEF", | |
141 | +"g. c #3AB4D3", | |
142 | +"h. c #F8F2F1", | |
143 | +"i. c #EBEBEB", | |
144 | +"j. c #C6C6C6", | |
145 | +"k. c #A8A8A8", | |
146 | +"l. c #F4F4F4", | |
147 | +"m. c #DBE7EB", | |
148 | +"n. c #6894A0", | |
149 | +"o. c #6C8288", | |
150 | +"p. c #A3A1A0", | |
151 | +"q. c #949494", | |
152 | +"r. c #8F8F8F", | |
153 | +"s. c #E2E2E2", | |
154 | +"t. c #BABABA", | |
155 | +"u. c #CBCACA", | |
156 | +"v. c #9A9898", | |
157 | +"w. c #F3F2F1", | |
158 | +"x. c #E9E9E9", | |
159 | +"y. c #E8E8E8", | |
160 | +"z. c #F9F9F9", | |
161 | +"A. c #F7F7F7", | |
162 | +"B. c #A9A9A9", | |
163 | +"C. c #C1C1C1", | |
164 | +"D. c #D7D7D7", | |
165 | +"E. c #F7F6F6", | |
166 | +"F. c #FAFAFA", | |
167 | +"G. c #5F5F5F", | |
168 | +"H. c #B2B2B2", | |
169 | +"I. c #F8F8F8", | |
170 | +"J. c #D8D8D8", | |
171 | +"K. c #909090", | |
172 | +"L. c #7D7D7D", | |
173 | +"M. c #858585", | |
174 | +"N. c #B4B4B4", | |
175 | +" . . . . . + + . . . . . ", | |
176 | +" . @ # $ % & * . = - ; . ", | |
177 | +" > , ' ) ! ~ { ] ^ / ( _ : ", | |
178 | +" < [ } | 1 2 . . * ~ 3 . . ", | |
179 | +" 4 5 6 7 8 9 = . 0 a b c ; d e > . ", | |
180 | +" f g h i j . 0 k l m n o p q r . . ", | |
181 | +" s t u v w . x y z A B C > . ", | |
182 | +" D E F G H . . = I J K L M N ", | |
183 | +" O P Q R . S T U V W X > ", | |
184 | +" . Y Z ` > . . ...+.@.#.2 ", | |
185 | +" R $.%. . . . . &.*.c =.-. ", | |
186 | +" . n ;.= . . >.,.'.a ). . . ", | |
187 | +" . !.~.{. . . ].^./.(. . # _. ", | |
188 | +" . :.<.[.}. . + |.1.2.3. 4...5.= ", | |
189 | +" * 6.c 7.+ 8.9.0.a.b. . 6.<.+ ", | |
190 | +" . c.7.# - . . d.e.f.g.h. ", | |
191 | +" . i.j.k.l. > m.n.o.p.$ q.r.s.. ", | |
192 | +" . . I & t.0 ; ] u.v.w.).x.x.y.z.. . ", | |
193 | +" . + A.B.c C.<.D.E. . . ", | |
194 | +"F.G.H.i.I. 4.C./ z.; ; . . ", | |
195 | +". / J.~ K.L.M.N.l.. . . ", | |
196 | +" . . + + + . . . . . "}; |
@@ -0,0 +1,214 @@ | ||
1 | +/* XPM */ | |
2 | +static const char * sozi_media_xpm[] = { | |
3 | +"22 22 189 2", | |
4 | +" c None", | |
5 | +". c #000000", | |
6 | +"+ c #030303", | |
7 | +"@ c #060606", | |
8 | +"# c #050505", | |
9 | +"$ c #040404", | |
10 | +"% c #EBEBEB", | |
11 | +"& c #5D5D5D", | |
12 | +"* c #6C6C6C", | |
13 | +"= c #ECECEC", | |
14 | +"- c #E3E3E3", | |
15 | +"; c #1C1C1C", | |
16 | +"> c #989898", | |
17 | +", c #888888", | |
18 | +"' c #6E6E6E", | |
19 | +") c #0A0A0A", | |
20 | +"! c #DDDDDD", | |
21 | +"~ c #A6A6A6", | |
22 | +"{ c #212121", | |
23 | +"] c #EAEAEA", | |
24 | +"^ c #595959", | |
25 | +"/ c #6A6A6A", | |
26 | +"( c #E7E1DF", | |
27 | +"_ c #DED6D1", | |
28 | +": c #1B1A1A", | |
29 | +"< c #A5A5A5", | |
30 | +"[ c #CCCCCC", | |
31 | +"} c #070707", | |
32 | +"| c #D3D3D3", | |
33 | +"1 c #151315", | |
34 | +"2 c #D6D3D6", | |
35 | +"3 c #FFFFFF", | |
36 | +"4 c #FBFCFC", | |
37 | +"5 c #E8BC9E", | |
38 | +"6 c #F55A00", | |
39 | +"7 c #F05F00", | |
40 | +"8 c #E4BCA1", | |
41 | +"9 c #F3F8FC", | |
42 | +"0 c #FCFCFC", | |
43 | +"a c #FEFEFE", | |
44 | +"b c #F6F6F6", | |
45 | +"c c #DCDCDC", | |
46 | +"d c #CACACA", | |
47 | +"e c #CDCDCD", | |
48 | +"f c #FBFBFB", | |
49 | +"g c #CBCBC9", | |
50 | +"h c #D8D8D7", | |
51 | +"i c #FEFEFF", | |
52 | +"j c #F7F7F7", | |
53 | +"k c #FDFDFD", | |
54 | +"l c #FBFBFC", | |
55 | +"m c #E7B99A", | |
56 | +"n c #F25600", | |
57 | +"o c #DD7A39", | |
58 | +"p c #E7DDD6", | |
59 | +"q c #D0D0D0", | |
60 | +"r c #C8C8C8", | |
61 | +"s c #CACBCC", | |
62 | +"t c #A3A298", | |
63 | +"u c #BFB483", | |
64 | +"v c #EEE8D1", | |
65 | +"w c #FBFBFA", | |
66 | +"x c #FAFBFC", | |
67 | +"y c #E6BA9E", | |
68 | +"z c #EB5400", | |
69 | +"A c #ECA372", | |
70 | +"B c #F8FBFD", | |
71 | +"C c #FBFCFE", | |
72 | +"D c #D3D1C7", | |
73 | +"E c #DDB617", | |
74 | +"F c #C4A423", | |
75 | +"G c #EFECE1", | |
76 | +"H c #FBFDFF", | |
77 | +"I c #E5C3AD", | |
78 | +"J c #DD5A03", | |
79 | +"K c #E8AD85", | |
80 | +"L c #F9FFFF", | |
81 | +"M c #E6E6E6", | |
82 | +"N c #E9E9EA", | |
83 | +"O c #CFCECD", | |
84 | +"P c #DEBF2D", | |
85 | +"Q c #C99E00", | |
86 | +"R c #EDE9D1", | |
87 | +"S c #E4D5CC", | |
88 | +"T c #AE6636", | |
89 | +"U c #E2BCA3", | |
90 | +"V c #FFFFFE", | |
91 | +"W c #E5E5E5", | |
92 | +"X c #C8C8C9", | |
93 | +"Y c #D9DBE5", | |
94 | +"Z c #DBBD39", | |
95 | +"` c #B79A21", | |
96 | +" . c #EDEADF", | |
97 | +".. c #ECEAE9", | |
98 | +"+. c #A98C7A", | |
99 | +"@. c #D3B8A6", | |
100 | +"#. c #C7C7C7", | |
101 | +"$. c #F1F3FC", | |
102 | +"%. c #A5965C", | |
103 | +"&. c #BDB496", | |
104 | +"*. c #F8F8F9", | |
105 | +"=. c #BEBBB8", | |
106 | +"-. c #B3ACA7", | |
107 | +";. c #E9E7E7", | |
108 | +">. c #B6B4B4", | |
109 | +",. c #92939A", | |
110 | +"'. c #DFDFE3", | |
111 | +"). c #ADAEAF", | |
112 | +"!. c #CCCDCE", | |
113 | +"~. c #7D898D", | |
114 | +"{. c #DCDBDA", | |
115 | +"]. c #EDEDED", | |
116 | +"^. c #DADADA", | |
117 | +"/. c #9B9B9B", | |
118 | +"(. c #DEDEDE", | |
119 | +"_. c #FFFEFE", | |
120 | +":. c #B4CBD2", | |
121 | +"<. c #389CB5", | |
122 | +"[. c #6E9CA8", | |
123 | +"}. c #D2D2D2", | |
124 | +"|. c #CECECE", | |
125 | +"1. c #B6B6B6", | |
126 | +"2. c #E7E7E7", | |
127 | +"3. c #B2D0D8", | |
128 | +"4. c #1BB6DE", | |
129 | +"5. c #00A7D3", | |
130 | +"6. c #82AFBB", | |
131 | +"7. c #EEEEEE", | |
132 | +"8. c #999999", | |
133 | +"9. c #F2F2F2", | |
134 | +"0. c #F0F0F0", | |
135 | +"a. c #E0E0E0", | |
136 | +"b. c #F9FCFC", | |
137 | +"c. c #1194B5", | |
138 | +"d. c #00CEFF", | |
139 | +"e. c #23BAE1", | |
140 | +"f. c #C3D0D4", | |
141 | +"g. c #D4D4D4", | |
142 | +"h. c #F3F3F3", | |
143 | +"i. c #FAFCFC", | |
144 | +"j. c #2E8FA8", | |
145 | +"k. c #00BDEF", | |
146 | +"l. c #3AB4D3", | |
147 | +"m. c #F8F2F1", | |
148 | +"n. c #C6C6C6", | |
149 | +"o. c #A8A8A8", | |
150 | +"p. c #F4F4F4", | |
151 | +"q. c #DBE7EB", | |
152 | +"r. c #6894A0", | |
153 | +"s. c #6C8288", | |
154 | +"t. c #A3A1A0", | |
155 | +"u. c #939393", | |
156 | +"v. c #949494", | |
157 | +"w. c #8F8F8F", | |
158 | +"x. c #E2E2E2", | |
159 | +"y. c #BEBEBE", | |
160 | +"z. c #BABABA", | |
161 | +"A. c #F1F1F1", | |
162 | +"B. c #CBCACA", | |
163 | +"C. c #9A9898", | |
164 | +"D. c #F3F2F1", | |
165 | +"E. c #E9E9E9", | |
166 | +"F. c #E8E8E8", | |
167 | +"G. c #F9F9F9", | |
168 | +"H. c #181818", | |
169 | +"I. c #2D2D2D", | |
170 | +"J. c #2C2C2C", | |
171 | +"K. c #ACACAC", | |
172 | +"L. c #1F1F1F", | |
173 | +"M. c #AAAAAA", | |
174 | +"N. c #ADADAD", | |
175 | +"O. c #242424", | |
176 | +"P. c #3C3C3C", | |
177 | +"Q. c #9D9D9D", | |
178 | +"R. c #8B8B8B", | |
179 | +"S. c #AFAFAF", | |
180 | +"T. c #AEAEAE", | |
181 | +"U. c #5A5A5A", | |
182 | +"V. c #474747", | |
183 | +"W. c #909090", | |
184 | +"X. c #7D7D7D", | |
185 | +"Y. c #3A3A3A", | |
186 | +"Z. c #B4B4B4", | |
187 | +"`. c #101010", | |
188 | +" + c #F8F8F8", | |
189 | +".+ c #0C0C0C", | |
190 | +"++ c #080808", | |
191 | +"@+ c #0D0D0D", | |
192 | +"#+ c #010101", | |
193 | +". + @ + . . @ # . . . # $ . . . # $ . . $ @ ", | |
194 | +"% & . * = - ; . > , ' . ) ! % ~ . { - ] ^ . ", | |
195 | +"% & . / ( _ : . < = [ . } | % ~ . 1 2 ] ^ . ", | |
196 | +". . . . . . . . . . . . . . . . . . . . . . ", | |
197 | +"3 3 4 5 6 7 8 9 0 a 3 b c d e f g h 3 i j k ", | |
198 | +"3 3 l m n o p 3 3 3 a b q r > s t u v w a a ", | |
199 | +"3 3 x y z A B 3 3 3 a 3 3 3 = C D E F G i a ", | |
200 | +"3 3 H I J K L 3 3 a 3 a 3 0 M N O P Q R 3 3 ", | |
201 | +"3 3 3 S T U 3 V 3 3 3 3 a 3 W X Y Z ` .3 i ", | |
202 | +"3 a 3 ..+.@.3 i a 3 3 3 a 3 - #.$.%.&.*.3 3 ", | |
203 | +"3 3 V 3 =.-.3 a 3 a 3 a a 3 ;.>.e ,.'.3 3 3 ", | |
204 | +"3 3 a 3 s ).0 3 a 3 a 3 3 3 !.~.{.c ].3 a a ", | |
205 | +"3 a 3 3 ^./.(.3 a 3 3 a _.:.<.[.3 a }.! 3 3 ", | |
206 | +"3 3 a 3 ] |.1.2.3 a 3 k 3.4.5.6.3 3 7.#.8.0 ", | |
207 | +"3 3 3 3 9.0.e a.k 3 3 b.c.d.e.f.3 a 3 0.|.k ", | |
208 | +"3 3 3 3 a g.a.}.h.a a i.j.k.l.m.3 3 3 3 3 3 ", | |
209 | +"3 3 a 3 3 % n.o.p.3 3 i q.r.s.t.u.v.w.x.a 3 ", | |
210 | +"3 a 3 3 a 3 M y.z.b f A.B.C.D.].E.E.F.G.p.f ", | |
211 | +". . . . . . . . . . . . . . . H.I.I.I.I.J.J.", | |
212 | +"K.L.. { M.N.O.. P.M.Q.. . R.S., . # < T.U.. ", | |
213 | +"a S.. V.W.X.Y.. Z.a 3 `.@ a 3 +. .+3 3 | . ", | |
214 | +".+. # . ++++. # . @++ @ @ . @+. @ # #+.+. @ "}; |
@@ -0,0 +1,50 @@ | ||
1 | +This is a front end for the integration of the Sozi player (see [1]) | |
2 | +to the Dia's SVG exports. Sozi is a zooming UI for presentation, a | |
3 | +bit like Prezi. Some examples of Sozi presentations are available on | |
4 | +the page [2]. | |
5 | + | |
6 | +This implementation supports Sozi strictly less than 14. The old | |
7 | +(<=13) "API" can be found at [3], but will probably be obsolete when | |
8 | +you will read this doc. | |
9 | + | |
10 | +Additional information can be found on the Sozi web site, particularly | |
11 | +helps about the usage of the player [4]. | |
12 | + | |
13 | +The implementation splits in several files : | |
14 | + | |
15 | +sozi-object : the base object that control placement of the object. | |
16 | +sozi-frame : the frame that represent a view of the presentation. | |
17 | +sozi-media : a video or audio to insert in the presentation | |
18 | +sozi-player : the minified javascript/css code of the Sozi player, | |
19 | + generated from the Sozi source code, taken from the | |
20 | + commit of the Sep 22, 2014 [5]. | |
21 | + | |
22 | +As an alternative to the embedded Sozi player version, you can provide | |
23 | +your own Sozi player with the "--with-sozi-path" configure option that | |
24 | +should point to a path containing the Sozi player files (sozi.version, | |
25 | +sozi.js, sozi.css, ...). | |
26 | + | |
27 | +Some issues still need to be addressed to improve this module: | |
28 | +- the problem of the frame title/sequence display : | |
29 | + - should we display something ? | |
30 | + - what : sequence number, title, both ? | |
31 | + - should it be editable in interactive rendering ? | |
32 | + - placement : inside, outside ? | |
33 | + - size : dynamic re-sizing ? | |
34 | +- the problem of the frame title/sequence management : | |
35 | + - the automatic sequence numbering is screwed after frame | |
36 | + deletion or undo command. | |
37 | + - is the automatic sequence management the good solution ? | |
38 | + - how to redraw all objects after changing sequence numbering ? | |
39 | +- display a preview of the media ? | |
40 | + | |
41 | + | |
42 | +[1] http://sozi.baierouge.fr/ | |
43 | +[2] http://sozi.wikidot.com/presentations | |
44 | +[3] https://web.archive.org/web/20130527164221/http://sozi.baierouge.fr/wiki/en:format | |
45 | +[4] http://sozi.baierouge.fr/pages/40-play.html | |
46 | +[5] https://github.com/senshu/Sozi/commit/e6598642ae6f06e87b689839fb0229ccf1f1130c | |
47 | + | |
48 | + | |
49 | + | |
50 | + |
@@ -0,0 +1,688 @@ | ||
1 | +/* -*- c-basic-offset:4; -*- */ | |
2 | +/* Dia -- an diagram creation/manipulation program | |
3 | + * Copyright (C) 1999 Alexander Larsson | |
4 | + * | |
5 | + * Sozi objects support | |
6 | + * Copyright (C) 2015 Paul Chavent | |
7 | + * | |
8 | + * This program is free software; you can redistribute it and/or modify | |
9 | + * it under the terms of the GNU General Public License as published by | |
10 | + * the Free Software Foundation; either version 2 of the License, or | |
11 | + * (at your option) any later version. | |
12 | + * | |
13 | + * This program is distributed in the hope that it will be useful, | |
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | + * GNU General Public License for more details. | |
17 | + * | |
18 | + * You should have received a copy of the GNU General Public License | |
19 | + * along with this program; if not, write to the Free Software | |
20 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | + */ | |
22 | + | |
23 | +/* standard libs*/ | |
24 | +#include <assert.h> | |
25 | + | |
26 | +/* xpath for searching in the svg doc */ | |
27 | +#include <libxml/xpath.h> | |
28 | + | |
29 | +/* dia stuff */ | |
30 | +#include "object.h" | |
31 | +#include "diarenderer.h" | |
32 | +#include "diasvgrenderer.h" | |
33 | +#include "properties.h" | |
34 | + | |
35 | +/* FIXME : legal dia stuff ? */ | |
36 | +#include "prop_inttypes.h" | |
37 | +#include "propinternals.h" | |
38 | + | |
39 | +/* sozi stuff */ | |
40 | +#include "pixmaps/sozi-frame.xpm" | |
41 | +#include "sozi-object.h" | |
42 | + | |
43 | +/****************************************************************************** | |
44 | + * | |
45 | + *****************************************************************************/ | |
46 | + | |
47 | +typedef enum | |
48 | +{ | |
49 | + TRANSITION_LINEAR , | |
50 | + TRANSITION_ACCELERATE , | |
51 | + TRANSITION_STRONG_ACCELERATE , | |
52 | + TRANSITION_DECELERATE , | |
53 | + TRANSITION_STRONG_DECELERATE , | |
54 | + TRANSITION_ACCELERATE_DECELERATE , | |
55 | + TRANSITION_STRONG_ACCELERATE_DECELERATE, | |
56 | + TRANSITION_DECELERATE_ACCELERATE , | |
57 | + TRANSITION_STRONG_DECELERATE_ACCELERATE, | |
58 | + TRANSITION_IMMEDIATE_BEGINNING , | |
59 | + TRANSITION_IMMEDIATE_END , | |
60 | + TRANSITION_IMMEDIATE_MIDDLE , | |
61 | +} TransitionProfileType; | |
62 | + | |
63 | +static const gchar * TransitionProfileDescr [] = | |
64 | +{ | |
65 | + "linear", | |
66 | + "accelerate", | |
67 | + "strong-accelerate", | |
68 | + "decelerate", | |
69 | + "strong-decelerate", | |
70 | + "accelerate-decelerate", | |
71 | + "strong-accelerate-decelerate", | |
72 | + "decelerate-accelerate", | |
73 | + "strong-decelerate-accelerate", | |
74 | + "immediate-beginning", | |
75 | + "immediate-end", | |
76 | + "immediate-middle", | |
77 | +}; | |
78 | + | |
79 | +typedef struct _SoziFrame | |
80 | +{ | |
81 | + /* sozi object inheritance */ | |
82 | + | |
83 | + SoziObject sozi_object; | |
84 | + | |
85 | + /* sozi frame specific stuff */ | |
86 | + | |
87 | + int old_sequence; /* internal sequence numbering managment */ | |
88 | + int sequence; /* final sequence number */ | |
89 | + | |
90 | + gchar * title; | |
91 | + gboolean hide; | |
92 | + gboolean clip; | |
93 | + gboolean timeout_enable; | |
94 | + int timeout_ms; | |
95 | + TransitionProfileType transition_profile; | |
96 | + int transition_duration_ms; | |
97 | + | |
98 | +} SoziFrame; | |
99 | + | |
100 | +/****************************************************************************** | |
101 | + * Dia object type operations | |
102 | + *****************************************************************************/ | |
103 | + | |
104 | +static DiaObject * sozi_frame_create(Point *startpoint, | |
105 | + void *user_data, | |
106 | + Handle **handle1, | |
107 | + Handle **handle2); | |
108 | +static DiaObject * sozi_frame_load(ObjectNode obj_node, int version, DiaContext *ctx); | |
109 | + | |
110 | +static ObjectTypeOps sozi_frame_type_ops = | |
111 | +{ | |
112 | + (CreateFunc) sozi_frame_create, /* create */ | |
113 | + (LoadFunc) sozi_frame_load, /* load (== object_load_using_properties ?) */ | |
114 | + (SaveFunc) object_save_using_properties, /* save */ | |
115 | + (GetDefaultsFunc) NULL, | |
116 | + (ApplyDefaultsFunc) NULL, | |
117 | +}; | |
118 | + | |
119 | +DiaObjectType sozi_frame_type = | |
120 | +{ | |
121 | + "Sozi - Frame", /* name */ | |
122 | + 0, /* version */ | |
123 | + sozi_frame_xpm, /* pixmap */ | |
124 | + &sozi_frame_type_ops, /* ops */ | |
125 | + NULL, /* pixmap_file */ | |
126 | + 0 /* default_user_data */ | |
127 | +}; | |
128 | + | |
129 | +/****************************************************************************** | |
130 | + * Dia object operations | |
131 | + *****************************************************************************/ | |
132 | + | |
133 | +static DiaObject * sozi_frame_copy(SoziFrame *sozi_frame); | |
134 | + | |
135 | +static void sozi_frame_destroy(SoziFrame *sozi_frame); | |
136 | + | |
137 | +static void sozi_frame_select(SoziFrame *sozi_frame, Point *clicked_point, | |
138 | + DiaRenderer *interactive_renderer); | |
139 | + | |
140 | +static void sozi_frame_draw(SoziFrame *sozi_frame, DiaRenderer *renderer); | |
141 | + | |
142 | +static real sozi_frame_distance_from(SoziFrame *sozi_frame, Point *point); | |
143 | + | |
144 | +static ObjectChange* sozi_frame_move(SoziFrame *sozi_frame, Point *to); | |
145 | + | |
146 | +static ObjectChange* sozi_frame_move_handle(SoziFrame *sozi_frame, Handle *handle, | |
147 | + Point *to, ConnectionPoint *cp, | |
148 | + HandleMoveReason reason, ModifierKeys modifiers); | |
149 | +static GtkWidget * sozi_frame_get_properties(SoziFrame *sozi_frame, gboolean is_default); | |
150 | + | |
151 | +static PropDescription * sozi_frame_describe_props(SoziFrame *sozi_frame); | |
152 | + | |
153 | +static void sozi_frame_get_props(SoziFrame *sozi_frame, GPtrArray *props); | |
154 | + | |
155 | +static void sozi_frame_set_props(SoziFrame *sozi_frame, GPtrArray *props); | |
156 | + | |
157 | + | |
158 | +static ObjectOps sozi_frame_ops = | |
159 | +{ | |
160 | + (DestroyFunc) sozi_frame_destroy, | |
161 | + (DrawFunc) sozi_frame_draw, | |
162 | + (DistanceFunc) sozi_frame_distance_from, | |
163 | + (SelectFunc) sozi_frame_select, | |
164 | + (CopyFunc) sozi_frame_copy, | |
165 | + (MoveFunc) sozi_frame_move, | |
166 | + (MoveHandleFunc) sozi_frame_move_handle, | |
167 | + (GetPropertiesFunc) sozi_frame_get_properties, | |
168 | + (ApplyPropertiesDialogFunc) object_apply_props_from_dialog, | |
169 | + (ObjectMenuFunc) 0, | |
170 | + (DescribePropsFunc) sozi_frame_describe_props, | |
171 | + (GetPropsFunc) sozi_frame_get_props, | |
172 | + (SetPropsFunc) sozi_frame_set_props, | |
173 | + (TextEditFunc) 0, | |
174 | + (ApplyPropertiesListFunc) object_apply_props, | |
175 | +}; | |
176 | + | |
177 | +/****************************************************************************** | |
178 | + * Functions for managing Sozi frame sequencing | |
179 | + *****************************************************************************/ | |
180 | + | |
181 | +struct sequence_pair | |
182 | +{ | |
183 | + int old; | |
184 | + int new; | |
185 | +}; | |
186 | + | |
187 | +static void | |
188 | +sozi_frames_reorder(gpointer data, gpointer user_data) | |
189 | +{ | |
190 | + /* see object.h for the description of the object structure */ | |
191 | + DiaObject *dia_object = (DiaObject *)data; | |
192 | + if(strcmp(dia_object->type->name, sozi_frame_type.name) == 0) { | |
193 | + SoziFrame *sozi_frame = (SoziFrame *)dia_object; | |
194 | + struct sequence_pair * seq_pair = (struct sequence_pair *)user_data; | |
195 | + int this_seq = sozi_frame->sequence; | |
196 | + if((seq_pair->new <= this_seq) && (this_seq < seq_pair->old)) { | |
197 | + /* fprintf(stdout, "old value %d ++ new value %d\n", sozi_frame->sequence, sozi_frame->sequence + 1); */ | |
198 | + sozi_frame->sequence++; | |
199 | + sozi_frame->old_sequence = sozi_frame->sequence; | |
200 | + /* FIXME : not sure it's the good way to redraw an object */ | |
201 | + /* sozi_frame_draw(sozi_frame); */ | |
202 | + } | |
203 | + else if((seq_pair->old < this_seq) && (this_seq <= seq_pair->new)) { | |
204 | + /* fprintf(stdout, "old value %d -- new value %d\n", sozi_frame->sequence, sozi_frame->sequence - 1); */ | |
205 | + sozi_frame->sequence--; | |
206 | + sozi_frame->old_sequence = sozi_frame->sequence; | |
207 | + /* FIXME : not sure it's the good way to redraw an object */ | |
208 | + /* sozi_frame_draw(sozi_frame); */ | |
209 | + } | |
210 | + } | |
211 | +} | |
212 | + | |
213 | +static void | |
214 | +sozi_frames_count(gpointer data, gpointer user_data) | |
215 | +{ | |
216 | + /* see object.h for the description of the object structure */ | |
217 | + DiaObject *dia_object = (DiaObject *)data; | |
218 | + if(strcmp(dia_object->type->name, sozi_frame_type.name) == 0) { | |
219 | + SoziFrame *sozi_frame = (SoziFrame *)dia_object; | |
220 | + /* only object with old_sequence different of zero should be | |
221 | + taken into account */ | |
222 | + if(sozi_frame->sequence) { | |
223 | + int * counter = (int *)user_data; | |
224 | + *counter = *counter + 1; | |
225 | + } | |
226 | + } | |
227 | +} | |
228 | + | |
229 | +static void | |
230 | +sozi_frame_update(SoziFrame *sozi_frame) | |
231 | +{ | |
232 | + char legend[32]; | |
233 | + int nb_char; | |
234 | + | |
235 | + /* fprintf(stdout, "sozi_frame_update\n"); */ | |
236 | + | |
237 | + /* probably editing default configuration or loading object | |
238 | + -> do not care */ | |
239 | + if(!sozi_frame->sozi_object.dia_object.parent_layer) { | |
240 | + return; | |
241 | + } | |
242 | + | |
243 | + /* fprintf(stdout, "sozi_frame_update : before : sequence = %d, old_sequence = %d\n", sozi_frame->sequence, sozi_frame->old_sequence); */ | |
244 | + | |
245 | + /* | |
246 | + sequence managment | |
247 | + We use exemples of data_foreach_object of diagramdata.h | |
248 | + */ | |
249 | + if(!sozi_frame->sequence) { | |
250 | + /* this condition is true iif the object have just been created */ | |
251 | + int frames_count = 0; | |
252 | + /* trig COUNTING of all frames */ | |
253 | + data_foreach_object(layer_get_parent_diagram(sozi_frame->sozi_object.dia_object.parent_layer), sozi_frames_count, &frames_count); | |
254 | + /* initialize the current sequence number */ | |
255 | + /* fprintf(stdout, "seq must be initialized after object creation (%d frames)\n", frames_count); */ | |
256 | + sozi_frame->sequence = frames_count + 1; | |
257 | + } | |
258 | + else if(sozi_frame->old_sequence && | |
259 | + (sozi_frame->old_sequence != sozi_frame->sequence)) { | |
260 | + /* this condition is true iif the object's sequence number | |
261 | + have just been changed (in sozi_frame_set_props for instance) */ | |
262 | + struct sequence_pair seq_pair; | |
263 | + seq_pair.old = sozi_frame->old_sequence; | |
264 | + seq_pair.new = sozi_frame->sequence; | |
265 | + /* fprintf(stdout, "seq %d has changed to %d\n", sozi_frame->old_sequence, sozi_frame->sequence); */ | |
266 | + /* temporary revert to the old sequence number for avoiding twins */ | |
267 | + sozi_frame->sequence = sozi_frame->old_sequence; | |
268 | + /* trig REORDERING of all frames */ | |
269 | + data_foreach_object(layer_get_parent_diagram(sozi_frame->sozi_object.dia_object.parent_layer), sozi_frames_reorder, &seq_pair); | |
270 | + /* restore the current sequence number */ | |
271 | + sozi_frame->sequence = seq_pair.new; | |
272 | + } | |
273 | + /* register the current sequence number */ | |
274 | + sozi_frame->old_sequence = sozi_frame->sequence; | |
275 | + | |
276 | + /* fprintf(stdout, "sozi_frame_update : after : sequence = %d, old_sequence = %d\n", sozi_frame->sequence, sozi_frame->old_sequence); */ | |
277 | + | |
278 | + /* update legend */ | |
279 | + nb_char = g_snprintf(legend, sizeof(legend), "#%d : %s", sozi_frame->sequence, sozi_frame->title); | |
280 | + if(sizeof(legend) < nb_char) | |
281 | + { | |
282 | + legend[sizeof(legend) - 1] = 0; | |
283 | + legend[sizeof(legend) - 2] = '.'; | |
284 | + legend[sizeof(legend) - 3] = '.'; | |
285 | + legend[sizeof(legend) - 4] = '.'; | |
286 | + } | |
287 | + text_set_string(sozi_frame->sozi_object.legend.text, legend); | |
288 | +} | |
289 | + | |
290 | +/****************************************************************************** | |
291 | + * Functions for managing the Sozi object life managment (init, copy, kill) | |
292 | + *****************************************************************************/ | |
293 | + | |
294 | +static void | |
295 | +sozi_frame_init(SoziFrame *sozi_frame) | |
296 | +{ | |
297 | + /* it will be initialized later, only if the object is placed on a */ | |
298 | + /* sheet, see sozi_frame_update here under */ | |
299 | + sozi_frame->old_sequence = 0; | |
300 | + sozi_frame->sequence = 0; | |
301 | + | |
302 | + if(sozi_frame->title == NULL) { | |
303 | + sozi_frame->title = g_strdup("frame title"); | |
304 | + } | |
305 | + | |
306 | + /* the sozi defaults can be found in Sozi/player/js/document.js */ | |
307 | + sozi_frame->hide = TRUE; | |
308 | + sozi_frame->clip = TRUE; | |
309 | + sozi_frame->timeout_enable = FALSE; | |
310 | + sozi_frame->timeout_ms = 5000; | |
311 | + sozi_frame->transition_profile = TRANSITION_LINEAR; | |
312 | + sozi_frame->transition_duration_ms = 1000; | |
313 | +} | |
314 | + | |
315 | +static void | |
316 | +sozi_frame_kill(SoziFrame *sozi_frame) | |
317 | +{ | |
318 | + if(sozi_frame->title != NULL) { | |
319 | + g_free(sozi_frame->title); | |
320 | + } | |
321 | +} | |
322 | + | |
323 | +/****************************************************************************** | |
324 | + * Functions that implement the Dia fops | |
325 | + *****************************************************************************/ | |
326 | + | |
327 | +static DiaObject * | |
328 | +sozi_frame_create(Point *startpoint, | |
329 | + void *user_data, | |
330 | + Handle **handle1, | |
331 | + Handle **handle2) | |
332 | +{ | |
333 | + SoziFrame *sozi_frame; | |
334 | + | |
335 | + sozi_frame = g_new0(SoziFrame, 1); | |
336 | + | |
337 | + /* init dia object */ | |
338 | + sozi_frame->sozi_object.dia_object.type = &sozi_frame_type; | |
339 | + sozi_frame->sozi_object.dia_object.ops = &sozi_frame_ops; | |
340 | + | |
341 | + /* init sozi object : that is also the place where the dia object | |
342 | + * geometry (position, handles, ...) will be initialized | |
343 | + */ | |
344 | + sozi_object_init(&sozi_frame->sozi_object, startpoint); | |
345 | + | |
346 | + /* init sozi frame */ | |
347 | + sozi_frame_init(sozi_frame); | |
348 | + | |
349 | + /* update sozi object geometry */ | |
350 | + sozi_object_update(&sozi_frame->sozi_object); | |
351 | + | |
352 | + /* handle are not used */ | |
353 | + *handle1 = NULL; | |
354 | + *handle2 = NULL; | |
355 | + | |
356 | + return &sozi_frame->sozi_object.dia_object; | |
357 | +} | |
358 | + | |
359 | +/****************************************************************************** | |
360 | + * | |
361 | + *****************************************************************************/ | |
362 | +static DiaObject * | |
363 | +sozi_frame_load(ObjectNode obj_node, int version, DiaContext *ctx) | |
364 | +{ | |
365 | + DiaObject * obj; | |
366 | + obj = object_load_using_properties(&sozi_frame_type, obj_node, version, ctx); | |
367 | + /* sync sequence numbers since the object should not trig neither | |
368 | + count neither reorder (see sozi_frame_update) */ | |
369 | + ((SoziFrame *)(obj))->old_sequence = ((SoziFrame *)(obj))->sequence; | |
370 | + return obj; | |
371 | +} | |
372 | + | |
373 | +/****************************************************************************** | |
374 | + * | |
375 | + *****************************************************************************/ | |
376 | +static DiaObject * | |
377 | +sozi_frame_copy(SoziFrame *sozi_frame) | |
378 | +{ | |
379 | + DiaObject * obj; | |
380 | + obj = object_copy_using_properties((DiaObject *)sozi_frame); | |
381 | + /* reset the sequence number so it can trigger the count (see | |
382 | + sozi_frame_update) */ | |
383 | + ((SoziFrame *)(obj))->sequence = 0; | |
384 | + ((SoziFrame *)(obj))->old_sequence = 0; | |
385 | + return obj; | |
386 | +} | |
387 | + | |
388 | +/****************************************************************************** | |
389 | + * | |
390 | + *****************************************************************************/ | |
391 | +static void | |
392 | +sozi_frame_destroy(SoziFrame *sozi_frame) | |
393 | +{ | |
394 | + /* kill sozi frame */ | |
395 | + sozi_frame_kill(sozi_frame); | |
396 | + | |
397 | + /* kill sozi object */ | |
398 | + sozi_object_kill(&sozi_frame->sozi_object); | |
399 | + | |
400 | + /* do NOT free sozi_frame, caller will take care about that */ | |
401 | +} | |
402 | + | |
403 | +/****************************************************************************** | |
404 | + * | |
405 | + *****************************************************************************/ | |
406 | +static void | |
407 | +sozi_frame_select(SoziFrame *sozi_frame, Point *clicked_point, | |
408 | + DiaRenderer *interactive_renderer) | |
409 | +{ | |
410 | + /* this callback will be called the first time the object is | |
411 | + placed on the sheet, it allows to initialize the object */ | |
412 | + sozi_frame_update(sozi_frame); | |
413 | + /* this one will update the legend */ | |
414 | + sozi_object_update(&sozi_frame->sozi_object); | |
415 | +} | |
416 | + | |
417 | +/****************************************************************************** | |
418 | + * | |
419 | + *****************************************************************************/ | |
420 | +static void | |
421 | +sozi_frame_draw_svg(SoziFrame *sozi_frame, DiaSvgRenderer *svg_renderer) | |
422 | +{ | |
423 | + static unsigned refid_cnt = 0; | |
424 | + xmlNs *sozi_name_space; | |
425 | + xmlNodePtr root; | |
426 | + xmlNodePtr node; | |
427 | + xmlNodePtr rect; | |
428 | + /* buffers for storing attributes */ | |
429 | + gchar * refid; | |
430 | + gchar * sequence; | |
431 | + gchar * timeout_ms; | |
432 | + gchar * transition_duration_ms; | |
433 | + const gchar * transition_profile; | |
434 | + | |
435 | + /* format attributes */ | |
436 | + | |
437 | + refid = g_strdup_printf("sozi_frame_%d", refid_cnt++); | |
438 | + sequence = g_strdup_printf("%d", sozi_frame->sequence); | |
439 | + timeout_ms = g_strdup_printf("%d", sozi_frame->timeout_ms); | |
440 | + transition_duration_ms = g_strdup_printf("%d", sozi_frame->transition_duration_ms); | |
441 | + transition_profile = (sozi_frame->transition_profile < sizeof(TransitionProfileDescr)/sizeof(TransitionProfileDescr[0]))?(TransitionProfileDescr[sozi_frame->transition_profile]):(TransitionProfileDescr[0]); | |
442 | + | |
443 | + /* draw the sozi base object and get a reference to the sozi | |
444 | + namespace and document root */ | |
445 | + | |
446 | + sozi_object_draw_svg(&sozi_frame->sozi_object, svg_renderer, refid, &sozi_name_space, &root, &rect); | |
447 | + | |
448 | + assert(sozi_name_space != NULL); | |
449 | + | |
450 | + /* add a "custom" frame for sozi */ | |
451 | + | |
452 | + node = xmlNewChild(root, sozi_name_space, (const xmlChar *)"frame", NULL); | |
453 | + xmlSetProp(node, (const xmlChar *)"sozi:refid" , (const xmlChar *)refid); | |
454 | + xmlSetProp(node, (const xmlChar *)"sozi:title" , (const xmlChar *)sozi_frame->title); | |
455 | + xmlSetProp(node, (const xmlChar *)"sozi:sequence" , (const xmlChar *)sequence); | |
456 | + xmlSetProp(node, (const xmlChar *)"sozi:hide" , (const xmlChar *)((sozi_frame->hide)?"true":"false")); | |
457 | + xmlSetProp(node, (const xmlChar *)"sozi:clip" , (const xmlChar *)((sozi_frame->clip)?"true":"false")); | |
458 | + xmlSetProp(node, (const xmlChar *)"sozi:show-in-frame-list" , (const xmlChar *)"true"); | |
459 | + xmlSetProp(node, (const xmlChar *)"sozi:timeout-enable" , (const xmlChar *)((sozi_frame->timeout_enable)?"true":"false")); | |
460 | + xmlSetProp(node, (const xmlChar *)"sozi:timeout-ms" , (const xmlChar *)timeout_ms); | |
461 | + xmlSetProp(node, (const xmlChar *)"sozi:transition-duration-ms" , (const xmlChar *)transition_duration_ms); | |
462 | + xmlSetProp(node, (const xmlChar *)"sozi:transition-zoom-percent", (const xmlChar *)"0"); | |
463 | + xmlSetProp(node, (const xmlChar *)"sozi:transition-profile" , (const xmlChar *)transition_profile); | |
464 | + xmlSetProp(node, (const xmlChar *)"sozi:transition-path-hide" , (const xmlChar *)"true"); | |
465 | + | |
466 | + /* free resources */ | |
467 | + g_free(refid); | |
468 | + g_free(sequence); | |
469 | + g_free(timeout_ms); | |
470 | + g_free(transition_duration_ms); | |
471 | +} | |
472 | + | |
473 | +/****************************************************************************** | |
474 | + * | |
475 | + *****************************************************************************/ | |
476 | + | |
477 | +#define DIA_IS_INTERACTIVE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_INTERACTIVE_RENDERER)) | |
478 | + | |
479 | +static void | |
480 | +sozi_frame_draw(SoziFrame *sozi_frame, DiaRenderer *renderer) | |
481 | +{ | |
482 | + | |
483 | + if (DIA_IS_SVG_RENDERER(renderer)) { | |
484 | + sozi_frame_draw_svg(sozi_frame, DIA_SVG_RENDERER (renderer)); | |
485 | + } | |
486 | + else if(DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer) || | |
487 | + !sozi_frame->hide) { | |
488 | + DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer); | |
489 | + | |
490 | + renderer_ops->set_linewidth(renderer, SOZI_OBJECT_LINE_WIDTH); | |
491 | + renderer_ops->set_linecaps(renderer, LINECAPS_BUTT); | |
492 | + renderer_ops->set_linejoin(renderer, LINEJOIN_MITER); | |
493 | + renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID, 0); | |
494 | + | |
495 | + renderer_ops->draw_polygon(renderer, sozi_frame->sozi_object.corners, 4, NULL, &color_black); | |
496 | + | |
497 | + if(sozi_frame->sozi_object.legend.disp == TRUE) { | |
498 | + text_draw(sozi_frame->sozi_object.legend.text, renderer); | |
499 | + } | |
500 | + } | |
501 | +} | |
502 | + | |
503 | +/****************************************************************************** | |
504 | + * | |
505 | + *****************************************************************************/ | |
506 | + | |
507 | +static real | |
508 | +sozi_frame_distance_from(SoziFrame *sozi_frame, Point *point) | |
509 | +{ | |
510 | + return distance_polygon_point(sozi_frame->sozi_object.corners, 4, SOZI_OBJECT_LINE_WIDTH, point); | |
511 | +} | |
512 | + | |
513 | +/****************************************************************************** | |
514 | + * | |
515 | + *****************************************************************************/ | |
516 | + | |
517 | +static ObjectChange* | |
518 | +sozi_frame_move(SoziFrame *sozi_frame, Point *to) | |
519 | +{ | |
520 | + return sozi_object_move(&sozi_frame->sozi_object, to); | |
521 | +} | |
522 | + | |
523 | +/****************************************************************************** | |
524 | + * | |
525 | + *****************************************************************************/ | |
526 | + | |
527 | +static ObjectChange* | |
528 | +sozi_frame_move_handle(SoziFrame *sozi_frame, Handle *handle, | |
529 | + Point *to, ConnectionPoint *cp, | |
530 | + HandleMoveReason reason, ModifierKeys modifiers) | |
531 | +{ | |
532 | + return sozi_object_move_handle(&sozi_frame->sozi_object, handle, | |
533 | + to, cp, reason, modifiers); | |
534 | +} | |
535 | + | |
536 | +/****************************************************************************** | |
537 | + * | |
538 | + *****************************************************************************/ | |
539 | + | |
540 | +static PropEnumData prop_aspect_data[] = | |
541 | +{ | |
542 | + { N_("Free") , ASPECT_FREE }, | |
543 | + { N_("Fixed") , ASPECT_FIXED }, | |
544 | + { NULL, 0 } | |
545 | +}; | |
546 | + | |
547 | +static PropEnumData prop_transition_profile_data[] = | |
548 | +{ | |
549 | + { N_("Constant speed") , TRANSITION_LINEAR }, | |
550 | + { N_("Speed up") , TRANSITION_ACCELERATE }, | |
551 | + { N_("Speed up (strong)") , TRANSITION_STRONG_ACCELERATE }, | |
552 | + { N_("Speed down") , TRANSITION_DECELERATE }, | |
553 | + { N_("Speed down (strong)") , TRANSITION_STRONG_DECELERATE }, | |
554 | + { N_("Speed up, then down") , TRANSITION_ACCELERATE_DECELERATE }, | |
555 | + { N_("Speed up, then down (strong)"), TRANSITION_STRONG_ACCELERATE_DECELERATE}, | |
556 | + { N_("Speed down, then up") , TRANSITION_DECELERATE_ACCELERATE }, | |
557 | + { N_("Speed down, then up (strong)"), TRANSITION_STRONG_DECELERATE_ACCELERATE}, | |
558 | + { N_("Immediate (beginning)") , TRANSITION_IMMEDIATE_BEGINNING }, | |
559 | + { N_("Immediate (end)") , TRANSITION_IMMEDIATE_END }, | |
560 | + { N_("Immediate (middle)") , TRANSITION_IMMEDIATE_MIDDLE }, | |
561 | + { NULL, 0 } | |
562 | +}; | |
563 | + | |
564 | +static PropDescription sozi_frame_props[] = | |
565 | +{ | |
566 | + OBJECT_COMMON_PROPERTIES, | |
567 | + | |
568 | + PROP_STD_NOTEBOOK_BEGIN, | |
569 | + | |
570 | + PROP_NOTEBOOK_PAGE("geometry",0,N_("Geometry")), | |
571 | + { "x" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center x") , NULL, NULL }, | |
572 | + { "y" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center y") , NULL, NULL }, | |
573 | + { "width" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Width") , NULL, NULL }, | |
574 | + { "height" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Height") , NULL, NULL }, | |
575 | + { "angle" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Angle (deg)") , NULL, NULL }, | |
576 | + { "aspect" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Aspect ratio") , NULL, prop_aspect_data }, | |
577 | + { "scale_from_center", PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Scale from center"), NULL, NULL }, | |
578 | + | |
579 | + PROP_NOTEBOOK_PAGE("legend",0,N_("Legend")), | |
580 | + { "legend_disp" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Legend is visible"), NULL, NULL}, | |
581 | + { "legend" , PROP_TYPE_TEXT , 0 , NULL , NULL, NULL}, | |
582 | + PROP_STD_TEXT_ALIGNMENT, | |
583 | + PROP_STD_TEXT_FONT, | |
584 | + PROP_STD_TEXT_HEIGHT, | |
585 | + PROP_STD_TEXT_COLOUR, | |
586 | + | |
587 | + PROP_NOTEBOOK_PAGE("sozi",0,N_("Sozi")), | |
588 | + { "frame_sequence" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame sequence") , NULL, NULL }, | |
589 | + { "frame_title" , PROP_TYPE_STRING, PROP_FLAG_VISIBLE, N_("Frame title") , NULL, NULL }, | |
590 | + { "frame_hide" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame hide") , NULL, NULL }, | |
591 | + { "frame_clip" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame clip") , NULL, NULL }, | |
592 | + { "frame_timeout_enable" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Frame timeout enable") , NULL, NULL }, | |
593 | + { "frame_timeout_ms" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame timeout (ms)") , NULL, NULL }, | |
594 | + { "frame_transition_profile" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Frame transition profile") , NULL, prop_transition_profile_data}, | |
595 | + { "frame_transition_duration_ms" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Frame transition duration (ms)") , NULL, NULL }, | |
596 | + PROP_STD_NOTEBOOK_END, | |
597 | + | |
598 | + PROP_DESC_END | |
599 | +}; | |
600 | + | |
601 | +static PropOffset sozi_frame_offsets[] = | |
602 | +{ | |
603 | + OBJECT_COMMON_PROPERTIES_OFFSETS, | |
604 | + | |
605 | + PROP_OFFSET_STD_NOTEBOOK_BEGIN, | |
606 | + | |
607 | + PROP_OFFSET_NOTEBOOK_PAGE("geometry"), | |
608 | + { "x" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.center.x) }, | |
609 | + { "y" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.center.y) }, | |
610 | + { "width" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.width) }, | |
611 | + { "height" , PROP_TYPE_REAL , offsetof(SoziFrame, sozi_object.height) }, | |
612 | + { "angle" , PROP_TYPE_INT , offsetof(SoziFrame, sozi_object.angle) }, | |
613 | + { "aspect" , PROP_TYPE_ENUM , offsetof(SoziFrame, sozi_object.aspect) }, | |
614 | + { "scale_from_center" , PROP_TYPE_BOOL , offsetof(SoziFrame, sozi_object.scale_from_center) }, | |
615 | + | |
616 | + PROP_OFFSET_NOTEBOOK_PAGE("legend"), | |
617 | + { "legend_disp" , PROP_TYPE_BOOL , offsetof(SoziFrame, sozi_object.legend.disp) }, | |
618 | + { "legend" , PROP_TYPE_TEXT , offsetof(SoziFrame, sozi_object.legend.text) }, | |
619 | + { "text_alignment" , PROP_TYPE_ENUM , offsetof(SoziFrame, sozi_object.legend.attrs.alignment) }, | |
620 | + { "text_font" , PROP_TYPE_FONT , offsetof(SoziFrame, sozi_object.legend.attrs.font) }, | |
621 | + { PROP_STDNAME_TEXT_HEIGHT, PROP_STDTYPE_TEXT_HEIGHT, offsetof(SoziFrame, sozi_object.legend.attrs.height) }, | |
622 | + { "text_colour" , PROP_TYPE_COLOUR , offsetof(SoziFrame, sozi_object.legend.attrs.color) }, | |
623 | + | |
624 | + PROP_OFFSET_NOTEBOOK_PAGE("sozi"), | |
625 | + { "frame_sequence" , PROP_TYPE_INT , offsetof(SoziFrame, sequence) }, | |
626 | + { "frame_title" , PROP_TYPE_STRING , offsetof(SoziFrame, title) }, | |
627 | + { "frame_hide" , PROP_TYPE_BOOL , offsetof(SoziFrame, hide) }, | |
628 | + { "frame_clip" , PROP_TYPE_BOOL , offsetof(SoziFrame, clip) }, | |
629 | + { "frame_timeout_enable" , PROP_TYPE_BOOL , offsetof(SoziFrame, timeout_enable) }, | |
630 | + { "frame_timeout_ms" , PROP_TYPE_INT , offsetof(SoziFrame, timeout_ms) }, | |
631 | + { "frame_transition_profile" , PROP_TYPE_ENUM , offsetof(SoziFrame, transition_profile) }, | |
632 | + { "frame_transition_duration_ms" , PROP_TYPE_INT , offsetof(SoziFrame, transition_duration_ms) }, | |
633 | + | |
634 | + PROP_OFFSET_STD_NOTEBOOK_END, | |
635 | + | |
636 | + {NULL} | |
637 | +}; | |
638 | + | |
639 | +static GtkWidget * | |
640 | +sozi_frame_get_properties(SoziFrame *sozi_frame, gboolean is_default) | |
641 | +{ | |
642 | + DiaObject * dia_object = &sozi_frame->sozi_object.dia_object; | |
643 | + GtkWidget * widget = object_create_props_dialog(dia_object, is_default); | |
644 | + | |
645 | + /* the following code allow to set the range of the "frame sequence" property */ | |
646 | + /* see propdialogs.c for reference code with PropWidgetAssoc */ | |
647 | + PropDialog *dialog = prop_dialog_from_widget(widget); | |
648 | + guint i; | |
649 | + for (i = 0; i < dialog->prop_widgets->len; ++i) { | |
650 | + PropWidgetAssoc *pwa = &g_array_index(dialog->prop_widgets, | |
651 | + PropWidgetAssoc, i); | |
652 | + if(pwa) { | |
653 | + if (strcmp(pwa->prop->descr->name, "frame_sequence") == 0) { | |
654 | + if(GTK_IS_SPIN_BUTTON(pwa->widget)) { | |
655 | + int count = 0; | |
656 | + data_foreach_object(layer_get_parent_diagram(dia_object->parent_layer), sozi_frames_count, &count); | |
657 | + | |
658 | + gtk_spin_button_set_range(GTK_SPIN_BUTTON(pwa->widget), 1, count); | |
659 | + } | |
660 | + } | |
661 | + } | |
662 | + } | |
663 | + return widget; | |
664 | +} | |
665 | + | |
666 | +static PropDescription * | |
667 | +sozi_frame_describe_props(SoziFrame *sozi_frame) | |
668 | +{ | |
669 | + if (sozi_frame_props[0].quark == 0) | |
670 | + prop_desc_list_calculate_quarks(sozi_frame_props); | |
671 | + return sozi_frame_props; | |
672 | +} | |
673 | + | |
674 | +static void | |
675 | +sozi_frame_get_props(SoziFrame *sozi_frame, GPtrArray *props) | |
676 | +{ | |
677 | + text_get_attributes(sozi_frame->sozi_object.legend.text, &sozi_frame->sozi_object.legend.attrs); | |
678 | + object_get_props_from_offsets(&sozi_frame->sozi_object.dia_object, sozi_frame_offsets, props); | |
679 | +} | |
680 | + | |
681 | +static void | |
682 | +sozi_frame_set_props(SoziFrame *sozi_frame, GPtrArray *props) | |
683 | +{ | |
684 | + object_set_props_from_offsets(&sozi_frame->sozi_object.dia_object, sozi_frame_offsets, props); | |
685 | + apply_textattr_properties(props, sozi_frame->sozi_object.legend.text, "legend" , &sozi_frame->sozi_object.legend.attrs); | |
686 | + sozi_frame_update(sozi_frame); | |
687 | + sozi_object_update(&sozi_frame->sozi_object); | |
688 | +} |
@@ -0,0 +1,505 @@ | ||
1 | +/* -*- c-basic-offset:4; -*- */ | |
2 | +/* Dia -- an diagram creation/manipulation program | |
3 | + * Copyright (C) 1999 Alexander Larsson | |
4 | + * | |
5 | + * Sozi objects support | |
6 | + * Copyright (C) 2015 Paul Chavent | |
7 | + * | |
8 | + * This program is free software; you can redistribute it and/or modify | |
9 | + * it under the terms of the GNU General Public License as published by | |
10 | + * the Free Software Foundation; either version 2 of the License, or | |
11 | + * (at your option) any later version. | |
12 | + * | |
13 | + * This program is distributed in the hope that it will be useful, | |
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | + * GNU General Public License for more details. | |
17 | + * | |
18 | + * You should have received a copy of the GNU General Public License | |
19 | + * along with this program; if not, write to the Free Software | |
20 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | + */ | |
22 | + | |
23 | +/* standard libs*/ | |
24 | +#include <assert.h> | |
25 | + | |
26 | +/* xpath for searching in the svg doc */ | |
27 | +#include <libxml/xpath.h> | |
28 | + | |
29 | +/* dia stuff */ | |
30 | +#include "object.h" | |
31 | +#include "diarenderer.h" | |
32 | +#include "diasvgrenderer.h" | |
33 | +#include "properties.h" | |
34 | + | |
35 | +/* sozi stuff */ | |
36 | +#include "pixmaps/sozi-media.xpm" | |
37 | +#include "sozi-object.h" | |
38 | + | |
39 | +/****************************************************************************** | |
40 | + * | |
41 | + *****************************************************************************/ | |
42 | + | |
43 | +typedef enum | |
44 | +{ | |
45 | + MEDIA_TYPE_UNDEFINED , | |
46 | + MEDIA_TYPE_VIDEO_MP4 , | |
47 | + MEDIA_TYPE_VIDEO_WEBM, | |
48 | + MEDIA_TYPE_VIDEO_OGG , | |
49 | + MEDIA_TYPE_AUDIO_MPEG, | |
50 | + MEDIA_TYPE_AUDIO_OGG , | |
51 | + MEDIA_TYPE_AUDIO_WAV , | |
52 | +} MediaType; | |
53 | + | |
54 | +/****************************************************************************** | |
55 | + * | |
56 | + *****************************************************************************/ | |
57 | + | |
58 | +typedef struct _SoziMedia | |
59 | +{ | |
60 | + /* sozi object inheritance */ | |
61 | + | |
62 | + SoziObject sozi_object; | |
63 | + | |
64 | + /* sozi media specific stuff */ | |
65 | + | |
66 | + MediaType type; | |
67 | + gchar * file; | |
68 | + | |
69 | + int start_frame; | |
70 | + int stop_frame; | |
71 | + | |
72 | +} SoziMedia; | |
73 | + | |
74 | +/****************************************************************************** | |
75 | + * Dia object type operations | |
76 | + *****************************************************************************/ | |
77 | + | |
78 | +static DiaObject * sozi_media_create(Point *startpoint, | |
79 | + void *user_data, | |
80 | + Handle **handle1, | |
81 | + Handle **handle2); | |
82 | +static DiaObject * sozi_media_load(ObjectNode obj_node, int version, DiaContext *ctx); | |
83 | + | |
84 | +static ObjectTypeOps sozi_media_type_ops = | |
85 | +{ | |
86 | + (CreateFunc) sozi_media_create, /* create */ | |
87 | + (LoadFunc) sozi_media_load, /* load (== object_load_using_properties ?) */ | |
88 | + (SaveFunc) object_save_using_properties, /* save */ | |
89 | + (GetDefaultsFunc) NULL, | |
90 | + (ApplyDefaultsFunc) NULL, | |
91 | +}; | |
92 | + | |
93 | +DiaObjectType sozi_media_type = | |
94 | +{ | |
95 | + "Sozi - Media", /* name */ | |
96 | + 0, /* version */ | |
97 | + sozi_media_xpm, /* pixmap */ | |
98 | + &sozi_media_type_ops, /* ops */ | |
99 | + NULL, /* pixmap_file */ | |
100 | + 0 /* default_user_data */ | |
101 | +}; | |
102 | + | |
103 | +/****************************************************************************** | |
104 | + * Dia object operations | |
105 | + *****************************************************************************/ | |
106 | + | |
107 | +static void sozi_media_destroy(SoziMedia *sozi_media); | |
108 | + | |
109 | +static void sozi_media_draw(SoziMedia *sozi_media, DiaRenderer *renderer); | |
110 | + | |
111 | +static real sozi_media_distance_from(SoziMedia *sozi_media, Point *point); | |
112 | + | |
113 | +static void sozi_media_select(SoziMedia *sozi_media, Point *clicked_point, | |
114 | + DiaRenderer *interactive_renderer); | |
115 | + | |
116 | +static ObjectChange* sozi_media_move(SoziMedia *sozi_media, Point *to); | |
117 | + | |
118 | +static ObjectChange* sozi_media_move_handle(SoziMedia *sozi_media, Handle *handle, | |
119 | + Point *to, ConnectionPoint *cp, | |
120 | + HandleMoveReason reason, ModifierKeys modifiers); | |
121 | + | |
122 | +static PropDescription * sozi_media_describe_props(SoziMedia *sozi_media); | |
123 | + | |
124 | +static void sozi_media_get_props(SoziMedia *sozi_media, GPtrArray *props); | |
125 | + | |
126 | +static void sozi_media_set_props(SoziMedia *sozi_media, GPtrArray *props); | |
127 | + | |
128 | + | |
129 | +static ObjectOps sozi_media_ops = | |
130 | +{ | |
131 | + (DestroyFunc) sozi_media_destroy, | |
132 | + (DrawFunc) sozi_media_draw, | |
133 | + (DistanceFunc) sozi_media_distance_from, | |
134 | + (SelectFunc) sozi_media_select, | |
135 | + (CopyFunc) object_copy_using_properties, | |
136 | + (MoveFunc) sozi_media_move, | |
137 | + (MoveHandleFunc) sozi_media_move_handle, | |
138 | + (GetPropertiesFunc) object_create_props_dialog, | |
139 | + (ApplyPropertiesDialogFunc) object_apply_props_from_dialog, | |
140 | + (ObjectMenuFunc) 0, | |
141 | + (DescribePropsFunc) sozi_media_describe_props, | |
142 | + (GetPropsFunc) sozi_media_get_props, | |
143 | + (SetPropsFunc) sozi_media_set_props, | |
144 | + (TextEditFunc) 0, | |
145 | + (ApplyPropertiesListFunc) object_apply_props, | |
146 | +}; | |
147 | + | |
148 | +/****************************************************************************** | |
149 | + * Functions for managing Sozi media | |
150 | + *****************************************************************************/ | |
151 | + | |
152 | +static void | |
153 | +sozi_media_update(SoziMedia *sozi_media) | |
154 | +{ | |
155 | + char legend[32]; | |
156 | + int nb_char; | |
157 | + | |
158 | + /* update legend */ | |
159 | + nb_char = g_snprintf(legend, sizeof(legend), "%s", sozi_media->file); | |
160 | + if(sizeof(legend) < nb_char) | |
161 | + { | |
162 | + legend[sizeof(legend) - 1] = 0; | |
163 | + legend[sizeof(legend) - 2] = '.'; | |
164 | + legend[sizeof(legend) - 3] = '.'; | |
165 | + legend[sizeof(legend) - 4] = '.'; | |
166 | + } | |
167 | + text_set_string(sozi_media->sozi_object.legend.text, legend); | |
168 | +} | |
169 | + | |
170 | +/****************************************************************************** | |
171 | + * Functions for managing the Sozi object life managment (init, copy, kill) | |
172 | + *****************************************************************************/ | |
173 | + | |
174 | +static void | |
175 | +sozi_media_init(SoziMedia *sozi_media) | |
176 | +{ | |
177 | + sozi_media->type = MEDIA_TYPE_UNDEFINED; | |
178 | + if(sozi_media->file == NULL) { | |
179 | + sozi_media->file = g_strdup(""); | |
180 | + } | |
181 | +} | |
182 | + | |
183 | +static void | |
184 | +sozi_media_kill(SoziMedia *sozi_media) | |
185 | +{ | |
186 | + if(sozi_media->file != NULL) { | |
187 | + g_free(sozi_media->file); | |
188 | + } | |
189 | +} | |
190 | + | |
191 | +/****************************************************************************** | |
192 | + * Functions that implement the Dia fops | |
193 | + *****************************************************************************/ | |
194 | + | |
195 | +static DiaObject * | |
196 | +sozi_media_create(Point *startpoint, | |
197 | + void *user_data, | |
198 | + Handle **handle1, | |
199 | + Handle **handle2) | |
200 | +{ | |
201 | + SoziMedia *sozi_media; | |
202 | + | |
203 | + sozi_media = g_new0(SoziMedia, 1); | |
204 | + | |
205 | + /* init dia object */ | |
206 | + sozi_media->sozi_object.dia_object.type = &sozi_media_type; | |
207 | + sozi_media->sozi_object.dia_object.ops = &sozi_media_ops; | |
208 | + | |
209 | + /* init sozi object : that is also the place where the dia object | |
210 | + * geometry (position, handles, ...) will be initialized | |
211 | + */ | |
212 | + sozi_object_init(&sozi_media->sozi_object, startpoint); | |
213 | + | |
214 | + /* init sozi media */ | |
215 | + sozi_media_init(sozi_media); | |
216 | + | |
217 | + /* update sozi object geometry */ | |
218 | + sozi_object_update(&sozi_media->sozi_object); | |
219 | + | |
220 | + /* handle are not used */ | |
221 | + *handle1 = NULL; | |
222 | + *handle2 = NULL; | |
223 | + | |
224 | + return &sozi_media->sozi_object.dia_object; | |
225 | +} | |
226 | + | |
227 | +/****************************************************************************** | |
228 | + * | |
229 | + *****************************************************************************/ | |
230 | +static void | |
231 | +sozi_media_destroy(SoziMedia *sozi_media) | |
232 | +{ | |
233 | + /* kill sozi media */ | |
234 | + sozi_media_kill(sozi_media); | |
235 | + | |
236 | + /* kill sozi object */ | |
237 | + sozi_object_kill(&sozi_media->sozi_object); | |
238 | + | |
239 | + /* do NOT free sozi_media, caller will take care about that */ | |
240 | +} | |
241 | + | |
242 | +/****************************************************************************** | |
243 | + * | |
244 | + *****************************************************************************/ | |
245 | +static void | |
246 | +sozi_media_draw_svg(SoziMedia *sozi_media, DiaSvgRenderer *svg_renderer) | |
247 | +{ | |
248 | + xmlNs *sozi_name_space; | |
249 | + xmlNodePtr root; | |
250 | + xmlNodePtr node; | |
251 | + xmlNodePtr rect; | |
252 | + /* buffers for storing attributes */ | |
253 | + gchar * type; | |
254 | + gchar * src; | |
255 | + gchar * start_frame; | |
256 | + gchar * stop_frame; | |
257 | + | |
258 | + /* format attributes */ | |
259 | + | |
260 | + switch(sozi_media->type) { | |
261 | + case MEDIA_TYPE_VIDEO_MP4 : type = g_strdup("video/mp4" ); break; | |
262 | + case MEDIA_TYPE_VIDEO_WEBM: type = g_strdup("video/webm"); break; | |
263 | + case MEDIA_TYPE_VIDEO_OGG : type = g_strdup("video/ogg" ); break; | |
264 | + case MEDIA_TYPE_AUDIO_MPEG: type = g_strdup("audio/mpeg"); break; | |
265 | + case MEDIA_TYPE_AUDIO_OGG : type = g_strdup("audio/ogg" ); break; | |
266 | + case MEDIA_TYPE_AUDIO_WAV : type = g_strdup("audio/wav" ); break; | |
267 | + default: return; | |
268 | + } | |
269 | + src = g_strdup(sozi_media->file); | |
270 | + start_frame = g_strdup_printf("%d", sozi_media->start_frame); | |
271 | + stop_frame = g_strdup_printf("%d", sozi_media->stop_frame); | |
272 | + | |
273 | + /* draw the sozi base object and get a reference to the sozi | |
274 | + namespace and document root */ | |
275 | + | |
276 | + sozi_object_draw_svg(&sozi_media->sozi_object, svg_renderer, 0, &sozi_name_space, &root, &rect); | |
277 | + | |
278 | + assert(sozi_name_space != NULL); | |
279 | + | |
280 | + /* add a "custom" media for sozi */ | |
281 | + | |
282 | + switch(sozi_media->type) { | |
283 | + case MEDIA_TYPE_VIDEO_MP4 : | |
284 | + case MEDIA_TYPE_VIDEO_WEBM: | |
285 | + case MEDIA_TYPE_VIDEO_OGG : | |
286 | + node = xmlNewChild(rect, sozi_name_space, (const xmlChar *)"video", NULL); | |
287 | + break; | |
288 | + case MEDIA_TYPE_AUDIO_MPEG: | |
289 | + case MEDIA_TYPE_AUDIO_OGG : | |
290 | + case MEDIA_TYPE_AUDIO_WAV : | |
291 | + node = xmlNewChild(rect, sozi_name_space, (const xmlChar *)"audio", NULL); | |
292 | + break; | |
293 | + default: node = 0; | |
294 | + } | |
295 | + | |
296 | + xmlSetProp(node, (const xmlChar *)"sozi:type" , (const xmlChar *)type); | |
297 | + xmlSetProp(node, (const xmlChar *)"sozi:src" , (const xmlChar *)src); | |
298 | + xmlSetProp(node, (const xmlChar *)"sozi:start-frame" , (const xmlChar *)start_frame); | |
299 | + xmlSetProp(node, (const xmlChar *)"sozi-stop-frame" , (const xmlChar *)stop_frame); | |
300 | + | |
301 | + /* free resources */ | |
302 | + g_free(type); | |
303 | + g_free(src); | |
304 | + g_free(start_frame); | |
305 | + g_free(stop_frame); | |
306 | +} | |
307 | + | |
308 | +/****************************************************************************** | |
309 | + * | |
310 | + *****************************************************************************/ | |
311 | + | |
312 | +#define DIA_IS_INTERACTIVE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_INTERACTIVE_RENDERER)) | |
313 | + | |
314 | +static void | |
315 | +sozi_media_draw(SoziMedia *sozi_media, DiaRenderer *renderer) | |
316 | +{ | |
317 | + | |
318 | + if (DIA_IS_SVG_RENDERER(renderer)) { | |
319 | + sozi_media_draw_svg(sozi_media, DIA_SVG_RENDERER (renderer)); | |
320 | + } | |
321 | + else if(DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer)) { | |
322 | + DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer); | |
323 | + | |
324 | + renderer_ops->set_linewidth(renderer, SOZI_OBJECT_LINE_WIDTH); | |
325 | + renderer_ops->set_linecaps(renderer, LINECAPS_BUTT); | |
326 | + renderer_ops->set_linejoin(renderer, LINEJOIN_MITER); | |
327 | + renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID, 0); | |
328 | + | |
329 | + renderer_ops->draw_polygon(renderer, sozi_media->sozi_object.corners, 4, NULL, &color_black); | |
330 | + | |
331 | + if(sozi_media->sozi_object.legend.disp == TRUE) { | |
332 | + text_draw(sozi_media->sozi_object.legend.text, renderer); | |
333 | + } | |
334 | + } | |
335 | +} | |
336 | + | |
337 | +/****************************************************************************** | |
338 | + * | |
339 | + *****************************************************************************/ | |
340 | + | |
341 | +static real | |
342 | +sozi_media_distance_from(SoziMedia *sozi_media, Point *point) | |
343 | +{ | |
344 | + return distance_polygon_point(sozi_media->sozi_object.corners, 4, SOZI_OBJECT_LINE_WIDTH, point); | |
345 | +} | |
346 | + | |
347 | +/****************************************************************************** | |
348 | + * | |
349 | + *****************************************************************************/ | |
350 | +static void | |
351 | +sozi_media_select(SoziMedia *sozi_media, Point *clicked_point, | |
352 | + DiaRenderer *interactive_renderer) | |
353 | +{ | |
354 | + /* this callback will be called the first time the object is | |
355 | + placed on the sheet, it allows to initialize the object */ | |
356 | + sozi_media_update(sozi_media); | |
357 | + sozi_object_update(&sozi_media->sozi_object); | |
358 | +} | |
359 | + | |
360 | +/****************************************************************************** | |
361 | + * | |
362 | + *****************************************************************************/ | |
363 | + | |
364 | +static ObjectChange* | |
365 | +sozi_media_move(SoziMedia *sozi_media, Point *to) | |
366 | +{ | |
367 | + return sozi_object_move(&sozi_media->sozi_object, to); | |
368 | +} | |
369 | + | |
370 | +/****************************************************************************** | |
371 | + * | |
372 | + *****************************************************************************/ | |
373 | + | |
374 | +static ObjectChange* | |
375 | +sozi_media_move_handle(SoziMedia *sozi_media, Handle *handle, | |
376 | + Point *to, ConnectionPoint *cp, | |
377 | + HandleMoveReason reason, ModifierKeys modifiers) | |
378 | +{ | |
379 | + return sozi_object_move_handle(&sozi_media->sozi_object, handle, | |
380 | + to, cp, reason, modifiers); | |
381 | +} | |
382 | + | |
383 | +/****************************************************************************** | |
384 | + * | |
385 | + *****************************************************************************/ | |
386 | +static DiaObject * | |
387 | +sozi_media_load(ObjectNode obj_node, int version, DiaContext *ctx) | |
388 | +{ | |
389 | + return object_load_using_properties(&sozi_media_type, obj_node, version, ctx); | |
390 | +} | |
391 | + | |
392 | +/****************************************************************************** | |
393 | + * | |
394 | + *****************************************************************************/ | |
395 | + | |
396 | +static PropEnumData prop_aspect_data[] = | |
397 | +{ | |
398 | + { N_("Free") , ASPECT_FREE }, | |
399 | + { N_("Fixed") , ASPECT_FIXED }, | |
400 | + { NULL, 0 } | |
401 | +}; | |
402 | + | |
403 | +static PropEnumData prop_media_type_data[] = | |
404 | +{ | |
405 | + { N_("undefined") , MEDIA_TYPE_UNDEFINED }, | |
406 | + { N_("video/mp4") , MEDIA_TYPE_VIDEO_MP4 }, | |
407 | + { N_("video/webm") , MEDIA_TYPE_VIDEO_WEBM }, | |
408 | + { N_("video/ogg") , MEDIA_TYPE_VIDEO_OGG }, | |
409 | + { N_("audio/mpeg") , MEDIA_TYPE_AUDIO_MPEG }, | |
410 | + { N_("audio/ogg") , MEDIA_TYPE_AUDIO_OGG }, | |
411 | + { N_("audio/wav") , MEDIA_TYPE_AUDIO_WAV }, | |
412 | + { NULL, 0 } | |
413 | +}; | |
414 | + | |
415 | +static PropDescription sozi_media_props[] = | |
416 | +{ | |
417 | + OBJECT_COMMON_PROPERTIES, | |
418 | + | |
419 | + PROP_STD_NOTEBOOK_BEGIN, | |
420 | + | |
421 | + PROP_NOTEBOOK_PAGE("geometry",0,N_("Geometry")), | |
422 | + { "x" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center x") , NULL, NULL }, | |
423 | + { "y" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Center y") , NULL, NULL }, | |
424 | + { "width" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Width") , NULL, NULL }, | |
425 | + { "height" , PROP_TYPE_REAL , PROP_FLAG_VISIBLE, N_("Height") , NULL, NULL }, | |
426 | + { "angle" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Angle (deg)") , NULL, NULL }, | |
427 | + { "aspect" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Aspect ratio") , NULL, prop_aspect_data }, | |
428 | + { "scale_from_center", PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Scale from center"), NULL, NULL }, | |
429 | + | |
430 | + PROP_NOTEBOOK_PAGE("legend",0,N_("Legend")), | |
431 | + { "legend_disp" , PROP_TYPE_BOOL , PROP_FLAG_VISIBLE, N_("Legend is visible"), NULL, NULL}, | |
432 | + { "legend" , PROP_TYPE_TEXT , 0 , NULL , NULL, NULL}, | |
433 | + PROP_STD_TEXT_ALIGNMENT, | |
434 | + PROP_STD_TEXT_FONT, | |
435 | + PROP_STD_TEXT_HEIGHT, | |
436 | + PROP_STD_TEXT_COLOUR, | |
437 | + | |
438 | + PROP_NOTEBOOK_PAGE("sozi",0,N_("Sozi")), | |
439 | + { "media_type" , PROP_TYPE_ENUM , PROP_FLAG_VISIBLE, N_("Media type") , NULL, prop_media_type_data}, | |
440 | + { "media_file" , PROP_TYPE_FILE , PROP_FLAG_VISIBLE, N_("Media file") , NULL, NULL }, | |
441 | + { "start_frame", PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Start frame"), NULL, NULL }, | |
442 | + { "stop_frame" , PROP_TYPE_INT , PROP_FLAG_VISIBLE, N_("Stop frame") , NULL, NULL }, | |
443 | + | |
444 | + PROP_STD_NOTEBOOK_END, | |
445 | + | |
446 | + PROP_DESC_END | |
447 | +}; | |
448 | + | |
449 | +static PropOffset sozi_media_offsets[] = | |
450 | +{ | |
451 | + OBJECT_COMMON_PROPERTIES_OFFSETS, | |
452 | + | |
453 | + PROP_OFFSET_STD_NOTEBOOK_BEGIN, | |
454 | + | |
455 | + PROP_OFFSET_NOTEBOOK_PAGE("geometry"), | |
456 | + { "x" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.center.x) }, | |
457 | + { "y" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.center.y) }, | |
458 | + { "width" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.width) }, | |
459 | + { "height" , PROP_TYPE_REAL , offsetof(SoziMedia, sozi_object.height) }, | |
460 | + { "angle" , PROP_TYPE_INT , offsetof(SoziMedia, sozi_object.angle) }, | |
461 | + { "aspect" , PROP_TYPE_ENUM , offsetof(SoziMedia, sozi_object.aspect) }, | |
462 | + { "scale_from_center" , PROP_TYPE_BOOL , offsetof(SoziMedia, sozi_object.scale_from_center) }, | |
463 | + | |
464 | + PROP_OFFSET_NOTEBOOK_PAGE("legend"), | |
465 | + { "legend_disp" , PROP_TYPE_BOOL , offsetof(SoziMedia, sozi_object.legend.disp) }, | |
466 | + { "legend" , PROP_TYPE_TEXT , offsetof(SoziMedia, sozi_object.legend.text) }, | |
467 | + { "text_alignment" , PROP_TYPE_ENUM , offsetof(SoziMedia, sozi_object.legend.attrs.alignment) }, | |
468 | + { "text_font" , PROP_TYPE_FONT , offsetof(SoziMedia, sozi_object.legend.attrs.font) }, | |
469 | + { PROP_STDNAME_TEXT_HEIGHT, PROP_STDTYPE_TEXT_HEIGHT, offsetof(SoziMedia, sozi_object.legend.attrs.height) }, | |
470 | + { "text_colour" , PROP_TYPE_COLOUR , offsetof(SoziMedia, sozi_object.legend.attrs.color) }, | |
471 | + | |
472 | + PROP_OFFSET_NOTEBOOK_PAGE("sozi"), | |
473 | + { "media_type" , PROP_TYPE_ENUM , offsetof(SoziMedia, type) }, | |
474 | + { "media_file" , PROP_TYPE_FILE , offsetof(SoziMedia, file) }, | |
475 | + { "start_frame" , PROP_TYPE_INT , offsetof(SoziMedia, start_frame) }, | |
476 | + { "stop_frame" , PROP_TYPE_INT , offsetof(SoziMedia, stop_frame) }, | |
477 | + | |
478 | + PROP_OFFSET_STD_NOTEBOOK_END, | |
479 | + | |
480 | + {NULL} | |
481 | +}; | |
482 | + | |
483 | +static PropDescription * | |
484 | +sozi_media_describe_props(SoziMedia *sozi_media) | |
485 | +{ | |
486 | + if (sozi_media_props[0].quark == 0) | |
487 | + prop_desc_list_calculate_quarks(sozi_media_props); | |
488 | + return sozi_media_props; | |
489 | +} | |
490 | + | |
491 | +static void | |
492 | +sozi_media_get_props(SoziMedia *sozi_media, GPtrArray *props) | |
493 | +{ | |
494 | + text_get_attributes(sozi_media->sozi_object.legend.text, &sozi_media->sozi_object.legend.attrs); | |
495 | + object_get_props_from_offsets(&sozi_media->sozi_object.dia_object, sozi_media_offsets, props); | |
496 | +} | |
497 | + | |
498 | +static void | |
499 | +sozi_media_set_props(SoziMedia *sozi_media, GPtrArray *props) | |
500 | +{ | |
501 | + object_set_props_from_offsets(&sozi_media->sozi_object.dia_object, sozi_media_offsets, props); | |
502 | + apply_textattr_properties(props, sozi_media->sozi_object.legend.text, "legend" , &sozi_media->sozi_object.legend.attrs); | |
503 | + sozi_media_update(sozi_media); | |
504 | + sozi_object_update(&sozi_media->sozi_object); | |
505 | +} |
@@ -0,0 +1,622 @@ | ||
1 | +/* -*- c-basic-offset:4; -*- */ | |
2 | +/* Dia -- an diagram creation/manipulation program | |
3 | + * Copyright (C) 1999 Alexander Larsson | |
4 | + * | |
5 | + * Sozi objects support | |
6 | + * Copyright (C) 2015 Paul Chavent | |
7 | + * | |
8 | + * This program is free software; you can redistribute it and/or modify | |
9 | + * it under the terms of the GNU General Public License as published by | |
10 | + * the Free Software Foundation; either version 2 of the License, or | |
11 | + * (at your option) any later version. | |
12 | + * | |
13 | + * This program is distributed in the hope that it will be useful, | |
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | + * GNU General Public License for more details. | |
17 | + * | |
18 | + * You should have received a copy of the GNU General Public License | |
19 | + * along with this program; if not, write to the Free Software | |
20 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | + */ | |
22 | + | |
23 | +/* standard libs*/ | |
24 | +#include <assert.h> | |
25 | +#include <math.h> | |
26 | + | |
27 | +/* xpath for searching in the svg doc (xmlDocGetRootElement) */ | |
28 | +#include <libxml/xpath.h> | |
29 | + | |
30 | +/* dia stuff */ | |
31 | +#include "diarenderer.h" | |
32 | + | |
33 | +/* sozi stuff */ | |
34 | +#include "sozi-player.h" | |
35 | +#include "sozi-object.h" | |
36 | + | |
37 | +/****************************************************************************** | |
38 | + * unit square | |
39 | + *****************************************************************************/ | |
40 | +static const Handle default_handles[4] = | |
41 | +{ | |
42 | + {HANDLE_RESIZE_NW, HANDLE_MAJOR_CONTROL, { 0, 0}, HANDLE_NONCONNECTABLE, NULL}, | |
43 | + {HANDLE_RESIZE_SW, HANDLE_MAJOR_CONTROL, { 0, 1}, HANDLE_NONCONNECTABLE, NULL}, | |
44 | + {HANDLE_RESIZE_SE, HANDLE_MAJOR_CONTROL, { 1, 1}, HANDLE_NONCONNECTABLE, NULL}, | |
45 | + {HANDLE_RESIZE_NE, HANDLE_MAJOR_CONTROL, { 1, 0}, HANDLE_NONCONNECTABLE, NULL}, | |
46 | +}; | |
47 | + | |
48 | +/****************************************************************************** | |
49 | + * FUNCTIONS FOR MANAGING ACCESS TO THE SVG SOZI PLAYER ENGINE | |
50 | + *****************************************************************************/ | |
51 | + | |
52 | +/** | |
53 | + * Test the presence of the sozi player in an svg document. | |
54 | + * @param[in] doc the svg document | |
55 | + * @param[in] sozi_elem the sozi player identification string that will | |
56 | + * probably be "//script[@id='sozi-script']" | |
57 | + * @return 1 if the sozi player has been found, 0 otherwise. | |
58 | + */ | |
59 | +static int | |
60 | +sozi_player_is_present(xmlDocPtr doc, const xmlChar *sozi_elem) | |
61 | +{ | |
62 | + xmlXPathContextPtr context; | |
63 | + xmlXPathObjectPtr result; | |
64 | + | |
65 | + context = xmlXPathNewContext(doc); | |
66 | + if(context == NULL) { | |
67 | + fprintf(stderr, "sozi-object : error in xmlXPathNewContext\n"); | |
68 | + return 0; | |
69 | + } | |
70 | + | |
71 | + result = xmlXPathEvalExpression(sozi_elem, context); | |
72 | + xmlXPathFreeContext(context); | |
73 | + if(result == NULL) { | |
74 | + fprintf(stderr, "sozi-object : error in xmlXPathEvalExpression\n"); | |
75 | + return 0; | |
76 | + } | |
77 | + | |
78 | + if(xmlXPathNodeSetIsEmpty(result->nodesetval)) { | |
79 | + xmlXPathFreeObject(result); | |
80 | + return 0; | |
81 | + } | |
82 | + | |
83 | + xmlXPathFreeObject(result); | |
84 | + return 1; | |
85 | +} | |
86 | + | |
87 | +/** | |
88 | + * Retreive the sozi player. | |
89 | + * @param[out] sozi_version_ptr sozi version placeholder | |
90 | + * @param[out] sozi_js_ptr sozi player placeholder | |
91 | + * @param[out] sozi_extras_media_js_ptr sozi player media extension placeholder | |
92 | + * @param[out] sozi_css_ptr sozi stylesheet placeholder | |
93 | + */ | |
94 | +static void | |
95 | +sozi_player_get(gchar **sozi_version_ptr, gchar **sozi_js_ptr, gchar **sozi_extras_media_js_ptr, gchar **sozi_css_ptr) | |
96 | +{ | |
97 | +#if defined(SOZI_PATH) | |
98 | + /* try to get sozi engine from SOZI_PATH */ | |
99 | + int i; | |
100 | + struct | |
101 | + { | |
102 | + const gchar * filename; | |
103 | + gchar ** data; | |
104 | + } external_sozi[3] = | |
105 | + { | |
106 | + { SOZI_PATH"/sozi.version" , sozi_version_ptr }, | |
107 | + { SOZI_PATH"/sozi.js" , sozi_js_ptr }, | |
108 | + { SOZI_PATH"/extras/sozi_extras_media.js" , sozi_extras_media_js_ptr }, | |
109 | + { SOZI_PATH"/sozi.css" , sozi_css_ptr } | |
110 | + }; | |
111 | + | |
112 | + for (i = 0; i < 3; i++) { | |
113 | + GError * err = 0; | |
114 | + if (!g_file_get_contents(external_sozi[i].filename, | |
115 | + external_sozi[i].data, | |
116 | + NULL, | |
117 | + &err)) { | |
118 | + g_warning("sozi-object : unable to read file \"%s\" : %s", | |
119 | + external_sozi[i].filename, | |
120 | + err->message); | |
121 | + g_error_free (err); | |
122 | + while(i--) { | |
123 | + g_free (*external_sozi[i].data); | |
124 | + } | |
125 | + break; | |
126 | + } | |
127 | + } | |
128 | + | |
129 | + if(i == 3) { | |
130 | + /* that's ok, don't need to go further */ | |
131 | + return; | |
132 | + } | |
133 | + | |
134 | +#else /* defined(SOZI_PATH) */ | |
135 | + g_warning("sozi-object : use builtin player"); | |
136 | +#endif /* defined(SOZI_PATH) */ | |
137 | + | |
138 | + /* if SOZI_PATH isn't defined, fallback to the player that comes with dia sources */ | |
139 | + *sozi_version_ptr = g_strdup((const gchar *)sozi_version); | |
140 | + *sozi_js_ptr = g_strdup((const gchar *)sozi_min_js); | |
141 | + *sozi_extras_media_js_ptr = g_strdup((const gchar *)sozi_extras_media_min_js); | |
142 | + *sozi_css_ptr = g_strdup((const gchar *)sozi_min_css); | |
143 | + | |
144 | +#if defined(SOZI_PATH) | |
145 | + g_warning("sozi-object : use sozi player version '%s'", *sozi_version_ptr); | |
146 | +#endif /* defined(SOZI_PATH) */ | |
147 | +} | |
148 | + | |
149 | +/****************************************************************************** | |
150 | + * FUNCTIONS FOR MANAGING THE SOZI OBJECT INIT AND UPDATE | |
151 | + *****************************************************************************/ | |
152 | + | |
153 | +void | |
154 | +sozi_object_init(SoziObject *sozi_object, Point *center) | |
155 | +{ | |
156 | + DiaObject *dia_object; | |
157 | + int i; | |
158 | + | |
159 | + dia_object = &sozi_object->dia_object; | |
160 | + | |
161 | + dia_object->position = *center; | |
162 | + | |
163 | + /* dia_object->bounding_box will be set in sozi_object_update */ | |
164 | + | |
165 | + dia_object->num_handles = 4; | |
166 | + if(dia_object->handles == NULL) { | |
167 | + dia_object->handles = g_new0(Handle *, 4); | |
168 | + } | |
169 | + | |
170 | + for (i = 0; i < 4; i++) { | |
171 | + if(dia_object->handles[i] == NULL) { | |
172 | + dia_object->handles[i] = g_new0(Handle, 1); | |
173 | + } | |
174 | + *dia_object->handles[i] = default_handles[i]; | |
175 | + } | |
176 | + | |
177 | + dia_object->num_connections = 1; | |
178 | + if(dia_object->connections == NULL) { | |
179 | + dia_object->connections = g_new0(ConnectionPoint *, 1); | |
180 | + } | |
181 | + | |
182 | + if(dia_object->connections[0] == NULL) { | |
183 | + dia_object->connections[0] = g_new0(ConnectionPoint, 1); | |
184 | + } | |
185 | + dia_object->connections[0]->object = dia_object; | |
186 | + dia_object->connections[0]->directions = DIR_ALL; | |
187 | + | |
188 | + /* dia_object->bounding_box will be set in sozi_object_update */ | |
189 | + | |
190 | + sozi_object->center = *center; | |
191 | + sozi_object->width = 4; | |
192 | + sozi_object->height = 3; | |
193 | + sozi_object->angle = 0; | |
194 | + sozi_object->aspect = ASPECT_FIXED; | |
195 | + sozi_object->scale_from_center = FALSE; | |
196 | + | |
197 | + /* sozi_object->cos_angle will be set in sozi_object_update */ | |
198 | + /* sozi_object->sin_angle will be set in sozi_object_update */ | |
199 | + /* sozi_object->m will be set in sozi_object_update */ | |
200 | + | |
201 | + /* sozi_object->corners are set in sozi_object_update */ | |
202 | + | |
203 | + sozi_object->legend.disp = TRUE; | |
204 | + sozi_object->legend.text = new_text_default(center, &color_black, ALIGN_LEFT); | |
205 | + text_get_attributes(sozi_object->legend.text, &sozi_object->legend.attrs); | |
206 | +} | |
207 | + | |
208 | +void | |
209 | +sozi_object_kill(SoziObject *sozi_object) | |
210 | +{ | |
211 | + int i; | |
212 | + | |
213 | + text_destroy(sozi_object->legend.text); | |
214 | + | |
215 | + object_unconnect_all(&sozi_object->dia_object); | |
216 | + | |
217 | + for (i = 0; i < 1; i++) { | |
218 | + if(sozi_object->dia_object.connections[i] != NULL) { | |
219 | + g_free(sozi_object->dia_object.connections[i]); | |
220 | + } | |
221 | + } | |
222 | + | |
223 | + for (i = 0; i < 4; i++) { | |
224 | + if(sozi_object->dia_object.handles[i] != NULL) { | |
225 | + g_free(sozi_object->dia_object.handles[i]); | |
226 | + } | |
227 | + } | |
228 | + | |
229 | + if (sozi_object->dia_object.connections) { | |
230 | + g_free(sozi_object->dia_object.connections); | |
231 | + sozi_object->dia_object.connections = NULL; | |
232 | + } | |
233 | + | |
234 | + if (sozi_object->dia_object.handles) { | |
235 | + g_free(sozi_object->dia_object.handles); | |
236 | + sozi_object->dia_object.handles = NULL; | |
237 | + } | |
238 | + | |
239 | + if (sozi_object->dia_object.meta) { | |
240 | + g_hash_table_destroy (sozi_object->dia_object.meta); | |
241 | + sozi_object->dia_object.meta = NULL; | |
242 | + } | |
243 | +} | |
244 | + | |
245 | +void | |
246 | +sozi_object_update(SoziObject *sozi_object) | |
247 | +{ | |
248 | + DiaObject *dia_object; | |
249 | + int i; | |
250 | + Point legend_pos; | |
251 | + Rectangle legend_bb; | |
252 | + | |
253 | + dia_object = &sozi_object->dia_object; | |
254 | + | |
255 | + dia_object->position = sozi_object->center; | |
256 | + | |
257 | + dia_object->bounding_box.left = G_MAXFLOAT; | |
258 | + dia_object->bounding_box.top = G_MAXFLOAT; | |
259 | + dia_object->bounding_box.right = -G_MAXFLOAT; | |
260 | + dia_object->bounding_box.bottom = -G_MAXFLOAT; | |
261 | + | |
262 | + /* angle */ | |
263 | + if(sozi_object->angle < -180) { | |
264 | + sozi_object->angle += 360.0; | |
265 | + } | |
266 | + if(180 < sozi_object->angle) { | |
267 | + sozi_object->angle -= 360; | |
268 | + } | |
269 | + sozi_object->cos_angle = cos(sozi_object->angle * M_PI / 180.0); | |
270 | + sozi_object->sin_angle = sin(sozi_object->angle * M_PI / 180.0); | |
271 | + | |
272 | + /* | |
273 | + * | |
274 | + * translate(center.x,center.y) . rotate(angle) . scale(width,height) . translate(-0.5,-0.5) | |
275 | + * | |
276 | + * m | |
277 | + * = | |
278 | + * | 1 0 x | . | cos(a) -sin(a) 0 | . | w 0 0 | . | 1 0 -0.5 | | |
279 | + * | 0 1 y | | sin(a) cos(a) 0 | | 0 h 0 | | 0 1 -0.5 | | |
280 | + * | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | |
281 | + * = | |
282 | + * | w*cos(a) -h*sin(a) x-0.5*w*cos(a)+0.5*h*sin(a) | | |
283 | + * | w*sin(a) h*cos(a) y-0.5*w*sin(a)-0.5*h*cos(a) | | |
284 | + * | 0 0 1 | | |
285 | + */ | |
286 | + sozi_object->m[0] = sozi_object->width * sozi_object->cos_angle ; | |
287 | + sozi_object->m[1] = -sozi_object->height * sozi_object->sin_angle ; | |
288 | + 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; | |
289 | + sozi_object->m[3] = sozi_object->width * sozi_object->sin_angle ; | |
290 | + sozi_object->m[4] = sozi_object->height * sozi_object->cos_angle ; | |
291 | + 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; | |
292 | + | |
293 | + for (i = 0; i < 4; i++) { | |
294 | + | |
295 | + 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]; | |
296 | + 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]; | |
297 | + | |
298 | + dia_object->handles[i]->pos = sozi_object->corners[i]; | |
299 | + | |
300 | + if(sozi_object->corners[i].x < dia_object->bounding_box.left) { | |
301 | + dia_object->bounding_box.left = sozi_object->corners[i].x - SOZI_OBJECT_LINE_WIDTH; | |
302 | + } | |
303 | + if(dia_object->bounding_box.right < sozi_object->corners[i].x) { | |
304 | + dia_object->bounding_box.right = sozi_object->corners[i].x + SOZI_OBJECT_LINE_WIDTH; | |
305 | + } | |
306 | + if(sozi_object->corners[i].y < dia_object->bounding_box.top) { | |
307 | + dia_object->bounding_box.top = sozi_object->corners[i].y - SOZI_OBJECT_LINE_WIDTH; | |
308 | + } | |
309 | + if(dia_object->bounding_box.bottom < sozi_object->corners[i].y) { | |
310 | + dia_object->bounding_box.bottom = sozi_object->corners[i].y + SOZI_OBJECT_LINE_WIDTH; | |
311 | + } | |
312 | + } | |
313 | + | |
314 | + dia_object->connections[0]->pos = sozi_object->corners[0]; | |
315 | + | |
316 | + /* setup legend appearence */ | |
317 | + legend_pos = sozi_object->corners[0]; | |
318 | + legend_pos.y += text_get_ascent(sozi_object->legend.text); | |
319 | + text_set_position(sozi_object->legend.text, &legend_pos); | |
320 | + | |
321 | + /* final bounding / enclosing box with legend */ | |
322 | + text_calc_boundingbox(sozi_object->legend.text, &legend_bb); | |
323 | + rectangle_union(&dia_object->bounding_box, &legend_bb); | |
324 | +} | |
325 | + | |
326 | +/****************************************************************************** | |
327 | + * FUNCTIONS FOR MANAGING THE SOZI OBJECT RENDERING | |
328 | + *****************************************************************************/ | |
329 | + | |
330 | +void | |
331 | +sozi_object_draw_svg(SoziObject *sozi_object, DiaSvgRenderer *svg_renderer, gchar * refid, xmlNs **p_sozi_name_space, xmlNodePtr * p_root, xmlNodePtr * p_rect) | |
332 | +{ | |
333 | + static xmlNs * sozi_name_space = NULL; | |
334 | + xmlNodePtr root; | |
335 | + xmlNodePtr node; | |
336 | + /* for managing sozi player implantation */ | |
337 | + gchar * sozi_version; | |
338 | + gchar * sozi_js; | |
339 | + gchar * sozi_extras_media_js; | |
340 | + gchar * sozi_css; | |
341 | + xmlChar * escaped; | |
342 | + /* buffers for storing attributes */ | |
343 | + gchar * x; | |
344 | + gchar * y; | |
345 | + gchar * width; | |
346 | + gchar * height; | |
347 | + gchar * transform; | |
348 | + gchar * style; | |
349 | + gchar dtostr_buf[6][G_ASCII_DTOSTR_BUF_SIZE]; | |
350 | +# define dtostr(n,d) g_ascii_formatd(dtostr_buf[(n)], sizeof(dtostr_buf[(n)]), "%g", (d)) | |
351 | + | |
352 | + root = xmlDocGetRootElement(svg_renderer->doc); | |
353 | + | |
354 | + /* check that the sozi namespace, scripts and style are present */ | |
355 | + | |
356 | + if (!sozi_player_is_present(svg_renderer->doc, (const xmlChar*) "//script[@id='sozi-script']")) { | |
357 | + | |
358 | + sozi_player_get(&sozi_version, &sozi_js, &sozi_extras_media_js, &sozi_css); | |
359 | + | |
360 | + sozi_name_space = xmlNewNs(root, (const xmlChar *)"http://sozi.baierouge.fr", (const xmlChar *)"sozi"); | |
361 | + | |
362 | + node = xmlNewChild(root, NULL, (const xmlChar *)"script", NULL); | |
363 | + xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-script"); | |
364 | + xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version); | |
365 | + escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_js); | |
366 | + xmlNodeSetContent(node, escaped); | |
367 | + xmlFree(escaped); | |
368 | + | |
369 | + node = xmlNewChild(root, NULL, (const xmlChar *)"script", NULL); | |
370 | + xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-extras-media-script"); | |
371 | + xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version); | |
372 | + escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_extras_media_js); | |
373 | + xmlNodeSetContent(node, escaped); | |
374 | + xmlFree(escaped); | |
375 | + | |
376 | + node = xmlNewChild(root, NULL, (const xmlChar *)"style", NULL); | |
377 | + xmlSetProp(node, (const xmlChar *)"id", (const xmlChar *)"sozi-style"); | |
378 | + xmlSetProp(node, (const xmlChar *)"sozi:version", (const xmlChar *)sozi_version); | |
379 | + escaped = xmlEncodeEntitiesReentrant(svg_renderer->doc, (const xmlChar *)sozi_css); | |
380 | + xmlNodeSetContent(node, escaped); | |
381 | + xmlFree(escaped); | |
382 | + | |
383 | + g_free(sozi_version); | |
384 | + g_free(sozi_js); | |
385 | + g_free(sozi_css); | |
386 | + } | |
387 | + | |
388 | + assert(sozi_name_space != NULL); | |
389 | + | |
390 | + /* format attributes */ | |
391 | + | |
392 | +#if 0 /* pure transformation */ | |
393 | + | |
394 | + x = g_strdup_printf("0"); | |
395 | + y = g_strdup_printf("0"); | |
396 | + /* FIXME : see Sozi/player/js/display.js | |
397 | + * exports.CameraState::setAtElement : | |
398 | + * the properties of the objects are based | |
399 | + * on the geometrical properties of the rectangle | |
400 | + * => this makes 1:1 ratio rectangles... | |
401 | + */ | |
402 | + width = g_strdup_printf("1"); | |
403 | + height = g_strdup_printf("1"); | |
404 | + transform = g_strdup_printf("matrix(%s,%s,%s,%s,%s,%s)", | |
405 | + /* svg has colomn-major order, we use row-major order */ | |
406 | + dtostr(0, sozi_object->m[0] * svg_renderer->scale), | |
407 | + dtostr(1, sozi_object->m[3] * svg_renderer->scale), | |
408 | + dtostr(2, sozi_object->m[1] * svg_renderer->scale), | |
409 | + dtostr(3, sozi_object->m[4] * svg_renderer->scale), | |
410 | + dtostr(4, sozi_object->m[2] * svg_renderer->scale), | |
411 | + dtostr(5, sozi_object->m[5] * svg_renderer->scale)); | |
412 | + /* FIXME : Scaling problem on stroke width : http://dev.w3.org/SVG/modules/vectoreffects/master/SVGVectorEffects.html */ | |
413 | + style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:%s", | |
414 | + dtostr(0, 0.1 / svg_renderer->scale)); | |
415 | + | |
416 | +#elif 0 /* decompose transformation */ | |
417 | + | |
418 | + x = g_strdup_printf("0"); | |
419 | + y = g_strdup_printf("0"); | |
420 | + /* FIXME : see Sozi/player/js/display.js | |
421 | + * exports.CameraState::setAtElement : | |
422 | + * the properties of the objects are based | |
423 | + * on the geometrical properties of the rectangle | |
424 | + * => this makes 1:1 ratio rectangles... | |
425 | + */ | |
426 | + width = g_strdup_printf("1"); | |
427 | + height = g_strdup_printf("1"); | |
428 | + transform = g_strdup_printf("scale(%s,%s),translate(%s,%s),rotate(%s),scale(%s,%s),translate(-0.5,-0.5)", | |
429 | + dtostr(0, svg_renderer->scale), | |
430 | + dtostr(1, svg_renderer->scale), | |
431 | + dtostr(2, sozi_object->center.x), | |
432 | + dtostr(3, sozi_object->center.y), | |
433 | + dtostr(4, sozi_object->angle), | |
434 | + dtostr(5, sozi_object->width), | |
435 | + dtostr(6, sozi_object->height)); | |
436 | + /* FIXME : Scaling problem on stroke width : http://dev.w3.org/SVG/modules/vectoreffects/master/SVGVectorEffects.html */ | |
437 | + style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:%s", | |
438 | + dtostr(0, 0.1 / svg_renderer->scale)); | |
439 | + | |
440 | +#else /* no apply scale to transformation : best compromise */ | |
441 | + | |
442 | + x = g_strdup_printf("%s", dtostr(0, sozi_object->corners[0].x * svg_renderer->scale)); | |
443 | + y = g_strdup_printf("%s", dtostr(0, sozi_object->corners[0].y * svg_renderer->scale)); | |
444 | + width = g_strdup_printf("%s", dtostr(0, sozi_object->width * svg_renderer->scale)); | |
445 | + height = g_strdup_printf("%s", dtostr(0, sozi_object->height * svg_renderer->scale)); | |
446 | + transform = g_strdup_printf("rotate(%s,%s,%s)", | |
447 | + dtostr(0, sozi_object->angle), | |
448 | + dtostr(1, sozi_object->corners[0].x * svg_renderer->scale), | |
449 | + dtostr(2, sozi_object->corners[0].y * svg_renderer->scale)); | |
450 | + | |
451 | + style = g_strdup_printf("fill:none;stroke:#000000;stroke-width:0.1"); | |
452 | + | |
453 | +#endif | |
454 | + | |
455 | + /* add a "classic" rectangle to the svg document */ | |
456 | + | |
457 | + node = xmlNewChild(svg_renderer->root, svg_renderer->svg_name_space, (const xmlChar *)"rect", NULL); | |
458 | + | |
459 | + if (refid) { | |
460 | + xmlSetProp(node, (const xmlChar *)"id" , (xmlChar *)refid); | |
461 | + } | |
462 | + xmlSetProp(node, (const xmlChar *)"x" , (xmlChar *)x); | |
463 | + xmlSetProp(node, (const xmlChar *)"y" , (xmlChar *)y); | |
464 | + xmlSetProp(node, (const xmlChar *)"width" , (xmlChar *)width); | |
465 | + xmlSetProp(node, (const xmlChar *)"height" , (xmlChar *)height); | |
466 | + xmlSetProp(node, (const xmlChar *)"transform", (xmlChar *)transform); | |
467 | + xmlSetProp(node, (const xmlChar *)"style" , (xmlChar *)style); | |
468 | + | |
469 | + /* free resources */ | |
470 | + g_free(x); | |
471 | + g_free(y); | |
472 | + g_free(width); | |
473 | + g_free(height); | |
474 | + g_free(transform); | |
475 | + g_free(style); | |
476 | + | |
477 | + /* provide results */ | |
478 | + *p_sozi_name_space = sozi_name_space; | |
479 | + *p_root = root; | |
480 | + *p_rect = node; | |
481 | + | |
482 | +# undef dtostr | |
483 | +} | |
484 | + | |
485 | +/****************************************************************************** | |
486 | + * FUNCTIONS FOR MANAGING THE OBJECT GRABBING AND SCALLING | |
487 | + *****************************************************************************/ | |
488 | + | |
489 | +ObjectChange* | |
490 | +sozi_object_move(SoziObject *sozi_object, Point *to) | |
491 | +{ | |
492 | + sozi_object->center = *to; | |
493 | + | |
494 | + sozi_object_update(sozi_object); | |
495 | + | |
496 | + return NULL; | |
497 | +} | |
498 | + | |
499 | +ObjectChange* | |
500 | +sozi_object_move_handle(SoziObject *sozi_object, Handle *handle, | |
501 | + Point *to, ConnectionPoint *cp, | |
502 | + HandleMoveReason reason, ModifierKeys modifiers) | |
503 | +{ | |
504 | + if(reason == HANDLE_MOVE_USER) { | |
505 | + | |
506 | + if(modifiers & MODIFIER_SHIFT) { | |
507 | + /* rotate object around its center */ | |
508 | + Point p1; | |
509 | + Point p2; | |
510 | + | |
511 | + /* p1 is the vector from the center to the old position of the handle */ | |
512 | + p1 = handle->pos; | |
513 | + point_sub(&p1, &sozi_object->center); | |
514 | + /* p2 is the vector from the center to the new position of the handle */ | |
515 | + p2 = *to; | |
516 | + point_sub(&p2, &sozi_object->center); | |
517 | + | |
518 | + /* | |
519 | + p1 . p2 = ||p1|| ||p2|| cos(delta) | |
520 | + p1 ^ p2 = ||p1|| ||p2|| sin(delta) | |
521 | + tan(delta) = (p1 ^ p2) / p1 . p2 | |
522 | + */ | |
523 | + sozi_object->angle += (180.0 / M_PI * atan2(p1.x * p2.y - p1.y * p2.x, p1.x * p2.x + p1.y * p2.y)); | |
524 | + } | |
525 | + else { | |
526 | + /* scale object */ | |
527 | + DiaObject * dia_object; | |
528 | + unsigned i; | |
529 | + | |
530 | + Point diagonal; | |
531 | + | |
532 | + real ratio; | |
533 | + real width; | |
534 | + real height; | |
535 | + | |
536 | + /* find the current handle */ | |
537 | + dia_object = &sozi_object->dia_object; | |
538 | + for(i = 0; i < 4; i++) { | |
539 | + if(dia_object->handles[i] == handle) { | |
540 | + break; | |
541 | + } | |
542 | + } | |
543 | + assert(i < 4); | |
544 | + | |
545 | + if(sozi_object->scale_from_center) { | |
546 | + /* scale object from its center */ | |
547 | + | |
548 | + /* diagonal is the vector from the center to the new handle pos */ | |
549 | + diagonal = *to; | |
550 | + point_sub(&diagonal, &sozi_object->center); | |
551 | + /* ratio is the old ratio */ | |
552 | + ratio = sozi_object->width / sozi_object->height; | |
553 | + /* dot product with the unit lenght vector that hold the width axe */ | |
554 | + width = 2 * fabs(diagonal.x * sozi_object->cos_angle + | |
555 | + diagonal.y * sozi_object->sin_angle); | |
556 | + /* cross product with the unit lenght vector that hold the width axe */ | |
557 | + height = 2 * fabs(diagonal.x * sozi_object->sin_angle - | |
558 | + diagonal.y * sozi_object->cos_angle); | |
559 | + /* compute the new size */ | |
560 | + if(sozi_object->aspect == ASPECT_FREE) { | |
561 | + sozi_object->width = width; | |
562 | + sozi_object->height = height; | |
563 | + } | |
564 | + else { | |
565 | + sozi_object->width = (((height * ratio) < width)?width:(height * ratio)); | |
566 | + sozi_object->height = (((width / ratio) < height)?height:(width / ratio)); | |
567 | + } | |
568 | + } | |
569 | + else { | |
570 | + /* scale object from oposite handle */ | |
571 | + | |
572 | + /* go to the oposite handle */ | |
573 | + i = (i + 2) % 4; | |
574 | + | |
575 | + /* diagonal is the vector from the oposite handle to the new handle pos */ | |
576 | + diagonal = *to; | |
577 | + point_sub(&diagonal, &dia_object->handles[i]->pos); | |
578 | + /* ratio is the old ratio */ | |
579 | + ratio = sozi_object->width / sozi_object->height; | |
580 | + /* dot product with the unit lenght vector that hold the width axe */ | |
581 | + width = fabs(diagonal.x * sozi_object->cos_angle + | |
582 | + diagonal.y * sozi_object->sin_angle); | |
583 | + /* cross product with the unit lenght vector that hold the width axe */ | |
584 | + height = fabs(diagonal.x * sozi_object->sin_angle - | |
585 | + diagonal.y * sozi_object->cos_angle); | |
586 | + /* compute the new size */ | |
587 | + if(sozi_object->aspect == ASPECT_FREE) { | |
588 | + sozi_object->width = width; | |
589 | + sozi_object->height = height; | |
590 | + } | |
591 | + else { | |
592 | + sozi_object->width = (((height * ratio) < width)?width:(height * ratio)); | |
593 | + sozi_object->height = (((width / ratio) < height)?height:(width / ratio)); | |
594 | + } | |
595 | + /* compute the new position */ | |
596 | + if(sozi_object->aspect == ASPECT_FREE) { | |
597 | + sozi_object->center.x = 0.5 * (dia_object->handles[i]->pos.x + to->x); | |
598 | + sozi_object->center.y = 0.5 * (dia_object->handles[i]->pos.y + to->y); | |
599 | + } | |
600 | + else { | |
601 | + /* FIXME : in FIXED aspect the behavior isn't userfriendly */ | |
602 | + static const real coefs [4][4] = | |
603 | + { | |
604 | + { 0.5,-0.5, 0.5, 0.5}, | |
605 | + { 0.5, 0.5, 0.5,-0.5}, | |
606 | + {-0.5, 0.5,-0.5,-0.5}, | |
607 | + {-0.5,-0.5,-0.5, 0.5}, | |
608 | + }; | |
609 | + sozi_object->center.x = dia_object->handles[i]->pos.x + | |
610 | + coefs[i][0] * sozi_object->width * sozi_object->cos_angle + | |
611 | + coefs[i][1] * sozi_object->height * sozi_object->sin_angle; | |
612 | + sozi_object->center.y = dia_object->handles[i]->pos.y + | |
613 | + coefs[i][2] * sozi_object->width * sozi_object->sin_angle + | |
614 | + coefs[i][3] * sozi_object->height * sozi_object->cos_angle; | |
615 | + } | |
616 | + } | |
617 | + } | |
618 | + sozi_object_update(sozi_object); | |
619 | + } | |
620 | + | |
621 | + return NULL; | |
622 | +} |
@@ -0,0 +1,141 @@ | ||
1 | +/* -*- c-basic-offset:4; -*- */ | |
2 | +/* Dia -- an diagram creation/manipulation program | |
3 | + * Copyright (C) 1999 Alexander Larsson | |
4 | + * | |
5 | + * Sozi objects support | |
6 | + * Copyright (C) 2015 Paul Chavent | |
7 | + * | |
8 | + * This program is free software; you can redistribute it and/or modify | |
9 | + * it under the terms of the GNU General Public License as published by | |
10 | + * the Free Software Foundation; either version 2 of the License, or | |
11 | + * (at your option) any later version. | |
12 | + * | |
13 | + * This program is distributed in the hope that it will be useful, | |
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | + * GNU General Public License for more details. | |
17 | + * | |
18 | + * You should have received a copy of the GNU General Public License | |
19 | + * along with this program; if not, write to the Free Software | |
20 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | + */ | |
22 | +#ifndef SOZI_OBJECT_H | |
23 | +#define SOZI_OBJECT_H | |
24 | + | |
25 | +#ifdef HAVE_CONFIG_H | |
26 | +#include <config.h> | |
27 | +#endif | |
28 | + | |
29 | +/* dia stuff */ | |
30 | +#include "object.h" | |
31 | +#include "diasvgrenderer.h" | |
32 | +#include "text.h" | |
33 | + | |
34 | +/** | |
35 | + * Common properties defines | |
36 | + */ | |
37 | +#define SOZI_OBJECT_LINE_WIDTH 0.01 | |
38 | + | |
39 | +/** | |
40 | + * A Sozi object is represented with a box with | |
41 | + * free or fixed aspect ratio. | |
42 | + */ | |
43 | +typedef enum | |
44 | +{ | |
45 | + ASPECT_FREE, | |
46 | + ASPECT_FIXED | |
47 | +} AspectType; | |
48 | + | |
49 | +/** | |
50 | + * Manage Sozi objects placement. | |
51 | + * | |
52 | + * This object hold the base geometry that manage | |
53 | + * other Sozi objects (frame,media, ...) placement. | |
54 | + * | |
55 | + * Could inherit struct _Element instead of DiaObject ? | |
56 | + * | |
57 | + * \extends _DiaObject | |
58 | + * | |
59 | + */ | |
60 | +typedef struct _SoziObject | |
61 | +{ | |
62 | + /* dia object inheritance */ | |
63 | + | |
64 | + DiaObject dia_object; | |
65 | + | |
66 | + /* geometry of the object */ | |
67 | + | |
68 | + Point center; | |
69 | + real width; | |
70 | + real height; | |
71 | + int angle; /* in degree , positive from x axis to y axis */ | |
72 | + AspectType aspect; | |
73 | + gboolean scale_from_center; | |
74 | + | |
75 | + /* geometry of the object : internal stuff */ | |
76 | + | |
77 | + real cos_angle; | |
78 | + real sin_angle; | |
79 | + | |
80 | + real m[6]; /* transformation matrix of the unit square */ | |
81 | + | |
82 | + Point corners[4]; /* corners of the object */ | |
83 | + | |
84 | + /* interactive rendering appearence */ | |
85 | + | |
86 | + struct | |
87 | + { | |
88 | + gboolean disp; | |
89 | + Text * text; | |
90 | + TextAttributes attrs; | |
91 | + } legend; | |
92 | + | |
93 | +} SoziObject; | |
94 | + | |
95 | +/** | |
96 | + * Initialize an already *allocated* object. | |
97 | + * @param[in] sozi_object pointer to object | |
98 | + * @param[in] center initial position of the object | |
99 | + */ | |
100 | +void sozi_object_init(SoziObject *sozi_object, Point *center); | |
101 | + | |
102 | +/** | |
103 | + * Cleanup the object. | |
104 | + * @param[in] sozi_object pointer to object | |
105 | + */ | |
106 | +void sozi_object_kill(SoziObject *sozi_object); | |
107 | + | |
108 | +/** | |
109 | + * Update the object. | |
110 | + * @param[in] sozi_object pointer to object | |
111 | + */ | |
112 | +void sozi_object_update(SoziObject *sozi_object); | |
113 | + | |
114 | +/** | |
115 | + * Helper function for the dia's DrawFunc | |
116 | + * @param[in] sozi_object pointer to object | |
117 | + * @param[in] svg_renderer | |
118 | + * @param[in] refif string describing the refid of the object | |
119 | + * @param[out] p_sozi_name_space a pointer to the sozi namespace pointer | |
120 | + * @param[out] p_root a pointer to the root element | |
121 | + * @param[out] p_rect a pointer to the sozi rect element | |
122 | + */ | |
123 | +void sozi_object_draw_svg(SoziObject *sozi_object, DiaSvgRenderer *svg_renderer, gchar * refid, xmlNs **p_sozi_name_space, xmlNodePtr * p_root, xmlNodePtr * p_rect); | |
124 | + | |
125 | +/** | |
126 | + * Helper function for the dia's MoveFunc | |
127 | + * @param[in] sozi_object pointer to object | |
128 | + * @param[in] to destination point pointer | |
129 | + */ | |
130 | +ObjectChange* sozi_object_move(SoziObject *sozi_object, Point *to); | |
131 | + | |
132 | +/** | |
133 | + * Helper function for the dia's MoveHandleFunc | |
134 | + * @param[in] sozi_object pointer to object | |
135 | + * ... | |
136 | + */ | |
137 | +ObjectChange* sozi_object_move_handle(SoziObject *sozi_object, Handle *handle, | |
138 | + Point *to, ConnectionPoint *cp, | |
139 | + HandleMoveReason reason, ModifierKeys modifiers); | |
140 | + | |
141 | +#endif /* SOZI_OBJECT_H */ |
@@ -0,0 +1,355 @@ | ||
1 | +#ifndef SOZI_PLAYER_H | |
2 | +#define SOZI_PLAYER_H | |
3 | + | |
4 | +static const char sozi_min_js[] = | |
5 | +"function namespace(b,d,a){var c=b;d.split(\".\").forEach(function(e){if(typeof c[e" | |
6 | +"]===\"undefined\"){c[e]={}}c=c[e]});if(a){a(c,b)}return c}namespace(this,\"sozi.eve" | |
7 | +"nts\",function(b){var a={};b.listen=function(c,d){if(!a.hasOwnProperty(c)){a[c]=[" | |
8 | +"]}a[c].push(d)};b.fire=function(d){var c=Array.prototype.slice.call(arguments,1)" | |
9 | +";if(a.hasOwnProperty(d)){a[d].forEach(function(e){e.apply(null,c)})}}});namespac" | |
10 | +"e(this,\"sozi.proto\",function(a){a.Object={installConstructors:function(){functio" | |
11 | +"n b(){}b.prototype=this;this.instance=function(){var c=new b();c.construct.apply" | |
12 | +"(c,arguments);return c};this.subtype=function(d){var c=new b();c.augment(d);c.in" | |
13 | +"stallConstructors();return c}},construct:function(){},augment:function(c){for(va" | |
14 | +"r b in c){if(c.hasOwnProperty(b)){this[b]=c[b]}}return this},bind:function(c){va" | |
15 | +"r b=this;return function(){return c.apply(b,arguments)}}};a.Object.installConstr" | |
16 | +"uctors()});namespace(this,\"sozi.actions\",function(A,g){var u=namespace(g,\"sozi.p" | |
17 | +"layer\");var v=namespace(g,\"sozi.display\");var n=g.document;var o=0;var w=1;var t" | |
18 | +"=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" | |
19 | +"iewPorts.player.zoom(C>0?t:1/t,B,D)}function x(B){u.stop();v.viewPorts.player.ro" | |
20 | +"tate(B>0?y:-y)}function s(){if(sozi.framelist.isVisible()){sozi.framelist.hide()" | |
21 | +";u.restart()}else{u.stop();sozi.framelist.show()}}function d(B){return v.viewPor" | |
22 | +"ts.player.contains(B.clientX,B.clientY)}function f(B){if(!d(B)){return}if(B.butt" | |
23 | +"on===o){n.documentElement.addEventListener(\"mousemove\",q,false);r=false;i=B.clie" | |
24 | +"ntX;h=B.clientY}else{if(B.button===w){s()}}B.stopPropagation();B.preventDefault(" | |
25 | +")}function q(B){if(!d(B)){return}u.stop();if(!r&&(Math.abs(B.clientX-i)>m||Math." | |
26 | +"abs(B.clientY-h)>m)){r=true}if(r){sozi.events.fire(\"sozi.player.cleanup\");v.view" | |
27 | +"Ports.player.drag(B.clientX-i,B.clientY-h);i=B.clientX;h=B.clientY}B.stopPropaga" | |
28 | +"tion()}function c(B){if(!d(B)){return}if(B.button===o){n.documentElement.removeE" | |
29 | +"ventListener(\"mousemove\",q,false)}B.stopPropagation();B.preventDefault()}functio" | |
30 | +"n p(B){if(!d(B)){return}u.moveToPrevious();B.stopPropagation();B.preventDefault(" | |
31 | +")}function e(B){if(!d(B)){return}if(!r&&B.button!==w){u.moveToNext()}B.stopPropa" | |
32 | +"gation();B.preventDefault()}function j(B){if(!d(B)){return}if(!B){B=g.event}var " | |
33 | +"C=0;if(B.wheelDelta){C=B.wheelDelta}else{if(B.detail){C=-B.detail}}if(C!==0){if(" | |
34 | +"B.shiftKey){x(C)}else{a(C,B.clientX,B.clientY)}}B.stopPropagation();B.preventDef" | |
35 | +"ault()}function l(B){if(B.altKey||B.ctrlKey||B.metaKey){return}switch(B.charCode" | |
36 | +"||B.which){case 43:a(1,g.innerWidth/2,g.innerHeight/2);break;case 45:a(-1,g.inne" | |
37 | +"rWidth/2,g.innerHeight/2);break;case 61:u.moveToCurrent();break;case 70:case 102" | |
38 | +":u.showAll();break;case 84:case 116:s();break;case 82:x(-1);break;case 114:x(1);" | |
39 | +"break;default:return}B.stopPropagation();B.preventDefault()}function b(B){if(B.a" | |
40 | +"ltKey||B.ctrlKey||B.metaKey){return}switch(B.keyCode){case 36:if(B.shiftKey){u.j" | |
41 | +"umpToFirst()}else{u.moveToFirst()}break;case 35:if(B.shiftKey){u.jumpToLast()}el" | |
42 | +"se{u.moveToLast()}break;case 38:case 33:case 37:if(B.shiftKey){u.jumpToPrevious(" | |
43 | +")}else{u.moveToPrevious()}break;case 40:case 34:case 39:case 13:case 32:if(B.shi" | |
44 | +"ftKey){u.jumpToNext()}else{u.moveToNext()}break;default:return}B.stopPropagation" | |
45 | +"();B.preventDefault()}function z(B){B.stopPropagation()}function k(){var C=n.get" | |
46 | +"ElementsByTagName(\"a\");for(var D=0;D<C.length;D+=1){C[D].addEventListener(\"click" | |
47 | +"\",z,false);C[D].addEventListener(\"contextmenu\",z,false)}var B=n.documentElement;" | |
48 | +"B.addEventListener(\"click\",e,false);B.addEventListener(\"mousedown\",f,false);B.ad" | |
49 | +"dEventListener(\"mouseup\",c,false);B.addEventListener(\"contextmenu\",p,false);B.ad" | |
50 | +"dEventListener(\"DOMMouseScroll\",j,false);g.onmousewheel=j;B.addEventListener(\"ke" | |
51 | +"ypress\",l,false);B.addEventListener(\"keydown\",b,false)}sozi.events.listen(\"sozi." | |
52 | +"display.ready\",k)});namespace(this,\"sozi.animation\",function(d,g){var h=g.mozReq" | |
53 | +"uestAnimationFrame||g.webkitRequestAnimationFrame||g.msRequestAnimationFrame||g." | |
54 | +"oRequestAnimationFrame;var k=function(){return g.performance&&g.performance.now?" | |
55 | +"g.performance.now():Date.now()};d.setAnimationFrameHandlers=function(l,m){h=l;k=" | |
56 | +"m};var i=40;var c;var j=[];function e(){if(j.length>0){if(h){h(e)}j.forEach(func" | |
57 | +"tion(l){l.step(k())})}else{if(!h){g.clearInterval(c)}}}function b(){if(h){h(e)}e" | |
58 | +"lse{c=g.setInterval(function(){e(k())},i)}}function a(l){j.push(l);if(j.length==" | |
59 | +"=1){b()}}function f(l){j.splice(j.indexOf(l),1)}d.Animator=sozi.proto.Object.sub" | |
60 | +"type({construct:function(){this.durationMs=0;this.data=null;this.initialTime=0;t" | |
61 | +"his.started=false},start:function(l,m){this.durationMs=l;this.data=m;this.initia" | |
62 | +"lTime=k();this.onStep(0);if(!this.started){this.started=true;a(this)}},stop:func" | |
63 | +"tion(){if(this.started){f(this);this.started=false}},step:function(m){var l=m-th" | |
64 | +"is.initialTime;if(l>=this.durationMs){this.stop();this.onStep(1);this.onDone()}e" | |
65 | +"lse{this.onStep(l/this.durationMs)}},onStep:function(l){},onDone:function(){}});" | |
66 | +"d.profiles={linear:function(l){return l},accelerate:function(l){return Math.pow(" | |
67 | +"l,3)},\"strong-accelerate\":function(l){return Math.pow(l,5)},decelerate:function(" | |
68 | +"l){return 1-Math.pow(1-l,3)},\"strong-decelerate\":function(l){return 1-Math.pow(1" | |
69 | +"-l,5)},\"accelerate-decelerate\":function(l){var m=l<=0.5?l:1-l,n=Math.pow(2*m,3)/" | |
70 | +"2;return l<=0.5?n:1-n},\"strong-accelerate-decelerate\":function(l){var m=l<=0.5?l" | |
71 | +":1-l,n=Math.pow(2*m,5)/2;return l<=0.5?n:1-n},\"decelerate-accelerate\":function(l" | |
72 | +"){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" | |
73 | +"lerate-accelerate\":function(l){var m=l<=0.5?l:1-l,n=(1-Math.pow(1-2*m,3))/2;retu" | |
74 | +"rn l<=0.5?n:1-n},\"immediate-beginning\":function(l){return 1},\"immediate-end\":fun" | |
75 | +"ction(l){return l===1?1:0},\"immediate-middle\":function(l){return l>=0.5?1:0}}});" | |
76 | +"namespace(this,\"sozi.display\",function(c,g){var f=\"http://www.w3.org/2000/svg\";v" | |
77 | +"ar b=\"http://www.w3.org/1999/xlink\";var i=g.document;var k;var h;var j;c.viewPor" | |
78 | +"ts={};var e;c.CameraState=sozi.proto.Object.subtype({construct:function(){this.c" | |
79 | +"x=this.cy=0;this.width=this.height=1;this.angle=0;this.clipped=true;this.transit" | |
80 | +"ionZoomPercent=0;this.transitionProfile=sozi.animation.profiles.linear;this.tran" | |
81 | +"sitionPath=null},setCenter:function(l,m){this.cx=l;this.cy=m;return this},setSiz" | |
82 | +"e:function(m,l){this.width=m;this.height=l;return this},setClipped:function(l){t" | |
83 | +"his.clipped=l;return this},setAngle:function(l){this.angle=(l+180)%360-180;retur" | |
84 | +"n this},setRawAngle:function(l){this.angle=l;return this},setTransitionZoomPerce" | |
85 | +"nt:function(l){this.transitionZoomPercent=l;return this},setTransitionProfile:fu" | |
86 | +"nction(l){this.transitionProfile=l;return this},setTransitionPath:function(l){th" | |
87 | +"is.transitionPath=l;return this},setAtElement:function(p){var s,o,t,m;if(p.nodeN" | |
88 | +"ame===\"rect\"){s=p.x.baseVal.value;o=p.y.baseVal.value;t=p.width.baseVal.value;m=" | |
89 | +"p.height.baseVal.value}else{var q=p.getBBox();s=q.x;o=q.y;t=q.width;m=q.height}v" | |
90 | +"ar n=i.documentElement.createSVGPoint();n.x=s+t/2;n.y=o+m/2;var r=p.getCTM();n=n" | |
91 | +".matrixTransform(r);var l=Math.sqrt(r.a*r.a+r.b*r.b);return this.setCenter(n.x,n" | |
92 | +".y).setSize(t*l,m*l).setAngle(Math.atan2(r.b,r.a)*180/Math.PI)},setAtState:funct" | |
93 | +"ion(l){return this.setCenter(l.cx,l.cy).setSize(l.width,l.height).setAngle(l.ang" | |
94 | +"le).setClipped(l.clipped).setTransitionZoomPercent(l.transitionZoomPercent).setT" | |
95 | +"ransitionProfile(l.transitionProfile).setTransitionPath(l.transitionPath)},inter" | |
96 | +"polatableAttributes:[\"width\",\"height\",\"angle\"],interpolate:function(n,o,t,v,r){v" | |
97 | +"ar p=1-t;for(var q=0;q<this.interpolatableAttributes.length;q+=1){var s=this.int" | |
98 | +"erpolatableAttributes[q];this[s]=o[s]*t+n[s]*p}var l=r?n.transitionPath:o.transi" | |
99 | +"tionPath;if(v&&l){var x=l.getTotalLength();if(r){var m=l.getPointAtLength(x);var" | |
100 | +" u=l.getPointAtLength(0);var w=l.getPointAtLength(x*p)}else{var m=l.getPointAtLe" | |
101 | +"ngth(0);var u=l.getPointAtLength(x);var w=l.getPointAtLength(x*t)}this.cx=w.x+(o" | |
102 | +".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*" | |
103 | +"t+n.cx*p;this.cy=o.cy*t+n.cy*p}}});c.Camera=c.CameraState.subtype({construct:fun" | |
104 | +"ction(n,o){c.CameraState.construct.call(this);this.viewPort=n;this.svgClipRect=i" | |
105 | +".createElementNS(f,\"rect\");var m=i.createElementNS(f,\"clipPath\");m.setAttribute(" | |
106 | +"\"id\",\"sozi-clip-path-\"+n.id+\"-\"+o);m.appendChild(this.svgClipRect);n.svgGroup.ap" | |
107 | +"pendChild(m);var l=i.createElementNS(f,\"g\");l.setAttribute(\"clip-path\",\"url(#soz" | |
108 | +"i-clip-path-\"+n.id+\"-\"+o+\")\");n.svgGroup.appendChild(l);if(n.isPrimary){this.svg" | |
109 | +"Layer=i.createElementNS(f,\"g\");this.svgLayer.appendChild(i.getElementById(o))}el" | |
110 | +"se{this.svgLayer=i.createElementNS(f,\"use\");this.svgLayer.setAttributeNS(b,\"href" | |
111 | +"\",\"#\"+o)}l.appendChild(this.svgLayer)},setAtState:function(l){return c.CameraSta" | |
112 | +"te.setAtState.call(this,l).update()},getScale:function(){return Math.min(this.vi" | |
113 | +"ewPort.width/this.width,this.viewPort.height/this.height)},rotate:function(l){re" | |
114 | +"turn this.setAngle(this.angle+l).update()},zoom:function(m,l,n){return this.setS" | |
115 | +"ize(this.width/m,this.height/m).drag((1-m)*(l-this.viewPort.width/2),(1-m)*(n-th" | |
116 | +"is.viewPort.height/2))},drag:function(m,l){var q=this.getScale();var o=this.angl" | |
117 | +"e*Math.PI/180;var n=Math.sin(o);var p=Math.cos(o);return this.setCenter(this.cx-" | |
118 | +"(m*p-l*n)/q,this.cy-(m*n+l*p)/q).setClipped(false).update()},update:function(){v" | |
119 | +"ar q=this.getScale();var n=this.width*q;var m=this.height*q;var l=(this.viewPort" | |
120 | +".width-n)/2;var r=(this.viewPort.height-m)/2;this.svgClipRect.setAttribute(\"x\",t" | |
121 | +"his.clipped?l:0);this.svgClipRect.setAttribute(\"y\",this.clipped?r:0);this.svgCli" | |
122 | +"pRect.setAttribute(\"width\",this.clipped?n:this.viewPort.width);this.svgClipRect." | |
123 | +"setAttribute(\"height\",this.clipped?m:this.viewPort.height);var p=-this.cx+this.w" | |
124 | +"idth/2+l/q;var o=-this.cy+this.height/2+r/q;this.svgLayer.setAttribute(\"transfor" | |
125 | +"m\",\"scale(\"+q+\")translate(\"+p+\",\"+o+\")rotate(\"+(-this.angle)+\",\"+this.cx+\",\"+thi" | |
126 | +"s.cy+\")\");return this}});c.ViewPort=sozi.proto.Object.subtype({construct:functio" | |
127 | +"n(n,m,l){this.id=n;c.viewPorts[n]=this;this.isPrimary=!!l;if(this.isPrimary){if(" | |
128 | +"e){throw\"Failed to create a primary viewport. A primary viewport already exists." | |
129 | +"\"}else{e=this}}this.svgGroup=i.createElementNS(f,\"g\");this.svgGroup.setAttribute" | |
130 | +"(\"class\",\"sozi-viewport\");this.svgGroup.setAttribute(\"id\",\"sozi-viewport-\"+n);i." | |
131 | +"documentElement.appendChild(this.svgGroup);this.setLocation(0,0).setSize(g.inner" | |
132 | +"Width,g.innerHeight);this.cameras={};m.forEach(function(o){this.cameras[o]=c.Cam" | |
133 | +"era.instance(this,o)},this)},setSize:function(m,l){this.width=m;this.height=l;re" | |
134 | +"turn this},setLocation:function(l,m){this.x=l;this.y=m;return this},contains:fun" | |
135 | +"ction(l,m){return l>=this.x&&l<this.x+this.width&&m>=this.y&&m<this.y+this.heigh" | |
136 | +"t},getDocumentState:function(){var m=c.CameraState.instance().setCenter(k.x+k.wi" | |
137 | +"dth/2,k.y+k.height/2).setSize(k.width,k.height).setClipped(false);var l={};for(v" | |
138 | +"ar n in this.cameras){l[n]=m}return l},update:function(){this.svgGroup.setAttrib" | |
139 | +"ute(\"transform\",\"translate(\"+this.x+\",\"+this.y+\")\");for(var l in this.cameras){t" | |
140 | +"his.cameras[l].update()}return this},showFrame:function(l){for(var m in l.states" | |
141 | +"){this.cameras[m].setAtState(l.states[m])}return this},drag:function(m,l){for(va" | |
142 | +"r n in this.cameras){this.cameras[n].drag(m,l)}return this},zoom:function(m,l,o)" | |
143 | +"{for(var n in this.cameras){this.cameras[n].zoom(m,l,o)}return this},rotate:func" | |
144 | +"tion(l){for(var m in this.cameras){this.cameras[m].rotate(l)}return this},onWind" | |
145 | +"owResize:function(m,l){this.setLocation(this.x*m,this.y*l).setSize(this.width*m," | |
146 | +"this.height*l).update()}});function d(){var l=i.documentElement;k=l.getBBox();h=" | |
147 | +"g.innerWidth;j=g.innerHeight;l.setAttribute(\"width\",h);l.setAttribute(\"height\",j" | |
148 | +");sozi.events.fire(\"sozi.display.ready\")}function a(){var l=i.documentElement;l." | |
149 | +"setAttribute(\"width\",g.innerWidth);l.setAttribute(\"height\",g.innerHeight);for(va" | |
150 | +"r m in c.viewPorts){c.viewPorts[m].onWindowResize(g.innerWidth/h,g.innerHeight/j" | |
151 | +")}h=g.innerWidth;j=g.innerHeight}sozi.events.listen(\"sozi.document.ready\",d);g.a" | |
152 | +"ddEventListener(\"resize\",a,false)});namespace(this,\"sozi.document\",function(c,e)" | |
153 | +"{var g=e.document;var b=\"http://sozi.baierouge.fr\";var d={title:\"Untitled\",seque" | |
154 | +"nce:\"0\",hide:\"true\",clip:\"true\",\"show-in-frame-list\":\"true\",\"timeout-enable\":\"fa" | |
155 | +"lse\",\"timeout-ms\":\"5000\",\"transition-duration-ms\":\"1000\",\"transition-zoom-percen" | |
156 | +"t\":\"0\",\"transition-profile\":\"linear\",\"transition-path-hide\":\"true\"};var h=[\"g\",\"" | |
157 | +"image\",\"path\",\"rect\",\"circle\",\"ellipse\",\"line\",\"polyline\",\"polygon\",\"text\",\"clip" | |
158 | +"path\"];c.frames=[];c.idLayerList=[];function j(l,k){return l.getAttributeNS(b,k)" | |
159 | +"||d[k]}function i(o,p,k){var l=o.states[p]=o.states[p]||sozi.display.CameraState" | |
160 | +".instance();if(typeof l.transitionZoomPercent===\"undefined\"||k.hasAttributeNS(b," | |
161 | +"\"transition-zoom-percent\")){l.setTransitionZoomPercent(parseInt(j(k,\"transition-" | |
162 | +"zoom-percent\"),10))}if(typeof l.transitionProfile===\"undefined\"||k.hasAttributeN" | |
163 | +"S(b,\"transition-profile\")){l.setTransitionProfile(sozi.animation.profiles[j(k,\"t" | |
164 | +"ransition-profile\")])}if(typeof l.transitionPath===\"undefined\"||k.hasAttributeNS" | |
165 | +"(b,\"transition-path\")){var n=g.getElementById(k.getAttributeNS(b,\"transition-pat" | |
166 | +"h\"));if(n&&n.nodeName===\"path\"){l.setTransitionPath(n);if(j(k,\"transition-path-h" | |
167 | +"ide\")===\"true\"){n.style.visibility=\"hidden\"}}}if(k.hasAttributeNS(b,\"refid\")){va" | |
168 | +"r m=g.getElementById(k.getAttributeNS(b,\"refid\"));if(m){l.setAtElement(m);if(j(k" | |
169 | +",\"hide\")===\"true\"){m.style.visibility=\"hidden\"}}}if(k.hasAttributeNS(b,\"clip\")){" | |
170 | +"l.setClipped(j(k,\"clip\")===\"true\")}}function a(){var l=[];var p=g.getElementsByT" | |
171 | +"agNameNS(b,\"layer\");for(var n=0;n<p.length;n+=1){var s=p[n].getAttributeNS(b,\"gr" | |
172 | +"oup\");if(s&&l.indexOf(s)===-1){l.push(s)}}var r=g.documentElement;var o=\"http://" | |
173 | +"www.w3.org/2000/svg\";var q=g.createElementNS(o,\"g\");var k=Array.prototype.slice." | |
174 | +"call(r.childNodes);k.forEach(function(u,t){if(!u.getAttribute){r.removeChild(u)}" | |
175 | +"else{if(l.indexOf(u.getAttribute(\"id\"))!==-1){if(q.firstChild){q.setAttribute(\"i" | |
176 | +"d\",\"sozi-wrapper-\"+t);c.idLayerList.push(\"sozi-wrapper-\"+t);r.insertBefore(q,u);" | |
177 | +"q=g.createElementNS(o,\"g\")}c.idLayerList.push(u.getAttribute(\"id\"))}else{if(h.in" | |
178 | +"dexOf(u.localName.toLowerCase())!==-1){r.removeChild(u);q.appendChild(u)}}}});if" | |
179 | +"(q.firstChild){q.setAttribute(\"id\",\"sozi-wrapper-\"+k.length);c.idLayerList.push(" | |
180 | +"\"sozi-wrapper-\"+k.length);r.appendChild(q)}var m=Array.prototype.slice.call(g.ge" | |
181 | +"tElementsByTagNameNS(b,\"frame\"));m.sort(function(u,t){var w=parseInt(j(u,\"sequen" | |
182 | +"ce\"),10);var v=parseInt(j(t,\"sequence\"),10);return w-v});m.forEach(function(v,u)" | |
183 | +"{var x={id:v.getAttribute(\"id\"),title:j(v,\"title\"),showInFrameList:j(v,\"show-in-" | |
184 | +"frame-list\")===\"true\",sequence:parseInt(j(v,\"sequence\"),10),timeoutEnable:j(v,\"t" | |
185 | +"imeout-enable\")===\"true\",timeoutMs:parseInt(j(v,\"timeout-ms\"),10),transitionDura" | |
186 | +"tionMs:parseInt(j(v,\"transition-duration-ms\"),10),states:{}};c.idLayerList.forEa" | |
187 | +"ch(function(A){if(u===0||A.search(\"sozi-wrapper-[0-9]+\")!==-1){i(x,A,v)}else{var" | |
188 | +" z=x.states[A]=sozi.display.CameraState.instance();var y=c.frames[c.frames.lengt" | |
189 | +"h-1].states[A];z.setAtState(y)}});var t=Array.prototype.slice.call(v.getElements" | |
190 | +"ByTagNameNS(b,\"layer\"));t.forEach(function(y){var z=y.getAttributeNS(b,\"group\");" | |
191 | +"if(z&&c.idLayerList.indexOf(z)!==-1){i(x,z,y)}});for(var w in x.states){if(x.sta" | |
192 | +"tes.hasOwnProperty(w)){c.frames.push(x);break}}})}c.getFrameIndexForId=function(" | |
193 | +"l){for(var k=0;k<c.frames.length;k+=1){if(c.frames[k].id===l){return k}}return -" | |
194 | +"1};function f(){g.documentElement.removeAttribute(\"viewBox\");a();sozi.events.fir" | |
195 | +"e(\"sozi.document.ready\")}e.addEventListener(\"load\",f,false)});namespace(this,\"so" | |
196 | +"zi.framelist\",function(u,k){var o=k.document;var c=5;var i;var p;var j=0;var h;v" | |
197 | +"ar s;var b;var v;var w;var t;var e=300;var f=\"decelerate\";var a=\"http://www.w3.o" | |
198 | +"rg/2000/svg\";function n(z){var x=z.relatedTarget,y=o.documentElement;while(x&&x!" | |
199 | +"==i&&x!==y){x=x.parentNode}if(x!==i){u.hide();sozi.player.restart();z.stopPropag" | |
200 | +"ation()}}function r(y){var x=p.getCTM().f;if(x<=-k.innerHeight/2){x+=k.innerHeig" | |
201 | +"ht/2}else{if(x<0){x=0}}p.setAttribute(\"transform\",\"translate(0,\"+x+\")\");y.stopPr" | |
202 | +"opagation()}function d(y){var x=p.getCTM().f;if(x+j>=k.innerHeight*3/2){x-=k.inn" | |
203 | +"erHeight/2}else{if(x+j>k.innerHeight+2*c){x=k.innerHeight-j-4*c}}p.setAttribute(" | |
204 | +"\"transform\",\"translate(0,\"+x+\")\");y.stopPropagation()}function g(x){return funct" | |
205 | +"ion(y){sozi.player.previewFrame(x);y.stopPropagation()}}function l(x){x.stopProp" | |
206 | +"agation()}function q(){i=o.createElementNS(a,\"g\");i.setAttribute(\"id\",\"sozi-toc\"" | |
207 | +");o.documentElement.appendChild(i);p=o.createElementNS(a,\"g\");i.appendChild(p);v" | |
208 | +"ar y=o.createElementNS(a,\"rect\");y.setAttribute(\"id\",\"sozi-toc-background\");y.se" | |
209 | +"tAttribute(\"x\",c);y.setAttribute(\"y\",c);y.setAttribute(\"rx\",c);y.setAttribute(\"r" | |
210 | +"y\",c);y.addEventListener(\"click\",l,false);y.addEventListener(\"mousedown\",l,false" | |
211 | +");y.addEventListener(\"mouseout\",n,false);p.appendChild(y);var A=0;sozi.document." | |
212 | +"frames.forEach(function(D,E){if(D.showInFrameList){var C=o.createElementNS(a,\"te" | |
213 | +"xt\");C.appendChild(o.createTextNode(D.title));C.setAttribute(\"id\",\"sozi-toc-\"+D." | |
214 | +"id);p.appendChild(C);if(E===sozi.player.currentFrameIndex){C.setAttribute(\"class" | |
215 | +"\",\"sozi-toc-current\")}var B=C.getBBox().width;j+=C.getBBox().height;if(B>A){A=B}" | |
216 | +"C.setAttribute(\"x\",2*c);C.setAttribute(\"y\",j+c);C.addEventListener(\"click\",g(E)," | |
217 | +"false);C.addEventListener(\"mousedown\",l,false)}});var x=o.createElementNS(a,\"pat" | |
218 | +"h\");x.setAttribute(\"class\",\"sozi-toc-arrow\");x.setAttribute(\"d\",\"M\"+(A+3*c)+\",\"+" | |
219 | +"(5*c)+\" l\"+(4*c)+\",0 l-\"+(2*c)+\",-\"+(3*c)+\" z\");x.addEventListener(\"click\",r,fal" | |
220 | +"se);x.addEventListener(\"mousedown\",l,false);i.appendChild(x);var z=o.createEleme" | |
221 | +"ntNS(a,\"path\");z.setAttribute(\"class\",\"sozi-toc-arrow\");z.setAttribute(\"d\",\"M\"+(" | |
222 | +"A+3*c)+\",\"+(7*c)+\" l\"+(4*c)+\",0 l-\"+(2*c)+\",\"+(3*c)+\" z\");z.addEventListener(\"cl" | |
223 | +"ick\",d,false);z.addEventListener(\"mousedown\",l,false);i.appendChild(z);y.setAttr" | |
224 | +"ibute(\"width\",A+7*c);y.setAttribute(\"height\",j+2*c);h=-A-9*c;s=0;w=v=h;i.setAttr" | |
225 | +"ibute(\"transform\",\"translate(\"+h+\",0)\");t=sozi.animation.Animator.instance().aug" | |
226 | +"ment({onStep:function(B){var D=sozi.animation.profiles[f](B),C=1-D;w=v*D+b*C;i.s" | |
227 | +"etAttribute(\"transform\",\"translate(\"+w+\",0)\")}})}function m(x){var y=Array.proto" | |
228 | +"type.slice.call(o.getElementsByClassName(\"sozi-toc-current\"));y.forEach(function" | |
229 | +"(A){A.removeAttribute(\"class\")});var z=sozi.document.frames[x];if(z.showInFrameL" | |
230 | +"ist){o.getElementById(\"sozi-toc-\"+z.id).setAttribute(\"class\",\"sozi-toc-current\")" | |
231 | +"}}u.show=function(){o.documentElement.appendChild(i);b=w;v=s;t.start(e)};u.hide=" | |
232 | +"function(){b=w;v=h;t.start(e)};u.isVisible=function(){return v===s};sozi.events." | |
233 | +"listen(\"sozi.player.ready\",q);sozi.events.listen(\"sozi.player.cleanup\",u.hide);s" | |
234 | +"ozi.events.listen(\"sozi.player.framechange\",m)});namespace(this,\"sozi.framenumbe" | |
235 | +"r\",function(a,d){var g=d.document;var e;var k,i;var f;var b=\"http://www.w3.org/2" | |
236 | +"000/svg\";function h(){var m=k.getBBox(),n=Math.max(m.width,m.height)*0.75,l=n*1." | |
237 | +"25;f.setAttribute(\"r\",n);e.setAttribute(\"transform\",\"translate(\"+l+\",\"+l+\")\")}fu" | |
238 | +"nction c(){e=g.createElementNS(b,\"g\");k=g.createElementNS(b,\"text\");f=g.createEl" | |
239 | +"ementNS(b,\"circle\");e.setAttribute(\"id\",\"sozi-framenumber\");f.setAttribute(\"cx\"," | |
240 | +"0);f.setAttribute(\"cy\",0);e.appendChild(f);i=g.createTextNode(sozi.player.curren" | |
241 | +"tFrameIndex+1);k.setAttribute(\"text-anchor\",\"middle\");k.setAttribute(\"dominant-b" | |
242 | +"aseline\",\"central\");k.setAttribute(\"x\",0);k.setAttribute(\"y\",0);k.appendChild(i)" | |
243 | +";e.appendChild(k);g.documentElement.appendChild(e);h()}function j(l){i.nodeValue" | |
244 | +"=l+1}sozi.events.listen(\"sozi.player.ready\",c);sozi.events.listen(\"sozi.player.f" | |
245 | +"ramechange\",j)});namespace(this,\"sozi.links\",function(c,e){var b=\"http://www.w3." | |
246 | +"org/2000/svg\";var a=\"http://www.w3.org/1999/xlink\";function f(g){return function" | |
247 | +"(h){sozi.player.moveToFrame(g);h.preventDefault();h.stopPropagation()}}function " | |
248 | +"d(){var h=e.document.getElementsByTagNameNS(b,\"a\");for(var j=0;j<h.length;j+=1){" | |
249 | +"var g=h[j].getAttributeNS(a,\"href\");if(g&&g[0]===\"#\"){h[j].addEventListener(\"cli" | |
250 | +"ck\",f(sozi.location.getFrameIndexForHash(g)),false)}}}sozi.events.listen(\"sozi.d" | |
251 | +"ocument.ready\",d)});namespace(this,\"sozi.location\",function(a,d){var b=false;a.g" | |
252 | +"etFrameIndex=function(){return a.getFrameIndexForHash(d.location.hash)};a.getFra" | |
253 | +"meIndexForHash=function(g){var h=g?g.slice(1):\"1\";var f;if(/^[0-9]+$/.test(h)){f" | |
254 | +"=parseInt(h,10)-1}else{f=sozi.document.getFrameIndexForId(h)}if(f<0){return 0}el" | |
255 | +"se{if(f>=sozi.document.frames.length){return sozi.document.frames.length-1}else{" | |
256 | +"return f}}};function e(){var f=a.getFrameIndex();if(!b){sozi.player.moveToFrame(" | |
257 | +"f)}b=false}function c(f){b=true;d.location.hash=\"#\"+sozi.document.frames[f].id}d" | |
258 | +".addEventListener(\"hashchange\",e,false);sozi.events.listen(\"sozi.player.framecha" | |
259 | +"nge\",c)});namespace(this,\"sozi.player\",function(d,g){var l;var c;var i;var e=500" | |
260 | +";var n=-10;var j=\"linear\";var f=0;d.currentFrameIndex=0;var k=false;var m=false;" | |
261 | +"function h(){if(sozi.document.frames[d.currentFrameIndex].timeoutEnable){m=true;" | |
262 | +"var o=(d.currentFrameIndex+1)%sozi.document.frames.length;i=g.setTimeout(functio" | |
263 | +"n(){d.moveToFrame(o)},sozi.document.frames[d.currentFrameIndex].timeoutMs)}}d.st" | |
264 | +"artFromIndex=function(o){k=true;m=false;f=o;d.currentFrameIndex=o;l.showFrame(so" | |
265 | +"zi.document.frames[o]);h()};d.restart=function(){d.startFromIndex(d.currentFrame" | |
266 | +"Index)};d.stop=function(){c.stop();if(m){g.clearTimeout(i);m=false}k=false;f=d.c" | |
267 | +"urrentFrameIndex};function b(o,y,w){var z={ss:((o<0)?Math.max(y,w):Math.min(y,w)" | |
268 | +")*(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" | |
269 | +"){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." | |
270 | +"ts/z.ts}return z}d.jumpToFrame=function(o){d.stop();sozi.events.fire(\"sozi.playe" | |
271 | +"r.cleanup\");f=o;d.currentFrameIndex=o;l.showFrame(sozi.document.frames[o]);sozi." | |
272 | +"events.fire(\"sozi.player.framechange\",o)};d.getAnimationData=function(o,q,s,p,v," | |
273 | +"t){var r={};for(var w in o){r[w]={initialState:sozi.display.CameraState.instance" | |
274 | +"(),finalState:sozi.display.CameraState.instance(),useTransitionPath:v,reverseTra" | |
275 | +"nsitionPath:t};r[w].profile=p||q[w].transitionProfile;r[w].initialState.setAtSta" | |
276 | +"te(o[w]);if(q.hasOwnProperty(w)){r[w].finalState.setAtState(q[w])}else{r[w].fina" | |
277 | +"lState.setAtState(o[w])}if(r[w].finalState.angle-r[w].initialState.angle>180){r[" | |
278 | +"w].finalState.setRawAngle(r[w].finalState.angle-360)}else{if(r[w].finalState.ang" | |
279 | +"le-r[w].initialState.angle<-180){r[w].initialState.setRawAngle(r[w].initialState" | |
280 | +".angle-360)}}var u=s||q[w].transitionZoomPercent;if(u&&q.hasOwnProperty(w)){r[w]" | |
281 | +".zoomWidth=b(u,o[w].width,q[w].width);r[w].zoomHeight=b(u,o[w].height,q[w].heigh" | |
282 | +"t)}}return r};d.previewFrame=function(o){d.currentFrameIndex=o;c.start(e,d.getAn" | |
283 | +"imationData(l.cameras,sozi.document.frames[o].states,n,sozi.animation.profiles[j" | |
284 | +"]),false,false);sozi.events.fire(\"sozi.player.framechange\",o)};d.moveToFrame=fun" | |
285 | +"ction(r){if(m){g.clearTimeout(i);m=false}var q,t,s,p,o;if(r===(d.currentFrameInd" | |
286 | +"ex-1)%sozi.document.frames.length){q=sozi.document.frames[d.currentFrameIndex].t" | |
287 | +"ransitionDurationMs;t=undefined;s=undefined;p=true;o=true}else{if(r===(d.current" | |
288 | +"FrameIndex+1)%sozi.document.frames.length){q=sozi.document.frames[r].transitionD" | |
289 | +"urationMs;t=undefined;s=undefined;p=true;o=false}else{q=e;t=n;s=sozi.animation.p" | |
290 | +"rofiles[j];p=false;o=false}}sozi.events.fire(\"sozi.player.cleanup\");k=true;d.cur" | |
291 | +"rentFrameIndex=r;c.start(q,d.getAnimationData(l.cameras,sozi.document.frames[r]." | |
292 | +"states,t,s,p,o));sozi.events.fire(\"sozi.player.framechange\",r)};d.jumpToFirst=fu" | |
293 | +"nction(){d.jumpToFrame(0)};d.moveToFirst=function(){d.moveToFrame(0)};d.jumpToPr" | |
294 | +"evious=function(){var o=d.currentFrameIndex;if(!c.started||f<=d.currentFrameInde" | |
295 | +"x){o-=1}if(o>=0){d.jumpToFrame(o)}};d.moveToPrevious=function(){for(var o=d.curr" | |
296 | +"entFrameIndex-1;o>=0;o-=1){var p=sozi.document.frames[o];if(!p.timeoutEnable||p." | |
297 | +"timeoutMs!==0){d.moveToFrame(o);break}}};d.jumpToNext=function(){var o=d.current" | |
298 | +"FrameIndex;if(!c.started||f>=d.currentFrameIndex){o+=1}if(o<sozi.document.frames" | |
299 | +".length){d.jumpToFrame(o)}};d.moveToNext=function(){if(d.currentFrameIndex<sozi." | |
300 | +"document.frames.length-1||sozi.document.frames[d.currentFrameIndex].timeoutEnabl" | |
301 | +"e){d.moveToFrame((d.currentFrameIndex+1)%sozi.document.frames.length)}};d.jumpTo" | |
302 | +"Last=function(){d.jumpToFrame(sozi.document.frames.length-1)};d.moveToLast=funct" | |
303 | +"ion(){d.moveToFrame(sozi.document.frames.length-1)};d.moveToCurrent=function(){d" | |
304 | +".moveToFrame(d.currentFrameIndex)};d.showAll=function(){d.stop();sozi.events.fir" | |
305 | +"e(\"sozi.player.cleanup\");c.start(e,d.getAnimationData(l.cameras,l.getDocumentSta" | |
306 | +"te(),n,sozi.animation.profiles[j],false,false))};function a(){l=sozi.display.Vie" | |
307 | +"wPort.instance(\"player\",sozi.document.idLayerList,true);d.startFromIndex(sozi.lo" | |
308 | +"cation.getFrameIndex());g.setTimeout(l.bind(l.update),1);sozi.events.fire(\"sozi." | |
309 | +"player.ready\")}d.onAnimationStep=function(o,q){for(var s in q){var p=l.cameras[s" | |
310 | +"];p.interpolate(q[s].initialState,q[s].finalState,q[s].profile(o),q[s].useTransi" | |
311 | +"tionPath,q[s].reverseTransitionPath);var r;if(q[s].zoomWidth&&q[s].zoomWidth.k!=" | |
312 | +"=0){r=o-q[s].zoomWidth.ts;p.width=q[s].zoomWidth.k*r*r+q[s].zoomWidth.ss}if(q[s]" | |
313 | +".zoomHeight&&q[s].zoomHeight.k!==0){r=o-q[s].zoomHeight.ts;p.height=q[s].zoomHei" | |
314 | +"ght.k*r*r+q[s].zoomHeight.ss}p.setClipped(q[s].finalState.clipped)}l.update()};c" | |
315 | +"=sozi.animation.Animator.instance().augment({onStep:function(o){d.onAnimationSte" | |
316 | +"p(o,this.data)},onDone:function(){for(var o in this.data){l.cameras[o].setAtStat" | |
317 | +"e(this.data[o].finalState)}l.update();f=d.currentFrameIndex;if(k){h()}}});sozi.e" | |
318 | +"vents.listen(\"sozi.display.ready\",a)});"; | |
319 | + | |
320 | +static const char sozi_extras_media_min_js[] = | |
321 | +"this.addEventListener(\"load\",function(){var h=\"http://www.w3.org/2000/svg\",l=\"ht" | |
322 | +"tp://sozi.baierouge.fr\",s=\"http://www.w3.org/1999/xhtml\",m=this,o=m.document,q=[" | |
323 | +"],r,e,d,c,p,a,g,f,b;function n(i){i.stopPropagation()}function t(i,j,k){sozi.eve" | |
324 | +"nts.listen(\"sozi.player.framechange\",function(u){var v=sozi.document.frames[u].i" | |
325 | +"d;if(v===j){i.play()}else{if(v===k){i.pause()}}})}q.push(o.getElementsByTagNameN" | |
326 | +"S(l,\"video\"));q.push(o.getElementsByTagNameNS(l,\"audio\"));r=[];for(c=0;c<q.lengt" | |
327 | +"h;c+=1){for(e=0;e<q[c].length;e+=1){p=q[c][e].parentNode;b=o.createElementNS(s,\"" | |
328 | +"source\");b.setAttribute(\"type\",q[c][e].getAttributeNS(l,\"type\"));b.setAttribute(" | |
329 | +"\"src\",q[c][e].getAttributeNS(l,\"src\"));for(d=0;d<r.length;d+=1){if(r[d].rect===p" | |
330 | +"){break}}if(d===r.length){p.setAttribute(\"visibility\",\"hidden\");f=o.createElemen" | |
331 | +"tNS(s,q[c][e].localName);f.setAttribute(\"controls\",\"controls\");if(q[c][e].localN" | |
332 | +"ame===\"video\"){f.setAttribute(\"width\",p.getAttribute(\"width\"));f.setAttribute(\"h" | |
333 | +"eight\",p.getAttribute(\"height\"))}f.addEventListener(\"click\",n,false);f.addEventL" | |
334 | +"istener(\"contextmenu\",n,false);g=o.createElementNS(s,\"html\");g.appendChild(f);a=" | |
335 | +"o.createElementNS(h,\"foreignObject\");a.setAttribute(\"x\",p.getAttribute(\"x\"));a.s" | |
336 | +"etAttribute(\"y\",p.getAttribute(\"y\"));a.setAttribute(\"width\",p.getAttribute(\"widt" | |
337 | +"h\"));a.setAttribute(\"height\",p.getAttribute(\"height\"));a.appendChild(g);p.parent" | |
338 | +"Node.insertBefore(a,p.nextSibling);if(q[c][e].hasAttributeNS(l,\"start-frame\")){t" | |
339 | +"(f,q[c][e].getAttributeNS(l,\"start-frame\"),q[c][e].getAttributeNS(l,\"stop-frame\"" | |
340 | +"))}r.push({rect:q[c][e].parentNode,htmlMedia:f})}r[d].htmlMedia.appendChild(b)}}" | |
341 | +"},false);"; | |
342 | + | |
343 | +static const char sozi_min_css[] = | |
344 | +"#sozi-toc text{fill:#eff;font-family:Verdana,sans-serif;font-size:12pt}#sozi-toc" | |
345 | +" text:hover{fill:#0cf;cursor:pointer}#sozi-toc text.sozi-toc-current{fill:#fa4}#" | |
346 | +"sozi-toc-background{stroke:#222;stroke-opacity:.1;stroke-width:10;fill:#222;fill" | |
347 | +"-opacity:.9}.sozi-toc-arrow{fill:#eff;fill-opacity:.75;stroke:none}.sozi-toc-arr" | |
348 | +"ow:hover{fill:#0cf}#sozi-framenumber circle{stroke:#222;stroke-opacity:.1;stroke" | |
349 | +"-width:4;fill:#222;fill-opacity:.9}#sozi-framenumber text{fill:#eff;font-family:" | |
350 | +"Verdana,sans-serif;font-size:12pt}"; | |
351 | + | |
352 | +static const char sozi_version[] = | |
353 | +"14.09-13143300"; | |
354 | + | |
355 | +#endif /* SOZI_PLAYER_H */ |
@@ -0,0 +1,47 @@ | ||
1 | +/* Dia -- an diagram creation/manipulation program | |
2 | + * Copyright (C) 1998 Alexander Larsson | |
3 | + * | |
4 | + * Sozi objects support | |
5 | + * Copyright (C) 2014 Paul Chavent | |
6 | + * | |
7 | + * This program is free software; you can redistribute it and/or modify | |
8 | + * it under the terms of the GNU General Public License as published by | |
9 | + * the Free Software Foundation; either version 2 of the License, or | |
10 | + * (at your option) any later version. | |
11 | + * | |
12 | + * This program is distributed in the hope that it will be useful, | |
13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | + * GNU General Public License for more details. | |
16 | + * | |
17 | + * You should have received a copy of the GNU General Public License | |
18 | + * along with this program; if not, write to the Free Software | |
19 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
20 | + */ | |
21 | + | |
22 | +#ifdef HAVE_CONFIG_H | |
23 | +#include <config.h> | |
24 | +#endif | |
25 | + | |
26 | +#include "object.h" | |
27 | + | |
28 | +#include "intl.h" | |
29 | +#include "plug-ins.h" | |
30 | + | |
31 | +extern DiaObjectType sozi_frame_type; | |
32 | +extern DiaObjectType sozi_media_type; | |
33 | + | |
34 | +DIA_PLUGIN_CHECK_INIT | |
35 | + | |
36 | +PluginInitResult | |
37 | +dia_plugin_init(PluginInfo *info) | |
38 | +{ | |
39 | + if (!dia_plugin_info_init(info, "Sozi",_("Sozi presentation objects"), | |
40 | + NULL, NULL)) | |
41 | + return DIA_PLUGIN_INIT_ERROR; | |
42 | + | |
43 | + object_register_type(&sozi_frame_type); | |
44 | + object_register_type(&sozi_media_type); | |
45 | + | |
46 | + return DIA_PLUGIN_INIT_OK; | |
47 | +} |
@@ -2,7 +2,7 @@ | ||
2 | 2 | |
3 | 3 | PLUGINS = aadl chronogram custom er flowchart fs grafcet \ |
4 | 4 | Istar Jackson Kaos misc network sadt standard uml \ |
5 | - Database custom_lines | |
5 | + Database Sozi custom_lines | |
6 | 6 | |
7 | 7 | #outdated: labels |
8 | 8 |
@@ -115,6 +115,16 @@ OBJECTS = \ | ||
115 | 115 | PKG_LINK = $(PKG_LINK) |
116 | 116 | !ENDIF |
117 | 117 | |
118 | +!IFDEF OBJ_Sozi | |
119 | +OBJECTS = \ | |
120 | + sozi.obj \ | |
121 | + sozi-frame.obj \ | |
122 | + sozi-media.obj \ | |
123 | + sozi-object.obj | |
124 | +PKG_LINK = $(PKG_LINK) $(LIBXML2_LIBS) \ | |
125 | + $(GTK2_LIBS) | |
126 | +!ENDIF | |
127 | + | |
118 | 128 | !IFDEF OBJ_eml |
119 | 129 | OBJECTS = \ |
120 | 130 | dbox.obj \ |
@@ -0,0 +1,358 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/"> | |
3 | + <dia:diagramdata> | |
4 | + <dia:attribute name="background"> | |
5 | + <dia:color val="#ffffffff"/> | |
6 | + </dia:attribute> | |
7 | + <dia:attribute name="pagebreak"> | |
8 | + <dia:color val="#000099ff"/> | |
9 | + </dia:attribute> | |
10 | + <dia:attribute name="paper"> | |
11 | + <dia:composite type="paper"> | |
12 | + <dia:attribute name="name"> | |
13 | + <dia:string>#Letter#</dia:string> | |
14 | + </dia:attribute> | |
15 | + <dia:attribute name="tmargin"> | |
16 | + <dia:real val="2.5399999618530273"/> | |
17 | + </dia:attribute> | |
18 | + <dia:attribute name="bmargin"> | |
19 | + <dia:real val="2.5399999618530273"/> | |
20 | + </dia:attribute> | |
21 | + <dia:attribute name="lmargin"> | |
22 | + <dia:real val="2.5399999618530273"/> | |
23 | + </dia:attribute> | |
24 | + <dia:attribute name="rmargin"> | |
25 | + <dia:real val="2.5399999618530273"/> | |
26 | + </dia:attribute> | |
27 | + <dia:attribute name="is_portrait"> | |
28 | + <dia:boolean val="true"/> | |
29 | + </dia:attribute> | |
30 | + <dia:attribute name="scaling"> | |
31 | + <dia:real val="1"/> | |
32 | + </dia:attribute> | |
33 | + <dia:attribute name="fitto"> | |
34 | + <dia:boolean val="false"/> | |
35 | + </dia:attribute> | |
36 | + </dia:composite> | |
37 | + </dia:attribute> | |
38 | + <dia:attribute name="grid"> | |
39 | + <dia:composite type="grid"> | |
40 | + <dia:attribute name="dynamic"> | |
41 | + <dia:boolean val="true"/> | |
42 | + </dia:attribute> | |
43 | + <dia:attribute name="width_x"> | |
44 | + <dia:real val="1"/> | |
45 | + </dia:attribute> | |
46 | + <dia:attribute name="width_y"> | |
47 | + <dia:real val="1"/> | |
48 | + </dia:attribute> | |
49 | + <dia:attribute name="visible_x"> | |
50 | + <dia:int val="1"/> | |
51 | + </dia:attribute> | |
52 | + <dia:attribute name="visible_y"> | |
53 | + <dia:int val="1"/> | |
54 | + </dia:attribute> | |
55 | + <dia:composite type="color"/> | |
56 | + </dia:composite> | |
57 | + </dia:attribute> | |
58 | + <dia:attribute name="color"> | |
59 | + <dia:color val="#d8e5e5ff"/> | |
60 | + </dia:attribute> | |
61 | + <dia:attribute name="guides"> | |
62 | + <dia:composite type="guides"> | |
63 | + <dia:attribute name="hguides"/> | |
64 | + <dia:attribute name="vguides"/> | |
65 | + </dia:composite> | |
66 | + </dia:attribute> | |
67 | + <dia:attribute name="display"> | |
68 | + <dia:composite type="display"> | |
69 | + <dia:attribute name="antialiased"> | |
70 | + <dia:boolean val="false"/> | |
71 | + </dia:attribute> | |
72 | + <dia:attribute name="snap-to-grid"> | |
73 | + <dia:boolean val="false"/> | |
74 | + </dia:attribute> | |
75 | + <dia:attribute name="snap-to-object"> | |
76 | + <dia:boolean val="true"/> | |
77 | + </dia:attribute> | |
78 | + <dia:attribute name="show-grid"> | |
79 | + <dia:boolean val="true"/> | |
80 | + </dia:attribute> | |
81 | + <dia:attribute name="show-connection-points"> | |
82 | + <dia:boolean val="true"/> | |
83 | + </dia:attribute> | |
84 | + </dia:composite> | |
85 | + </dia:attribute> | |
86 | + </dia:diagramdata> | |
87 | + <dia:layer name="Background" visible="true" connectable="true" active="true"> | |
88 | + <dia:object type="Standard - Polygon" version="0" id="O0"> | |
89 | + <dia:attribute name="obj_pos"> | |
90 | + <dia:point val="7.71064,7.04681"/> | |
91 | + </dia:attribute> | |
92 | + <dia:attribute name="obj_bb"> | |
93 | + <dia:rectangle val="7.38042,5.00225;12.7387,9.09137"/> | |
94 | + </dia:attribute> | |
95 | + <dia:attribute name="poly_points"> | |
96 | + <dia:point val="7.71064,7.04681"/> | |
97 | + <dia:point val="9.27661,6.8017"/> | |
98 | + <dia:point val="8.4936,5.82128"/> | |
99 | + <dia:point val="9.7464,6.43404"/> | |
100 | + <dia:point val="10.0596,5.20851"/> | |
101 | + <dia:point val="10.3727,6.43404"/> | |
102 | + <dia:point val="11.6255,5.82128"/> | |
103 | + <dia:point val="10.8425,6.8017"/> | |
104 | + <dia:point val="12.4085,7.04681"/> | |
105 | + <dia:point val="10.8425,7.29191"/> | |
106 | + <dia:point val="11.6255,8.27234"/> | |
107 | + <dia:point val="10.3727,7.65957"/> | |
108 | + <dia:point val="10.0596,8.88511"/> | |
109 | + <dia:point val="9.7464,7.65957"/> | |
110 | + <dia:point val="8.4936,8.27234"/> | |
111 | + <dia:point val="9.27661,7.29191"/> | |
112 | + </dia:attribute> | |
113 | + <dia:attribute name="line_width"> | |
114 | + <dia:real val="0.10212765957446809"/> | |
115 | + </dia:attribute> | |
116 | + <dia:attribute name="show_background"> | |
117 | + <dia:boolean val="true"/> | |
118 | + </dia:attribute> | |
119 | + </dia:object> | |
120 | + <dia:object type="Standard - Polygon" version="0" id="O1"> | |
121 | + <dia:attribute name="obj_pos"> | |
122 | + <dia:point val="3.6766,7.84683"/> | |
123 | + </dia:attribute> | |
124 | + <dia:attribute name="obj_bb"> | |
125 | + <dia:rectangle val="3.62554,6.43405;5.77021,8.57872"/> | |
126 | + </dia:attribute> | |
127 | + <dia:attribute name="poly_points"> | |
128 | + <dia:point val="3.6766,7.84683"/> | |
129 | + <dia:point val="3.6766,7.16594"/> | |
130 | + <dia:point val="4.35745,7.16594"/> | |
131 | + <dia:point val="4.35745,6.48511"/> | |
132 | + <dia:point val="5.0383,6.48511"/> | |
133 | + <dia:point val="5.0383,7.16594"/> | |
134 | + <dia:point val="5.71915,7.16594"/> | |
135 | + <dia:point val="5.71915,7.84683"/> | |
136 | + <dia:point val="5.0383,7.84683"/> | |
137 | + <dia:point val="5.0383,8.52766"/> | |
138 | + <dia:point val="4.35745,8.52766"/> | |
139 | + <dia:point val="4.35745,7.84683"/> | |
140 | + </dia:attribute> | |
141 | + <dia:attribute name="line_width"> | |
142 | + <dia:real val="0.10212765957446809"/> | |
143 | + </dia:attribute> | |
144 | + <dia:attribute name="show_background"> | |
145 | + <dia:boolean val="true"/> | |
146 | + </dia:attribute> | |
147 | + </dia:object> | |
148 | + <dia:object type="Standard - Polygon" version="0" id="O2"> | |
149 | + <dia:attribute name="obj_pos"> | |
150 | + <dia:point val="8.98723,2.75745"/> | |
151 | + </dia:attribute> | |
152 | + <dia:attribute name="obj_bb"> | |
153 | + <dia:rectangle val="8.91502,1.66395;11.102,3.85094"/> | |
154 | + </dia:attribute> | |
155 | + <dia:attribute name="poly_points"> | |
156 | + <dia:point val="8.98723,2.75745"/> | |
157 | + <dia:point val="9.27901,2.46565"/> | |
158 | + <dia:point val="9.27901,2.02796"/> | |
159 | + <dia:point val="9.71673,2.02796"/> | |
160 | + <dia:point val="10.0085,1.73617"/> | |
161 | + <dia:point val="10.3003,2.02796"/> | |
162 | + <dia:point val="10.738,2.02796"/> | |
163 | + <dia:point val="10.738,2.46565"/> | |
164 | + <dia:point val="11.0298,2.75745"/> | |
165 | + <dia:point val="10.738,3.04924"/> | |
166 | + <dia:point val="10.738,3.48693"/> | |
167 | + <dia:point val="10.3003,3.48693"/> | |
168 | + <dia:point val="10.0085,3.77872"/> | |
169 | + <dia:point val="9.71673,3.48693"/> | |
170 | + <dia:point val="9.27901,3.48693"/> | |
171 | + <dia:point val="9.27901,3.04924"/> | |
172 | + </dia:attribute> | |
173 | + <dia:attribute name="line_width"> | |
174 | + <dia:real val="0.10212765957446809"/> | |
175 | + </dia:attribute> | |
176 | + <dia:attribute name="show_background"> | |
177 | + <dia:boolean val="true"/> | |
178 | + </dia:attribute> | |
179 | + </dia:object> | |
180 | + <dia:object type="Sozi - Frame" version="0" id="O3"> | |
181 | + <dia:attribute name="obj_pos"> | |
182 | + <dia:point val="12.25,6.325"/> | |
183 | + </dia:attribute> | |
184 | + <dia:attribute name="obj_bb"> | |
185 | + <dia:rectangle val="4.69,2.74;19.81,9.91"/> | |
186 | + </dia:attribute> | |
187 | + <dia:attribute name="meta"> | |
188 | + <dia:composite type="dict"/> | |
189 | + </dia:attribute> | |
190 | + <dia:attribute name="x"> | |
191 | + <dia:real val="12.250000000000004"/> | |
192 | + </dia:attribute> | |
193 | + <dia:attribute name="y"> | |
194 | + <dia:real val="6.3250000000000002"/> | |
195 | + </dia:attribute> | |
196 | + <dia:attribute name="width"> | |
197 | + <dia:real val="15.100000000000001"/> | |
198 | + </dia:attribute> | |
199 | + <dia:attribute name="height"> | |
200 | + <dia:real val="7.1500000000000004"/> | |
201 | + </dia:attribute> | |
202 | + <dia:attribute name="angle"> | |
203 | + <dia:int val="0"/> | |
204 | + </dia:attribute> | |
205 | + <dia:attribute name="aspect"> | |
206 | + <dia:enum val="0"/> | |
207 | + </dia:attribute> | |
208 | + <dia:attribute name="scale_from_center"> | |
209 | + <dia:boolean val="false"/> | |
210 | + </dia:attribute> | |
211 | + <dia:attribute name="legend_disp"> | |
212 | + <dia:boolean val="true"/> | |
213 | + </dia:attribute> | |
214 | + <dia:attribute name="legend"> | |
215 | + <dia:composite type="text"> | |
216 | + <dia:attribute name="string"> | |
217 | + <dia:string>##1 : frame#</dia:string> | |
218 | + </dia:attribute> | |
219 | + <dia:attribute name="font"> | |
220 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
221 | + </dia:attribute> | |
222 | + <dia:attribute name="height"> | |
223 | + <dia:real val="0.80000000000000004"/> | |
224 | + </dia:attribute> | |
225 | + <dia:attribute name="pos"> | |
226 | + <dia:point val="4.7,3.345"/> | |
227 | + </dia:attribute> | |
228 | + <dia:attribute name="color"> | |
229 | + <dia:color val="#000000ff"/> | |
230 | + </dia:attribute> | |
231 | + <dia:attribute name="alignment"> | |
232 | + <dia:enum val="0"/> | |
233 | + </dia:attribute> | |
234 | + </dia:composite> | |
235 | + </dia:attribute> | |
236 | + <dia:attribute name="frame_sequence"> | |
237 | + <dia:int val="1"/> | |
238 | + </dia:attribute> | |
239 | + <dia:attribute name="frame_title"> | |
240 | + <dia:string>#frame#</dia:string> | |
241 | + </dia:attribute> | |
242 | + <dia:attribute name="frame_hide"> | |
243 | + <dia:boolean val="false"/> | |
244 | + </dia:attribute> | |
245 | + <dia:attribute name="frame_clip"> | |
246 | + <dia:boolean val="true"/> | |
247 | + </dia:attribute> | |
248 | + <dia:attribute name="frame_timeout_enable"> | |
249 | + <dia:boolean val="false"/> | |
250 | + </dia:attribute> | |
251 | + <dia:attribute name="frame_timeout_ms"> | |
252 | + <dia:int val="5000"/> | |
253 | + </dia:attribute> | |
254 | + <dia:attribute name="frame_transition_profile"> | |
255 | + <dia:enum val="0"/> | |
256 | + </dia:attribute> | |
257 | + <dia:attribute name="frame_transition_duration_ms"> | |
258 | + <dia:int val="1000"/> | |
259 | + </dia:attribute> | |
260 | + </dia:object> | |
261 | + <dia:object type="Standard - Text" version="1" id="O4"> | |
262 | + <dia:attribute name="obj_pos"> | |
263 | + <dia:point val="14,5.05"/> | |
264 | + </dia:attribute> | |
265 | + <dia:attribute name="obj_bb"> | |
266 | + <dia:rectangle val="14,4.455;19.085,7.6"/> | |
267 | + </dia:attribute> | |
268 | + <dia:attribute name="text"> | |
269 | + <dia:composite type="text"> | |
270 | + <dia:attribute name="string"> | |
271 | + <dia:string>#the outside | |
272 | +part of those | |
273 | +shape shouldn't | |
274 | +be visible#</dia:string> | |
275 | + </dia:attribute> | |
276 | + <dia:attribute name="font"> | |
277 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
278 | + </dia:attribute> | |
279 | + <dia:attribute name="height"> | |
280 | + <dia:real val="0.80000000000000004"/> | |
281 | + </dia:attribute> | |
282 | + <dia:attribute name="pos"> | |
283 | + <dia:point val="14,5.05"/> | |
284 | + </dia:attribute> | |
285 | + <dia:attribute name="color"> | |
286 | + <dia:color val="#000000ff"/> | |
287 | + </dia:attribute> | |
288 | + <dia:attribute name="alignment"> | |
289 | + <dia:enum val="0"/> | |
290 | + </dia:attribute> | |
291 | + </dia:composite> | |
292 | + </dia:attribute> | |
293 | + <dia:attribute name="valign"> | |
294 | + <dia:enum val="3"/> | |
295 | + </dia:attribute> | |
296 | + </dia:object> | |
297 | + <dia:object type="Standard - Arc" version="0" id="O5"> | |
298 | + <dia:attribute name="obj_pos"> | |
299 | + <dia:point val="15.9,7.95"/> | |
300 | + </dia:attribute> | |
301 | + <dia:attribute name="obj_bb"> | |
302 | + <dia:rectangle val="5.74433,7.52288;15.926,9.70077"/> | |
303 | + </dia:attribute> | |
304 | + <dia:attribute name="conn_endpoints"> | |
305 | + <dia:point val="15.9,7.95"/> | |
306 | + <dia:point val="5.7703,7.54885"/> | |
307 | + </dia:attribute> | |
308 | + <dia:attribute name="curve_distance"> | |
309 | + <dia:real val="-1.9218580617030492"/> | |
310 | + </dia:attribute> | |
311 | + <dia:attribute name="line_width"> | |
312 | + <dia:real val="0.05000000074505806"/> | |
313 | + </dia:attribute> | |
314 | + <dia:attribute name="end_arrow"> | |
315 | + <dia:enum val="1"/> | |
316 | + </dia:attribute> | |
317 | + <dia:attribute name="end_arrow_length"> | |
318 | + <dia:real val="0.5"/> | |
319 | + </dia:attribute> | |
320 | + <dia:attribute name="end_arrow_width"> | |
321 | + <dia:real val="0.5"/> | |
322 | + </dia:attribute> | |
323 | + <dia:connections> | |
324 | + <dia:connection handle="1" to="O1" connection="24"/> | |
325 | + </dia:connections> | |
326 | + </dia:object> | |
327 | + <dia:object type="Standard - Arc" version="0" id="O6"> | |
328 | + <dia:attribute name="obj_pos"> | |
329 | + <dia:point val="16.15,4.3"/> | |
330 | + </dia:attribute> | |
331 | + <dia:attribute name="obj_bb"> | |
332 | + <dia:rectangle val="10.8516,2.67997;16.1803,4.33034"/> | |
333 | + </dia:attribute> | |
334 | + <dia:attribute name="conn_endpoints"> | |
335 | + <dia:point val="16.15,4.3"/> | |
336 | + <dia:point val="10.8819,2.97681"/> | |
337 | + </dia:attribute> | |
338 | + <dia:attribute name="curve_distance"> | |
339 | + <dia:real val="0.35109460505000434"/> | |
340 | + </dia:attribute> | |
341 | + <dia:attribute name="line_width"> | |
342 | + <dia:real val="0.05000000074505806"/> | |
343 | + </dia:attribute> | |
344 | + <dia:attribute name="end_arrow"> | |
345 | + <dia:enum val="1"/> | |
346 | + </dia:attribute> | |
347 | + <dia:attribute name="end_arrow_length"> | |
348 | + <dia:real val="0.5"/> | |
349 | + </dia:attribute> | |
350 | + <dia:attribute name="end_arrow_width"> | |
351 | + <dia:real val="0.5"/> | |
352 | + </dia:attribute> | |
353 | + <dia:connections> | |
354 | + <dia:connection handle="1" to="O2" connection="32"/> | |
355 | + </dia:connections> | |
356 | + </dia:object> | |
357 | + </dia:layer> | |
358 | +</dia:diagram> |
@@ -0,0 +1,695 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/"> | |
3 | + <dia:diagramdata> | |
4 | + <dia:attribute name="background"> | |
5 | + <dia:color val="#ffffffff"/> | |
6 | + </dia:attribute> | |
7 | + <dia:attribute name="pagebreak"> | |
8 | + <dia:color val="#000099ff"/> | |
9 | + </dia:attribute> | |
10 | + <dia:attribute name="paper"> | |
11 | + <dia:composite type="paper"> | |
12 | + <dia:attribute name="name"> | |
13 | + <dia:string>#Letter#</dia:string> | |
14 | + </dia:attribute> | |
15 | + <dia:attribute name="tmargin"> | |
16 | + <dia:real val="2.5399999618530273"/> | |
17 | + </dia:attribute> | |
18 | + <dia:attribute name="bmargin"> | |
19 | + <dia:real val="2.5399999618530273"/> | |
20 | + </dia:attribute> | |
21 | + <dia:attribute name="lmargin"> | |
22 | + <dia:real val="2.5399999618530273"/> | |
23 | + </dia:attribute> | |
24 | + <dia:attribute name="rmargin"> | |
25 | + <dia:real val="2.5399999618530273"/> | |
26 | + </dia:attribute> | |
27 | + <dia:attribute name="is_portrait"> | |
28 | + <dia:boolean val="true"/> | |
29 | + </dia:attribute> | |
30 | + <dia:attribute name="scaling"> | |
31 | + <dia:real val="1"/> | |
32 | + </dia:attribute> | |
33 | + <dia:attribute name="fitto"> | |
34 | + <dia:boolean val="false"/> | |
35 | + </dia:attribute> | |
36 | + </dia:composite> | |
37 | + </dia:attribute> | |
38 | + <dia:attribute name="grid"> | |
39 | + <dia:composite type="grid"> | |
40 | + <dia:attribute name="dynamic"> | |
41 | + <dia:boolean val="true"/> | |
42 | + </dia:attribute> | |
43 | + <dia:attribute name="width_x"> | |
44 | + <dia:real val="1"/> | |
45 | + </dia:attribute> | |
46 | + <dia:attribute name="width_y"> | |
47 | + <dia:real val="1"/> | |
48 | + </dia:attribute> | |
49 | + <dia:attribute name="visible_x"> | |
50 | + <dia:int val="1"/> | |
51 | + </dia:attribute> | |
52 | + <dia:attribute name="visible_y"> | |
53 | + <dia:int val="1"/> | |
54 | + </dia:attribute> | |
55 | + <dia:composite type="color"/> | |
56 | + </dia:composite> | |
57 | + </dia:attribute> | |
58 | + <dia:attribute name="color"> | |
59 | + <dia:color val="#d8e5e5ff"/> | |
60 | + </dia:attribute> | |
61 | + <dia:attribute name="guides"> | |
62 | + <dia:composite type="guides"> | |
63 | + <dia:attribute name="hguides"/> | |
64 | + <dia:attribute name="vguides"/> | |
65 | + </dia:composite> | |
66 | + </dia:attribute> | |
67 | + <dia:attribute name="display"> | |
68 | + <dia:composite type="display"> | |
69 | + <dia:attribute name="antialiased"> | |
70 | + <dia:boolean val="false"/> | |
71 | + </dia:attribute> | |
72 | + <dia:attribute name="snap-to-grid"> | |
73 | + <dia:boolean val="false"/> | |
74 | + </dia:attribute> | |
75 | + <dia:attribute name="snap-to-object"> | |
76 | + <dia:boolean val="true"/> | |
77 | + </dia:attribute> | |
78 | + <dia:attribute name="show-grid"> | |
79 | + <dia:boolean val="true"/> | |
80 | + </dia:attribute> | |
81 | + <dia:attribute name="show-connection-points"> | |
82 | + <dia:boolean val="true"/> | |
83 | + </dia:attribute> | |
84 | + </dia:composite> | |
85 | + </dia:attribute> | |
86 | + </dia:diagramdata> | |
87 | + <dia:layer name="Background" visible="true" connectable="true"> | |
88 | + <dia:object type="Standard - Beziergon" version="0" id="O0"> | |
89 | + <dia:attribute name="obj_pos"> | |
90 | + <dia:point val="2.0094,9.33686"/> | |
91 | + </dia:attribute> | |
92 | + <dia:attribute name="obj_bb"> | |
93 | + <dia:rectangle val="1.03497,8.41749;11.9087,17.8212"/> | |
94 | + </dia:attribute> | |
95 | + <dia:attribute name="bez_points"> | |
96 | + <dia:point val="2.0094,9.33686"/> | |
97 | + <dia:point val="3.67597,7.51163"/> | |
98 | + <dia:point val="11.6386,8.57107"/> | |
99 | + <dia:point val="11.8997,11.0594"/> | |
100 | + <dia:point val="12.1609,13.5477"/> | |
101 | + <dia:point val="6.30133,19.7177"/> | |
102 | + <dia:point val="3.50928,17.2484"/> | |
103 | + <dia:point val="0.797517,14.85"/> | |
104 | + <dia:point val="0.342829,11.162"/> | |
105 | + </dia:attribute> | |
106 | + <dia:attribute name="corner_types"> | |
107 | + <dia:enum val="2"/> | |
108 | + <dia:enum val="2"/> | |
109 | + <dia:enum val="2"/> | |
110 | + <dia:enum val="2"/> | |
111 | + </dia:attribute> | |
112 | + <dia:attribute name="line_color"> | |
113 | + <dia:color val="#ff6600ff"/> | |
114 | + </dia:attribute> | |
115 | + <dia:attribute name="line_width"> | |
116 | + <dia:real val="0.0010011641443538998"/> | |
117 | + </dia:attribute> | |
118 | + <dia:attribute name="inner_color"> | |
119 | + <dia:color val="#ff6600ff"/> | |
120 | + </dia:attribute> | |
121 | + <dia:attribute name="show_background"> | |
122 | + <dia:boolean val="true"/> | |
123 | + </dia:attribute> | |
124 | + </dia:object> | |
125 | + <dia:object type="Standard - Beziergon" version="0" id="O1"> | |
126 | + <dia:attribute name="obj_pos"> | |
127 | + <dia:point val="4.22411,0.76579"/> | |
128 | + </dia:attribute> | |
129 | + <dia:attribute name="obj_bb"> | |
130 | + <dia:rectangle val="1.73616,0.762159;7.91506,6.2939"/> | |
131 | + </dia:attribute> | |
132 | + <dia:attribute name="bez_points"> | |
133 | + <dia:point val="4.22411,0.76579"/> | |
134 | + <dia:point val="5.64927,0.642147"/> | |
135 | + <dia:point val="8.62423,4.2153"/> | |
136 | + <dia:point val="7.75982,5.37715"/> | |
137 | + <dia:point val="6.89532,6.5391"/> | |
138 | + <dia:point val="1.98121,6.86869"/> | |
139 | + <dia:point val="1.76066,4.72249"/> | |
140 | + <dia:point val="1.54643,2.63807"/> | |
141 | + <dia:point val="2.79883,0.889534"/> | |
142 | + </dia:attribute> | |
143 | + <dia:attribute name="corner_types"> | |
144 | + <dia:enum val="2"/> | |
145 | + <dia:enum val="2"/> | |
146 | + <dia:enum val="2"/> | |
147 | + <dia:enum val="2"/> | |
148 | + </dia:attribute> | |
149 | + <dia:attribute name="line_color"> | |
150 | + <dia:color val="#ddafe9ff"/> | |
151 | + </dia:attribute> | |
152 | + <dia:attribute name="line_width"> | |
153 | + <dia:real val="0.0010011641443538998"/> | |
154 | + </dia:attribute> | |
155 | + <dia:attribute name="inner_color"> | |
156 | + <dia:color val="#ddafe9ff"/> | |
157 | + </dia:attribute> | |
158 | + <dia:attribute name="show_background"> | |
159 | + <dia:boolean val="true"/> | |
160 | + </dia:attribute> | |
161 | + </dia:object> | |
162 | + <dia:object type="Standard - Beziergon" version="0" id="O2"> | |
163 | + <dia:attribute name="obj_pos"> | |
164 | + <dia:point val="9.34967,23.3697"/> | |
165 | + </dia:attribute> | |
166 | + <dia:attribute name="obj_bb"> | |
167 | + <dia:rectangle val="9.23625,12.3391;22.535,27.62"/> | |
168 | + </dia:attribute> | |
169 | + <dia:attribute name="bez_points"> | |
170 | + <dia:point val="9.34967,23.3697"/> | |
171 | + <dia:point val="8.27833,20.0668"/> | |
172 | + <dia:point val="15.1025,11.079"/> | |
173 | + <dia:point val="18.3225,12.4883"/> | |
174 | + <dia:point val="21.5424,13.8977"/> | |
175 | + <dia:point val="25.0074,25.3385"/> | |
176 | + <dia:point val="20.0527,27.0328"/> | |
177 | + <dia:point val="15.2404,28.6786"/> | |
178 | + <dia:point val="10.421,26.6724"/> | |
179 | + </dia:attribute> | |
180 | + <dia:attribute name="corner_types"> | |
181 | + <dia:enum val="2"/> | |
182 | + <dia:enum val="2"/> | |
183 | + <dia:enum val="2"/> | |
184 | + <dia:enum val="2"/> | |
185 | + </dia:attribute> | |
186 | + <dia:attribute name="line_color"> | |
187 | + <dia:color val="#ffcc00ff"/> | |
188 | + </dia:attribute> | |
189 | + <dia:attribute name="line_width"> | |
190 | + <dia:real val="0.0010011641443538998"/> | |
191 | + </dia:attribute> | |
192 | + <dia:attribute name="inner_color"> | |
193 | + <dia:color val="#ffcc00ff"/> | |
194 | + </dia:attribute> | |
195 | + <dia:attribute name="show_background"> | |
196 | + <dia:boolean val="true"/> | |
197 | + </dia:attribute> | |
198 | + </dia:object> | |
199 | + <dia:object type="Standard - Beziergon" version="0" id="O3"> | |
200 | + <dia:attribute name="obj_pos"> | |
201 | + <dia:point val="35.8762,20.9047"/> | |
202 | + </dia:attribute> | |
203 | + <dia:attribute name="obj_bb"> | |
204 | + <dia:rectangle val="23.4,5.16355;41.4764,20.9881"/> | |
205 | + </dia:attribute> | |
206 | + <dia:attribute name="bez_points"> | |
207 | + <dia:point val="35.8762,20.9047"/> | |
208 | + <dia:point val="31.88,21.9304"/> | |
209 | + <dia:point val="21.7272,13.1713"/> | |
210 | + <dia:point val="23.6373,9.45712"/> | |
211 | + <dia:point val="25.5474,5.743"/> | |
212 | + <dia:point val="39.372,2.48231"/> | |
213 | + <dia:point val="41.0141,8.48358"/> | |
214 | + <dia:point val="42.6089,14.3126"/> | |
215 | + <dia:point val="39.8726,19.8791"/> | |
216 | + </dia:attribute> | |
217 | + <dia:attribute name="corner_types"> | |
218 | + <dia:enum val="2"/> | |
219 | + <dia:enum val="2"/> | |
220 | + <dia:enum val="2"/> | |
221 | + <dia:enum val="2"/> | |
222 | + </dia:attribute> | |
223 | + <dia:attribute name="line_color"> | |
224 | + <dia:color val="#00ccffff"/> | |
225 | + </dia:attribute> | |
226 | + <dia:attribute name="line_width"> | |
227 | + <dia:real val="0.0010011641443538998"/> | |
228 | + </dia:attribute> | |
229 | + <dia:attribute name="inner_color"> | |
230 | + <dia:color val="#00ccffff"/> | |
231 | + </dia:attribute> | |
232 | + <dia:attribute name="show_background"> | |
233 | + <dia:boolean val="true"/> | |
234 | + </dia:attribute> | |
235 | + </dia:object> | |
236 | + <dia:object type="Standard - Text" version="1" id="O4"> | |
237 | + <dia:attribute name="obj_pos"> | |
238 | + <dia:point val="4.6,3.7"/> | |
239 | + </dia:attribute> | |
240 | + <dia:attribute name="obj_bb"> | |
241 | + <dia:rectangle val="3.70125,2.05625;5.49875,5.34375"/> | |
242 | + </dia:attribute> | |
243 | + <dia:attribute name="text"> | |
244 | + <dia:composite type="text"> | |
245 | + <dia:attribute name="string"> | |
246 | + <dia:string>#1#</dia:string> | |
247 | + </dia:attribute> | |
248 | + <dia:attribute name="font"> | |
249 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
250 | + </dia:attribute> | |
251 | + <dia:attribute name="height"> | |
252 | + <dia:real val="3.5321847480686248"/> | |
253 | + </dia:attribute> | |
254 | + <dia:attribute name="pos"> | |
255 | + <dia:point val="4.6,4.67875"/> | |
256 | + </dia:attribute> | |
257 | + <dia:attribute name="color"> | |
258 | + <dia:color val="#000000ff"/> | |
259 | + </dia:attribute> | |
260 | + <dia:attribute name="alignment"> | |
261 | + <dia:enum val="1"/> | |
262 | + </dia:attribute> | |
263 | + </dia:composite> | |
264 | + </dia:attribute> | |
265 | + <dia:attribute name="valign"> | |
266 | + <dia:enum val="2"/> | |
267 | + </dia:attribute> | |
268 | + </dia:object> | |
269 | + <dia:object type="Standard - Text" version="1" id="O5"> | |
270 | + <dia:attribute name="obj_pos"> | |
271 | + <dia:point val="5.9,12.95"/> | |
272 | + </dia:attribute> | |
273 | + <dia:attribute name="obj_bb"> | |
274 | + <dia:rectangle val="5.00125,11.3063;6.79875,14.5938"/> | |
275 | + </dia:attribute> | |
276 | + <dia:attribute name="text"> | |
277 | + <dia:composite type="text"> | |
278 | + <dia:attribute name="string"> | |
279 | + <dia:string>#2#</dia:string> | |
280 | + </dia:attribute> | |
281 | + <dia:attribute name="font"> | |
282 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
283 | + </dia:attribute> | |
284 | + <dia:attribute name="height"> | |
285 | + <dia:real val="3.5321847480686248"/> | |
286 | + </dia:attribute> | |
287 | + <dia:attribute name="pos"> | |
288 | + <dia:point val="5.9,13.9288"/> | |
289 | + </dia:attribute> | |
290 | + <dia:attribute name="color"> | |
291 | + <dia:color val="#000000ff"/> | |
292 | + </dia:attribute> | |
293 | + <dia:attribute name="alignment"> | |
294 | + <dia:enum val="1"/> | |
295 | + </dia:attribute> | |
296 | + </dia:composite> | |
297 | + </dia:attribute> | |
298 | + <dia:attribute name="valign"> | |
299 | + <dia:enum val="2"/> | |
300 | + </dia:attribute> | |
301 | + </dia:object> | |
302 | + <dia:object type="Standard - Text" version="1" id="O6"> | |
303 | + <dia:attribute name="obj_pos"> | |
304 | + <dia:point val="16.45,21.3625"/> | |
305 | + </dia:attribute> | |
306 | + <dia:attribute name="obj_bb"> | |
307 | + <dia:rectangle val="15.5512,19.7188;17.3487,23.0063"/> | |
308 | + </dia:attribute> | |
309 | + <dia:attribute name="text"> | |
310 | + <dia:composite type="text"> | |
311 | + <dia:attribute name="string"> | |
312 | + <dia:string>#3#</dia:string> | |
313 | + </dia:attribute> | |
314 | + <dia:attribute name="font"> | |
315 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
316 | + </dia:attribute> | |
317 | + <dia:attribute name="height"> | |
318 | + <dia:real val="3.5321847480686248"/> | |
319 | + </dia:attribute> | |
320 | + <dia:attribute name="pos"> | |
321 | + <dia:point val="16.45,22.3412"/> | |
322 | + </dia:attribute> | |
323 | + <dia:attribute name="color"> | |
324 | + <dia:color val="#000000ff"/> | |
325 | + </dia:attribute> | |
326 | + <dia:attribute name="alignment"> | |
327 | + <dia:enum val="1"/> | |
328 | + </dia:attribute> | |
329 | + </dia:composite> | |
330 | + </dia:attribute> | |
331 | + <dia:attribute name="valign"> | |
332 | + <dia:enum val="2"/> | |
333 | + </dia:attribute> | |
334 | + </dia:object> | |
335 | + <dia:object type="Standard - Text" version="1" id="O7"> | |
336 | + <dia:attribute name="obj_pos"> | |
337 | + <dia:point val="33.25,12.2"/> | |
338 | + </dia:attribute> | |
339 | + <dia:attribute name="obj_bb"> | |
340 | + <dia:rectangle val="32.3513,10.5563;34.1487,13.8438"/> | |
341 | + </dia:attribute> | |
342 | + <dia:attribute name="text"> | |
343 | + <dia:composite type="text"> | |
344 | + <dia:attribute name="string"> | |
345 | + <dia:string>#4#</dia:string> | |
346 | + </dia:attribute> | |
347 | + <dia:attribute name="font"> | |
348 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
349 | + </dia:attribute> | |
350 | + <dia:attribute name="height"> | |
351 | + <dia:real val="3.5321847480686248"/> | |
352 | + </dia:attribute> | |
353 | + <dia:attribute name="pos"> | |
354 | + <dia:point val="33.25,13.1788"/> | |
355 | + </dia:attribute> | |
356 | + <dia:attribute name="color"> | |
357 | + <dia:color val="#000000ff"/> | |
358 | + </dia:attribute> | |
359 | + <dia:attribute name="alignment"> | |
360 | + <dia:enum val="1"/> | |
361 | + </dia:attribute> | |
362 | + </dia:composite> | |
363 | + </dia:attribute> | |
364 | + <dia:attribute name="valign"> | |
365 | + <dia:enum val="2"/> | |
366 | + </dia:attribute> | |
367 | + </dia:object> | |
368 | + </dia:layer> | |
369 | + <dia:layer name="Sozi" visible="true" connectable="true" active="true"> | |
370 | + <dia:object type="Sozi - Frame" version="0" id="O8"> | |
371 | + <dia:attribute name="obj_pos"> | |
372 | + <dia:point val="4.83689,3.9539"/> | |
373 | + </dia:attribute> | |
374 | + <dia:attribute name="obj_bb"> | |
375 | + <dia:rectangle val="0.49,-0.144176;12.7938,8.05198"/> | |
376 | + </dia:attribute> | |
377 | + <dia:attribute name="meta"> | |
378 | + <dia:composite type="dict"/> | |
379 | + </dia:attribute> | |
380 | + <dia:attribute name="x"> | |
381 | + <dia:real val="4.8368887106105847"/> | |
382 | + </dia:attribute> | |
383 | + <dia:attribute name="y"> | |
384 | + <dia:real val="3.953901623377714"/> | |
385 | + </dia:attribute> | |
386 | + <dia:attribute name="width"> | |
387 | + <dia:real val="6.0885762356124022"/> | |
388 | + </dia:attribute> | |
389 | + <dia:attribute name="height"> | |
390 | + <dia:real val="6.953687819240038"/> | |
391 | + </dia:attribute> | |
392 | + <dia:attribute name="angle"> | |
393 | + <dia:int val="111"/> | |
394 | + </dia:attribute> | |
395 | + <dia:attribute name="aspect"> | |
396 | + <dia:enum val="0"/> | |
397 | + </dia:attribute> | |
398 | + <dia:attribute name="scale_from_center"> | |
399 | + <dia:boolean val="false"/> | |
400 | + </dia:attribute> | |
401 | + <dia:attribute name="legend_disp"> | |
402 | + <dia:boolean val="true"/> | |
403 | + </dia:attribute> | |
404 | + <dia:attribute name="legend"> | |
405 | + <dia:composite type="text"> | |
406 | + <dia:attribute name="string"> | |
407 | + <dia:string>##1 : purple#</dia:string> | |
408 | + </dia:attribute> | |
409 | + <dia:attribute name="font"> | |
410 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
411 | + </dia:attribute> | |
412 | + <dia:attribute name="height"> | |
413 | + <dia:real val="0.80000000000000004"/> | |
414 | + </dia:attribute> | |
415 | + <dia:attribute name="pos"> | |
416 | + <dia:point val="9.17378,2.9528"/> | |
417 | + </dia:attribute> | |
418 | + <dia:attribute name="color"> | |
419 | + <dia:color val="#000000ff"/> | |
420 | + </dia:attribute> | |
421 | + <dia:attribute name="alignment"> | |
422 | + <dia:enum val="0"/> | |
423 | + </dia:attribute> | |
424 | + </dia:composite> | |
425 | + </dia:attribute> | |
426 | + <dia:attribute name="frame_sequence"> | |
427 | + <dia:int val="1"/> | |
428 | + </dia:attribute> | |
429 | + <dia:attribute name="frame_title"> | |
430 | + <dia:string>#purple#</dia:string> | |
431 | + </dia:attribute> | |
432 | + <dia:attribute name="frame_hide"> | |
433 | + <dia:boolean val="true"/> | |
434 | + </dia:attribute> | |
435 | + <dia:attribute name="frame_clip"> | |
436 | + <dia:boolean val="true"/> | |
437 | + </dia:attribute> | |
438 | + <dia:attribute name="frame_timeout_enable"> | |
439 | + <dia:boolean val="true"/> | |
440 | + </dia:attribute> | |
441 | + <dia:attribute name="frame_timeout_ms"> | |
442 | + <dia:int val="5000"/> | |
443 | + </dia:attribute> | |
444 | + <dia:attribute name="frame_transition_profile"> | |
445 | + <dia:enum val="9"/> | |
446 | + </dia:attribute> | |
447 | + <dia:attribute name="frame_transition_duration_ms"> | |
448 | + <dia:int val="1000"/> | |
449 | + </dia:attribute> | |
450 | + </dia:object> | |
451 | + <dia:object type="Sozi - Frame" version="0" id="O9"> | |
452 | + <dia:attribute name="obj_pos"> | |
453 | + <dia:point val="6.45837,12.6431"/> | |
454 | + </dia:attribute> | |
455 | + <dia:attribute name="obj_bb"> | |
456 | + <dia:rectangle val="-0.99556,5.57629;13.9123,19.71"/> | |
457 | + </dia:attribute> | |
458 | + <dia:attribute name="meta"> | |
459 | + <dia:composite type="dict"/> | |
460 | + </dia:attribute> | |
461 | + <dia:attribute name="x"> | |
462 | + <dia:real val="6.4583688375909283"/> | |
463 | + </dia:attribute> | |
464 | + <dia:attribute name="y"> | |
465 | + <dia:real val="12.643144578810967"/> | |
466 | + </dia:attribute> | |
467 | + <dia:attribute name="width"> | |
468 | + <dia:real val="10.328227726194189"/> | |
469 | + </dia:attribute> | |
470 | + <dia:attribute name="height"> | |
471 | + <dia:real val="11.789506279330688"/> | |
472 | + </dia:attribute> | |
473 | + <dia:attribute name="angle"> | |
474 | + <dia:int val="67"/> | |
475 | + </dia:attribute> | |
476 | + <dia:attribute name="aspect"> | |
477 | + <dia:enum val="0"/> | |
478 | + </dia:attribute> | |
479 | + <dia:attribute name="scale_from_center"> | |
480 | + <dia:boolean val="false"/> | |
481 | + </dia:attribute> | |
482 | + <dia:attribute name="legend_disp"> | |
483 | + <dia:boolean val="true"/> | |
484 | + </dia:attribute> | |
485 | + <dia:attribute name="legend"> | |
486 | + <dia:composite type="text"> | |
487 | + <dia:attribute name="string"> | |
488 | + <dia:string>##2 : orange#</dia:string> | |
489 | + </dia:attribute> | |
490 | + <dia:attribute name="font"> | |
491 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
492 | + </dia:attribute> | |
493 | + <dia:attribute name="height"> | |
494 | + <dia:real val="0.80000000000000004"/> | |
495 | + </dia:attribute> | |
496 | + <dia:attribute name="pos"> | |
497 | + <dia:point val="9.86674,6.18129"/> | |
498 | + </dia:attribute> | |
499 | + <dia:attribute name="color"> | |
500 | + <dia:color val="#000000ff"/> | |
501 | + </dia:attribute> | |
502 | + <dia:attribute name="alignment"> | |
503 | + <dia:enum val="0"/> | |
504 | + </dia:attribute> | |
505 | + </dia:composite> | |
506 | + </dia:attribute> | |
507 | + <dia:attribute name="frame_sequence"> | |
508 | + <dia:int val="2"/> | |
509 | + </dia:attribute> | |
510 | + <dia:attribute name="frame_title"> | |
511 | + <dia:string>#orange#</dia:string> | |
512 | + </dia:attribute> | |
513 | + <dia:attribute name="frame_hide"> | |
514 | + <dia:boolean val="true"/> | |
515 | + </dia:attribute> | |
516 | + <dia:attribute name="frame_clip"> | |
517 | + <dia:boolean val="true"/> | |
518 | + </dia:attribute> | |
519 | + <dia:attribute name="frame_timeout_enable"> | |
520 | + <dia:boolean val="true"/> | |
521 | + </dia:attribute> | |
522 | + <dia:attribute name="frame_timeout_ms"> | |
523 | + <dia:int val="5000"/> | |
524 | + </dia:attribute> | |
525 | + <dia:attribute name="frame_transition_profile"> | |
526 | + <dia:enum val="8"/> | |
527 | + </dia:attribute> | |
528 | + <dia:attribute name="frame_transition_duration_ms"> | |
529 | + <dia:int val="4000"/> | |
530 | + </dia:attribute> | |
531 | + </dia:object> | |
532 | + <dia:object type="Sozi - Frame" version="0" id="O10"> | |
533 | + <dia:attribute name="obj_pos"> | |
534 | + <dia:point val="16.2253,19.9172"/> | |
535 | + </dia:attribute> | |
536 | + <dia:attribute name="obj_bb"> | |
537 | + <dia:rectangle val="8.06947,11.0118;24.3811,28.8225"/> | |
538 | + </dia:attribute> | |
539 | + <dia:attribute name="meta"> | |
540 | + <dia:composite type="dict"/> | |
541 | + </dia:attribute> | |
542 | + <dia:attribute name="x"> | |
543 | + <dia:real val="16.225268207101003"/> | |
544 | + </dia:attribute> | |
545 | + <dia:attribute name="y"> | |
546 | + <dia:real val="19.91716554243725"/> | |
547 | + </dia:attribute> | |
548 | + <dia:attribute name="width"> | |
549 | + <dia:real val="13.992806630147285"/> | |
550 | + </dia:attribute> | |
551 | + <dia:attribute name="height"> | |
552 | + <dia:real val="15.796188994319914"/> | |
553 | + </dia:attribute> | |
554 | + <dia:attribute name="angle"> | |
555 | + <dia:int val="9"/> | |
556 | + </dia:attribute> | |
557 | + <dia:attribute name="aspect"> | |
558 | + <dia:enum val="0"/> | |
559 | + </dia:attribute> | |
560 | + <dia:attribute name="scale_from_center"> | |
561 | + <dia:boolean val="false"/> | |
562 | + </dia:attribute> | |
563 | + <dia:attribute name="legend_disp"> | |
564 | + <dia:boolean val="true"/> | |
565 | + </dia:attribute> | |
566 | + <dia:attribute name="legend"> | |
567 | + <dia:composite type="text"> | |
568 | + <dia:attribute name="string"> | |
569 | + <dia:string>##3 : yellow#</dia:string> | |
570 | + </dia:attribute> | |
571 | + <dia:attribute name="font"> | |
572 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
573 | + </dia:attribute> | |
574 | + <dia:attribute name="height"> | |
575 | + <dia:real val="0.80000000000000004"/> | |
576 | + </dia:attribute> | |
577 | + <dia:attribute name="pos"> | |
578 | + <dia:point val="10.5505,11.6168"/> | |
579 | + </dia:attribute> | |
580 | + <dia:attribute name="color"> | |
581 | + <dia:color val="#000000ff"/> | |
582 | + </dia:attribute> | |
583 | + <dia:attribute name="alignment"> | |
584 | + <dia:enum val="0"/> | |
585 | + </dia:attribute> | |
586 | + </dia:composite> | |
587 | + </dia:attribute> | |
588 | + <dia:attribute name="frame_sequence"> | |
589 | + <dia:int val="3"/> | |
590 | + </dia:attribute> | |
591 | + <dia:attribute name="frame_title"> | |
592 | + <dia:string>#yellow#</dia:string> | |
593 | + </dia:attribute> | |
594 | + <dia:attribute name="frame_hide"> | |
595 | + <dia:boolean val="true"/> | |
596 | + </dia:attribute> | |
597 | + <dia:attribute name="frame_clip"> | |
598 | + <dia:boolean val="true"/> | |
599 | + </dia:attribute> | |
600 | + <dia:attribute name="frame_timeout_enable"> | |
601 | + <dia:boolean val="true"/> | |
602 | + </dia:attribute> | |
603 | + <dia:attribute name="frame_timeout_ms"> | |
604 | + <dia:int val="5000"/> | |
605 | + </dia:attribute> | |
606 | + <dia:attribute name="frame_transition_profile"> | |
607 | + <dia:enum val="6"/> | |
608 | + </dia:attribute> | |
609 | + <dia:attribute name="frame_transition_duration_ms"> | |
610 | + <dia:int val="4000"/> | |
611 | + </dia:attribute> | |
612 | + </dia:object> | |
613 | + <dia:object type="Sozi - Frame" version="0" id="O11"> | |
614 | + <dia:attribute name="obj_pos"> | |
615 | + <dia:point val="32.4929,12.1225"/> | |
616 | + </dia:attribute> | |
617 | + <dia:attribute name="obj_bb"> | |
618 | + <dia:rectangle val="21.2089,2.13318;43.7769,22.1118"/> | |
619 | + </dia:attribute> | |
620 | + <dia:attribute name="meta"> | |
621 | + <dia:composite type="dict"/> | |
622 | + </dia:attribute> | |
623 | + <dia:attribute name="x"> | |
624 | + <dia:real val="32.492894760028236"/> | |
625 | + </dia:attribute> | |
626 | + <dia:attribute name="y"> | |
627 | + <dia:real val="12.122508567288529"/> | |
628 | + </dia:attribute> | |
629 | + <dia:attribute name="width"> | |
630 | + <dia:real val="16.490360886728233"/> | |
631 | + </dia:attribute> | |
632 | + <dia:attribute name="height"> | |
633 | + <dia:real val="19.764601636825244"/> | |
634 | + </dia:attribute> | |
635 | + <dia:attribute name="angle"> | |
636 | + <dia:int val="-79"/> | |
637 | + </dia:attribute> | |
638 | + <dia:attribute name="aspect"> | |
639 | + <dia:enum val="0"/> | |
640 | + </dia:attribute> | |
641 | + <dia:attribute name="scale_from_center"> | |
642 | + <dia:boolean val="false"/> | |
643 | + </dia:attribute> | |
644 | + <dia:attribute name="legend_disp"> | |
645 | + <dia:boolean val="true"/> | |
646 | + </dia:attribute> | |
647 | + <dia:attribute name="legend"> | |
648 | + <dia:composite type="text"> | |
649 | + <dia:attribute name="string"> | |
650 | + <dia:string>##4 : blue#</dia:string> | |
651 | + </dia:attribute> | |
652 | + <dia:attribute name="font"> | |
653 | + <dia:font family="sans" style="0" name="Helvetica"/> | |
654 | + </dia:attribute> | |
655 | + <dia:attribute name="height"> | |
656 | + <dia:real val="0.80000000000000004"/> | |
657 | + </dia:attribute> | |
658 | + <dia:attribute name="pos"> | |
659 | + <dia:point val="21.2189,18.9256"/> | |
660 | + </dia:attribute> | |
661 | + <dia:attribute name="color"> | |
662 | + <dia:color val="#000000ff"/> | |
663 | + </dia:attribute> | |
664 | + <dia:attribute name="alignment"> | |
665 | + <dia:enum val="0"/> | |
666 | + </dia:attribute> | |
667 | + </dia:composite> | |
668 | + </dia:attribute> | |
669 | + <dia:attribute name="frame_sequence"> | |
670 | + <dia:int val="4"/> | |
671 | + </dia:attribute> | |
672 | + <dia:attribute name="frame_title"> | |
673 | + <dia:string>#blue#</dia:string> | |
674 | + </dia:attribute> | |
675 | + <dia:attribute name="frame_hide"> | |
676 | + <dia:boolean val="true"/> | |
677 | + </dia:attribute> | |
678 | + <dia:attribute name="frame_clip"> | |
679 | + <dia:boolean val="true"/> | |
680 | + </dia:attribute> | |
681 | + <dia:attribute name="frame_timeout_enable"> | |
682 | + <dia:boolean val="true"/> | |
683 | + </dia:attribute> | |
684 | + <dia:attribute name="frame_timeout_ms"> | |
685 | + <dia:int val="5000"/> | |
686 | + </dia:attribute> | |
687 | + <dia:attribute name="frame_transition_profile"> | |
688 | + <dia:enum val="0"/> | |
689 | + </dia:attribute> | |
690 | + <dia:attribute name="frame_transition_duration_ms"> | |
691 | + <dia:int val="4000"/> | |
692 | + </dia:attribute> | |
693 | + </dia:object> | |
694 | + </dia:layer> | |
695 | +</dia:diagram> |
@@ -13,7 +13,7 @@ sheet_in_files = \ | ||
13 | 13 | ciscotelephony.sheet.in Cybernetics.sheet.in IsometricMap.sheet.in \ |
14 | 14 | Istar.sheet.in Jackson.sheet.in KAOS.sheet.in ChemEng.sheet.in \ |
15 | 15 | AADL.sheet.in Gane_and_Sarson.sheet.in BPMN.sheet.in \ |
16 | - Lights.sheet.in Database.sheet.in Shape_Design.sheet.in | |
16 | + Lights.sheet.in Database.sheet.in Sozi.sheet.in Shape_Design.sheet.in | |
17 | 17 | |
18 | 18 | SHEETS = $(sheet_in_files:.sheet.in=.sheet) |
19 | 19 |
@@ -0,0 +1,13 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> <!-- -*- xml -*- --> | |
2 | +<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns"> | |
3 | + <_name>Sozi</_name> | |
4 | + <_description>Objects to do Sozi (zooming ui) presentations</_description> | |
5 | + <contents> | |
6 | + <object name="Sozi - Frame"> | |
7 | + <_description>Sozi frame</_description> | |
8 | + </object> | |
9 | + <object name="Sozi - Media"> | |
10 | + <_description>Sozi media</_description> | |
11 | + </object> | |
12 | + </contents> | |
13 | +</sheet> |