File: 95-parallel-previews.diff

package info (click to toggle)
efl 1.21.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 261,264 kB
  • sloc: ansic: 1,026,744; cpp: 43,352; cs: 14,773; sh: 5,539; makefile: 3,347; objc: 1,518; pascal: 431; python: 322; xml: 182; sed: 16
file content (255 lines) | stat: -rw-r--r-- 11,229 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
Description: Perform widget preview generation in parallel
Author: Ross Vandegrift <ross@kallisti.us>
Origin: other
Forwarded: yes
Last-Update: 2016-11-26
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -16,85 +16,6 @@
 
 previews-data:
 	@$(MAKE) -C previews doc
-# dir:file name:executable:width:height
-WGT_PREVIEW = \
-	actionslider:preview-00.png:widget_preview_actionslider:120:30 \
-	bg:preview-00.png:widget_preview_bg:50:50 \
-	box:preview-00.png:widget_preview_box:200:160 \
-	bubble:preview-00.png:widget_preview_bubble1:160:50 \
-	bubble:preview-01.png:widget_preview_bubble2:160:50 \
-	bubble:preview-02.png:widget_preview_bubble3:160:50 \
-	button:preview-00.png:widget_preview_button1:160:50 \
-	button:preview-01.png:widget_preview_button2:160:50 \
-	button:preview-02.png:widget_preview_button3:160:50 \
-	calendar:preview-00.png:widget_preview_calendar:300:300 \
-	check:preview-00.png:widget_preview_check1:160:50 \
-	check:preview-01.png:widget_preview_check2:160:50 \
-	check:preview-02.png:widget_preview_check3:160:50 \
-	clock:preview-00.png:widget_preview_clock:200:100 \
-	colorselector:preview-00.png:widget_preview_colorselector:320:300 \
-	conformant:preview-00.png:widget_preview_conformant:200:400 \
-	combobox:preview-00.png:widget_preview_combobox:300:300 \
-	ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130 \
-	datetime:preview-00.png:widget_preview_datetime1:360:60 \
-	datetime:preview-01.png:widget_preview_datetime2:200:60 \
-	datetime:preview-02.png:widget_preview_datetime3:200:60 \
-	dayselector:preview-00.png:widget_preview_dayselector:350:50 \
-	diskselector:preview-00.png:widget_preview_diskselector:120:50 \
-	entry:preview-00.png:widget_preview_entry1:160:50 \
-	entry:preview-01.png:widget_preview_entry2:160:50 \
-	entry:preview-02.png:widget_preview_entry3:160:50 \
-	entry:preview-03.png:widget_preview_entry4:160:50 \
-	fileselector:preview-00.png:widget_preview_fileselector:300:300 \
-	fileselector_button:preview-00.png:widget_preview_fileselector_button1:200:50 \
-	fileselector_button:preview-01.png:widget_preview_fileselector_button2:200:50 \
-	fileselector_button:preview-02.png:widget_preview_fileselector_button3:160:50 \
-	fileselector_entry:preview-00.png:widget_preview_fileselector_entry:70:50 \
-	flip:preview-00.png:widget_preview_flip:100:100 \
-	flipselector:preview-00.png:widget_preview_flipselector:100:60 \
-	frame:preview-00.png:widget_preview_frame:100:50 \
-	gengrid:preview-00.png:widget_preview_gengrid:200:160 \
-	genlist:preview-00.png:widget_preview_genlist1:200:200 \
-	genlist:preview-01.png:widget_preview_genlist2:200:160 \
-	genlist:preview-02.png:widget_preview_genlist3:200:160 \
-	genlist:preview-03.png:widget_preview_genlist4:200:160 \
-	genlist:preview-04.png:widget_preview_genlist5:200:160 \
-	hover:preview-00.png:widget_preview_hover:90:170 \
-	hoversel:preview-00.png:widget_preview_hoversel:90:170 \
-	icon:preview-00.png:widget_preview_icon:50:50 \
-	image:preview-00.png:widget_preview_image:50:50 \
-	index:preview-00.png:widget_preview_index:200:160 \
-	inwin:preview-00.png:widget_preview_inwin1:200:160 \
-	inwin:preview-01.png:widget_preview_inwin2:200:160 \
-	inwin:preview-02.png:widget_preview_inwin3:200:160 \
-	label:preview-00.png:widget_preview_label:70:30 \
-	layout:preview-00.png:widget_preview_layout:200:160 \
-	list:preview-00.png:widget_preview_list:200:200 \
-	map:preview-00.png:widget_preview_map:256:256 \
-	mapbuf:preview-00.png:widget_preview_mapbuf:200:200 \
-	menu:preview-00.png:widget_preview_menu:100:100 \
-	notify:preview-00.png:widget_preview_notify:60:30 \
-	nstate:preview-00.png:widget_preview_nstate:45:28 \
-	panel:preview-00.png:widget_preview_panel:150:50 \
-	panes:preview-00.png:widget_preview_panes:200:100 \
-	photocam:preview-00.png:widget_preview_photocam:243:162 \
-	popup:preview-00.png:widget_preview_popup:480:400 \
-	prefs:preview-00.png:widget_preview_prefs:200:160 \
-	prefs:preview-00.png:widget_preview_prefs:280:250 \
-	progressbar:preview-00.png:widget_preview_progressbar:150:50 \
-	radio:preview-00.png:widget_preview_radio:60:20 \
-	scroller:preview-00.png:widget_preview_scroller:100:30 \
-	segment_control:preview-00.png:widget_preview_segment_control:240:120 \
-	separator:preview-00.png:widget_preview_separator:10:80 \
-	slider:preview-00.png:widget_preview_slider:200:100 \
-	slideshow:preview-00.png:widget_preview_slideshow:50:50 \
-	spinner:preview-00.png:widget_preview_spinner:160:30 \
-	table::preview-00.png:widget_preview_table:100:100 \
-	table:preview-00.png:widget_preview_table:100:100 \
-	thumb:preview-00.png:widget_preview_thumb:100:100 \
-	toolbar:preview-00.png:widget_preview_toolbar:300:100 \
-	web:preview-00.png:widget_preview_web:300:300 \
-	win:preview-00.png:widget_preview_win:200:200
 
 # put in here every elm widget, so that it gets its hierarchy tree built
 # then, make a reference to the generated image, in the form
@@ -171,18 +92,7 @@
 	@$(MAKE) -C widgets
 
 widget-preview: widget-build
-	@for ss in $(WGT_PREVIEW); do \
-		ENTRY=($${ss//:/ }) ; \
-		DIR=$${ENTRY[0]} ; \
-		SS=$${ENTRY[1]} ; \
-		BIN=$${ENTRY[2]} ; \
-		X=$${ENTRY[3]} ; \
-		Y=$${ENTRY[4]} ; \
-		echo "Generating widget preview image" $${SS} "for widget" $${DIR}; \
-		$(top_srcdir)/doc/shot.sh $(top_builddir)/doc/html/img/widget/$${DIR} $${SS} $(top_builddir)/doc/widgets/$${BIN} $${X} $${Y} ; \
-		mkdir -p $(top_builddir)/doc/latex/img/widget/$${DIR} ; \
-		convert $(top_builddir)/doc/html/img/widget/$${DIR}/$${SS} $(top_builddir)/doc/latex/img/widget/$${DIR}/$${SS/.png/.eps} ; \
-	done
+	$(top_srcdir)/doc/shot.sh $(top_builddir)
 
 widget-tree-figures: doc
 	$(srcdir)/widget_hierarchy.py --scan $(top_srcdir)/src/lib -o $(builddir)/widget_tree.p;
--- a/doc/shot.sh
+++ b/doc/shot.sh
@@ -1,18 +1,131 @@
-#!/bin/sh
+#!/bin/bash
 
-DIR=$1
-shift
-FILE=$1
-shift
+WGT_PREVIEW=$(cat <<EOF
+actionslider:preview-00.png:widget_preview_actionslider:120:30
+bg:preview-00.png:widget_preview_bg:50:50
+box:preview-00.png:widget_preview_box:200:160
+bubble:preview-00.png:widget_preview_bubble1:160:50
+bubble:preview-01.png:widget_preview_bubble2:160:50
+bubble:preview-02.png:widget_preview_bubble3:160:50
+button:preview-00.png:widget_preview_button1:160:50
+button:preview-01.png:widget_preview_button2:160:50
+button:preview-02.png:widget_preview_button3:160:50
+calendar:preview-00.png:widget_preview_calendar:300:300
+check:preview-00.png:widget_preview_check1:160:50
+check:preview-01.png:widget_preview_check2:160:50
+check:preview-02.png:widget_preview_check3:160:50
+clock:preview-00.png:widget_preview_clock:200:100
+colorselector:preview-00.png:widget_preview_colorselector:320:300
+conformant:preview-00.png:widget_preview_conformant:200:400
+combobox:preview-00.png:widget_preview_combobox:300:300
+ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130
+datetime:preview-00.png:widget_preview_datetime1:360:60
+datetime:preview-01.png:widget_preview_datetime2:200:60
+datetime:preview-02.png:widget_preview_datetime3:200:60
+dayselector:preview-00.png:widget_preview_dayselector:350:50
+diskselector:preview-00.png:widget_preview_diskselector:120:50
+entry:preview-00.png:widget_preview_entry1:160:50
+entry:preview-01.png:widget_preview_entry2:160:50
+entry:preview-02.png:widget_preview_entry3:160:50
+entry:preview-03.png:widget_preview_entry4:160:50
+fileselector:preview-00.png:widget_preview_fileselector:300:300
+fileselector_button:preview-00.png:widget_preview_fileselector_button1:200:50
+fileselector_button:preview-01.png:widget_preview_fileselector_button2:200:50
+fileselector_button:preview-02.png:widget_preview_fileselector_button3:160:50
+fileselector_entry:preview-00.png:widget_preview_fileselector_entry:70:50
+flip:preview-00.png:widget_preview_flip:100:100
+flipselector:preview-00.png:widget_preview_flipselector:100:60
+frame:preview-00.png:widget_preview_frame:100:50
+gengrid:preview-00.png:widget_preview_gengrid:200:160
+genlist:preview-00.png:widget_preview_genlist1:200:200
+genlist:preview-01.png:widget_preview_genlist2:200:160
+genlist:preview-02.png:widget_preview_genlist3:200:160
+genlist:preview-03.png:widget_preview_genlist4:200:160
+genlist:preview-04.png:widget_preview_genlist5:200:160
+hover:preview-00.png:widget_preview_hover:90:170
+hoversel:preview-00.png:widget_preview_hoversel:90:170
+icon:preview-00.png:widget_preview_icon:50:50
+image:preview-00.png:widget_preview_image:50:50
+index:preview-00.png:widget_preview_index:200:160
+inwin:preview-00.png:widget_preview_inwin1:200:160
+inwin:preview-01.png:widget_preview_inwin2:200:160
+inwin:preview-02.png:widget_preview_inwin3:200:160
+label:preview-00.png:widget_preview_label:70:30
+layout:preview-00.png:widget_preview_layout:200:160
+list:preview-00.png:widget_preview_list:200:200
+map:preview-00.png:widget_preview_map:256:256
+mapbuf:preview-00.png:widget_preview_mapbuf:200:200
+menu:preview-00.png:widget_preview_menu:100:100
+notify:preview-00.png:widget_preview_notify:60:30
+nstate:preview-00.png:widget_preview_nstate:45:28
+panel:preview-00.png:widget_preview_panel:150:50
+panes:preview-00.png:widget_preview_panes:200:100
+photocam:preview-00.png:widget_preview_photocam:243:162
+popup:preview-00.png:widget_preview_popup:480:400
+prefs:preview-00.png:widget_preview_prefs:200:160
+prefs:preview-00.png:widget_preview_prefs:280:250
+progressbar:preview-00.png:widget_preview_progressbar:150:50
+radio:preview-00.png:widget_preview_radio:60:20
+scroller:preview-00.png:widget_preview_scroller:100:30
+segment_control:preview-00.png:widget_preview_segment_control:240:120
+separator:preview-00.png:widget_preview_separator:10:80
+slider:preview-00.png:widget_preview_slider:200:100
+slideshow:preview-00.png:widget_preview_slideshow:50:50
+spinner:preview-00.png:widget_preview_spinner:160:30
+table::preview-00.png:widget_preview_table:100:100
+table:preview-00.png:widget_preview_table:100:100
+thumb:preview-00.png:widget_preview_thumb:100:100
+toolbar:preview-00.png:widget_preview_toolbar:300:100
+web:preview-00.png:widget_preview_web:300:300
+win:preview-00.png:widget_preview_win:200:2
+EOF
+	   )
+
+HTML_ROOT=$1/doc/html/img/widget
+LATEX_ROOT=$1/doc/latex/img/widget
+BIN_ROOT=$1/doc/widgets
 
 export ELM_THEME=default
 export ELM_SCALE=1.0
-export ELM_ENGINE=shot:delay=3:file=$DIR/$FILE
 export ELM_DISPLAY=shot
 export ILLUME_KBD=0,0,240,123
 export ILLUME_IND=0,0,240,32
 export ILLUME_STK=0,288,240,32
 
-mkdir -p $DIR || true
+# Create dirs ahead of time
+for ss in $WGT_PREVIEW; do
+    ENTRY=(${ss//:/ })
+    DIR=${ENTRY[0]}
+    mkdir -p $HTML_ROOT/$DIR
+    mkdir -p $LATEX_ROOT/$DIR
+done
+
+# Mass generate previews
+for ss in $WGT_PREVIEW; do
+    ENTRY=(${ss//:/ })
+    DIR=${ENTRY[0]}
+    SS=${ENTRY[1]}
+    BIN=${ENTRY[2]}
+    X=${ENTRY[3]}
+    Y=${ENTRY[4]}
+
+    export ELM_ENGINE=shot:delay=3:file=$HTML_ROOT/$DIR/$SS
+
+    $BIN_ROOT/$BIN $X $Y &
+done
+
+wait
+
+# Mass convert to eps
+for ss in $WGT_PREVIEW; do
+    ENTRY=(${ss//:/ })
+    DIR=${ENTRY[0]}
+    SS=${ENTRY[1]}
+    BIN=${ENTRY[2]}
+    X=${ENTRY[3]}
+    Y=${ENTRY[4]}
+
+    export ELM_ENGINE=shot:delay=3:file=$DIR/$FILE
 
-exec $@
+    convert $HTML_ROOT/$DIR/$SS $LATEX_ROOT/$DIR/${SS/.png/.eps} &
+done