~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to src/gtk2_control.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-25 15:47:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080225154712-qvr11ekcea4c9ry8
Tags: 1.1.6-0.1ubuntu1
* Merge from debian-multimedia (LP: #120003), Ubuntu Changes:
 - For ffmpeg-related build-deps, remove cvs from package names.
 - Standards-Version 3.7.3
 - Maintainer Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * gtk2_control.c
3
 
 *
4
 
 * Copyright (C) 2003,04 Karl H. Beckers, Frankfurt
5
 
 * EMail: khb@jarre-de-the.net
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
 *
21
 
 */
22
 
 
23
 
#include "../config.h" //autoconf output
24
 
 
25
 
#include <stdio.h>
26
 
#include <stdlib.h>
27
 
#include <string.h>
28
 
#include <ctype.h>              /* isdigit() */
29
 
#include <X11/Intrinsic.h>
30
 
#include <X11/StringDefs.h>
31
 
#include <X11/Shell.h>
32
 
#include <X11/cursorfont.h>
33
 
#include <X11/Xmu/WinUtil.h>
34
 
#ifdef HAVE_LIBZ
35
 
#include <zlib.h>
36
 
#endif
37
 
#include <sys/types.h>
38
 
#include <sys/stat.h>
39
 
#include <unistd.h>
40
 
 
41
 
#include <gdk/gdkkeysyms.h>
42
 
#include <gtk/gtk.h>
43
 
#include <gdk/gdkx.h>
44
 
#include <pango/pango-layout.h>
45
 
#include <gdk-pixbuf/gdk-pixdata.h>
46
 
#include "led_meter.h"
47
 
 
48
 
#ifdef HAVE_LIBAVCODEC
49
 
#ifdef HAVE_LIBAVFORMAT
50
 
#include <ffmpeg/avcodec.h>
51
 
#include <ffmpeg/avformat.h>
52
 
#endif // HAVE_AVCODEC
53
 
#endif // HAVE_AVFORMAT
54
 
 
55
 
#include "job.h"
56
 
#include "capture.h"
57
 
//#include "main.h"
58
 
#include "app_data.h"
59
 
#include "util.h"
60
 
#include "gtk2_support.h"
61
 
#include "gtk2_options.h"
62
 
#include "frame.h"
63
 
#include "gtk2_frame.h"
64
 
 
65
 
#define GLADE_HOOKUP_OBJECT(component, widget, name) \
66
 
g_object_set_data_full(G_OBJECT(component), name, \
67
 
gtk_widget_ref(widget), (GDestroyNotify) gtk_widget_unref)
68
 
 
69
 
#define GLADE_HOOKUP_OBJECT_NO_REF(component, widget, name) \
70
 
g_object_set_data(G_OBJECT(component), name, widget)
71
 
 
72
 
 
73
 
/* GdkPixbuf RGBA C-Source image dump */
74
 
 
75
 
static const guint8 animate_icon[] =
76
 
{ ""
77
 
  /* Pixbuf magic (0x47646b50) */
78
 
  "GdkP"
79
 
  /* length: header (24) + pixel_data (1040) */
80
 
  "\0\0\4("
81
 
  /* pixdata_type (0x1010002) */
82
 
  "\1\1\0\2"
83
 
  /* rowstride (80) */
84
 
  "\0\0\0P"
85
 
  /* width (20) */
86
 
  "\0\0\0\24"
87
 
  /* height (13) */
88
 
  "\0\0\0\15"
89
 
  /* pixel_data: */
90
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
91
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
92
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
93
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
94
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
95
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
96
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
97
 
  "\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377"
98
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
99
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0"
100
 
  "\0\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
101
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
102
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
103
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
104
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
105
 
  "\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
106
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
107
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
108
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
109
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
110
 
  "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
111
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
112
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
113
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
114
 
  "\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
115
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
116
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
117
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
118
 
  "\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
119
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0"
120
 
  "\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
121
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
122
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
123
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
124
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
125
 
  "\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0"
126
 
  "\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
127
 
  "\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0"
128
 
  "\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
129
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
130
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
131
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
132
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
133
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
134
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
135
 
  "\377\0\377\377\377\0"
136
 
};
137
 
 
138
 
 
139
 
/* GdkPixbuf RGBA C-Source image dump */
140
 
 
141
 
static const guint8 edit_icon[] =
142
 
{ ""
143
 
  /* Pixbuf magic (0x47646b50) */
144
 
  "GdkP"
145
 
  /* length: header (24) + pixel_data (624) */
146
 
  "\0\0\2\210"
147
 
  /* pixdata_type (0x1010002) */
148
 
  "\1\1\0\2"
149
 
  /* rowstride (48) */
150
 
  "\0\0\0""0"
151
 
  /* width (12) */
152
 
  "\0\0\0\14"
153
 
  /* height (13) */
154
 
  "\0\0\0\15"
155
 
  /* pixel_data: */
156
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
157
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
158
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
159
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
160
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
161
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
162
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
163
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
164
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
165
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
166
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
167
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
168
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
169
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
170
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
171
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
172
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
173
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
174
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
175
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
176
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
177
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
178
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
179
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
180
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
181
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
182
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
183
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
184
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
185
 
  "\377\0"
186
 
};
187
 
 
188
 
 
189
 
/* GdkPixbuf RGBA C-Source image dump */
190
 
 
191
 
static const guint8 move_icon[] =
192
 
{ ""
193
 
  /* Pixbuf magic (0x47646b50) */
194
 
  "GdkP"
195
 
  /* length: header (24) + pixel_data (676) */
196
 
  "\0\0\2\274"
197
 
  /* pixdata_type (0x1010002) */
198
 
  "\1\1\0\2"
199
 
  /* rowstride (52) */
200
 
  "\0\0\0""4"
201
 
  /* width (13) */
202
 
  "\0\0\0\15"
203
 
  /* height (13) */
204
 
  "\0\0\0\15"
205
 
  /* pixel_data: */
206
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
207
 
  "\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
208
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
209
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
210
 
  "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
211
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
212
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
213
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
214
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0"
215
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
216
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0"
217
 
  "\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0"
218
 
  "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
219
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377"
220
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
221
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
222
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0"
223
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
224
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377"
225
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377"
226
 
  "\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
227
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
228
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377"
229
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
230
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
231
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
232
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
233
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
234
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
235
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
236
 
  "\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
237
 
  "\0\377\377\377\0\377\377\377\0"
238
 
};
239
 
 
240
 
 
241
 
/* GdkPixbuf RGBA C-Source image dump */
242
 
 
243
 
static const guint8 next_icon[] =
244
 
{ ""
245
 
  /* Pixbuf magic (0x47646b50) */
246
 
  "GdkP"
247
 
  /* length: header (24) + pixel_data (468) */
248
 
  "\0\0\1\354"
249
 
  /* pixdata_type (0x1010002) */
250
 
  "\1\1\0\2"
251
 
  /* rowstride (36) */
252
 
  "\0\0\0$"
253
 
  /* width (9) */
254
 
  "\0\0\0\11"
255
 
  /* height (13) */
256
 
  "\0\0\0\15"
257
 
  /* pixel_data: */
258
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
259
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
260
 
  "\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
261
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
262
 
  "\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
263
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
264
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
265
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
266
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
267
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
268
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
269
 
  "\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
270
 
  "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0"
271
 
  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
272
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
273
 
  "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
274
 
  "\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
275
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
276
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
277
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
278
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
279
 
  "\377\0"
280
 
};
281
 
 
282
 
 
283
 
/* GdkPixbuf RGBA C-Source image dump */
284
 
 
285
 
static const guint8 pause_icon[] =
286
 
{ ""
287
 
  /* Pixbuf magic (0x47646b50) */
288
 
  "GdkP"
289
 
  /* length: header (24) + pixel_data (728) */
290
 
  "\0\0\2\360"
291
 
  /* pixdata_type (0x1010002) */
292
 
  "\1\1\0\2"
293
 
  /* rowstride (56) */
294
 
  "\0\0\0""8"
295
 
  /* width (14) */
296
 
  "\0\0\0\16"
297
 
  /* height (13) */
298
 
  "\0\0\0\15"
299
 
  /* pixel_data: */
300
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
301
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
302
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
303
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
304
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
305
 
  "\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
306
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
307
 
  "\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0"
308
 
  "\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
309
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
310
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
311
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
312
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
313
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
314
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
315
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
316
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
317
 
  "\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
318
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
319
 
  "\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0"
320
 
  "\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
321
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
322
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
323
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
324
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
325
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
326
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
327
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
328
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
329
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
330
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
331
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
332
 
  "\0"
333
 
};
334
 
 
335
 
 
336
 
/* GdkPixbuf RGBA C-Source image dump */
337
 
 
338
 
static const guint8 prev_icon[] =
339
 
{ ""
340
 
  /* Pixbuf magic (0x47646b50) */
341
 
  "GdkP"
342
 
  /* length: header (24) + pixel_data (468) */
343
 
  "\0\0\1\354"
344
 
  /* pixdata_type (0x1010002) */
345
 
  "\1\1\0\2"
346
 
  /* rowstride (36) */
347
 
  "\0\0\0$"
348
 
  /* width (9) */
349
 
  "\0\0\0\11"
350
 
  /* height (13) */
351
 
  "\0\0\0\15"
352
 
  /* pixel_data: */
353
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
354
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
355
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
356
 
  "\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
357
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
358
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
359
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
360
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
361
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
362
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
363
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
364
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0"
365
 
  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
366
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
367
 
  "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
368
 
  "\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
369
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
370
 
  "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
371
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
372
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
373
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
374
 
  "\377\0"
375
 
};
376
 
 
377
 
 
378
 
/* GdkPixbuf RGBA C-Source image dump */
379
 
 
380
 
static const guint8 record_on_icon[] =
381
 
{ ""
382
 
  /* Pixbuf magic (0x47646b50) */
383
 
  "GdkP"
384
 
  /* length: header (24) + pixel_data (676) */
385
 
  "\0\0\2\274"
386
 
  /* pixdata_type (0x1010002) */
387
 
  "\1\1\0\2"
388
 
  /* rowstride (52) */
389
 
  "\0\0\0""4"
390
 
  /* width (13) */
391
 
  "\0\0\0\15"
392
 
  /* height (13) */
393
 
  "\0\0\0\15"
394
 
  /* pixel_data: */
395
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
396
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
397
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
398
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377"
399
 
  "\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
400
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
401
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
402
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
403
 
  "\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377"
404
 
  "\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377"
405
 
  "\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377"
406
 
  "\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
407
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377"
408
 
  "\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
409
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377\0\377"
410
 
  "\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
411
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377"
412
 
  "\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
413
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
414
 
  "\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
415
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
416
 
  "\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
417
 
  "\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377"
418
 
  "\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377"
419
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
420
 
  "\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
421
 
  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
422
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0"
423
 
  "\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
424
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
425
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
426
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
427
 
};
428
 
 
429
 
 
430
 
/* GdkPixbuf RGBA C-Source image dump */
431
 
 
432
 
static const guint8 select_icon[] =
433
 
{ ""
434
 
  /* Pixbuf magic (0x47646b50) */
435
 
  "GdkP"
436
 
  /* length: header (24) + pixel_data (676) */
437
 
  "\0\0\2\274"
438
 
  /* pixdata_type (0x1010002) */
439
 
  "\1\1\0\2"
440
 
  /* rowstride (52) */
441
 
  "\0\0\0""4"
442
 
  /* width (13) */
443
 
  "\0\0\0\15"
444
 
  /* height (13) */
445
 
  "\0\0\0\15"
446
 
  /* pixel_data: */
447
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
448
 
  "\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
449
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
450
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
451
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
452
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
453
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
454
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
455
 
  "\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\377\0"
456
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
457
 
  "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
458
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
459
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0"
460
 
  "\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377"
461
 
  "\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
462
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
463
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
464
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377"
465
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377"
466
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
467
 
  "\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
468
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
469
 
  "\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\377\0\0\0\0\377"
470
 
  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
471
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
472
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
473
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
474
 
  "\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
475
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
476
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
477
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
478
 
  "\0\377\377\377\0"
479
 
};
480
 
 
481
 
 
482
 
/* GdkPixbuf RGBA C-Source image dump */
483
 
 
484
 
static const guint8 step_icon[] =
485
 
{ ""
486
 
  /* Pixbuf magic (0x47646b50) */
487
 
  "GdkP"
488
 
  /* length: header (24) + pixel_data (780) */
489
 
  "\0\0\3$"
490
 
  /* pixdata_type (0x1010002) */
491
 
  "\1\1\0\2"
492
 
  /* rowstride (60) */
493
 
  "\0\0\0<"
494
 
  /* width (15) */
495
 
  "\0\0\0\17"
496
 
  /* height (13) */
497
 
  "\0\0\0\15"
498
 
  /* pixel_data: */
499
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
500
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
501
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
502
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
503
 
  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
504
 
  "\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
505
 
  "\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0"
506
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
507
 
  "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0"
508
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
509
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
510
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0"
511
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377"
512
 
  "\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
513
 
  "\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
514
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
515
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
516
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
517
 
  "\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
518
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
519
 
  "\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
520
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
521
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
522
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
523
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
524
 
  "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
525
 
  "\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
526
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
527
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
528
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
529
 
  "\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
530
 
  "\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
531
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
532
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
533
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
534
 
  "\377\377\0"
535
 
};
536
 
 
537
 
 
538
 
/* GdkPixbuf RGBA C-Source image dump */
539
 
 
540
 
static const guint8 stop_icon[] =
541
 
{ ""
542
 
  /* Pixbuf magic (0x47646b50) */
543
 
  "GdkP"
544
 
  /* length: header (24) + pixel_data (728) */
545
 
  "\0\0\2\360"
546
 
  /* pixdata_type (0x1010002) */
547
 
  "\1\1\0\2"
548
 
  /* rowstride (56) */
549
 
  "\0\0\0""8"
550
 
  /* width (14) */
551
 
  "\0\0\0\16"
552
 
  /* height (13) */
553
 
  "\0\0\0\15"
554
 
  /* pixel_data: */
555
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
556
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
557
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
558
 
  "\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
559
 
  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
560
 
  "\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
561
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
562
 
  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
563
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
564
 
  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
565
 
  "\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
566
 
  "\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377"
567
 
  "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
568
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
569
 
  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
570
 
  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
571
 
  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
572
 
  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
573
 
  "\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
574
 
  "\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
575
 
  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
576
 
  "\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
577
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
578
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
579
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
580
 
  "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0"
581
 
  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
582
 
  "\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
583
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
584
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
585
 
  "\0\377\377\377\0\377\377\377\0\377\377\377\0"
586
 
};
587
 
 
588
 
 
589
 
// globals
590
 
// need to define this here, because we're calling it from
591
 
// an event here
592
 
GtkWidget *dialog1;
593
 
GtkWidget *window1;
594
 
GtkWidget *handlebox1;
595
 
GtkWidget *hbox1;
596
 
//GtkWidget *menubar1;
597
 
//GtkWidget *MI_file;
598
 
GtkWidget *MI_file_menu;
599
 
GtkWidget *MI_preferences;
600
 
GtkWidget *image36;
601
 
GtkWidget *MI_prefs_save;
602
 
GtkWidget *image32;
603
 
GtkWidget *MI_make_video;
604
 
GtkWidget *MI_continue;
605
 
GtkWidget *image33;
606
 
GtkWidget *MI_help;
607
 
GtkWidget *image34;
608
 
GtkWidget *separatormenuitem1, *separatormenuitem2;
609
 
GtkWidget *MI_quit1;
610
 
GtkWidget *image35;
611
 
GtkWidget *filename;
612
 
GtkWidget *toolbar3;
613
 
GtkWidget *toolbar2;
614
 
GtkWidget *tmp_toolbar_icon;
615
 
GtkWidget *stop;
616
 
GtkWidget *pause_tb;
617
 
GtkWidget *record;
618
 
GtkWidget *step;
619
 
GtkWidget *previous;
620
 
GtkWidget *next;
621
 
GtkWidget *move;
622
 
GtkWidget *select_tb;
623
 
GtkWidget *MI_animate;
624
 
GtkWidget *edit;
625
 
GtkWidget *frame_drop_meter;
626
 
GtkTooltips *tooltips;
627
 
 
628
 
// more globals
629
 
static Job *jobp;
630
 
static guint stop_timer_id, start_timer_id;
631
 
struct timeval curr_time;
632
 
long start_time, pause_time, time_captured;
633
 
 
634
 
void start_recording(Job *job);
635
 
GtkWidget* create_window1(char *param_animate_cmd, char *param_mkvideo_cmd,
636
 
char *param_edit_cmd, char *param_help_cmd);
637
 
void InitGTKControl(AppData *app);
638
 
gboolean stop_recording_gui_stuff(Job *jobp);
639
 
gboolean stop_recording_nongui_stuff(Job *jobp);
640
 
gboolean timer_start_recording (Job *job);
641
 
void GtkChangeLabel(int pic_no);
642
 
 
643
 
 
644
 
 
645
 
/*
646
 
 * XVIDCAP GUI API ( IF THAT WORD IS ALLOWED HERE ;) )
647
 
 *
648
 
 * XVC_PREINIT IS FOR GUI PREINITIALIZATION LIKE SETTING FALLBACK OPTIONS
649
 
 * XVC_CREATEGUI IS FOR GUI CREATION
650
 
 * XVC_CREATEFRAME SHOULD CREATE THE SELECTION FRAME
651
 
 * XVC_INITGUI IS FOR MISCELLANEOUS INITIALIZATION STUFF
652
 
 * XVC_RUNGUI IS A WRAPPER AROUND THE UI'S MAIN LOOP
653
 
 *
654
 
 * XVC_ADDTIMEOUT IS A WRAPPER AROUND THE GUI'S FUNCTIONALITY FOR TRIGGERING ACTIONS AT A
655
 
 * GIVEN TIME
656
 
 * XVC_CHANGEGUILABEL IS A WRAPPER AROUND A FUNCTION TO CHANGE THE DISPLAY
657
 
 * OF THE CURRENT FRAME NUMBER (NOT NECESSARY IN A LABEL)
658
 
 * XVC_STOPCAPTURE IS A HOOK FOR RESETTING THE GUI TO A STOPPED STATE
659
 
 * XVC_STARTCAPTURE IS A HOOK FOR STARTING A CAPTURE SESSION
660
 
 */
661
 
 
662
 
Boolean XVC_PreInit( int argc, char **argv, AppData *app ) {
663
 
    // the gtk gui doesn't recognize the Xt ressources as fallback values
664
 
    // one effect is that here cap_width and cap_height will be zerio if
665
 
    // not explicitly set
666
 
    // FIXME: research other side-effects .....
667
 
    if ( app->cap_width == 0 || app->cap_height == 0 ) {
668
 
        app->cap_width = 192;
669
 
        app->cap_height = 144;
670
 
    }
671
 
    //other defaults from fallback.h
672
 
    // FIXME: this should be user-definable
673
 
    app->play_cmd = "animate \"%s\" -delay %d &";
674
 
    app->video_cmd = "ppm2mpeg \"%s\" %d %d %d %d %f %d &";
675
 
    app->edit_cmd = "display \"%s\" &";
676
 
    app->help_cmd = "xterm -e man xvidcap &";
677
 
    
678
 
    //still other defaults
679
 
    app->file = "test.mpeg";
680
 
    app->fps = 10;
681
 
    app->time = 0;
682
 
    app->frames = 1000;
683
 
    
684
 
    gtk_init(&argc, &argv);
685
 
    
686
 
    return TRUE;
687
 
}
688
 
 
689
 
 
690
 
Boolean XVC_CreateGUI(AppData *app) {
691
 
    int pos_x, pos_y;
692
 
    Display *dpy;
693
 
    
694
 
    #ifdef ENABLE_NLS
695
 
    bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
696
 
    bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
697
 
    textdomain(GETTEXT_PACKAGE);
698
 
    #endif
699
 
    gtk_set_locale();
700
 
    //add_pixmap_directory("/usr/local/share/project2/pixmaps");
701
 
    
702
 
    window1 = create_window1(app->play_cmd, app->video_cmd, app->edit_cmd, app->help_cmd);
703
 
    if ( ! ( app->flags & FLG_NOGUI ) ) {
704
 
        gtk_widget_show(window1);
705
 
        gtk_window_get_position( GTK_WINDOW(window1), &pos_x, &pos_y);
706
 
        gtk_window_move( GTK_WINDOW(window1), (pos_x + FRAME_WIDTH), pos_y);
707
 
        
708
 
        dpy = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
709
 
    } else {
710
 
        dpy = XOpenDisplay(NULL);
711
 
    }
712
 
    #ifdef HasDGA
713
 
    if (!XF86DGAQueryExtension(dpy, &dga_evb, &dga_errb))
714
 
        app->flags &= ~FLG_USE_DGA;
715
 
    else {
716
 
        int flag = 0;
717
 
        XF86DGAQueryDirectVideo(dpy, XDefaultScreen(dpy), &flag);
718
 
        if ((flag & XF86DGADirectPresent) == 0) {
719
 
            app->flags &= ~FLG_USE_DGA;
720
 
            if (app->verbose) {
721
 
                printf("xfdga: no direct present\n");
722
 
            }
723
 
        }
724
 
    }
725
 
    #endif //HasDGA
726
 
    
727
 
    #ifdef HAVE_SHMAT
728
 
    if (!XShmQueryExtension(dpy))
729
 
        app->flags &= ~FLG_USE_SHM;
730
 
    #endif //HAVE_SHMAT
731
 
    
732
 
    if (app->flags & FLG_NOGUI ) {
733
 
        XCloseDisplay(dpy);
734
 
    }
735
 
    return TRUE;
736
 
}
737
 
 
738
 
 
739
 
Boolean XVC_CreateFrame(AppData *app) {
740
 
    if ( app->cap_width == 0 ) app->cap_width = 10;
741
 
    if ( app->cap_height == 0 ) app->cap_height = 10;
742
 
    GtkCreateFrame( GTK_WINDOW(window1), app->cap_width, app->cap_height, app->flags );
743
 
    return TRUE;
744
 
}
745
 
 
746
 
 
747
 
Boolean XVC_InitGUI(AppData *app) {
748
 
    InitGTKControl(app);
749
 
    return TRUE;
750
 
}
751
 
 
752
 
 
753
 
int XVC_RunGUI() {
754
 
    gtk_main();
755
 
    return 0;
756
 
}
757
 
 
758
 
 
759
 
void XVC_AddTimeout(int ms, void *func, Job *job) {
760
 
    gtk_timeout_add((guint32) ms, (GtkFunction) func, job);
761
 
}
762
 
 
763
 
 
764
 
void XVC_ChangeGUILabel( int pic_no ) {
765
 
    GtkChangeLabel( pic_no );
766
 
}
767
 
 
768
 
 
769
 
void XVC_StopCapture(Job *job) {
770
 
    gboolean rc;
771
 
    
772
 
    rc = stop_recording_nongui_stuff(job);
773
 
    rc = stop_recording_gui_stuff(job);
774
 
}
775
 
 
776
 
 
777
 
void XVC_StartCapture(Job *job) {
778
 
    gboolean rc;
779
 
    
780
 
    rc = start_recording_nongui_stuff(job);
781
 
    rc = start_recording_gui_stuff(job);
782
 
}
783
 
 
784
 
 
785
 
void XVC_ChangeFrame(int x, int y, int width, int height, Boolean reposition_control ) {
786
 
    GtkChangeFrame(x, y, width, height, reposition_control );
787
 
}
788
 
 
789
 
 
790
 
void XVC_FrameMonitor(Job *job, int measured_time) {
791
 
    int percent, diff, n;
792
 
   
793
 
    if ( measured_time == 0 ) {
794
 
        percent = 0;
795
 
    } 
796
 
    else if ( measured_time <= job->time_per_frame ) percent = 30;
797
 
    else if ( measured_time >= (job->time_per_frame * 2)) percent = 100;
798
 
    else {
799
 
        diff = measured_time - job->time_per_frame;
800
 
        percent = diff * 70 / job->time_per_frame;
801
 
        percent += 30;
802
 
    }
803
 
//    printf("percent: %i\n", percent); 
804
 
    led_meter_set_percent (LED_METER(frame_drop_meter), percent);
805
 
 
806
 
    if ( percent == 0 ) LED_METER(frame_drop_meter)->old_max_da = 0;
807
 
}
808
 
 
809
 
 
810
 
/*
811
 
 * HELPER FUNCTIONS ...
812
 
 *
813
 
 *
814
 
 */
815
 
 
816
 
gint keySnooper (GtkWidget *grab_widget, GdkEventKey *event, gpointer func_data) {
817
 
    printf("keyval: %i - mods: %i\n", event->keyval, event->state);
818
 
}
819
 
 
820
 
 
821
 
/*
822
 
 * change value of frame/filename display
823
 
 */
824
 
void
825
 
GtkChangeLabel(int pic_no) {
826
 
    PangoLayout *layout;
827
 
    gint width, height, old_handlebox_width, old_filename_width;
828
 
    int filename_length;
829
 
    
830
 
    static char file[PATH_MAX+1], tmp_buf[PATH_MAX+1];
831
 
    static int blub;
832
 
    gboolean ignore = TRUE;
833
 
    GdkRectangle r;
834
 
    GdkEvent eev;
835
 
    
836
 
    if (jobp->flags & FLG_MULTI_IMAGE) {
837
 
        sprintf(tmp_buf, jobp->file, jobp->movie_no);
838
 
        sprintf(file, "%s[%04d]", tmp_buf, pic_no);
839
 
//        sprintf(file, "%s[%04d]", jobp->file, pic_no);
840
 
    } else {
841
 
        sprintf(file, jobp->file, pic_no);
842
 
    }
843
 
    filename_length = strlen(file);
844
 
    if (filename_length > 60) {
845
 
        char tmp_file[PATH_MAX+1];
846
 
        char *tmp_file2, *ptr, *ptr2;
847
 
        int n;
848
 
        
849
 
        strncpy(tmp_file, file, 20);
850
 
        tmp_file[20] = 0;
851
 
        n = filename_length - 20;
852
 
        ptr = (char*) &file + n;
853
 
        tmp_file2 = strncat(tmp_file, "...", 4);
854
 
        tmp_file2 = strncat(tmp_file, ptr, 45);
855
 
        strncpy(file, tmp_file2, 45);
856
 
    }
857
 
    
858
 
    gtk_button_set_label(GTK_BUTTON(filename), file);
859
 
    
860
 
    layout = gtk_widget_create_pango_layout(filename, file);
861
 
    pango_layout_get_pixel_size(layout, &width, &height);
862
 
    g_object_unref(layout);
863
 
    
864
 
    gtk_widget_set_size_request(GTK_WIDGET(filename), (width + 30), -1);
865
 
    
866
 
}
867
 
 
868
 
 
869
 
 
870
 
// first callbacks here ....
871
 
//
872
 
//
873
 
 
874
 
//on_window1_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
875
 
gboolean
876
 
on_window1_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
877
 
    if ((jobp->state & VC_STOP) == 0 ) XVC_StopCapture(jobp);
878
 
    DestroyFrame();
879
 
    return FALSE;
880
 
}
881
 
 
882
 
gboolean
883
 
on_window1_destroy(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
884
 
    gtk_main_quit();
885
 
}
886
 
 
887
 
void
888
 
on_MI_preferences_activate(GtkMenuItem *menuitem, gpointer user_data) {
889
 
    dialog1 = create_dialog1(jobp);
890
 
    gtk_widget_show(dialog1);
891
 
}
892
 
 
893
 
void
894
 
on_MI_prefs_save_activate(GtkMenuItem *menuitem, gpointer user_data) {
895
 
    XVC_WriteOptionsFile(jobp);
896
 
}
897
 
 
898
 
void
899
 
on_MI_continue_activate(GtkMenuItem *menuitem, gpointer user_data) {
900
 
    if ( gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)) ) {
901
 
        if ( (! is_filename_mutable(jobp->file)) || (! jobp->flags & FLG_MULTI_IMAGE) ) {
902
 
            printf("Output not a video file or no counter in filename\nDisabling autocontinue!\n");
903
 
            gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), FALSE);
904
 
        } else {
905
 
            jobp->flags |= FLG_AUTO_CONTINUE;
906
 
        }
907
 
    } else {
908
 
        jobp->flags &= ~FLG_AUTO_CONTINUE;
909
 
    }
910
 
}
911
 
 
912
 
void
913
 
on_MI_make_video_activate(GtkMenuItem *menuitem, gpointer user_data) {
914
 
    char *fmt = (char *)user_data;
915
 
    char cmd[PATH_MAX*2+2];
916
 
    sprintf(cmd, fmt, jobp->file, jobp->start_no, jobp->pic_no-1,
917
 
    jobp->area->width, jobp->area->height, jobp->fps, jobp->time_per_frame);
918
 
    if (jobp->flags & FLG_RUN_VERBOSE)
919
 
        printf("calling: '%s'\n", cmd);
920
 
    
921
 
    system(cmd);
922
 
}
923
 
 
924
 
void
925
 
on_MI_help_activate(GtkMenuItem *menuitem, gpointer user_data) {
926
 
    if (jobp->flags & FLG_RUN_VERBOSE)
927
 
        printf("calling '%s'\n", (char*) user_data);
928
 
    system((char*)user_data);
929
 
}
930
 
 
931
 
void
932
 
on_MI_quit1_activate(GtkMenuItem *menuitem, gpointer user_data) {
933
 
    gboolean ignore;
934
 
    g_signal_emit_by_name((GtkObject*) window1, "destroy", &ignore);
935
 
}
936
 
 
937
 
 
938
 
gboolean stop_recording_nongui_stuff(Job *job) {
939
 
    // non-gui stuff
940
 
    job->state = VC_STOP;
941
 
 
942
 
    return FALSE;
943
 
}
944
 
 
945
 
gboolean stop_recording_gui_stuff(Job *job) {
946
 
    // GUI stuff
947
 
//    gtk_widget_set_sensitive(GTK_WIDGET(MI_file), TRUE);
948
 
    gtk_widget_set_sensitive(GTK_WIDGET(select_tb), TRUE);
949
 
    gtk_widget_set_sensitive(GTK_WIDGET(record), TRUE);
950
 
 
951
 
    gtk_widget_set_sensitive(GTK_WIDGET(MI_file_menu), TRUE);
952
 
    gtk_widget_set_sensitive(GTK_WIDGET(edit), TRUE);
953
 
    
954
 
    if (! ((jobp->flags & FLG_MULTI_IMAGE) != 0 && is_filename_mutable(jobp->file) != TRUE )) {
955
 
        gtk_widget_set_sensitive(GTK_WIDGET(next), TRUE);
956
 
        if ((jobp->flags & FLG_MULTI_IMAGE) == 0) {
957
 
            if (jobp->pic_no >= jobp->step) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
958
 
        } else {
959
 
            if (jobp->movie_no > 0) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
960
 
        }
961
 
    }
962
 
    
963
 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pause_tb), FALSE);
964
 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(record), FALSE);
965
 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), TRUE);
966
 
    
967
 
//    if (!(jobp->flags & FLG_RUN_VERBOSE))
968
 
        GtkChangeLabel(jobp->pic_no);
969
 
 
970
 
    return FALSE;    
971
 
}
972
 
 
973
 
 
974
 
gboolean timer_stop_recording(Job *job) {
975
 
    if ( job->flags & FLG_AUTO_CONTINUE) {
976
 
        stop_recording_nongui_stuff(job);
977
 
        job->state |= VC_CONTINUE;
978
 
    } else {
979
 
        stop_recording_nongui_stuff(job);
980
 
        stop_recording_gui_stuff(job);
981
 
    }
982
 
    return FALSE;
983
 
}
984
 
 
985
 
 
986
 
void
987
 
on_stop_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
988
 
    if (gtk_toggle_button_get_active(togglebutton)) {
989
 
        if (stop_timer_id) gtk_timeout_remove(stop_timer_id);
990
 
        stop_recording_nongui_stuff(jobp);
991
 
        stop_recording_gui_stuff(jobp);
992
 
    } else {
993
 
        // empty
994
 
    }
995
 
}
996
 
 
997
 
 
998
 
gboolean start_recording_gui_stuff(Job *job) {
999
 
    // GUI stuff
1000
 
    gtk_widget_set_sensitive(record, FALSE);
1001
 
//    gtk_widget_set_sensitive(MI_file, FALSE);
1002
 
    if ((jobp->state & VC_PAUSE) == 0) gtk_widget_set_sensitive(stop, TRUE);
1003
 
    gtk_widget_set_sensitive(select_tb, FALSE);
1004
 
    gtk_widget_set_sensitive(pause_tb, TRUE);
1005
 
    
1006
 
    gtk_widget_set_sensitive(MI_file_menu, FALSE);
1007
 
    gtk_widget_set_sensitive(edit, FALSE);
1008
 
    
1009
 
    if (jobp->state & VC_PAUSE) {
1010
 
        if ( (jobp->flags & FLG_MULTI_IMAGE) == 0 ) {
1011
 
            gtk_widget_set_sensitive(step, TRUE);
1012
 
            gtk_widget_set_sensitive(next, TRUE);
1013
 
            if (jobp->pic_no >= jobp->step ) gtk_widget_set_sensitive(previous, TRUE);
1014
 
        } else {
1015
 
            gtk_widget_set_sensitive(step, FALSE);
1016
 
            if ( ! is_filename_mutable(jobp->file) ) {
1017
 
                gtk_widget_set_sensitive(next, FALSE);
1018
 
                gtk_widget_set_sensitive(previous, FALSE);
1019
 
            }
1020
 
        }
1021
 
    } else {
1022
 
        gtk_widget_set_sensitive(next, FALSE);
1023
 
        gtk_widget_set_sensitive(previous, FALSE);
1024
 
    }
1025
 
 
1026
 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1027
 
    
1028
 
    return FALSE;
1029
 
}
1030
 
 
1031
 
gboolean start_recording_nongui_stuff(Job *job) {
1032
 
    // non-gui stuff
1033
 
    // hiermit wird auch VC_READY zur�ckgesetzt ...
1034
 
    job->state = (VC_REC | VC_START) | (job->state & VC_PAUSE);
1035
 
    
1036
 
    if (job->flags & FLG_MULTI_IMAGE) {
1037
 
        job->pic_no = jobp->start_no;
1038
 
        GtkChangeLabel(jobp->pic_no);
1039
 
    }
1040
 
    
1041
 
    
1042
 
    if (job->max_time && (job->state & VC_PAUSE) == 0 ) {
1043
 
        /* install a timer which stops recording
1044
 
         * we need milli secs ..
1045
 
         */
1046
 
        gettimeofday(&curr_time, NULL);
1047
 
        time_captured = 0;
1048
 
        start_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1049
 
        stop_timer_id = gtk_timeout_add((guint32)(jobp->max_time * 1000), (GtkFunction) timer_stop_recording, jobp);
1050
 
    }
1051
 
    
1052
 
    job->capture(jobp, NULL);
1053
 
    
1054
 
    return FALSE;
1055
 
}
1056
 
 
1057
 
 
1058
 
void
1059
 
on_record_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1060
 
    if (gtk_toggle_button_get_active(togglebutton)) {
1061
 
        start_recording_gui_stuff(jobp);
1062
 
        start_recording_nongui_stuff(jobp);
1063
 
    } else {
1064
 
        //empty
1065
 
    }
1066
 
1067
 
 
1068
 
 
1069
 
void
1070
 
on_pause_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1071
 
    #ifdef DEBUG
1072
 
    printf("on_pause_toggled(%d)\n", (int) gtk_toggle_button_get_active(togglebutton));
1073
 
    #endif
1074
 
    if (gtk_toggle_button_get_active(togglebutton)) {
1075
 
        // stop timer handling only if max_time is configured
1076
 
        if (jobp->max_time ) {
1077
 
            gettimeofday(&curr_time, NULL);
1078
 
            pause_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1079
 
            if (( jobp->state & VC_REC ) != 0 ) {
1080
 
                time_captured = ( pause_time - start_time ) + time_captured;
1081
 
            } else {
1082
 
                time_captured = 0;
1083
 
            }
1084
 
            if (stop_timer_id) gtk_timeout_remove(stop_timer_id);
1085
 
        }
1086
 
        
1087
 
        jobp->state |= VC_PAUSE;
1088
 
        jobp->state &= ~VC_STOP;
1089
 
        
1090
 
        // GUI stuff
1091
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1092
 
//        gtk_widget_set_sensitive(GTK_WIDGET(stop), TRUE);
1093
 
        if ((jobp->flags & FLG_MULTI_IMAGE) == 0 && jobp->state & VC_REC) {
1094
 
            gtk_widget_set_sensitive(GTK_WIDGET(step), TRUE);
1095
 
            gtk_widget_set_sensitive(GTK_WIDGET(next), TRUE);
1096
 
            if (jobp->pic_no >= jobp->step) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1097
 
            gtk_widget_set_sensitive(GTK_WIDGET(edit), TRUE);
1098
 
        }
1099
 
    } else {
1100
 
        jobp->state &= ~VC_PAUSE;
1101
 
        jobp->state &= ~VC_STEP;
1102
 
        // step is always only active if a running recording session is paused
1103
 
        // so releasing pause can always deactivate it
1104
 
        gtk_widget_set_sensitive(GTK_WIDGET(step), FALSE);
1105
 
        // the following only when recording is going on (not when just pressing and
1106
 
        // releasing pause
1107
 
        if (jobp->state & VC_REC) {
1108
 
            gtk_widget_set_sensitive(GTK_WIDGET(next), FALSE);
1109
 
            gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1110
 
            gtk_widget_set_sensitive(GTK_WIDGET(edit), FALSE);
1111
 
        }
1112
 
/*        if (jobp->state & VC_REC) {
1113
 
            gtk_widget_set_sensitive(GTK_WIDGET(stop), TRUE);
1114
 
            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1115
 
        } */
1116
 
        
1117
 
        // restart timer handling only if max_time is configured
1118
 
        if (jobp->max_time) {
1119
 
            /* install a timer which stops recording
1120
 
             * we need milli secs ..
1121
 
             */
1122
 
            gettimeofday(&curr_time, NULL);
1123
 
            start_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1124
 
            stop_timer_id = gtk_timeout_add((guint32)(jobp->max_time * 1000 - time_captured), (GtkFunction) timer_stop_recording, jobp);
1125
 
        }
1126
 
    }
1127
 
    
1128
 
}
1129
 
 
1130
 
 
1131
 
void
1132
 
on_step_clicked(GtkButton *button, gpointer user_data) {
1133
 
    if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1134
 
        if (!(jobp->state & (VC_PAUSE | VC_REC)))
1135
 
            return;
1136
 
        jobp->state |= VC_STEP;
1137
 
        jobp->capture(jobp, NULL);
1138
 
        if (jobp->pic_no == jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1139
 
    }
1140
 
}
1141
 
 
1142
 
void
1143
 
on_filename_clicked(GtkButton *button, gpointer user_data) {
1144
 
    if ( ( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1145
 
        if ( jobp->pic_no != jobp->start_no && ( jobp->state & VC_STOP ) > 0 
1146
 
                    || ( jobp->state & VC_PAUSE ) > 0 ) {
1147
 
            jobp->pic_no = jobp->start_no;
1148
 
            GtkChangeLabel(jobp->pic_no);
1149
 
        }
1150
 
    } else {
1151
 
        if ( jobp->movie_no != 0 && ( jobp->state & VC_STOP ) > 0) {
1152
 
            jobp->movie_no = 0;
1153
 
            jobp->pic_no = jobp->start_no;
1154
 
            GtkChangeLabel(jobp->pic_no);
1155
 
        }
1156
 
    }
1157
 
}
1158
 
 
1159
 
void
1160
 
on_previous_clicked(GtkButton *button, gpointer user_data) {
1161
 
    if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1162
 
        if ( jobp->pic_no >= jobp->step) {
1163
 
            jobp->pic_no -= jobp->step;
1164
 
            GtkChangeLabel(jobp->pic_no);
1165
 
        } else {
1166
 
            fprintf(stderr, "previous button active although picture number < step. this should never happen\n");
1167
 
        }
1168
 
        if ( jobp->pic_no < jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1169
 
    } else {
1170
 
        if ( jobp->movie_no > 0) {
1171
 
            jobp->movie_no -= 1;
1172
 
            GtkChangeLabel(jobp->pic_no);
1173
 
        } else {
1174
 
            fprintf(stderr, "previous button active although movie number == 0. this should never happen\n");
1175
 
        }
1176
 
        if ( jobp->movie_no == 0 ) gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1177
 
    }
1178
 
}
1179
 
 
1180
 
void
1181
 
on_next_clicked(GtkButton *button, gpointer user_data) {
1182
 
    if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1183
 
        jobp->pic_no += jobp->step;
1184
 
        GtkChangeLabel(jobp->pic_no);
1185
 
        if (jobp->pic_no == jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1186
 
    } else {
1187
 
        jobp->movie_no += 1;
1188
 
        GtkChangeLabel(jobp->pic_no);
1189
 
        if (jobp->movie_no == 1) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1190
 
    }
1191
 
}
1192
 
 
1193
 
 
1194
 
void on_move_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1195
 
    GtkTooltips *tooltips;
1196
 
    XRectangle *frame_rectangle;
1197
 
    int x, y, pheight, pwidth;
1198
 
    
1199
 
    tooltips = gtk_tooltips_new ();
1200
 
    
1201
 
    if (gtk_toggle_button_get_active(togglebutton)) {
1202
 
        XVC_frame_lock = 1; // button pressed = move frame with control
1203
 
        gtk_tooltips_set_tip (tooltips, GTK_WIDGET (togglebutton), _ ("Detach selection frame"), NULL);
1204
 
        
1205
 
        gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_NORTH_WEST );
1206
 
        gtk_window_get_position( GTK_WINDOW(window1), &x, &y);
1207
 
        gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1208
 
        gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_STATIC );
1209
 
        gtk_window_get_position( GTK_WINDOW(window1), &x, &y);
1210
 
        gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1211
 
        if (x < 0)
1212
 
            x = 0;
1213
 
        y += pheight + FRAME_OFFSET;
1214
 
        if (y < 0)
1215
 
            y = 0;
1216
 
        frame_rectangle = GetArea();
1217
 
        XVC_ChangeFrame(x, y, frame_rectangle->width, frame_rectangle->height, FALSE);
1218
 
    } else {
1219
 
        XVC_frame_lock = 0;
1220
 
        gtk_tooltips_set_tip (tooltips, GTK_WIDGET (togglebutton), _ ("Attach selection frame"), NULL);
1221
 
    }
1222
 
}
1223
 
 
1224
 
 
1225
 
void
1226
 
on_select_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1227
 
    if (gtk_toggle_button_get_active(togglebutton)) {
1228
 
        Display *display = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
1229
 
        Cursor cursor;
1230
 
        Window root, target = None, temp = None;
1231
 
        XEvent event;
1232
 
        int buttons = 0;
1233
 
        int x_down, y_down, x_up, y_up, x, y, pheight = 0, pwidth = 0;
1234
 
        int width, height;
1235
 
        XGCValues gcv;
1236
 
        GC gc;
1237
 
        
1238
 
        root = RootWindow(display, DefaultScreen(display));
1239
 
        cursor = XCreateFontCursor(display, XC_crosshair);
1240
 
        
1241
 
        gcv.background = XBlackPixel(display, XDefaultScreen(display));
1242
 
        gcv.foreground = XWhitePixel(display, XDefaultScreen(display));
1243
 
        gcv.function = GXinvert;
1244
 
        gcv.plane_mask = gcv.background ^ gcv.foreground;
1245
 
        gcv.subwindow_mode = IncludeInferiors;
1246
 
        gc = XCreateGC(display, root,
1247
 
        GCBackground | GCForeground | GCFunction | GCPlaneMask | GCSubwindowMode, &gcv);
1248
 
        /* grab the mouse
1249
 
         */
1250
 
        if (XGrabPointer(display, root, False,
1251
 
        PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
1252
 
        GrabModeSync, GrabModeAsync, root, cursor, CurrentTime)
1253
 
        != GrabSuccess) {
1254
 
            printf("Can't grab mouse!\n");
1255
 
            return;
1256
 
        }
1257
 
        x_down = y_down = x_up = y_up = width = height = 0;
1258
 
        
1259
 
        while (buttons < 2) {
1260
 
            /* allow pointer events */
1261
 
            XAllowEvents(display, SyncPointer, CurrentTime);
1262
 
            /* search in the queue for button events */
1263
 
            XWindowEvent(display, root,
1264
 
            PointerMotionMask|ButtonPressMask|ButtonReleaseMask, &event);
1265
 
            switch (event.type) {
1266
 
                case ButtonPress:
1267
 
                    x_down = event.xbutton.x;
1268
 
                    y_down = event.xbutton.y;
1269
 
                    target = event.xbutton.subwindow; /* window selected */
1270
 
                    if (target == None) {
1271
 
                        target = root;
1272
 
                    }
1273
 
                    buttons++;
1274
 
                    break;
1275
 
                case ButtonRelease:
1276
 
                    x_up = event.xbutton.x;
1277
 
                    y_up = event.xbutton.y;
1278
 
                    buttons++;
1279
 
                    break;
1280
 
                default:
1281
 
                    /* motion notify */
1282
 
                    if (buttons == 1) {
1283
 
                        if (width) {
1284
 
                            /* remove old frame */
1285
 
                            XDrawRectangle(display, root, gc, x, y, width, height);
1286
 
                        }
1287
 
                        /* button is pressed */
1288
 
                        if (x_down > event.xbutton.x) {
1289
 
                            width = x_down - event.xbutton.x + 1;
1290
 
                            x = event.xbutton.x;
1291
 
                        } else {
1292
 
                            width = event.xbutton.x - x_down + 1;
1293
 
                            x = x_down;
1294
 
                        }
1295
 
                        if (y_down > event.xbutton.y) {
1296
 
                            height = y_down - event.xbutton.y + 1;
1297
 
                            y = event.xbutton.y;
1298
 
                        } else {
1299
 
                            height = event.xbutton.y - y_down + 1;
1300
 
                            y = y_down;
1301
 
                        }
1302
 
                        XDrawRectangle(display, root, gc, x, y, width, height);
1303
 
                    }
1304
 
                    break;
1305
 
            }
1306
 
        }
1307
 
        if (width) /* remove old frame */
1308
 
            XDrawRectangle(display, root, gc, x, y, width, height);
1309
 
        XUngrabPointer(display, CurrentTime);      /* Done with pointer */
1310
 
        XFreeCursor(display, cursor);
1311
 
        XFreeGC(display, gc);
1312
 
        
1313
 
        if ((x_down != x_up) && (y_down != y_up)) {
1314
 
            /* an individual frame was selected
1315
 
             */
1316
 
            if (x_up < x_down) {
1317
 
                width = x_down - x_up + 2;
1318
 
                x = x_up;
1319
 
            } else {
1320
 
                width = x_up - x_down + 2;
1321
 
                x = x_down;
1322
 
            }
1323
 
            if (y_up < y_down) {
1324
 
                height = y_down - y_up + 2;
1325
 
                y = y_up;
1326
 
            } else {
1327
 
                height = y_up - y_down + 2;
1328
 
                y = y_down;
1329
 
            }
1330
 
            if (target != root)
1331
 
                target = XmuClientWindow(display, target);
1332
 
            XGetWindowAttributes(display, target, &jobp->win_attr);
1333
 
            jobp->win_attr.width = width;
1334
 
            jobp->win_attr.height = height;
1335
 
        } else {
1336
 
            /* if (target == root) {
1337
 
             printf ("Drag your mouse to select an area on the root window.\n");
1338
 
             return;
1339
 
             } */
1340
 
            if (target != root) {
1341
 
                /* get the real window */
1342
 
                target = XmuClientWindow(display, target);
1343
 
            }
1344
 
            XGetWindowAttributes(display, target, &jobp->win_attr);
1345
 
            XTranslateCoordinates(display, target, root, 0, 0, &x, &y, &temp);
1346
 
        }
1347
 
        
1348
 
        jobp->win_attr.x = x;
1349
 
        jobp->win_attr.y = y;
1350
 
        
1351
 
        /* we must move the panel a little bit, so get the height of
1352
 
         the panel to adjust the y value */
1353
 
        gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_STATIC );
1354
 
        //              gtk_window_get_position ( GTK_WINDOW (window1), &x, &y);
1355
 
        gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1356
 
        
1357
 
        /* add the space between the panel and the frame */
1358
 
        // FIXME: find out how to determine real title bar height, if possible
1359
 
        // this is just to get the main control out of the way, because
1360
 
        // if we have the frame locked, the move will trigger the move callback
1361
 
        // however, this will not leave the selection at the right coordinates
1362
 
        // because we're not moving the control enough, because we don*t know
1363
 
        // the height of the title bar ...
1364
 
        
1365
 
        pheight = pheight + FRAME_OFFSET;
1366
 
        if (IsFrameLocked()) {
1367
 
            gtk_window_move(GTK_WINDOW(window1), x, y - pheight);
1368
 
        }
1369
 
        
1370
 
        if (jobp->flags & FLG_RUN_VERBOSE) {
1371
 
            printf("Original Selection geometry: %dx%d+%d+%d\n",
1372
 
            jobp->win_attr.width, jobp->win_attr.height, x, y);
1373
 
        }
1374
 
        #ifdef HAVE_LIBAVCODEC
1375
 
        #ifdef HAVE_LIBAVFORMAT
1376
 
        /*
1377
 
         * make sure we have even width and height for ffmpeg
1378
 
         */
1379
 
        if (jobp->target >= CAP_FFM) {
1380
 
            Boolean changed = FALSE;
1381
 
            int w, h;
1382
 
            
1383
 
            if ((jobp->win_attr.width % 2) > 0 ) {
1384
 
                jobp->win_attr.width--;
1385
 
                changed = TRUE;
1386
 
            }
1387
 
            if ((jobp->win_attr.height % 2) > 0) {
1388
 
                jobp->win_attr.height--;
1389
 
                changed = TRUE;
1390
 
            }
1391
 
            if ( jobp->win_attr.width < 20 ) {
1392
 
                jobp->win_attr.width = 20;
1393
 
                changed = TRUE;
1394
 
            }
1395
 
            if ( jobp->win_attr.height < 20 ) {
1396
 
                jobp->win_attr.height = 20;
1397
 
                changed = TRUE;
1398
 
            }
1399
 
            
1400
 
            if (changed) {
1401
 
                if (jobp->flags & FLG_RUN_VERBOSE) {
1402
 
                    printf("Modified Selection geometry: %dx%d+%d+%d\n",
1403
 
                    jobp->win_attr.width, jobp->win_attr.height, x, y);
1404
 
                }
1405
 
            }
1406
 
        }
1407
 
        #endif
1408
 
        #endif
1409
 
        GtkChangeFrame(x, y, jobp->win_attr.width, jobp->win_attr.height, FALSE);
1410
 
        
1411
 
        jobp->ncolors = GetColors(display, &jobp->win_attr, &jobp->colors);
1412
 
        if (jobp->get_colors) {
1413
 
            if (jobp->color_table)
1414
 
                free(jobp->color_table);
1415
 
            jobp->color_table = (*jobp->get_colors)(jobp->colors, jobp->ncolors);
1416
 
        }
1417
 
        if (jobp->flags & FLG_RUN_VERBOSE) {
1418
 
            fprintf(stderr, "color_table first entry: 0x%.8X\n", *(u_int32_t*)jobp->color_table);
1419
 
        }
1420
 
        job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
1421
 
        #ifdef DEBUG
1422
 
        printf("new visual: %d\n", jobp->win_attr.visual->class);
1423
 
        #endif
1424
 
    }
1425
 
    gtk_toggle_button_set_active(togglebutton, FALSE);
1426
 
}
1427
 
 
1428
 
void
1429
 
on_MI_animate_activate(GtkButton *button, gpointer user_data) {
1430
 
    char file[PATH_MAX+1], buff[PATH_MAX*2+1], *p;
1431
 
    char *cmd = (char *) user_data;
1432
 
    int i = 0, n=0;
1433
 
    
1434
 
    p = jobp->file;
1435
 
    while (*p) {
1436
 
        if (*p == '%') {
1437
 
            p++;
1438
 
            sscanf(p, "%dd", &n);
1439
 
            while (n) {
1440
 
                file[i++] = '?';
1441
 
                n--;
1442
 
            }
1443
 
            while (isdigit(*p))
1444
 
                p++;
1445
 
            p++;
1446
 
        } else {
1447
 
            file[i] = *p;
1448
 
            p++;
1449
 
            i++;
1450
 
        }
1451
 
    }
1452
 
    file[i] = '\0';
1453
 
    sprintf(buff, cmd, file, jobp->time_per_frame);
1454
 
    if (jobp->flags & FLG_RUN_VERBOSE);
1455
 
    printf("calling: '%s'\n", buff);
1456
 
    
1457
 
    system(buff);
1458
 
}
1459
 
 
1460
 
void
1461
 
on_edit_clicked(GtkButton *button, gpointer user_data) {
1462
 
    char cmd[PATH_MAX*2+4];
1463
 
    char buf[PATH_MAX+1];
1464
 
    int n;
1465
 
    
1466
 
    if (jobp->pic_no < 1)
1467
 
        n = 0;
1468
 
    else
1469
 
        n = jobp->pic_no - 1;
1470
 
    
1471
 
    sprintf(buf, jobp->file, n);
1472
 
    sprintf(cmd, (char*)user_data, buf);
1473
 
    if (jobp->flags & FLG_RUN_VERBOSE)
1474
 
        printf("calling: '%s'\n", cmd);
1475
 
    
1476
 
    system(cmd);
1477
 
}
1478
 
 
1479
 
 
1480
 
void position_popup_menu (GtkMenu *menu, gint *x, gint *y,
1481
 
    gboolean *push_in, gpointer user_data) {
1482
 
        
1483
 
    int pwidth = 0, pheight = 0, px = 0, py = 0, tx = 0, ty = 0;
1484
 
    GtkWidget *w;
1485
 
                               
1486
 
    w = GTK_WIDGET(filename);
1487
 
    pheight = w->allocation.height;
1488
 
                                                 
1489
 
    while ( ( GTK_WIDGET_FLAGS(w) & GTK_TOPLEVEL ) == 0 ) {
1490
 
//        printf("widget name: %s\n", gtk_widget_get_name(w) );
1491
 
        px = w->allocation.x;
1492
 
        py = w->allocation.y;
1493
 
        tx += px;
1494
 
        ty += py;
1495
 
        w = gtk_widget_get_parent(w);
1496
 
    }
1497
 
    
1498
 
    gtk_window_get_position( GTK_WINDOW(w), &px, &py);
1499
 
    tx += px;
1500
 
    ty += py;
1501
 
    
1502
 
    *x = tx;
1503
 
    *y = ty + pheight;
1504
 
}
1505
 
 
1506
 
// this pops up the menu on right click on filename button
1507
 
static gint menu_popup( GtkWidget *widget,
1508
 
                          GdkEvent *event )
1509
 
{
1510
 
    gboolean is_sensitive;
1511
 
    
1512
 
    GdkEventButton *bevent = (GdkEventButton *) event; 
1513
 
    g_object_get((gpointer) MI_file_menu, (gchar*) "sensitive", &is_sensitive, NULL);
1514
 
    if (bevent->button == (guint) 3 && is_sensitive == TRUE ) {
1515
 
        gtk_menu_popup (GTK_MENU (widget), NULL, NULL, position_popup_menu, NULL,
1516
 
                        bevent->button, bevent->time);
1517
 
        /* Tell calling code that we have handled this event; the buck
1518
 
         * stops here. */
1519
 
        return TRUE;
1520
 
    }
1521
 
    /* Tell calling code that we have not handled this event; pass it on. */
1522
 
    return FALSE;
1523
 
}
1524
 
 
1525
 
// this handles the shortcut keybindings for the menu
1526
 
static gint window_key_pressed( GtkWidget *widget,
1527
 
                          GdkEvent *event )
1528
 
{
1529
 
    gboolean is_sensitive;
1530
 
 
1531
 
    GdkEventKey *kevent = (GdkEventKey *) event; 
1532
 
//    printf("keyval: %i - mods: %i\n", kevent->keyval, kevent->state);
1533
 
 
1534
 
    g_object_get((gpointer) MI_file_menu, (gchar*) "sensitive", &is_sensitive, NULL);
1535
 
 
1536
 
    if (kevent->keyval == 112 && kevent->state == 4 && is_sensitive == TRUE ) {
1537
 
        gtk_menu_item_activate(GTK_MENU_ITEM(MI_preferences));
1538
 
        return TRUE;
1539
 
    } else if (kevent->keyval == 113 && kevent->state == 4 && is_sensitive == TRUE ) {
1540
 
        gtk_menu_item_activate(GTK_MENU_ITEM(MI_quit1));
1541
 
        return TRUE;
1542
 
    }
1543
 
    /* Tell calling code that we have not handled this event; pass it on. */
1544
 
    return FALSE;
1545
 
}
1546
 
 
1547
 
 
1548
 
 
1549
 
// now the widget
1550
 
//
1551
 
//
1552
 
GtkWidget*
1553
 
create_window1(char *param_animate_cmd, char *param_mkvideo_cmd,
1554
 
char *param_edit_cmd, char *param_help_cmd) {
1555
 
 
1556
 
    GtkAccelGroup *accel_group;
1557
 
    
1558
 
    tooltips = gtk_tooltips_new ();
1559
 
    accel_group = gtk_accel_group_new ();
1560
 
    
1561
 
    window1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1562
 
    gtk_window_set_title(GTK_WINDOW(window1), _("video capture"));
1563
 
    gtk_window_set_resizable(GTK_WINDOW(window1), FALSE);
1564
 
 
1565
 
    hbox1 = gtk_hbox_new(FALSE, 0);
1566
 
    gtk_widget_show(hbox1);
1567
 
    gtk_container_add(GTK_CONTAINER(window1), hbox1);
1568
 
/*    
1569
 
    menubar1 = gtk_menu_bar_new();
1570
 
    gtk_widget_show(menubar1);
1571
 
    gtk_box_pack_start(GTK_BOX(hbox1), menubar1, FALSE, FALSE, 0);
1572
 
    
1573
 
    MI_file = gtk_menu_item_new_with_mnemonic(_("_File"));
1574
 
    gtk_widget_show(MI_file);
1575
 
    gtk_container_add(GTK_CONTAINER(menubar1), MI_file);
1576
 
*/    
1577
 
    MI_file_menu = gtk_menu_new();
1578
 
//    gtk_menu_item_set_submenu(GTK_MENU_ITEM(MI_file), MI_file_menu);
1579
 
    
1580
 
    MI_preferences = gtk_image_menu_item_new_with_mnemonic(_("_Preferences"));
1581
 
    gtk_widget_show(MI_preferences);
1582
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_preferences);
1583
 
    gtk_widget_add_accelerator (MI_preferences, "activate", accel_group,
1584
 
                              GDK_p, GDK_CONTROL_MASK,
1585
 
                              GTK_ACCEL_VISIBLE);
1586
 
    
1587
 
    image32 = gtk_image_new_from_stock("gtk-preferences", GTK_ICON_SIZE_MENU);
1588
 
    gtk_widget_show(image32);
1589
 
    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_preferences), image32);
1590
 
    
1591
 
    MI_prefs_save = gtk_image_menu_item_new_with_mnemonic(_("_Save Preferences"));
1592
 
    gtk_widget_show(MI_prefs_save);
1593
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_prefs_save);
1594
 
    
1595
 
    image36 = gtk_image_new_from_stock("gtk-floppy", GTK_ICON_SIZE_MENU);
1596
 
    gtk_widget_show(image36);
1597
 
    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_prefs_save), image36);
1598
 
 
1599
 
    MI_continue = gtk_check_menu_item_new_with_mnemonic(_("Auto_continue (y/n)"));
1600
 
    gtk_widget_show(MI_continue);
1601
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_continue);
1602
 
    
1603
 
    separatormenuitem2 = gtk_menu_item_new();
1604
 
    gtk_widget_show(separatormenuitem2);
1605
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), separatormenuitem2);
1606
 
    gtk_widget_set_sensitive(separatormenuitem2, FALSE);
1607
 
    
1608
 
    MI_make_video = gtk_image_menu_item_new_with_mnemonic(_("_Make Video"));
1609
 
    gtk_widget_show(MI_make_video);
1610
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_make_video);
1611
 
    
1612
 
    image33 = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_MENU);
1613
 
    gtk_widget_show(image33);
1614
 
    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_make_video), image33);
1615
 
 
1616
 
    MI_animate = gtk_image_menu_item_new_with_mnemonic(_("_Animate"));
1617
 
    gtk_widget_show(MI_animate);
1618
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_animate);
1619
 
//    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_animate), image33);
1620
 
    
1621
 
    /*    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, animate_icon, FALSE, NULL) );
1622
 
    animate = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1623
 
    GTK_TOOLBAR_CHILD_BUTTON,
1624
 
    NULL,
1625
 
    _("Animate"),
1626
 
    _("Make animated GIF of captured individual frames"), NULL,
1627
 
    tmp_toolbar_icon, NULL, NULL);
1628
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1629
 
    gtk_widget_show(animate); */
1630
 
    
1631
 
    MI_help = gtk_image_menu_item_new_with_mnemonic(_("_Help"));
1632
 
    gtk_widget_show(MI_help);
1633
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_help);
1634
 
    
1635
 
    image34 = gtk_image_new_from_stock("gtk-help", GTK_ICON_SIZE_MENU);
1636
 
    gtk_widget_show(image34);
1637
 
    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_help), image34);
1638
 
    
1639
 
    separatormenuitem1 = gtk_menu_item_new();
1640
 
    gtk_widget_show(separatormenuitem1);
1641
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), separatormenuitem1);
1642
 
    gtk_widget_set_sensitive(separatormenuitem1, FALSE);
1643
 
    
1644
 
    MI_quit1 = gtk_image_menu_item_new_with_mnemonic(_("_Quit"));
1645
 
    gtk_widget_show(MI_quit1);
1646
 
    gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_quit1);
1647
 
    gtk_widget_add_accelerator (MI_quit1, "activate", accel_group,
1648
 
                              GDK_q, GDK_CONTROL_MASK,
1649
 
                              GTK_ACCEL_VISIBLE);
1650
 
    
1651
 
    image35 = gtk_image_new_from_stock("gtk-quit", GTK_ICON_SIZE_MENU);
1652
 
    gtk_widget_show(image35);
1653
 
    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_quit1), image35);
1654
 
    
1655
 
    toolbar2 = gtk_toolbar_new();
1656
 
    gtk_widget_show(toolbar2);
1657
 
    gtk_box_pack_start(GTK_BOX(hbox1), toolbar2, FALSE, FALSE, 0);
1658
 
    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar2), GTK_TOOLBAR_TEXT);
1659
 
    
1660
 
    filename = gtk_button_new_with_label(_("filename"));
1661
 
    gtk_button_set_use_underline(GTK_BUTTON(filename), FALSE);
1662
 
    g_object_set((gpointer) filename, (gchar*) "can-focus", (gboolean) FALSE, NULL);
1663
 
    gtk_widget_show(filename);
1664
 
//    gtk_box_pack_start(GTK_BOX(hbox1), filename, FALSE, FALSE, 0);
1665
 
    gtk_widget_set_size_request(filename, 130, -1);
1666
 
    gtk_tooltips_set_tip (tooltips, filename, _ ("Reset frame counter and filename"), NULL);
1667
 
    gtk_toolbar_insert_widget (GTK_TOOLBAR (toolbar2), filename,
1668
 
            "Reset frame counter and filename", "Reset frame counter and filename", 0);
1669
 
    
1670
 
    frame_drop_meter = led_meter_new ();
1671
 
    gtk_widget_show(frame_drop_meter);
1672
 
    gtk_box_pack_start(GTK_BOX(hbox1), frame_drop_meter, FALSE, FALSE, 0);
1673
 
    led_meter_set_tip(LED_METER(frame_drop_meter), "Monitor current frame rate\nyellow = 10-50 % too slow\nred = 50+ % too slow");
1674
 
 
1675
 
    toolbar3 = gtk_toolbar_new();
1676
 
    gtk_widget_show(toolbar3);
1677
 
    gtk_box_pack_start(GTK_BOX(hbox1), toolbar3, FALSE, FALSE, 0);
1678
 
    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar3), GTK_TOOLBAR_ICONS);
1679
 
    
1680
 
    //tmp_toolbar_icon = create_pixmap(window1, "stop.png");
1681
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, stop_icon, FALSE, NULL) );
1682
 
    stop = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1683
 
    GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1684
 
    NULL,
1685
 
    _("_STOP"),
1686
 
    _("Stop recording"), NULL,
1687
 
    tmp_toolbar_icon, NULL, NULL);
1688
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1689
 
//    gtk_widget_set_sensitive(stop, FALSE);
1690
 
    gtk_widget_show(stop);
1691
 
    //    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), TRUE);
1692
 
    
1693
 
    //tmp_toolbar_icon = create_pixmap(window1, "pause.png");
1694
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, pause_icon, FALSE, NULL) );
1695
 
    pause_tb = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1696
 
    GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1697
 
    NULL,
1698
 
    _("_PAUSE"),
1699
 
    _("Pause recording"), NULL,
1700
 
    tmp_toolbar_icon, NULL, NULL);
1701
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1702
 
    gtk_widget_show(pause_tb);
1703
 
//    gtk_widget_set_sensitive(pause_tb, FALSE);
1704
 
    
1705
 
    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1706
 
    
1707
 
    //tmp_toolbar_icon = create_pixmap(window1, "record_on.png");
1708
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, record_on_icon, FALSE, NULL) );
1709
 
    record = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1710
 
    GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1711
 
    NULL,
1712
 
    _("_RECORD"),
1713
 
    _("Start recording"), NULL,
1714
 
    tmp_toolbar_icon, NULL, NULL);
1715
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1716
 
    gtk_widget_show(record);
1717
 
    
1718
 
    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1719
 
    
1720
 
    //tmp_toolbar_icon = create_pixmap(window1, "step.png");
1721
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, step_icon, FALSE, NULL) );
1722
 
    step = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1723
 
    GTK_TOOLBAR_CHILD_BUTTON,
1724
 
    NULL,
1725
 
    _("Capture single frame"),
1726
 
    _("Capture single frame"), NULL,
1727
 
    tmp_toolbar_icon, NULL, NULL);
1728
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1729
 
    gtk_widget_show(step);
1730
 
    gtk_widget_set_sensitive(step, FALSE);
1731
 
    
1732
 
    //tmp_toolbar_icon = create_pixmap(window1, "prev.png");
1733
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, prev_icon, FALSE, NULL) );
1734
 
    previous = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1735
 
    GTK_TOOLBAR_CHILD_BUTTON,
1736
 
    NULL,
1737
 
    _("Move cursor back one frame"),
1738
 
    _("Move cursor back one frame"), NULL,
1739
 
    tmp_toolbar_icon, NULL, NULL);
1740
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1741
 
    gtk_widget_show(previous);
1742
 
    
1743
 
    //tmp_toolbar_icon = create_pixmap(window1, "next.png");
1744
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, next_icon, FALSE, NULL) );
1745
 
    next = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1746
 
    GTK_TOOLBAR_CHILD_BUTTON,
1747
 
    NULL,
1748
 
    _("Move cursor to next frame"),
1749
 
    _("Move cursor to next frame"), NULL,
1750
 
    tmp_toolbar_icon, NULL, NULL);
1751
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1752
 
    gtk_widget_show(next);
1753
 
    
1754
 
    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1755
 
    
1756
 
    //tmp_toolbar_icon = create_pixmap(window1, "move.png");
1757
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, move_icon, FALSE, NULL) );
1758
 
    move = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1759
 
    GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1760
 
    NULL,
1761
 
    _("Sticky Selection"),
1762
 
    _("Detach selection frame"), NULL,
1763
 
    tmp_toolbar_icon, NULL, NULL);
1764
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1765
 
    gtk_widget_show(move);
1766
 
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(move), TRUE);
1767
 
    
1768
 
    //tmp_toolbar_icon = create_pixmap(window1, "select.png");
1769
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, select_icon, FALSE, NULL) );
1770
 
    select_tb = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1771
 
    GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1772
 
    NULL,
1773
 
    _("Modify Selection"),
1774
 
    _("Select rectangular area to capture"), NULL,
1775
 
    tmp_toolbar_icon, NULL, NULL);
1776
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1777
 
    gtk_widget_show(select_tb);
1778
 
    
1779
 
    gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1780
 
    
1781
 
    //tmp_toolbar_icon = create_pixmap(window1, "animate.png");
1782
 
/*    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, animate_icon, FALSE, NULL) );
1783
 
    animate = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1784
 
    GTK_TOOLBAR_CHILD_BUTTON,
1785
 
    NULL,
1786
 
    _("Animate"),
1787
 
    _("Make animated GIF of captured individual frames"), NULL,
1788
 
    tmp_toolbar_icon, NULL, NULL);
1789
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1790
 
    gtk_widget_show(animate); */
1791
 
    
1792
 
    //tmp_toolbar_icon = create_pixmap(window1, "edit.png");
1793
 
    tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, edit_icon, FALSE, NULL) );
1794
 
    edit = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1795
 
    GTK_TOOLBAR_CHILD_BUTTON,
1796
 
    NULL,
1797
 
    _("Edit"),
1798
 
    _("Edit current individual frame"), NULL,
1799
 
    tmp_toolbar_icon, NULL, NULL);
1800
 
    gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1801
 
    gtk_widget_show(edit);
1802
 
    
1803
 
    g_signal_connect((gpointer) window1, "delete_event",
1804
 
    G_CALLBACK(on_window1_delete_event),
1805
 
    NULL);
1806
 
    g_signal_connect((gpointer) window1, "destroy",
1807
 
    G_CALLBACK(on_window1_destroy),
1808
 
    NULL);
1809
 
    g_signal_connect_swapped (G_OBJECT (window1), "key_press_event",
1810
 
                              G_CALLBACK (window_key_pressed), 
1811
 
                              NULL);
1812
 
    g_signal_connect((gpointer) MI_preferences, "activate",
1813
 
    G_CALLBACK(on_MI_preferences_activate),
1814
 
    NULL);
1815
 
    g_signal_connect((gpointer) MI_prefs_save, "activate",
1816
 
    G_CALLBACK(on_MI_prefs_save_activate),
1817
 
    jobp);
1818
 
    g_signal_connect((gpointer) MI_continue, "activate",
1819
 
    G_CALLBACK(on_MI_continue_activate),
1820
 
    jobp);
1821
 
    g_signal_connect((gpointer) MI_make_video, "activate",
1822
 
    G_CALLBACK(on_MI_make_video_activate),
1823
 
    param_mkvideo_cmd);
1824
 
    g_signal_connect((gpointer) MI_animate, "activate",
1825
 
    G_CALLBACK(on_MI_animate_activate),
1826
 
    param_animate_cmd);
1827
 
    g_signal_connect((gpointer) MI_help, "activate",
1828
 
    G_CALLBACK(on_MI_help_activate),
1829
 
    param_help_cmd);
1830
 
    g_signal_connect((gpointer) MI_quit1, "activate",
1831
 
    G_CALLBACK(on_MI_quit1_activate),
1832
 
    NULL);
1833
 
    g_signal_connect((gpointer) stop, "toggled",
1834
 
    G_CALLBACK(on_stop_toggled),
1835
 
    NULL);
1836
 
    g_signal_connect((gpointer) pause_tb, "toggled",
1837
 
    G_CALLBACK(on_pause_toggled),
1838
 
    NULL);
1839
 
    g_signal_connect((gpointer) record, "toggled",
1840
 
    G_CALLBACK(on_record_toggled),
1841
 
    NULL);
1842
 
    g_signal_connect((gpointer) record, "activate",
1843
 
    G_CALLBACK(on_record_toggled),
1844
 
    NULL);
1845
 
    g_signal_connect((gpointer) step, "clicked",
1846
 
    G_CALLBACK(on_step_clicked),
1847
 
    NULL);
1848
 
    g_signal_connect((gpointer) filename, "clicked",
1849
 
    G_CALLBACK(on_filename_clicked),
1850
 
    NULL);
1851
 
    g_signal_connect_swapped (G_OBJECT (filename), "button_press_event",
1852
 
                              G_CALLBACK (menu_popup), 
1853
 
                              G_OBJECT (MI_file_menu));
1854
 
    g_signal_connect((gpointer) previous, "clicked",
1855
 
    G_CALLBACK(on_previous_clicked),
1856
 
    NULL);
1857
 
    g_signal_connect((gpointer) next, "clicked",
1858
 
    G_CALLBACK(on_next_clicked),
1859
 
    NULL);
1860
 
    g_signal_connect((gpointer) move, "toggled",
1861
 
    G_CALLBACK(on_move_toggled),
1862
 
    NULL);
1863
 
    g_signal_connect((gpointer) select_tb, "toggled",
1864
 
    G_CALLBACK(on_select_toggled),
1865
 
    NULL);
1866
 
/*    g_signal_connect((gpointer) animate, "clicked",
1867
 
    G_CALLBACK(on_animate_clicked),
1868
 
    param_animate_cmd); */
1869
 
    g_signal_connect((gpointer) edit, "clicked",
1870
 
    G_CALLBACK(on_edit_clicked),
1871
 
    param_edit_cmd);
1872
 
    
1873
 
    /* Store pointers to all widgets, for use by lookup_widget(). */
1874
 
    GLADE_HOOKUP_OBJECT_NO_REF(window1, window1, "window1");
1875
 
    GLADE_HOOKUP_OBJECT(window1, hbox1, "hbox1");
1876
 
/*    GLADE_HOOKUP_OBJECT(window1, menubar1, "menubar1");
1877
 
    GLADE_HOOKUP_OBJECT(window1, MI_file, "MI_file"); */
1878
 
    GLADE_HOOKUP_OBJECT(window1, MI_file_menu, "MI_file_menu");
1879
 
    GLADE_HOOKUP_OBJECT(window1, MI_preferences, "MI_preferences");
1880
 
    GLADE_HOOKUP_OBJECT(window1, image32, "image32");
1881
 
    GLADE_HOOKUP_OBJECT(window1, MI_prefs_save, "MI_prefs_save");
1882
 
    GLADE_HOOKUP_OBJECT(window1, MI_continue, "MI_continue");
1883
 
    GLADE_HOOKUP_OBJECT(window1, image36, "image36");
1884
 
    GLADE_HOOKUP_OBJECT(window1, MI_make_video, "MI_make_video");
1885
 
    GLADE_HOOKUP_OBJECT(window1, MI_animate, "MI_animate");
1886
 
    GLADE_HOOKUP_OBJECT(window1, image33, "image33");
1887
 
    GLADE_HOOKUP_OBJECT(window1, MI_help, "MI_help");
1888
 
    GLADE_HOOKUP_OBJECT(window1, image34, "image34");
1889
 
    GLADE_HOOKUP_OBJECT(window1, separatormenuitem1, "separatormenuitem1");
1890
 
    GLADE_HOOKUP_OBJECT(window1, separatormenuitem2, "separatormenuitem2");
1891
 
    GLADE_HOOKUP_OBJECT(window1, MI_quit1, "MI_quit1");
1892
 
    GLADE_HOOKUP_OBJECT(window1, image35, "image35");
1893
 
    GLADE_HOOKUP_OBJECT(window1, filename, "filename");
1894
 
    GLADE_HOOKUP_OBJECT(window1, toolbar3, "toolbar3");
1895
 
    GLADE_HOOKUP_OBJECT(window1, stop, "stop");
1896
 
    GLADE_HOOKUP_OBJECT(window1, pause_tb, "pause");
1897
 
    GLADE_HOOKUP_OBJECT(window1, record, "record");
1898
 
    GLADE_HOOKUP_OBJECT(window1, step, "step");
1899
 
    GLADE_HOOKUP_OBJECT(window1, previous, "previous");
1900
 
    GLADE_HOOKUP_OBJECT(window1, next, "next");
1901
 
    GLADE_HOOKUP_OBJECT(window1, move, "move");
1902
 
    GLADE_HOOKUP_OBJECT(window1, select_tb, "select");
1903
 
    GLADE_HOOKUP_OBJECT(window1, frame_drop_meter, "frame_drop_meter");
1904
 
//    GLADE_HOOKUP_OBJECT(window1, animate, "animate");
1905
 
    GLADE_HOOKUP_OBJECT(window1, edit, "edit");
1906
 
    
1907
 
    return window1;
1908
 
}
1909
 
 
1910
 
void
1911
 
InitGTKControl(AppData *app) {
1912
 
    Display *mydisplay;
1913
 
    Window root, topwin;
1914
 
    
1915
 
    char *param_file;
1916
 
    int param_codec, compress;
1917
 
    float param_fps, param_max_time;
1918
 
    int param_max_frames, start_at_no, step, param_quality, mouseWanted;
1919
 
    char *dev, *snd;
1920
 
    int rate, size, channels, flags, bpp;
1921
 
    char *param_animate_cmd, *param_mkvideo_cmd, *param_edit_cmd, *param_help_cmd;
1922
 
    extern XVC_frame_lock;
1923
 
    
1924
 
    
1925
 
    param_file = app->file;
1926
 
    param_codec = app->targetCodec;
1927
 
    compress = app->compress;
1928
 
    param_fps = app->fps;
1929
 
    param_max_time = app->time;
1930
 
    param_max_frames = app->frames;
1931
 
    start_at_no = app->start_no;
1932
 
    step = app->step;
1933
 
    param_quality = app->quality;
1934
 
    mouseWanted = app->mouseWanted;
1935
 
    dev = app->device;
1936
 
    snd = app->snddev;
1937
 
    rate = app->sndrate;
1938
 
    size = app->sndsize;
1939
 
    channels = app->sndchannels;
1940
 
    flags = app->flags;
1941
 
    bpp = app->bpp;
1942
 
    param_animate_cmd = app->play_cmd;
1943
 
    param_mkvideo_cmd = app->video_cmd;
1944
 
    param_edit_cmd = app->edit_cmd;
1945
 
    param_help_cmd = app->help_cmd;
1946
 
    
1947
 
    // xvidcap specific initialization
1948
 
    // this is taken from control.c's CreateControl, but I don't want this
1949
 
    // stuff in create_window (for parts can't put it there)
1950
 
    
1951
 
    if ( app->cap_pos_x >= 0 || app->cap_pos_y >=0 ) {
1952
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(move), FALSE);
1953
 
        XVC_frame_lock = 0;
1954
 
    }
1955
 
    
1956
 
    if (! ( flags & FLG_NOGUI ) ) {
1957
 
        mydisplay = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
1958
 
    } else {
1959
 
        mydisplay = XOpenDisplay(NULL);
1960
 
    }
1961
 
    root = RootWindow(mydisplay, DefaultScreen(mydisplay));
1962
 
    
1963
 
    jobp = job_init(flags);
1964
 
    
1965
 
    jobp->area = GetArea();
1966
 
    jobp->bpp = bpp;
1967
 
    
1968
 
    if (!XGetWindowAttributes(mydisplay, root, &jobp->win_attr))
1969
 
        perror("Can't get window attributes!\n");
1970
 
    // the default is to use the colormap of the root window
1971
 
    jobp->ncolors = GetColors(mydisplay, &jobp->win_attr, &jobp->colors);
1972
 
    
1973
 
    /* find capture function */
1974
 
    job_set_capture();
1975
 
    
1976
 
    /* set frames per second */
1977
 
    job_set_fps(param_fps);
1978
 
    
1979
 
    /* jpeg quality parameter */
1980
 
    job_set_quality(param_quality);
1981
 
    
1982
 
    /* png compression */
1983
 
    job_set_compression(compress);
1984
 
    
1985
 
#ifdef HAVE_FFMPEG_AUDIO
1986
 
    /* initialize sound recording parameters */
1987
 
    job_set_sound_dev(snd, rate, size, channels);
1988
 
#endif // HAVE_FFMPEG_AUDIO
1989
 
 
1990
 
    jobp->targetCodec = param_codec;
1991
 
    jobp->mouseWanted = mouseWanted;
1992
 
    
1993
 
    jobp->max_time = param_max_time;
1994
 
    jobp->max_frames = param_max_frames;
1995
 
    jobp->start_no = start_at_no;
1996
 
    jobp->pic_no = start_at_no;
1997
 
    jobp->step = step;
1998
 
    jobp->video_dev = dev;
1999
 
 
2000
 
    // get color table       
2001
 
    if (jobp->get_colors)
2002
 
        jobp->color_table = (*jobp->get_colors)(jobp->colors, jobp->ncolors);
2003
 
    
2004
 
    // set filename
2005
 
    job_set_file(param_file);
2006
 
    // unset autocontinue unless we capture to movie and file is mutable
2007
 
    if ( jobp->flags & FLG_AUTO_CONTINUE && ( (! is_filename_mutable(jobp->file)) ||
2008
 
                (jobp->flags & FLG_MULTI_IMAGE) == 0 ) ) {
2009
 
        jobp->flags &= ~FLG_AUTO_CONTINUE;
2010
 
        printf("Output not a video file or no counter in filename\nDisabling autocontinue!\n");
2011
 
    }
2012
 
    if ( jobp->flags & FLG_MULTI_IMAGE ) {
2013
 
        if ( jobp->flags & FLG_AUTO_CONTINUE ) {
2014
 
            gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), TRUE);
2015
 
            gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), TRUE);
2016
 
        } else {
2017
 
            if ( is_filename_mutable(jobp->file)) {
2018
 
                gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), TRUE);
2019
 
                gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2020
 
            } else {
2021
 
                gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), FALSE);
2022
 
                gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2023
 
            }
2024
 
        }
2025
 
    } else {
2026
 
        gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), FALSE);
2027
 
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2028
 
    }
2029
 
    
2030
 
    
2031
 
    // set output handler (xto... .c)
2032
 
    job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
2033
 
    GtkChangeLabel(jobp->pic_no);
2034
 
    
2035
 
    #ifdef HAVE_LIBAVCODEC
2036
 
    #ifdef HAVE_LIBAVFORMAT
2037
 
    /*
2038
 
     * make sure we have even width and height for ffmpeg
2039
 
     */
2040
 
    if (jobp->target >= CAP_FFM) {
2041
 
        Boolean changed = FALSE;
2042
 
        
2043
 
        if (jobp->flags & FLG_RUN_VERBOSE) {
2044
 
            fprintf(stderr, "control.InitControl(): Original dimensions: %i * %i\n", jobp->area->width, jobp->area->height);
2045
 
        }
2046
 
        if ((jobp->area->width % 2) > 0 ) {
2047
 
            jobp->area->width--;
2048
 
            changed = TRUE;
2049
 
        }
2050
 
        if ((jobp->area->height % 2) > 0) {
2051
 
            jobp->area->height--;
2052
 
            changed = TRUE;
2053
 
        }
2054
 
        if ( jobp->win_attr.width < 26 ) {
2055
 
            jobp->win_attr.width = 26;
2056
 
            changed = TRUE;
2057
 
        }
2058
 
        if ( jobp->win_attr.height < 26 ) {
2059
 
            jobp->win_attr.height = 26;
2060
 
            changed = TRUE;
2061
 
        }
2062
 
        
2063
 
        if (changed) {
2064
 
            GtkChangeFrame(jobp->area->x, jobp->area->y, jobp->area->width, jobp->area->height, FALSE);
2065
 
            if (jobp->flags & FLG_RUN_VERBOSE) {
2066
 
                fprintf(stderr, "control.InitControl(): Modified dimensions: %i * %i\n", jobp->area->width, jobp->area->height);
2067
 
            }
2068
 
        }
2069
 
    }
2070
 
    #endif
2071
 
    #endif
2072
 
    
2073
 
    /* previous and next buttons have different meanings for on-the-fly encoding
2074
 
     * and individual frame capture ... this sets the tooltips accordingly */
2075
 
    if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
2076
 
        gtk_tooltips_set_tip (tooltips, previous, "Move cursor back one frame",
2077
 
                "Move cursor back one frame");
2078
 
        gtk_tooltips_set_tip (tooltips, next, "Move cursor to next frame",
2079
 
                "Move cursor to next frame");
2080
 
        gtk_tooltips_set_tip (tooltips, filename, 
2081
 
            "Left Click: Reset frame counter and filename\nRight Click: Popup Menu",
2082
 
            "Left Click: Reset frame counter and filename\nRight Click: Popup Menu");
2083
 
        if (jobp->pic_no >= jobp->step ) gtk_widget_set_sensitive(previous, TRUE);
2084
 
        else gtk_widget_set_sensitive(previous, FALSE);
2085
 
    } else {
2086
 
        if ( is_filename_mutable(jobp->file) ) {
2087
 
            gtk_widget_set_sensitive(next, TRUE);
2088
 
            if (jobp->movie_no > 0 ) gtk_widget_set_sensitive(previous, TRUE);
2089
 
            else gtk_widget_set_sensitive(previous, FALSE);
2090
 
        } else {
2091
 
            gtk_widget_set_sensitive(next, FALSE);
2092
 
            gtk_widget_set_sensitive(previous, FALSE);
2093
 
        }
2094
 
        gtk_tooltips_set_tip (tooltips, previous, "Move cursor to previous movie",
2095
 
                "Move cursor to previous movie");
2096
 
        gtk_tooltips_set_tip (tooltips, next, "Move cursor to next movie",
2097
 
                "Move cursor to next movie");
2098
 
        gtk_tooltips_set_tip (tooltips, filename, 
2099
 
            "Left Click: Reset movie counter to zero\nRight Click: Popup Menu",
2100
 
            "Left Click: Reset movie counter to zero\nRight Click: Popup Menu");
2101
 
    }
2102
 
    
2103
 
    /* If we run without GUI, we autostart the recording */
2104
 
    if ( jobp->flags & FLG_NOGUI ) {
2105
 
        XCloseDisplay(mydisplay);
2106
 
        gtk_init_add( (GtkFunction) start_recording_nongui_stuff, jobp );
2107
 
    } 
2108
 
    
2109
 
    // register key_snooper for shortcuts ...
2110
 
//    gtk_key_snooper_install(keySnooper, NULL);
2111
 
    
2112
 
}
2113
 
 
2114
 
 
2115
 
 
2116