1 // widget-helper.h
2 // LiVES
3 // (c) G. Finch 2012 - 2018 <salsaman+lives@gmail.com>
4 // released under the GNU GPL 3 or later
5 // see file ../COPYING or www.gnu.org for licensing details
6 
7 #ifndef HAS_LIVES_WIDGET_HELPER_H
8 #define HAS_LIVES_WIDGET_HELPER_H
9 
10 #ifndef IS_SOLARIS
11 #define WIDGET_HELPER_GLOBAL_INLINE inline
12 #define WIDGET_HELPER_LOCAL_INLINE static inline
13 #else
14 #define WIDGET_HELPER_GLOBAL_INLINE
15 #define WIDGET_HELPER_LOCAL_INLINE
16 #endif
17 
18 #ifndef M_PI
19 #define M_PI 3.1415926536
20 #endif
21 
22 #define LIVES_HAS_GRID_WIDGET 0
23 #define LIVES_HAS_SWITCH_WIDGET 0
24 #define LIVES_HAS_IMAGE_MENU_ITEM 0
25 #define LIVES_HAS_DEVICE_MANAGER 0
26 
27 #define MIN_SPINBUTTON_SIZE 6 ///< min digits for spinbuttons
28 
29 #define LONG_ENTRY_WIDTH ((int)(100.*widget_opts.scale))
30 #define SHORT_ENTRY_WIDTH ((int)(40.*widget_opts.scale))
31 #define MEDIUM_ENTRY_WIDTH ((int)(60.*widget_opts.scale))
32 #define SHORTER_ENTRY_WIDTH (MEDIUM_ENTRY_WIDTH >> 1)
33 
34 typedef enum {
35   LIVES_DISPLAY_TYPE_UNKNOWN = 0,
36   LIVES_DISPLAY_TYPE_X11,
37   LIVES_DISPLAY_TYPE_WIN32,
38   LIVES_DISPLAY_TYPE_WAYLAND
39 } lives_display_t;
40 
41 typedef struct {
42   int x, y;
43   int width, height;
44 } lives_rect_t;
45 
46 // values below are multiplied by scale (unless value is -1)
47 #define W_CSS_MIN_WIDTH -1
48 #define W_CSS_MIN_HEIGHT 18
49 #define W_PACKING_WIDTH  10 // packing width for widgets with labels
50 #define W_PACKING_HEIGHT 6 // packing height for widgets
51 #define W_BORDER_WIDTH   10 // default border width
52 #define W_FILL_LENGTH    (W_PACKING_WIDTH * 4) // default extra fill size
53 
54 #if defined (GUI_GTK) || defined (LIVES_PAINTER_IS_CAIRO)
55 #include "widget-helper-gtk.h"
56 #endif
57 
58 // basic functions (wrappers for Toolkit functions)
59 
60 #ifdef LIVES_LINGO_IS_PANGO
61 // pango stuff. I suppose it should be here on the offchance that it might one day be used with a non-gtk+ toolkit...
62 typedef PangoLayout LingoLayout;
63 typedef PangoContext LingoContext;
64 typedef PangoWrapMode LingoWrapMode;
65 typedef PangoEllipsizeMode LingoEllipsizeMode;
66 typedef PangoFontDescription LingoFontDescription;
67 #define lingo_layout_set_alignment(a, b) pango_layout_set_alignment(a, b)
68 
69 #define LINGO_ALIGN_LEFT PANGO_ALIGN_LEFT
70 #define LINGO_ALIGN_RIGHT PANGO_ALIGN_RIGHT
71 #define LINGO_ALIGN_CENTER PANGO_ALIGN_CENTER
72 
73 #define LINGO_WRAP_WORD PANGO_WRAP_WORD
74 #define LINGO_WRAP_CHAR PANGO_WRAP_CHAR
75 #define LINGO_WRAP_WORD_CHAR PANGO_WRAP_WORD_CHAR
76 
77 #define LINGO_ELLIPSIZE_NONE PANGO_ELLIPSIZE_NONE
78 #define LINGO_ELLIPSIZE_START PANGO_ELLIPSIZE_START
79 #define LINGO_ELLIPSIZE_END PANGO_ELLIPSIZE_END
80 #define LINGO_ELLIPSIZE_MIDDLE PANGO_ELLIPSIZE_MIDDLE
81 
82 #define lingo_layout_set_text(a, b, c) pango_layout_set_text(a, b, c)
83 #define lingo_layout_set_markup_with_accel(a, b, c, d, e) \
84   pango_layout_set_markup_with_accel(a, b, c, d, e)
85 #ifdef LIVES_PAINTER_IS_CAIRO
86 #define LIVES_PAINTER_COLOR_PALETTE(endian) (endian == LIVES_BIG_ENDIAN ? WEED_PALETTE_ARGB32 \
87 					     : WEED_PALETTE_BGRA32)
88 #define lingo_painter_show_layout(a, b) pango_cairo_show_layout(a, b)
89 #endif
90 #ifdef GUI_GTK
91 #define lives_widget_create_lingo_context(a) gtk_widget_create_pango_context(a)
92 #endif
93 #define lingo_layout_get_size(a, b, c) pango_layout_get_size(a, b, c)
94 #define lingo_layout_new(a) pango_layout_new(a)
95 #define lingo_layout_set_markup(a, b, c) pango_layout_set_markup(a, b, c)
96 #define lingo_layout_set_width(a, b) pango_layout_set_width(a, b)
97 #define lingo_layout_set_height(a, b) pango_layout_set_height(a, b)
98 
99 #define lingo_font_description_new(a) pango_font_description_new()
100 #define lingo_font_description_get_size(a) pango_font_description_get_size(a)
101 #define lingo_font_description_set_size(a, b) pango_font_description_set_size(a, b)
102 #define lingo_font_description_free(a) pango_font_description_free(a)
103 
104 #define LINGO_IS_LAYOUT(a) PANGO_IS_LAYOUT(a)
105 #define LINGO_IS_CONTEXT(a) PANGO_IS_CONTEXT(a)
106 
107 #define LINGO_SCALE PANGO_SCALE
108 #endif
109 
110 typedef LingoEllipsizeMode LiVESEllipsizeMode;
111 #define LIVES_ELLIPSIZE_NONE LINGO_ELLIPSIZE_NONE
112 #define LIVES_ELLIPSIZE_START LINGO_ELLIPSIZE_START
113 #define LIVES_ELLIPSIZE_MIDDLE LINGO_ELLIPSIZE_MIDDLE
114 #define LIVES_ELLIPSIZE_END LINGO_ELLIPSIZE_END
115 
116 
117 #ifdef LIVES_PAINTER_IS_CAIRO
118 // ...likewise with cairo
119 #ifndef GUI_GTK
120 #include <cairo/cairo.h>
121 #endif
122 
123 typedef cairo_t lives_painter_t;
124 typedef cairo_surface_t lives_painter_surface_t;
125 
126 boolean lives_painter_surface_destroy(lives_painter_surface_t *);
127 lives_painter_surface_t *lives_painter_surface_reference(lives_painter_surface_t *);
128 
129 typedef cairo_format_t lives_painter_format_t;
130 
131 #define LIVES_PAINTER_FORMAT_A1   CAIRO_FORMAT_A1
132 #define LIVES_PAINTER_FORMAT_A8   CAIRO_FORMAT_A8
133 #define LIVES_PAINTER_FORMAT_RGB24 CAIRO_FORMAT_RGB24
134 #define LIVES_PAINTER_FORMAT_ARGB32 CAIRO_FORMAT_ARGB32
135 
136 typedef cairo_content_t lives_painter_content_t; // eg. color, alpha, color+alpha
137 
138 #define LIVES_PAINTER_CONTENT_COLOR CAIRO_CONTENT_COLOR
139 
140 typedef cairo_operator_t lives_painter_operator_t;
141 
142 #define LIVES_PAINTER_OPERATOR_UNKNOWN CAIRO_OPERATOR_OVER
143 #define LIVES_PAINTER_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER
144 
145 #define LIVES_PAINTER_OPERATOR_DEST_OUT CAIRO_OPERATOR_DEST_OUT
146 #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
147 #define LIVES_PAINTER_OPERATOR_DIFFERENCE CAIRO_OPERATOR_OVER
148 #define LIVES_PAINTER_OPERATOR_OVERLAY CAIRO_OPERATOR_OVER
149 #else
150 #define LIVES_PAINTER_OPERATOR_DIFFERENCE CAIRO_OPERATOR_DIFFERENCE
151 #define LIVES_PAINTER_OPERATOR_OVERLAY CAIRO_OPERATOR_OVERLAY
152 #endif
153 
154 typedef cairo_fill_rule_t lives_painter_fill_rule_t;
155 
156 #define LIVES_PAINTER_FILL_RULE_WINDING  CAIRO_FILL_RULE_WINDING
157 #define LIVES_PAINTER_FILL_RULE_EVEN_ODD CAIRO_FILL_RULE_EVEN_ODD
158 
159 #endif
160 
161 // lives_painter_functions
162 
163 lives_painter_t *lives_painter_create_from_surface(lives_painter_surface_t *target);
164 
165 lives_painter_t *lives_painter_create_from_widget(LiVESWidget *);
166 boolean lives_painter_remerge(lives_painter_t *);
167 
168 boolean lives_painter_set_source_pixbuf(lives_painter_t *, const LiVESPixbuf *, double pixbuf_x, double pixbuf_y);
169 boolean lives_painter_set_source_surface(lives_painter_t *, lives_painter_surface_t *, double x, double y);
170 
171 lives_painter_surface_t *lives_xwindow_create_similar_surface(LiVESXWindow *window,
172     lives_painter_content_t cont,
173     int width, int height);
174 lives_painter_surface_t *lives_widget_create_painter_surface(LiVESWidget *);
175 lives_painter_surface_t *lives_painter_image_surface_create(lives_painter_format_t format, int width, int height);
176 lives_painter_surface_t *lives_painter_image_surface_create_for_data(uint8_t *data, lives_painter_format_t,
177     int width, int height, int stride);
178 
179 boolean lives_painter_surface_flush(lives_painter_surface_t *);
180 
181 boolean lives_painter_destroy(lives_painter_t *);
182 
183 boolean lives_painter_new_path(lives_painter_t *);
184 
185 boolean lives_painter_paint(lives_painter_t *);
186 
187 boolean lives_painter_fill(lives_painter_t *);
188 boolean lives_painter_stroke(lives_painter_t *);
189 boolean lives_painter_clip(lives_painter_t *);
190 
191 boolean lives_painter_render_background(LiVESWidget *, lives_painter_t *, double x, double y, double width, double height);
192 
193 boolean lives_painter_set_source_rgb(lives_painter_t *, double red, double green, double blue);
194 boolean lives_painter_set_source_rgba(lives_painter_t *, double red, double green, double blue, double alpha);
195 
196 boolean lives_painter_set_line_width(lives_painter_t *, double width);
197 
198 boolean lives_painter_translate(lives_painter_t *, double x, double y);
199 
200 boolean lives_painter_rectangle(lives_painter_t *, double x, double y, double width, double height);
201 boolean lives_painter_arc(lives_painter_t *, double xc, double yc, double radius, double angle1, double angle2);
202 boolean lives_painter_line_to(lives_painter_t *, double x, double y);
203 boolean lives_painter_move_to(lives_painter_t *, double x, double y);
204 boolean lives_painter_close_path(lives_painter_t *);
205 
206 boolean lives_painter_set_operator(lives_painter_t *, lives_painter_operator_t);
207 
208 boolean lives_painter_set_fill_rule(lives_painter_t *, lives_painter_fill_rule_t);
209 
210 lives_painter_surface_t *lives_painter_get_target(lives_painter_t *);
211 int lives_painter_format_stride_for_width(lives_painter_format_t, int width);
212 
213 uint8_t *lives_painter_image_surface_get_data(lives_painter_surface_t *);
214 int lives_painter_image_surface_get_width(lives_painter_surface_t *);
215 int lives_painter_image_surface_get_height(lives_painter_surface_t *);
216 int lives_painter_image_surface_get_stride(lives_painter_surface_t *);
217 lives_painter_format_t lives_painter_image_surface_get_format(lives_painter_surface_t *);
218 
219 // utils
220 LiVESAlign lives_justify_to_align(LiVESJustification justification);
221 
222 LiVESScrollDirection lives_get_scroll_direction(LiVESXEventScroll *event);
223 
224 boolean lives_has_icon(LiVESIconTheme *, const char *stock_id, LiVESIconSize size);
225 
226 const char *lives_get_stock_icon_alt(int alt_stock_id);
227 void widget_helper_set_stock_icon_alts(LiVESIconTheme *);
228 
229 boolean widget_helper_init(void);
230 boolean widget_opts_rescale(double scale);
231 
232 lives_colRGBA64_t lives_rgba_col_new(int red, int green, int blue, int alpha);
233 lives_colRGBA64_t *widget_color_to_lives_rgba(lives_colRGBA64_t *, LiVESWidgetColor *);
234 LiVESWidgetColor *lives_rgba_to_widget_color(LiVESWidgetColor *, lives_colRGBA64_t *);
235 
236 lives_colRGBA64_t *lives_painter_set_source_rgb_from_lives_rgba(lives_painter_t *, lives_colRGBA64_t *);
237 lives_colRGB48_t *lives_painter_set_source_rgb_from_lives_rgb(lives_painter_t *, lives_colRGB48_t *);
238 LiVESWidgetColor *lives_painter_set_source_rgb_from_lives_widget_color(lives_painter_t *, LiVESWidgetColor *);
239 
240 boolean clear_widget_bg(LiVESWidget *widget, lives_painter_surface_t *);
241 boolean clear_widget_bg_area(LiVESWidget *widget, lives_painter_surface_t *s,
242                              double x, double y, double width, double height);
243 
244 boolean lives_rgba_equal(lives_colRGBA64_t *col1, lives_colRGBA64_t *col2);
245 lives_colRGBA64_t *lives_rgba_copy(lives_colRGBA64_t *col1, lives_colRGBA64_t *col2);
246 
247 // object funcs.
248 
249 boolean lives_widget_object_ref(livespointer); ///< increase refcount by one
250 boolean lives_widget_object_unref(livespointer); ///< decrease refcount by one: if refcount==0, object is destroyed
251 
252 // remove any "floating" reference and add a new ref
253 boolean lives_widget_object_ref_sink(livespointer);
254 
255 // set string data and free it later
256 void lives_widget_object_set_data_auto(LiVESWidgetObject *, const char *key, livespointer data);
257 
258 // set list and free it later (but not the list data)
259 void lives_widget_object_set_data_list(LiVESWidgetObject *, const char *key, LiVESList *list);
260 
261 // set widget object and unref it later
262 void lives_widget_object_set_data_widget_object(LiVESWidgetObject *, const char *key, livespointer other);
263 // lives_pixbuf functions
264 
265 int lives_pixbuf_get_width(const LiVESPixbuf *);
266 int lives_pixbuf_get_height(const LiVESPixbuf *);
267 boolean lives_pixbuf_get_has_alpha(const LiVESPixbuf *);
268 int lives_pixbuf_get_rowstride(const LiVESPixbuf *);
269 int lives_pixbuf_get_n_channels(const LiVESPixbuf *);
270 unsigned char *lives_pixbuf_get_pixels(const LiVESPixbuf *);
271 const unsigned char *lives_pixbuf_get_pixels_readonly(const LiVESPixbuf *);
272 LiVESPixbuf *lives_pixbuf_new(boolean has_alpha, int width, int height);
273 LiVESPixbuf *lives_pixbuf_copy(LiVESPixbuf *);
274 LiVESPixbuf *lives_pixbuf_new_from_data(const unsigned char *buf, boolean has_alpha, int width, int height,
275                                         int rowstride, LiVESPixbufDestroyNotify lives_free_buffer_fn,
276                                         livespointer destroy_fn_data);
277 
278 LiVESPixbuf *lives_pixbuf_new_from_file(const char *filename, LiVESError **error);
279 LiVESWidget *lives_image_new_from_pixbuf(LiVESPixbuf *);
280 LiVESPixbuf *lives_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, boolean preserve_aspect_ratio,
281     LiVESError **error);
282 
283 LiVESPixbuf *lives_pixbuf_scale_simple(const LiVESPixbuf *src, int dest_width, int dest_height,
284                                        LiVESInterpType interp_type);
285 
286 boolean lives_pixbuf_saturate_and_pixelate(const LiVESPixbuf *src, LiVESPixbuf *dest, float saturation, boolean pixilate);
287 
288 // basic widget fns
289 
290 // TODO consider combining  get/set value, get/set label, get/set label widget
291 
292 #ifdef GUI_GTK
293 
294 typedef GConnectFlags LiVESConnectFlags;
295 
296 #define LIVES_CONNECT_AFTER G_CONNECT_AFTER
297 #define LIVES_CONNECT_SWAPPED G_CONNECT_SWAPPED
298 
299 unsigned long lives_signal_connect_sync(livespointer instance, const char *detailed_signal, LiVESGuiCallback c_handler,
300                                         livespointer data, LiVESConnectFlags flags);
301 
302 unsigned long lives_signal_connect_async(livespointer instance, const char *detailed_signal, LiVESGuiCallback c_handler,
303     livespointer data, LiVESConnectFlags flags);
304 
305 #define lives_signal_connect(instance, detailed_signal, c_handler, data) \
306   lives_signal_connect_async(instance, detailed_signal, c_handler, data, 0)
307 #define lives_signal_connect_after(instance, detailed_signal, c_handler, data) \
308   lives_signal_connect_async(instance, detailed_signal, c_handler, data, LIVES_CONNECT_AFTER)
309 #define lives_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
310   lives_signal_connect_async(instance, detailed_signal, c_handler, data, LIVES_CONNECT_SWAPPED)
311 
312 #define lives_signal_sync_connect(instance, detailed_signal, c_handler, data) \
313   lives_signal_connect_sync(instance, detailed_signal, c_handler, data, 0)
314 #define lives_signal_sync_connect_after(instance, detailed_signal, c_handler, data) \
315   lives_signal_connect_sync(instance, detailed_signal, c_handler, data, LIVES_CONNECT_AFTER)
316 #define lives_signal_sync_connect_swapped(instance, detailed_signal, c_handler, data) \
317   lives_signal_connect_sync(instance, detailed_signal, c_handler, data, LIVES_CONNECT_SWAPPED)
318 
319 boolean lives_signal_handlers_sync_disconnect_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
320 boolean lives_signal_handlers_sync_block_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
321 boolean lives_signal_handlers_sync_unblock_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
322 
323 boolean lives_signal_handlers_disconnect_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
324 boolean lives_signal_handlers_block_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
325 boolean lives_signal_handlers_unblock_by_func(livespointer instance, LiVESGuiCallback func, livespointer data);
326 #else
327 ulong lives_signal_connect(LiVESWidget *, const char *signal_name, ulong funcptr, livespointer data);
328 #endif
329 
330 boolean lives_signal_handler_block(livespointer instance, unsigned long handler_id);
331 boolean lives_signal_handler_unblock(livespointer instance, unsigned long handler_id);
332 
333 boolean lives_signal_handler_disconnect(livespointer instance, unsigned long handler_id);
334 boolean lives_signal_stop_emission_by_name(livespointer instance, const char *detailed_signal);
335 
336 boolean lives_grab_add(LiVESWidget *);
337 boolean lives_grab_remove(LiVESWidget *);
338 
339 #ifdef GUI_GTK
340 boolean set_css_value_direct(LiVESWidget *, LiVESWidgetState state, const char *selector,
341                              const char *detail, const char *value);
342 #endif
343 
344 boolean lives_widget_set_sensitive(LiVESWidget *, boolean state);
345 boolean lives_widget_get_sensitive(LiVESWidget *);
346 
347 boolean lives_widget_show(LiVESWidget *);
348 boolean lives_widget_show_now(LiVESWidget *);
349 boolean lives_widget_show_all(LiVESWidget *);
350 boolean lives_widget_show_all_from_bg(LiVESWidget *);
351 boolean lives_widget_hide(LiVESWidget *);
352 boolean lives_widget_destroy(LiVESWidget *);
353 boolean lives_widget_realize(LiVESWidget *);
354 
355 boolean lives_widget_queue_draw(LiVESWidget *);
356 boolean lives_widget_queue_draw_area(LiVESWidget *, int x, int y, int width, int height);
357 boolean lives_widget_queue_resize(LiVESWidget *);
358 boolean lives_widget_set_size_request(LiVESWidget *, int width, int height);
359 boolean lives_widget_set_minimum_size(LiVESWidget *, int width, int height);
360 boolean lives_widget_set_maximum_size(LiVESWidget *, int width, int height);
361 boolean lives_widget_reparent(LiVESWidget *, LiVESWidget *new_parent);
362 
363 boolean lives_widget_is_ancestor(LiVESWidget *, LiVESWidget *ancestor);
364 
365 boolean lives_widget_set_app_paintable(LiVESWidget *, boolean paintable);
366 boolean lives_widget_set_opacity(LiVESWidget *widget, double opacity);
367 
368 boolean lives_widget_has_focus(LiVESWidget *);
369 boolean lives_widget_is_focus(LiVESWidget *);
370 boolean lives_widget_has_default(LiVESWidget *);
371 
372 boolean lives_widget_set_halign(LiVESWidget *, LiVESAlign align);
373 boolean lives_widget_set_valign(LiVESWidget *, LiVESAlign align);
374 
375 LiVESWidget *lives_event_box_new(void);
376 boolean lives_event_box_set_above_child(LiVESEventBox *, boolean set);
377 
378 LiVESWidget *lives_label_new(const char *text);
379 
380 const char *lives_label_get_text(LiVESLabel *);
381 boolean lives_label_set_text(LiVESLabel *, const char *text);
382 
383 boolean lives_label_set_markup(LiVESLabel *, const char *markup);
384 
385 boolean lives_label_set_mnemonic_widget(LiVESLabel *, LiVESWidget *widget);
386 LiVESWidget *lives_label_get_mnemonic_widget(LiVESLabel *);
387 
388 boolean lives_label_set_selectable(LiVESLabel *, boolean setting);
389 
390 boolean lives_label_set_line_wrap(LiVESLabel *, boolean set);
391 boolean lives_label_set_line_wrap_mode(LiVESLabel *, LingoWrapMode mode);
392 boolean lives_label_seT_lines(LiVESLabel *, int nlines);
393 boolean lives_label_set_ellipsize(LiVESLabel *, LiVESEllipsizeMode mode);
394 
395 //////////
396 
397 LiVESWidget *lives_button_new(void);
398 LiVESWidget *lives_button_new_with_label(const char *label);
399 
400 boolean lives_button_set_label(LiVESButton *, const char *label);
401 const char *lives_button_get_label(LiVESButton *);
402 boolean lives_button_clicked(LiVESButton *);
403 
404 boolean lives_button_set_relief(LiVESButton *, LiVESReliefStyle);
405 boolean lives_button_set_image(LiVESButton *, LiVESWidget *image);
406 boolean lives_button_set_image_from_stock(LiVESButton *, const char *stock_id);
407 boolean lives_button_set_focus_on_click(LiVESButton *, boolean focus);
408 boolean lives_widget_set_focus_on_click(LiVESWidget *, boolean focus);
409 
410 /////////////////////////////
411 
412 LiVESWidget *lives_switch_new(void);
413 boolean lives_switch_set_active(LiVESSwitch *, boolean);
414 boolean lives_switch_get_active(LiVESSwitch *);
415 
416 LiVESWidget *lives_spinner_new(void);
417 boolean lives_spinner_start(LiVESSpinner *);
418 boolean lives_spinner_stop(LiVESSpinner *);
419 
420 LiVESWidget *lives_check_button_new(void);
421 LiVESWidget *lives_check_button_new_with_label(const char *label);
422 
423 LiVESWidget *lives_radio_button_new(LiVESSList *group);
424 
425 LiVESWidget *lives_spin_button_new(LiVESAdjustment *, double climb_rate, uint32_t digits);
426 
427 LiVESResponseType lives_dialog_run(LiVESDialog *);
428 boolean lives_dialog_response(LiVESDialog *, int response);
429 int lives_dialog_get_response_for_widget(LiVESDialog *, LiVESWidget *);
430 
431 boolean lives_widget_set_bg_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
432 boolean lives_widget_set_fg_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
433 boolean lives_widget_set_text_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
434 boolean lives_widget_set_base_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
435 
436 boolean lives_widget_set_border_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
437 boolean lives_widget_set_outline_color(LiVESWidget *, LiVESWidgetState state, const LiVESWidgetColor *);
438 
439 boolean lives_widget_set_text_size(LiVESWidget *, LiVESWidgetState state, const char *size);
440 
441 boolean lives_widget_get_fg_state_color(LiVESWidget *, LiVESWidgetState state, LiVESWidgetColor *);
442 boolean lives_widget_get_bg_state_color(LiVESWidget *, LiVESWidgetState state, LiVESWidgetColor *);
443 
444 boolean lives_color_parse(const char *spec, LiVESWidgetColor *);
445 
446 LiVESWidgetColor *lives_widget_color_copy(LiVESWidgetColor *c1orNULL, const LiVESWidgetColor *c2);
447 boolean lives_widget_color_equal(LiVESWidgetColor *, const LiVESWidgetColor *);
448 boolean lives_widget_color_mix(LiVESWidgetColor *c1, const LiVESWidgetColor *c2, float mixval);
449 
450 LiVESWidget *lives_image_new(void);
451 LiVESWidget *lives_image_new_from_file(const char *filename);
452 LiVESWidget *lives_image_new_from_stock(const char *stock_id, LiVESIconSize size);
453 
454 boolean lives_image_set_from_pixbuf(LiVESImage *, LiVESPixbuf *);
455 LiVESPixbuf *lives_image_get_pixbuf(LiVESImage *);
456 
457 boolean lives_widget_set_margin_left(LiVESWidget *, int margin);
458 boolean lives_widget_set_margin_right(LiVESWidget *, int margin);
459 boolean lives_widget_set_margin_top(LiVESWidget *, int margin);
460 boolean lives_widget_set_margin_bottom(LiVESWidget *, int margin);
461 
462 boolean lives_widget_set_margin(LiVESWidget *, int margin);
463 boolean lives_widget_set_padding(LiVESWidget *, int padding);
464 
465 LiVESWidget *lives_dialog_get_content_area(LiVESDialog *);
466 LiVESWidget *lives_dialog_get_action_area(LiVESDialog *);
467 
468 boolean lives_dialog_add_action_widget(LiVESDialog *, LiVESWidget *, int response_id);
469 
470 LiVESWidget *lives_window_new(LiVESWindowType wintype);
471 boolean lives_window_set_title(LiVESWindow *, const char *title);
472 const char *lives_window_get_title(LiVESWindow *);
473 boolean lives_window_set_transient_for(LiVESWindow *, LiVESWindow *parent);
474 
475 boolean lives_window_set_modal(LiVESWindow *, boolean modal);
476 boolean lives_window_set_deletable(LiVESWindow *, boolean deletable);
477 boolean lives_window_set_resizable(LiVESWindow *, boolean resizable);
478 boolean lives_window_set_keep_below(LiVESWindow *, boolean keep_below);
479 boolean lives_window_set_keep_above(LiVESWindow *, boolean keep_below);
480 boolean lives_window_set_decorated(LiVESWindow *, boolean decorated);
481 
482 boolean lives_window_set_default_size(LiVESWindow *, int width, int height);
483 
484 boolean lives_window_set_monitor(LiVESWindow *window, int monnum);
485 
486 boolean lives_widget_get_position(LiVESWidget *, int *x, int *y);
487 
488 LiVESWidget *lives_window_get_focus(LiVESWindow *);
489 
490 boolean lives_window_get_modal(LiVESWindow *);
491 boolean lives_window_set_modal(LiVESWindow *, boolean modal);
492 
493 boolean lives_window_move(LiVESWindow *, int x, int y);
494 boolean lives_window_get_position(LiVESWindow *, int *x, int *y);
495 boolean lives_window_set_position(LiVESWindow *, LiVESWindowPosition pos);
496 boolean lives_window_resize(LiVESWindow *, int width, int height);
497 boolean lives_window_present(LiVESWindow *);
498 boolean lives_window_fullscreen(LiVESWindow *);
499 boolean lives_window_unfullscreen(LiVESWindow *);
500 boolean lives_window_maximize(LiVESWindow *);
501 boolean lives_window_unmaximize(LiVESWindow *);
502 boolean lives_window_set_hide_titlebar_when_maximized(LiVESWindow *, boolean setting);
503 
504 boolean lives_window_add_accel_group(LiVESWindow *, LiVESAccelGroup *group);
505 boolean lives_window_remove_accel_group(LiVESWindow *, LiVESAccelGroup *group);
506 boolean lives_menu_set_accel_group(LiVESMenu *, LiVESAccelGroup *group);
507 
508 LiVESAdjustment *lives_adjustment_new(double value, double lower, double upper,
509                                       double step_increment, double page_increment, double page_size);
510 
511 boolean lives_box_reorder_child(LiVESBox *, LiVESWidget *child, int pos);
512 boolean lives_box_set_homogeneous(LiVESBox *, boolean homogeneous);
513 boolean lives_box_set_spacing(LiVESBox *, int spacing);
514 boolean lives_box_set_child_packing(LiVESBox *, LiVESWidget *child, boolean expand, boolean fill,
515                                     uint32_t padding, LiVESPackType pack_type);
516 
517 boolean lives_box_pack_start(LiVESBox *, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding);
518 boolean lives_box_pack_end(LiVESBox *, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding);
519 
520 LiVESWidget *lives_hbox_new(boolean homogeneous, int spacing);
521 LiVESWidget *lives_vbox_new(boolean homogeneous, int spacing);
522 
523 LiVESWidget *lives_hseparator_new(void);
524 LiVESWidget *lives_vseparator_new(void);
525 
526 LiVESWidget *lives_hbutton_box_new(void);
527 LiVESWidget *lives_vbutton_box_new(void);
528 
529 boolean lives_button_box_set_layout(LiVESButtonBox *, LiVESButtonBoxStyle bstyle);
530 boolean lives_button_box_set_button_width(LiVESButtonBox *, LiVESWidget *button, int min_width);
531 
532 boolean lives_button_box_set_child_non_homogeneous(LiVESButtonBox *, LiVESWidget *child, boolean set);
533 
534 boolean lives_button_set_border_colour(LiVESWidget *, LiVESWidgetState state, LiVESWidgetColor *);
535 boolean lives_button_center(LiVESWidget *);
536 boolean lives_button_uncenter(LiVESWidget *, int normal_width);
537 boolean lives_button_box_make_first(LiVESButtonBox *, LiVESWidget *);
538 boolean lives_dialog_make_widget_first(LiVESDialog *, LiVESWidget *);
539 LiVESAccelGroup *lives_dialog_add_escape(LiVESDialog *dlg, LiVESWidget *button);
540 
541 LiVESWidget *lives_standard_toolbar_new(void);
542 
543 LiVESWidget *lives_standard_hscale_new(LiVESAdjustment *);
544 LiVESWidget *lives_vscale_new(LiVESAdjustment *);
545 
546 LiVESWidget *lives_hpaned_new(void);
547 LiVESWidget *lives_vpaned_new(void);
548 
549 boolean lives_paned_set_position(LiVESPaned *, int pos);
550 int lives_paned_get_position(LiVESPaned *);
551 boolean lives_paned_pack(int where, LiVESPaned *, LiVESWidget *child, boolean resize, boolean shrink);
552 
553 LiVESWidget *lives_hscrollbar_new(LiVESAdjustment *);
554 LiVESWidget *lives_vscrollbar_new(LiVESAdjustment *);
555 
556 LiVESWidget *lives_arrow_new(LiVESArrowType, LiVESShadowType);
557 
558 LiVESWidget *lives_alignment_new(float xalign, float yalign, float xscale, float yscale);
559 boolean lives_alignment_set(LiVESWidget *, float xalign, float yalign, float xscale, float yscale);
560 
561 LiVESWidget *lives_expander_new(const char *label);
562 LiVESWidget *lives_expander_get_label_widget(LiVESExpander *);
563 boolean lives_expander_set_use_markup(LiVESExpander *, boolean val);
564 boolean lives_expander_set_expanded(LiVESExpander *, boolean val);
565 boolean lives_expander_set_label(LiVESExpander *, const char *text);
566 boolean lives_expander_get_expanded(LiVESExpander *);
567 boolean lives_label_set_width_chars(LiVESLabel *, int nchars);
568 boolean lives_label_set_halignment(LiVESLabel *, float yalign);
569 
570 LiVESWidget *lives_combo_new(void);
571 LiVESWidget *lives_combo_new_with_model(LiVESTreeModel *model);
572 LiVESTreeModel *lives_combo_get_model(LiVESCombo *);
573 boolean lives_combo_set_model(LiVESCombo *, LiVESTreeModel *);
574 boolean lives_combo_set_focus_on_click(LiVESCombo *, boolean state);
575 void lives_combo_popup(LiVESCombo *);
576 boolean lives_combo_remove_all_text(LiVESCombo *);
577 
578 boolean lives_combo_append_text(LiVESCombo *, const char *text);
579 boolean lives_combo_set_entry_text_column(LiVESCombo *, int column);
580 
581 const char *lives_combo_get_active_text(LiVESCombo *) WARN_UNUSED;
582 boolean lives_combo_set_active_text(LiVESCombo *, const char *text);
583 boolean lives_combo_set_active_index(LiVESCombo *, int index);
584 int lives_combo_get_active_index(LiVESCombo *);
585 boolean lives_combo_get_active_iter(LiVESCombo *, LiVESTreeIter *);
586 boolean lives_combo_set_active_iter(LiVESCombo *, LiVESTreeIter *);
587 boolean lives_combo_set_active_string(LiVESCombo *, const char *active_str);
588 
589 LiVESWidget *lives_combo_get_entry(LiVESCombo *);
590 
591 boolean lives_combo_populate(LiVESCombo *, LiVESList *list);
592 
593 LiVESWidget *lives_text_view_new(void);
594 LiVESWidget *lives_text_view_new_with_buffer(LiVESTextBuffer *);
595 LiVESTextBuffer *lives_text_view_get_buffer(LiVESTextView *);
596 boolean lives_text_view_set_editable(LiVESTextView *, boolean setting);
597 boolean lives_text_view_set_accepts_tab(LiVESTextView *, boolean setting);
598 boolean lives_text_view_set_cursor_visible(LiVESTextView *, boolean setting);
599 boolean lives_text_view_set_wrap_mode(LiVESTextView *, LiVESWrapMode wrapmode);
600 boolean lives_text_view_set_justification(LiVESTextView *, LiVESJustification justify);
601 boolean lives_text_view_set_top_margin(LiVESTextView *, int margin);
602 boolean lives_text_view_set_bottom_margin(LiVESTextView *, int margin);
603 
604 LiVESTextBuffer *lives_text_buffer_new(void);
605 char *lives_text_buffer_get_text(LiVESTextBuffer *, LiVESTextIter *start,
606                                  LiVESTextIter *end, boolean inc_hidden_chars);
607 char *lives_text_buffer_get_all_text(LiVESTextBuffer *);
608 boolean lives_text_buffer_set_text(LiVESTextBuffer *, const char *, int len);
609 
610 boolean lives_text_buffer_insert(LiVESTextBuffer *, LiVESTextIter *, const char *, int len);
611 boolean lives_text_buffer_insert_at_cursor(LiVESTextBuffer *, const char *, int len);
612 
613 boolean lives_text_buffer_get_start_iter(LiVESTextBuffer *, LiVESTextIter *);
614 boolean lives_text_buffer_get_end_iter(LiVESTextBuffer *, LiVESTextIter *);
615 
616 boolean lives_text_buffer_place_cursor(LiVESTextBuffer *, LiVESTextIter *);
617 
618 LiVESTextMark *lives_text_buffer_create_mark(LiVESTextBuffer *, const char *mark_name,
619     const LiVESTextIter *where, boolean left_gravity);
620 boolean lives_text_buffer_delete_mark(LiVESTextBuffer *, LiVESTextMark *);
621 
622 boolean lives_text_buffer_delete(LiVESTextBuffer *, LiVESTextIter *start, LiVESTextIter *end);
623 
624 boolean lives_text_buffer_get_iter_at_mark(LiVESTextBuffer *, LiVESTextIter *, LiVESTextMark *);
625 
626 boolean lives_tree_model_get(LiVESTreeModel *, LiVESTreeIter *, ...);
627 boolean lives_tree_model_get_iter(LiVESTreeModel *, LiVESTreeIter *, LiVESTreePath *);
628 boolean lives_tree_model_get_iter_first(LiVESTreeModel *, LiVESTreeIter *);
629 LiVESTreePath *lives_tree_model_get_path(LiVESTreeModel *, LiVESTreeIter *);
630 boolean lives_tree_model_iter_children(LiVESTreeModel *, LiVESTreeIter *, LiVESTreeIter *parent);
631 int lives_tree_model_iter_n_children(LiVESTreeModel *, LiVESTreeIter *);
632 boolean lives_tree_model_iter_next(LiVESTreeModel *, LiVESTreeIter *);
633 
634 boolean lives_tree_path_free(LiVESTreePath *);
635 LiVESTreePath *lives_tree_path_new_from_string(const char *path);
636 int lives_tree_path_get_depth(LiVESTreePath *);
637 int *lives_tree_path_get_indices(LiVESTreePath *);
638 
639 LiVESTreeStore *lives_tree_store_new(int ncols, ...);
640 boolean lives_tree_store_append(LiVESTreeStore *, LiVESTreeIter *, LiVESTreeIter *parent);
641 boolean lives_tree_store_prepend(LiVESTreeStore *, LiVESTreeIter *, LiVESTreeIter *parent);
642 boolean lives_tree_store_set(LiVESTreeStore *, LiVESTreeIter *, ...);
643 
644 LiVESWidget *lives_tree_view_new(void);
645 LiVESWidget *lives_tree_view_new_with_model(LiVESTreeModel *);
646 boolean lives_tree_view_set_model(LiVESTreeView *, LiVESTreeModel *);
647 LiVESTreeModel *lives_tree_view_get_model(LiVESTreeView *);
648 int lives_tree_view_append_column(LiVESTreeView *, LiVESTreeViewColumn *);
649 boolean lives_tree_view_set_headers_visible(LiVESTreeView *, boolean vis);
650 LiVESAdjustment *lives_tree_view_get_hadjustment(LiVESTreeView *);
651 LiVESTreeSelection *lives_tree_view_get_selection(LiVESTreeView *);
652 
653 LiVESTreeViewColumn *lives_tree_view_column_new_with_attributes(const char *title, LiVESCellRenderer *, ...);
654 boolean lives_tree_view_column_set_sizing(LiVESTreeViewColumn *, LiVESTreeViewColumnSizing type);
655 boolean lives_tree_view_column_set_fixed_width(LiVESTreeViewColumn *, int fwidth);
656 
657 boolean lives_tree_selection_get_selected(LiVESTreeSelection *, LiVESTreeModel **, LiVESTreeIter *);
658 boolean lives_tree_selection_set_mode(LiVESTreeSelection *, LiVESSelectionMode);
659 boolean lives_tree_selection_select_iter(LiVESTreeSelection *, LiVESTreeIter *);
660 
661 LiVESListStore *lives_list_store_new(int ncols, ...);
662 boolean lives_list_store_set(LiVESListStore *, LiVESTreeIter *, ...);
663 boolean lives_list_store_insert(LiVESListStore *, LiVESTreeIter *, int position);
664 
665 LiVESCellRenderer *lives_cell_renderer_text_new(void);
666 LiVESCellRenderer *lives_cell_renderer_spin_new(void);
667 LiVESCellRenderer *lives_cell_renderer_toggle_new(void);
668 LiVESCellRenderer *lives_cell_renderer_pixbuf_new(void);
669 
670 LiVESWidget *lives_drawing_area_new(void);
671 
672 int lives_event_get_time(LiVESXEvent *);
673 
674 boolean lives_toggle_button_get_active(LiVESToggleButton *);
675 boolean lives_toggle_button_set_active(LiVESToggleButton *, boolean active);
676 boolean lives_toggle_button_set_mode(LiVESToggleButton *, boolean drawind);
677 boolean lives_toggle_button_toggle(LiVESToggleButton *);
678 
679 LiVESWidget *lives_toggle_tool_button_new(void);
680 boolean lives_toggle_tool_button_get_active(LiVESToggleToolButton *);
681 boolean lives_toggle_tool_button_set_active(LiVESToggleToolButton *, boolean active);
682 boolean lives_toggle_tool_button_toggle(LiVESToggleToolButton *);
683 
684 int lives_utf8_strcmpfunc(livesconstpointer, livesconstpointer, livespointer fwd);
685 
686 LiVESList *add_sorted_list_to_menu(LiVESMenu *, LiVESList *);
687 
688 LiVESSList *lives_radio_button_get_group(LiVESRadioButton *);
689 LiVESSList *lives_radio_menu_item_get_group(LiVESRadioMenuItem *);
690 
691 LiVESWidget *lives_widget_get_parent(LiVESWidget *);
692 LiVESWidget *lives_widget_get_toplevel(LiVESWidget *);
693 
694 LiVESXWindow *lives_widget_get_xwindow(LiVESWidget *);
695 boolean lives_xwindow_set_keep_above(LiVESXWindow *, boolean setting);
696 boolean lives_xwindow_invalidate_rect(LiVESXWindow *, lives_rect_t *, boolean inv_childs);
697 
698 boolean lives_widget_set_can_focus(LiVESWidget *, boolean state);
699 boolean lives_widget_set_can_default(LiVESWidget *, boolean state);
700 boolean lives_widget_set_can_focus_and_default(LiVESWidget *);
701 
702 boolean lives_widget_add_events(LiVESWidget *, int events);
703 boolean lives_widget_set_events(LiVESWidget *, int events);
704 boolean lives_widget_remove_accelerator(LiVESWidget *, LiVESAccelGroup *, uint32_t accel_key, LiVESXModifierType accel_mods);
705 boolean lives_widget_get_preferred_size(LiVESWidget *, LiVESRequisition *min_size, LiVESRequisition *nat_size);
706 
707 boolean lives_widget_set_no_show_all(LiVESWidget *, boolean set);
708 boolean lives_widget_get_no_show_all(LiVESWidget *);
709 
710 boolean lives_container_remove(LiVESContainer *, LiVESWidget *);
711 boolean lives_container_add(LiVESContainer *, LiVESWidget *);
712 boolean lives_container_set_border_width(LiVESContainer *, uint32_t width);
713 
714 boolean lives_container_foreach(LiVESContainer *, LiVESWidgetCallback callback, livespointer cb_data);
715 LiVESList *lives_container_get_children(LiVESContainer *);
716 boolean lives_container_set_focus_child(LiVESContainer *, LiVESWidget *child);
717 LiVESWidget *lives_container_get_focus_child(LiVESContainer *);
718 
719 LiVESWidget *lives_progress_bar_new(void);
720 boolean lives_progress_bar_set_fraction(LiVESProgressBar *, double fraction);
721 boolean lives_progress_bar_set_pulse_step(LiVESProgressBar *, double fraction);
722 boolean lives_progress_bar_pulse(LiVESProgressBar *);
723 
724 double lives_spin_button_get_value(LiVESSpinButton *);
725 int lives_spin_button_get_value_as_int(LiVESSpinButton *);
726 
727 LiVESAdjustment *lives_spin_button_get_adjustment(LiVESSpinButton *);
728 LiVESAdjustment *lives_spin_button_set_adjustment(LiVESSpinButton *, LiVESAdjustment *adj);
729 
730 boolean lives_spin_button_set_value(LiVESSpinButton *, double value);
731 boolean lives_spin_button_set_range(LiVESSpinButton *, double min, double max);
732 
733 boolean lives_spin_button_set_wrap(LiVESSpinButton *, boolean wrap);
734 
735 boolean lives_spin_button_set_step_increment(LiVESSpinButton *button, double step_increment);
736 boolean lives_spin_button_set_snap_to_ticks(LiVESSpinButton *, boolean snap);
737 boolean lives_spin_button_set_snap_to_multiples(LiVESSpinButton *, double mult);
738 
739 boolean lives_spin_button_set_digits(LiVESSpinButton *, uint32_t digits);
740 
741 boolean lives_spin_button_update(LiVESSpinButton *);
742 
743 LiVESWidget *lives_color_button_new_with_color(const LiVESWidgetColor *);
744 LiVESWidgetColor *lives_color_button_get_color(LiVESColorButton *, LiVESWidgetColor *);
745 boolean lives_color_button_set_color(LiVESColorButton *, const LiVESWidgetColor *);
746 boolean lives_color_button_set_alpha(LiVESColorButton *, int16_t alpha);
747 int16_t lives_color_button_get_alpha(LiVESColorButton *);
748 boolean lives_color_button_set_title(LiVESColorButton *, const char *title);
749 boolean lives_color_button_set_use_alpha(LiVESColorButton *, boolean use_alpha);
750 
751 LiVESToolItem *lives_tool_button_new(LiVESWidget *icon_widget, const char *label);
752 LiVESToolItem *lives_tool_item_new(void);
753 LiVESToolItem *lives_separator_tool_item_new(void);
754 boolean lives_tool_button_set_icon_widget(LiVESToolButton *, LiVESWidget *icon);
755 boolean lives_tool_button_set_label_widget(LiVESToolButton *, LiVESWidget *label);
756 boolean lives_tool_button_set_use_underline(LiVESToolButton *, boolean use_underline);
757 
758 LiVESWidget *lives_message_dialog_new(LiVESWindow *parent, LiVESDialogFlags flags, LiVESMessageType type,
759                                       LiVESButtonsType buttons,
760                                       const char *msg_fmt, ...);
761 
762 double lives_ruler_get_value(LiVESRuler *);
763 double lives_ruler_set_value(LiVESRuler *, double value);
764 
765 boolean lives_ruler_set_range(LiVESRuler *, double lower, double upper, double position, double max_size);
766 double lives_ruler_set_upper(LiVESRuler *, double upper);
767 double lives_ruler_set_lower(LiVESRuler *, double lower);
768 
769 LiVESWidget *lives_toolbar_new(void);
770 boolean lives_toolbar_insert(LiVESToolbar *, LiVESToolItem *, int pos);
771 boolean lives_toolbar_set_show_arrow(LiVESToolbar *, boolean show);
772 LiVESIconSize lives_toolbar_get_icon_size(LiVESToolbar *);
773 boolean lives_toolbar_set_icon_size(LiVESToolbar *, LiVESIconSize icon_size);
774 boolean lives_toolbar_set_style(LiVESToolbar *, LiVESToolbarStyle style);
775 
776 int lives_widget_get_allocation_x(LiVESWidget *);
777 int lives_widget_get_allocation_y(LiVESWidget *);
778 int lives_widget_get_allocation_width(LiVESWidget *);
779 int lives_widget_get_allocation_height(LiVESWidget *);
780 
781 boolean lives_widget_set_state(LiVESWidget *, LiVESWidgetState state);
782 LiVESWidgetState lives_widget_get_state(LiVESWidget *widget);
783 
784 LiVESWidget *lives_bin_get_child(LiVESBin *);
785 
786 boolean lives_widget_is_sensitive(LiVESWidget *);
787 boolean lives_widget_is_visible(LiVESWidget *);
788 boolean lives_widget_is_realized(LiVESWidget *);
789 
790 double lives_adjustment_get_upper(LiVESAdjustment *);
791 double lives_adjustment_get_lower(LiVESAdjustment *);
792 double lives_adjustment_get_page_size(LiVESAdjustment *);
793 double lives_adjustment_get_step_increment(LiVESAdjustment *);
794 double lives_adjustment_get_value(LiVESAdjustment *);
795 
796 boolean lives_adjustment_set_upper(LiVESAdjustment *, double upper);
797 boolean lives_adjustment_set_lower(LiVESAdjustment *, double lower);
798 boolean lives_adjustment_set_page_size(LiVESAdjustment *, double page_size);
799 boolean lives_adjustment_set_step_increment(LiVESAdjustment *, double step_increment);
800 boolean lives_adjustment_set_value(LiVESAdjustment *, double value);
801 
802 boolean lives_adjustment_clamp_page(LiVESAdjustment *, double lower, double upper);
803 
804 LiVESAdjustment *lives_range_get_adjustment(LiVESRange *);
805 boolean lives_range_set_value(LiVESRange *, double value);
806 boolean lives_range_set_range(LiVESRange *, double min, double max);
807 boolean lives_range_set_increments(LiVESRange *, double step, double page);
808 boolean lives_range_set_inverted(LiVESRange *, boolean invert);
809 
810 double lives_range_get_value(LiVESRange *);
811 
812 boolean lives_editable_set_editable(LiVESEditable *, boolean editable);
813 boolean lives_editable_get_editable(LiVESEditable *);
814 boolean lives_editable_select_region(LiVESEditable *, int start_pos, int end_pos);
815 
816 LiVESWidget *lives_entry_new(void);
817 boolean lives_entry_set_editable(LiVESEntry *, boolean editable);
818 boolean lives_entry_get_editable(LiVESEntry *);
819 const char *lives_entry_get_text(LiVESEntry *);
820 boolean lives_entry_set_text(LiVESEntry *, const char *text);
821 boolean lives_entry_set_width_chars(LiVESEntry *, int nchars);
822 boolean lives_entry_set_max_length(LiVESEntry *, int len);
823 boolean lives_entry_set_activates_default(LiVESEntry *, boolean act);
824 boolean lives_entry_get_activates_default(LiVESEntry *);
825 boolean lives_entry_set_visibility(LiVESEntry *, boolean vis);
826 boolean lives_entry_set_has_frame(LiVESEntry *, boolean has);
827 boolean lives_entry_set_alignment(LiVESEntry *, float align);
828 
829 double lives_scale_button_get_value(LiVESScaleButton *);
830 boolean lives_scale_button_set_value(LiVESScaleButton *, double value);
831 
832 LiVESWidget *lives_table_new(uint32_t rows, uint32_t cols, boolean homogeneous);
833 boolean lives_table_set_row_spacings(LiVESTable *, uint32_t spacing);
834 boolean lives_table_set_col_spacings(LiVESTable *, uint32_t spacing);
835 boolean lives_table_resize(LiVESTable *, uint32_t rows, uint32_t cols);
836 boolean lives_table_attach(LiVESTable *, LiVESWidget *child, uint32_t left, uint32_t right,
837                            uint32_t top, uint32_t bottom, LiVESAttachOptions xoptions, LiVESAttachOptions yoptions,
838                            uint32_t xpad, uint32_t ypad);
839 
840 boolean lives_table_set_column_homogeneous(LiVESTable *, boolean homogeneous);
841 boolean lives_table_set_row_homogeneous(LiVESTable *, boolean homogeneous);
842 
843 #if LIVES_TABLE_IS_GRID
844 LiVESWidget *lives_grid_new(void);
845 boolean lives_grid_set_row_spacing(LiVESGrid *, uint32_t spacing);
846 boolean lives_grid_set_column_spacing(LiVESGrid *, uint32_t spacing);
847 boolean lives_grid_attach_next_to(LiVESGrid *, LiVESWidget *child, LiVESWidget *sibling,
848                                   LiVESPositionType side, int width, int height);
849 
850 boolean lives_grid_insert_row(LiVESGrid *, int posn);
851 boolean lives_grid_remove_row(LiVESGrid *, int posn);
852 #endif
853 
854 #if GTK_CHECK_VERSION(3,2,0)
855 char *lives_font_chooser_get_font(LiVESFontChooser *);
856 boolean lives_font_chooser_set_font(LiVESFontChooser *, const char *fontname);
857 LingoFontDescription *lives_font_chooser_get_font_desc(LiVESFontChooser *);
858 boolean lives_font_chooser_set_font_desc(LiVESFontChooser *, LingoFontDescription *lfd);
859 #endif
860 
861 LiVESWidget *lives_frame_new(const char *label);
862 boolean lives_frame_set_label(LiVESFrame *, const char *label);
863 boolean lives_frame_set_label_align(LiVESFrame *, float xalign, float yalign);
864 boolean lives_frame_set_label_widget(LiVESFrame *, LiVESWidget *);
865 LiVESWidget *lives_frame_get_label_widget(LiVESFrame *);
866 boolean lives_frame_set_shadow_type(LiVESFrame *, LiVESShadowType);
867 
868 LiVESWidget *lives_notebook_new(void);
869 LiVESWidget *lives_notebook_get_nth_page(LiVESNotebook *, int pagenum);
870 int lives_notebook_get_current_page(LiVESNotebook *);
871 boolean lives_notebook_set_current_page(LiVESNotebook *, int pagenum);
872 boolean lives_notebook_set_tab_label(LiVESNotebook *, LiVESWidget *child, LiVESWidget *tablabel);
873 
874 LiVESWidget *lives_menu_new(void);
875 LiVESWidget *lives_menu_bar_new(void);
876 
877 boolean lives_menu_popup(LiVESMenu *, LiVESXEventButton *);
878 
879 boolean lives_menu_reorder_child(LiVESMenu *, LiVESWidget *, int pos);
880 boolean lives_menu_detach(LiVESMenu *);
881 
882 boolean lives_menu_shell_insert(LiVESMenuShell *, LiVESWidget *child, int pos);
883 boolean lives_menu_shell_prepend(LiVESMenuShell *, LiVESWidget *child);
884 boolean lives_menu_shell_append(LiVESMenuShell *, LiVESWidget *child);
885 
886 LiVESWidget *lives_menu_item_new(void);
887 LiVESWidget *lives_menu_item_new_with_label(const char *label);
888 
889 boolean lives_menu_item_set_accel_path(LiVESMenuItem *, const char *path);
890 
891 LiVESWidget *lives_check_menu_item_new_with_label(const char *label);
892 boolean lives_check_menu_item_set_draw_as_radio(LiVESCheckMenuItem *, boolean setting);
893 
894 LiVESWidget *lives_radio_menu_item_new_with_label(LiVESSList *group, const char *label);
895 LiVESWidget *lives_image_menu_item_new_with_label(const char *label);
896 LiVESWidget *lives_image_menu_item_new_from_stock(const char *stock_id, LiVESAccelGroup *accel_group);
897 
898 LiVESToolItem *lives_menu_tool_button_new(LiVESWidget *icon, const char *label);
899 boolean lives_menu_tool_button_set_menu(LiVESMenuToolButton *, LiVESWidget *menu);
900 
901 #if !GTK_CHECK_VERSION(3, 10, 0)
902 
903 boolean lives_image_menu_item_set_image(LiVESImageMenuItem *, LiVESWidget *image);
904 
905 #endif
906 
907 boolean lives_menu_item_set_submenu(LiVESMenuItem *, LiVESWidget *);
908 LiVESWidget *lives_menu_item_get_submenu(LiVESMenuItem *);
909 
910 boolean lives_menu_item_activate(LiVESMenuItem *);
911 
912 boolean lives_check_menu_item_set_active(LiVESCheckMenuItem *, boolean state);
913 boolean lives_check_menu_item_get_active(LiVESCheckMenuItem *);
914 
915 boolean lives_menu_set_title(LiVESMenu *, const char *title);
916 
917 int lives_display_get_n_screens(LiVESXDisplay *);
918 
919 char *lives_file_chooser_get_filename(LiVESFileChooser *);
920 LiVESSList *lives_file_chooser_get_filenames(LiVESFileChooser *);
921 
922 boolean lives_widget_grab_focus(LiVESWidget *);
923 boolean lives_widget_grab_default(LiVESWidget *);
924 
925 LiVESWidget *lives_widget_set_tooltip_text(LiVESWidget *, const char *text);
926 
927 boolean lives_widget_process_updates(LiVESWidget *);
928 
929 boolean lives_xwindow_get_origin(LiVESXWindow *, int *posx, int *posy);
930 boolean lives_xwindow_get_frame_extents(LiVESXWindow *, lives_rect_t *);
931 
932 LiVESAccelGroup *lives_accel_group_new(void);
933 boolean lives_accel_group_connect(LiVESAccelGroup *, uint32_t key, LiVESXModifierType mod, LiVESAccelFlags flags,
934                                   LiVESWidgetClosure *closure);
935 boolean lives_accel_group_disconnect(LiVESAccelGroup *, LiVESWidgetClosure *closure);
936 boolean lives_accel_groups_activate(LiVESWidgetObject *object, uint32_t key, LiVESXModifierType mod);
937 
938 boolean lives_widget_add_accelerator(LiVESWidget *, const char *accel_signal, LiVESAccelGroup *accel_group,
939                                      uint32_t accel_key, LiVESXModifierType accel_mods, LiVESAccelFlags accel_flags);
940 
941 boolean lives_widget_get_pointer(LiVESXDevice *, LiVESWidget *, int *x, int *y);
942 boolean lives_widget_get_modmask(LiVESXDevice *, LiVESWidget *, LiVESXModifierType *modmask);
943 LiVESXWindow *lives_display_get_window_at_pointer(LiVESXDevice *, LiVESXDisplay *, int *win_x, int *win_y);
944 boolean lives_display_get_pointer(LiVESXDevice *, LiVESXDisplay *, LiVESXScreen **, int *x, int *y, LiVESXModifierType *mask);
945 boolean lives_display_warp_pointer(LiVESXDevice *, LiVESXDisplay *, LiVESXScreen *, int x, int y);
946 
947 LiVESXDisplay *lives_widget_get_display(LiVESWidget *);
948 lives_display_t lives_widget_get_display_type(LiVESWidget *);
949 
950 uint64_t lives_widget_get_xwinid(LiVESWidget *, const char *failure_msg);
951 LiVESWindow *lives_widget_get_window(LiVESWidget *);
952 
953 LiVESWidget *lives_scrolled_window_new(LiVESAdjustment *hadj, LiVESAdjustment *vadj);
954 LiVESAdjustment *lives_scrolled_window_get_hadjustment(LiVESScrolledWindow *);
955 LiVESAdjustment *lives_scrolled_window_get_vadjustment(LiVESScrolledWindow *);
956 
957 boolean lives_scrolled_window_set_policy(LiVESScrolledWindow *, LiVESPolicyType hpolicy, LiVESPolicyType vpolicy);
958 boolean lives_scrolled_window_add_with_viewport(LiVESScrolledWindow *, LiVESWidget *child);
959 
960 boolean lives_scrolled_window_set_min_content_height(LiVESScrolledWindow *, int height);
961 boolean lives_scrolled_window_set_min_content_width(LiVESScrolledWindow *, int width);
962 
963 boolean lives_xwindow_raise(LiVESXWindow *);
964 boolean lives_xwindow_set_cursor(LiVESXWindow *, LiVESXCursor *);
965 
966 uint32_t lives_timer_add(uint32_t interval, LiVESWidgetSourceFunc function, livespointer data);
967 boolean lives_timer_remove(uint32_t timer);
968 uint32_t lives_idle_add(LiVESWidgetSourceFunc function, livespointer data);
969 
970 boolean lives_source_remove(uint32_t handle);
971 
972 uint32_t lives_accelerator_get_default_mod_mask();
973 
974 int lives_screen_get_width(LiVESXScreen *);
975 int lives_screen_get_height(LiVESXScreen *);
976 
977 boolean lives_scale_set_draw_value(LiVESScale *, boolean draw_value);
978 boolean lives_scale_set_value_pos(LiVESScale *, LiVESPositionType ptype);
979 boolean lives_scale_set_digits(LiVESScale *, int digits);
980 
981 boolean lives_has_toplevel_focus(LiVESWidget *window);
982 
983 // optional (return TRUE if implemented)
984 
985 boolean lives_dialog_set_has_separator(LiVESDialog *, boolean has);
986 boolean lives_widget_set_hexpand(LiVESWidget *, boolean state);
987 boolean lives_widget_set_vexpand(LiVESWidget *, boolean state);
988 boolean lives_image_menu_item_set_always_show_image(LiVESImageMenuItem *, boolean show);
989 boolean lives_scale_button_set_orientation(LiVESScaleButton *, LiVESOrientation orientation);
990 boolean lives_window_set_auto_startup_notification(boolean set);
991 
992 // compound functions (composed of basic functions)
993 boolean lives_widget_set_pack_type(LiVESBox *, LiVESWidget *, LiVESPackType);
994 
995 void lives_label_set_hpadding(LiVESLabel *, int pad);
996 
997 LiVESWidget *align_horizontal_with(LiVESWidget *thingtoadd, LiVESWidget *thingtoalignwith);
998 
999 boolean lives_box_pack_first(LiVESBox *, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding);
1000 
1001 // this is not the same as a GtkLayout !!
1002 LiVESWidget *lives_layout_new(LiVESBox *);
1003 LiVESWidget *lives_layout_hbox_new(LiVESLayout *);
1004 LiVESWidget *lives_layout_row_new(LiVESLayout *);
1005 int lives_layout_add_row(LiVESLayout *);
1006 LiVESWidget *lives_layout_pack(LiVESHBox *, LiVESWidget *);
1007 LiVESWidget *lives_layout_add_label(LiVESLayout *, const char *text, boolean horizontal);
1008 void lives_layout_label_set_text(LiVESLabel *, const char *text);
1009 LiVESWidget *lives_layout_add_fill(LiVESLayout *, boolean horizontal);
1010 LiVESWidget *lives_layout_add_separator(LiVESLayout *, boolean horizontal);
1011 LiVESWidget *lives_layout_expansion_row_new(LiVESLayout *, LiVESWidget *widget);
1012 
1013 boolean lives_button_grab_default_special(LiVESWidget *);
1014 boolean lives_button_ungrab_default_special(LiVESWidget *);
1015 
1016 #define BUTTON_DIM_VAL (0.4 * 65535.) // fg / bg ratio for dimmed buttons (BUTTON_DIM_VAL/65535) (lower is dimmer)
1017 
1018 #define LOCK_BUTTON_WIDTH 24 ///< sizes for the lock button
1019 #define LOCK_BUTTON_HEIGHT 24
1020 
1021 boolean show_warn_image(LiVESWidget *, const char *text);
1022 boolean hide_warn_image(LiVESWidget *);
1023 
1024 boolean is_standard_widget(LiVESWidget *);
1025 
1026 boolean lives_widget_set_frozen(LiVESWidget *, boolean state);
1027 
1028 #ifdef USE_SPECIAL_BUTTONS
1029 void sbutt_render(LiVESWidget *, LiVESWidgetState state, livespointer user_data);
1030 
1031 LiVESWidget *lives_standard_button_new(int width, int height);
1032 LiVESWidget *lives_standard_button_new_with_label(const char *labeltext, int width, int height);
1033 boolean lives_standard_button_set_label(LiVESButton *, const char *label);
1034 const char *lives_standard_button_get_label(LiVESButton *);
1035 boolean lives_standard_button_set_image(LiVESButton *, LiVESWidget *image);
1036 
1037 LiVESWidget *lives_standard_button_new_full(const char *label, int width, int height, LiVESBox *,
1038     boolean fake_default, const char *ttips);
1039 LiVESWidget *lives_standard_button_new_from_stock_full(const char *stock_id, const char *label,
1040     int width, int height, LiVESBox *, boolean fake_default, const char *ttips);
1041 #else
1042 #define lives_standard_button_new(w, h) lives_button_new()
1043 #define lives_standard_button_new_with_label(l, w, h) lives_button_new_with_label(l)
1044 #define lives_standard_button_set_label(b, l); lives_button_set_label(b, l)
1045 #define lives_standard_button_get_label(b) lives_button_get_label(b)
1046 #define lives_standard_button_set_image(b, i) lives_button_set_image(b, i)
1047 #endif
1048 
1049 LiVESWidget *lives_standard_button_new_from_stock(const char *stock_id, const char *label,
1050     int width, int height);
1051 LiVESWidget *lives_standard_menu_new(void);
1052 
1053 LiVESWidget *lives_standard_menu_item_new(void);
1054 LiVESWidget *lives_standard_menu_item_new_with_label(const char *labeltext);
1055 
1056 LiVESWidget *lives_standard_image_menu_item_new_with_label(const char *labeltext);
1057 LiVESWidget *lives_standard_image_menu_item_new_from_stock(const char *stock_id, LiVESAccelGroup *accel_group);
1058 
1059 LiVESWidget *lives_standard_radio_menu_item_new_with_label(LiVESSList *group, const char *labeltext);
1060 
1061 LiVESWidget *lives_standard_check_menu_item_new_with_label(const char *labeltext, boolean active);
1062 
1063 LiVESWidget *lives_standard_check_menu_item_new_for_var(const char *ltext, boolean *var, boolean invert);
1064 
1065 LiVESWidget *lives_standard_switch_new(const char *labeltext, boolean active, LiVESBox *,
1066                                        const char *tooltip);
1067 
1068 LiVESWidget *lives_standard_vpaned_new(void);
1069 LiVESWidget *lives_standard_hpaned_new(void);
1070 
1071 LiVESWidget *lives_standard_notebook_new(const LiVESWidgetColor *bg_color, const LiVESWidgetColor *act_color);
1072 
1073 LiVESWidget *lives_standard_label_new(const char *labeltext);
1074 LiVESWidget *lives_standard_label_new_with_mnemonic_widget(const char *text, LiVESWidget *mnemonic_widget);
1075 LiVESWidget *lives_standard_label_new_with_tooltips(const char *text, LiVESBox *box,
1076     const char *tips);
1077 LiVESWidget *lives_standard_formatted_label_new(const char *text);
1078 
1079 char *lives_big_and_bold(const char *fmt, ...);
1080 
1081 void lives_label_chomp(LiVESLabel *);
1082 
1083 LiVESWidget *lives_standard_drawing_area_new(LiVESGuiCallback, lives_painter_surface_t **);
1084 
1085 LiVESWidget *lives_standard_frame_new(const char *labeltext, float xalign, boolean invisible_outline);
1086 
1087 LiVESWidget *lives_standard_check_button_new(const char *labeltext, boolean active, LiVESBox *, const char *tooltip);
1088 LiVESWidget *lives_glowing_check_button_new(const char *labeltext, LiVESBox *, const char *tooltip, boolean *togglevalue);
1089 LiVESWidget *lives_standard_radio_button_new(const char *labeltext, LiVESSList **rbgroup,
1090     LiVESBox *, const char *tooltip);
1091 LiVESWidget *lives_standard_spin_button_new(const char *labeltext, double val, double min,
1092     double max, double step, double page, int dp, LiVESBox *,
1093     const char *tooltip);
1094 LiVESWidget *lives_standard_combo_new(const char *labeltext, LiVESList *list, LiVESBox *, const char *tooltip);
1095 
1096 LiVESWidget *lives_standard_combo_new_with_model(LiVESTreeModel *, LiVESBox *);
1097 
1098 LiVESWidget *lives_standard_entry_new(const char *labeltext, const char *txt, int dispwidth, int maxchars, LiVESBox *,
1099                                       const char *tooltip);
1100 
1101 LiVESWidget *lives_standard_direntry_new(const char *labeltext, const char *txt, int dispwidth, int maxchars, LiVESBox *,
1102     const char *tooltip);
1103 
1104 LiVESWidget *lives_standard_fileentry_new(const char *labeltext, const char *txt, const char *defdir, int dispwidth,
1105     int maxchars,
1106     LiVESBox *box, const char *tooltip);
1107 
1108 LiVESWidget *lives_standard_progress_bar_new(void);
1109 
1110 LiVESWidget *lives_standard_font_chooser_new(void);
1111 
1112 LiVESToolItem *lives_menu_tool_button_new(LiVESWidget *icon, const char *label);
1113 
1114 LiVESWidget *lives_standard_lock_button_new(boolean is_locked, int width, int height,
1115     const char *label, const char *tooltip);
1116 
1117 boolean lives_lock_button_get_locked(LiVESButton *);
1118 boolean lives_lock_button_toggle(LiVESButton *);
1119 
1120 boolean lives_dialog_set_button_layout(LiVESDialog *, LiVESButtonBoxStyle bstyle);
1121 
1122 LiVESWidget *lives_standard_dialog_new(const char *title, boolean add_std_buttons, int width, int height);
1123 
1124 LiVESWidget *lives_dialog_add_button_from_stock(LiVESDialog *, const char *stock_id, const char *label, int response_id);
1125 
1126 LiVESWidget *lives_standard_hruler_new(void);
1127 
1128 LiVESWidget *lives_standard_scrolled_window_new(int width, int height, LiVESWidget *child);
1129 
1130 double lives_scrolled_window_scroll_to(LiVESScrolledWindow *, LiVESPositionType pos);
1131 
1132 LiVESWidget *lives_standard_expander_new(const char *labeltext, LiVESBox *parent, LiVESWidget *child);
1133 
1134 LiVESWidget *lives_volume_button_new(LiVESOrientation orientation, LiVESAdjustment *, double volume);
1135 
1136 LiVESWidget *lives_standard_file_button_new(boolean is_dir, const char *def_dir);
1137 
1138 LiVESWidget *lives_standard_color_button_new(LiVESBox *parent, const char *name, boolean use_alpha, lives_colRGBA64_t *rgba,
1139     LiVESWidget **sb_red, LiVESWidget **sb_green, LiVESWidget **sb_blue, LiVESWidget **sb_alpha);
1140 
1141 LiVESWidget *lives_standard_text_view_new(const char *text, LiVESTextBuffer *tbuff);
1142 
1143 LiVESWidget *lives_standard_table_new(uint32_t rows, uint32_t cols, boolean homogeneous);
1144 
1145 LiVESToolItem *lives_standard_menu_tool_button_new(LiVESWidget *icon, const char *label);
1146 
1147 LiVESXCursor *lives_cursor_new_from_pixbuf(LiVESXDisplay *, LiVESPixbuf *, int x, int y);
1148 
1149 void set_button_image_border_colour(LiVESButton *, LiVESWidgetState state, LiVESWidgetColor *);
1150 
1151 // util functions
1152 
1153 // THEME COLOURS (will be done more logically in the future)
1154 void lives_widget_apply_theme(LiVESWidget *, LiVESWidgetState state); // normal theme colours
1155 void lives_widget_apply_theme_dimmed(LiVESWidget *, LiVESWidgetState state, int dimval); // dimmed normal theme
1156 void set_child_dimmed_colour(LiVESWidget *, int dim); // dimmed normal theme for children (insensitive state only)
1157 
1158 // if set_all, set the widget itself (labels always set_all; buttons are ignored if set_all is FALSE)
1159 void set_child_colour(LiVESWidget *, boolean set_all); // normal theme, sensitive and insensitive
1160 
1161 void lives_widget_apply_theme2(LiVESWidget *, LiVESWidgetState state, boolean set_fg); // menu and bars colours
1162 void lives_widget_apply_theme_dimmed2(LiVESWidget *, LiVESWidgetState state, int dimval);
1163 void set_child_dimmed_colour2(LiVESWidget *, int dim); // dimmed m & b for children (insensitive state only)
1164 
1165 // like set_child_colour, but with menu and bars colours
1166 void set_child_alt_colour(LiVESWidget *, boolean set_all);
1167 void set_child_alt_colour_prelight(LiVESWidget *);
1168 
1169 void lives_widget_apply_theme3(LiVESWidget *, LiVESWidgetState state); // info base/text
1170 void set_child_colour3(LiVESWidget *, boolean set_all);
1171 
1172 boolean lives_widget_set_sensitive_with(LiVESWidget *, LiVESWidget *other);
1173 boolean lives_widget_set_show_hide_with(LiVESWidget *, LiVESWidget *other);
1174 
1175 boolean lives_image_scale(LiVESImage *, int width, int height, LiVESInterpType interp_type);
1176 
1177 LiVESPixbuf *lives_pixbuf_new_from_stock_at_size(const char *stock_id, LiVESIconSize size, int x, int y);
1178 LiVESWidget *lives_image_new_from_stock_at_size(const char *stock_id, LiVESIconSize size, int x, int y);
1179 
1180 boolean lives_widget_queue_draw_if_visible(LiVESWidget *);
1181 boolean lives_widget_queue_draw_and_update(LiVESWidget *);
1182 
1183 boolean global_recent_manager_add(const char *file_name);
1184 
1185 boolean lives_cursor_unref(LiVESXCursor *);
1186 
1187 boolean lives_tree_store_find_iter(LiVESTreeStore *, int col, const char *val, LiVESTreeIter *existing, LiVESTreeIter *newiter);
1188 
1189 boolean lives_widget_context_update(void);
1190 
1191 LiVESWidget *lives_menu_add_separator(LiVESMenu *);
1192 
1193 void lives_menu_item_set_text(LiVESWidget *, const char *text, boolean use_mnemonic);
1194 const char *lives_menu_item_get_text(LiVESWidget *);
1195 
1196 boolean lives_widget_get_fg_color(LiVESWidget *, LiVESWidgetColor *);
1197 
1198 boolean lives_widget_set_show_hide_parent(LiVESWidget *);
1199 
1200 boolean lives_window_center(LiVESWindow *);
1201 boolean lives_window_uncenter(LiVESWindow *);
1202 
1203 boolean lives_entry_set_completion_from_list(LiVESEntry *, LiVESList *);
1204 
1205 boolean lives_widget_unparent(LiVESWidget *);
1206 
1207 void lives_tooltips_copy(LiVESWidget *dest, LiVESWidget *source);
1208 
1209 char *lives_text_view_get_text(LiVESTextView *);
1210 boolean lives_text_view_set_text(LiVESTextView *, const char *text, int len);
1211 
1212 boolean lives_text_buffer_insert_at_end(LiVESTextBuffer *, const char *text);
1213 
1214 void lives_general_button_clicked(LiVESButton *, livespointer data_to_free);
1215 
1216 boolean lives_spin_button_configure(LiVESSpinButton *, double value, double lower, double upper,
1217                                     double step_increment, double page_increment);
1218 
1219 size_t calc_spin_button_width(double min, double max, int dp);
1220 
1221 double lives_spin_button_get_snapval(LiVESSpinButton *, double val);
1222 
1223 int get_box_child_index(LiVESBox *, LiVESWidget *child);
1224 
1225 boolean lives_box_pack_top(LiVESBox *, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding);
1226 //lives_box_reorder_child(LIVES_BOX(mt->fx_list_vbox), xeventbox, 0);
1227 
1228 boolean lives_container_child_set_shrinkable(LiVESContainer *, LiVESWidget *child, boolean val);
1229 
1230 boolean set_submenu_colours(LiVESMenu *, LiVESWidgetColor *colf, LiVESWidgetColor *colb);
1231 
1232 /// set callbacks
1233 boolean toggle_sets_sensitive(LiVESToggleButton *, LiVESWidget *, boolean invert);
1234 boolean toggle_toolbutton_sets_sensitive(LiVESToggleToolButton *, LiVESWidget *, boolean invert);
1235 boolean menu_sets_sensitive(LiVESCheckMenuItem *, LiVESWidget *,  boolean invert);
1236 boolean toggle_sets_visible(LiVESToggleButton *, LiVESWidget *, boolean invert);
1237 boolean toggle_toolbutton_sets_visible(LiVESToggleToolButton *, LiVESWidget *, boolean invert);
1238 boolean menu_sets_visible(LiVESCheckMenuItem *, LiVESWidget *,  boolean invert);
1239 boolean toggle_sets_sensitive_cond(LiVESToggleButton *, LiVESWidget *,
1240                                    livespointer condsens, livespointer condinsens, boolean invert);
1241 boolean toggle_toggles_var(LiVESToggleButton *, boolean *var, boolean invert);
1242 
1243 // callbacks
1244 boolean label_act_toggle(LiVESWidget *, LiVESXEventButton *, LiVESWidget *);
1245 boolean widget_act_toggle(LiVESWidget *, LiVESWidget *);
1246 boolean widget_inact_toggle(LiVESWidget *, LiVESWidget *);
1247 
1248 boolean toggle_button_toggle(LiVESToggleButton *);
1249 
1250 boolean label_act_lockbutton(LiVESWidget *, LiVESXEventButton *, LiVESButton *);
1251 
1252 void funkify_dialog(LiVESWidget *dialog);
1253 EXPOSE_FN_PROTOTYPE(draw_cool_toggle);
1254 void lives_cool_toggled(LiVESWidget *tbutton, livespointer);
1255 
1256 boolean unhide_cursor(LiVESXWindow *);
1257 void hide_cursor(LiVESXWindow *);
1258 
1259 boolean set_tooltips_state(LiVESWidget *, boolean state);
1260 
1261 boolean get_border_size(LiVESWidget *win, int *bx, int *by);
1262 boolean lives_window_get_inner_size(LiVESWindow *, int *x, int *y);
1263 
1264 LiVESWidget *lives_standard_hseparator_new(void);
1265 LiVESWidget *lives_standard_vseparator_new(void);
1266 
1267 LiVESWidget *add_hsep_to_box(LiVESBox *);
1268 LiVESWidget *add_vsep_to_box(LiVESBox *);
1269 
1270 LiVESWidget *add_fill_to_box(LiVESBox *);
1271 LiVESWidget *add_spring_to_box(LiVESBox *, int min);
1272 
1273 LiVESWidget *lives_toolbar_insert_space(LiVESToolbar *);
1274 LiVESWidget *lives_toolbar_insert_label(LiVESToolbar *, const char *labeltext, LiVESWidget *actwidg);
1275 LiVESWidget *lives_standard_tool_button_new(LiVESToolbar *, GtkWidget *icon_widget, const char *label, const char *tooltips);
1276 boolean lives_tool_button_set_border_color(LiVESWidget *button, LiVESWidgetState state, LiVESWidgetColor *);
1277 LiVESWidget *lives_glowing_tool_button_new(const char *labeltext, LiVESToolbar *tbar, const char *tooltip,
1278     boolean *togglevalue);
1279 
1280 boolean lives_accel_path_disconnect(LiVESAccelGroup *, const char *path);
1281 
1282 boolean lives_widget_get_mod_mask(LiVESWidget *, LiVESXModifierType *modmask);
1283 
1284 boolean lives_widget_nullify_with(LiVESWidget *, void **);
1285 boolean lives_widget_destroy_with(LiVESWidget *, LiVESWidget *dieplease);
1286 
1287 void *lives_fg_run(weed_plant_t *lpt, void *retval);
1288 
1289 #define LIVES_JUSTIFY_DEFAULT (def_widget_opts.justify)
1290 
1291 typedef enum {
1292   LIVES_CURSOR_NORMAL = 0, ///< must be zero
1293   LIVES_CURSOR_BUSY,
1294   LIVES_CURSOR_CENTER_PTR,
1295   LIVES_CURSOR_HAND2,
1296   LIVES_CURSOR_SB_H_DOUBLE_ARROW,
1297   LIVES_CURSOR_CROSSHAIR,
1298   LIVES_CURSOR_TOP_LEFT_CORNER,
1299   LIVES_CURSOR_BOTTOM_RIGHT_CORNER,
1300 
1301   /// non-standard cursors
1302   LIVES_CURSOR_BLOCK,
1303   LIVES_CURSOR_AUDIO_BLOCK,
1304   LIVES_CURSOR_VIDEO_BLOCK,
1305   LIVES_CURSOR_FX_BLOCK
1306 } lives_cursor_t;
1307 
1308 void lives_set_cursor_style(lives_cursor_t cstyle, LiVESWidget *);
1309 
1310 typedef int lives_expand_t;
1311 #define LIVES_EXPAND_NONE 0
1312 #define LIVES_EXPAND_DEFAULT_HEIGHT 1
1313 #define LIVES_EXPAND_DEFAULT_WIDTH 2
1314 #define LIVES_EXPAND_DEFAULT (LIVES_EXPAND_DEFAULT_HEIGHT | LIVES_EXPAND_DEFAULT_WIDTH)
1315 #define LIVES_EXPAND_EXTRA_HEIGHT 4
1316 #define LIVES_EXPAND_EXTRA_WIDTH 8
1317 #define LIVES_EXPAND_EXTRA (LIVES_EXPAND_EXTRA_HEIGHT | LIVES_EXPAND_EXTRA_WIDTH)
1318 
1319 #define LIVES_SHOULD_EXPAND (widget_opts.expand != LIVES_EXPAND_NONE)
1320 #define LIVES_SHOULD_EXPAND_DEFAULT (widget_opts.expand == LIVES_EXPAND_DEFAULT)
1321 #define LIVES_SHOULD_EXPAND_EXTRA (widget_opts.expand == LIVES_EXPAND_EXTRA)
1322 
1323 #define LIVES_SHOULD_EXPAND_WIDTH (widget_opts.expand & (LIVES_EXPAND_DEFAULT_WIDTH | LIVES_EXPAND_EXTRA_WIDTH))
1324 #define LIVES_SHOULD_EXPAND_HEIGHT (widget_opts.expand & (LIVES_EXPAND_DEFAULT_HEIGHT | LIVES_EXPAND_EXTRA_HEIGHT))
1325 
1326 #define LIVES_SHOULD_EXPAND_EXTRA_WIDTH (widget_opts.expand & LIVES_EXPAND_EXTRA_WIDTH)
1327 #define LIVES_SHOULD_EXPAND_EXTRA_HEIGHT (widget_opts.expand & LIVES_EXPAND_EXTRA_HEIGHT)
1328 
1329 #define LIVES_SHOULD_EXPAND_DEFAULT_WIDTH (LIVES_SHOULD_EXPAND_WIDTH && !LIVES_SHOULD_EXPAND_EXTRA_WIDTH)
1330 #define LIVES_SHOULD_EXPAND_DEFAULT_HEIGHT (LIVES_SHOULD_EXPAND_HEIGHT && !LIVES_SHOULD_EXPAND_EXTRA_HEIGHT)
1331 
1332 #define LIVES_SHOULD_EXPAND_DEFAULT_FOR(box) ((LIVES_IS_HBOX(box) && LIVES_SHOULD_EXPAND_DEFAULT_WIDTH) || (LIVES_IS_VBOX(box) && LIVES_EXPAND_DEFAULT_HEIGHT))
1333 
1334 #define LIVES_SHOULD_EXPAND_EXTRA_FOR(box) ((LIVES_IS_HBOX(box) && LIVES_SHOULD_EXPAND_EXTRA_WIDTH) || (LIVES_IS_VBOX(box) && LIVES_SHOULD_EXPAND_EXTRA_HEIGHT))
1335 
1336 #define LIVES_SHOULD_EXPAND_FOR(box) (LIVES_SHOULD_EXPAND_DEFAULT_FOR(box) || LIVES_SHOULD_EXPAND_EXTRA_FOR(box))
1337 
1338 LiVESList *get_textsizes_list(void);
1339 const char *lives_textsize_to_string(int val);
1340 
1341 // custom stock images
1342 #define LIVES_LIVES_STOCK_AUDIO "lives-audio"
1343 #define LIVES_LIVES_STOCK_PLAY_SEL "lives-playsel"
1344 #define LIVES_LIVES_STOCK_FULLSCREEN "lives-fullscreen"
1345 #define LIVES_LIVES_STOCK_SEPWIN "lives-sepwin"
1346 #define LIVES_LIVES_STOCK_VOLUME_MUTE "lives-volume_mute"
1347 #define LIVES_LIVES_STOCK_LOOP "lives-loop"
1348 #define LIVES_LIVES_STOCK_ZOOM_IN "lives-zoom-in"
1349 #define LIVES_LIVES_STOCK_ZOOM_OUT "lives-zoom-out"
1350 #define LIVES_LIVES_STOCK_PREF_GUI "lives-pref_gui"
1351 #define LIVES_LIVES_STOCK_PREF_DECODING "lives-pref_decoding"
1352 #define LIVES_LIVES_STOCK_PREF_DIRECTORY "lives-pref_directory"
1353 #define LIVES_LIVES_STOCK_PREF_EFFECTS "lives-pref_effects"
1354 #define LIVES_LIVES_STOCK_PREF_ENCODING "lives-pref_encoding"
1355 #define LIVES_LIVES_STOCK_PREF_JACK "lives-pref_jack"
1356 #define LIVES_LIVES_STOCK_PREF_MIDI "lives-pref_midi"
1357 #define LIVES_LIVES_STOCK_PREF_MISC "lives-pref_misc"
1358 #define LIVES_LIVES_STOCK_PREF_MULTITRACK "lives-pref_multitrack"
1359 #define LIVES_LIVES_STOCK_PREF_NET "lives-pref_net"
1360 #define LIVES_LIVES_STOCK_PREF_PLAYBACK "lives-pref_playback"
1361 #define LIVES_LIVES_STOCK_PREF_RECORD "lives-pref_record"
1362 #define LIVES_LIVES_STOCK_PREF_THEMES "lives-pref_themes"
1363 #define LIVES_LIVES_STOCK_PREF_WARNING "lives-pref_warning"
1364 
1365 // font sizes
1366 #define LIVES_TEXT_SIZE_XX_SMALL "xx-small" // 0
1367 #define LIVES_TEXT_SIZE_X_SMALL "x-small"  // 1
1368 #define LIVES_TEXT_SIZE_SMALL "small"      // 2
1369 #define LIVES_TEXT_SIZE_MEDIUM "medium"   // 3
1370 #define LIVES_TEXT_SIZE_LARGE "large"      // 4
1371 #define LIVES_TEXT_SIZE_X_LARGE "x-large"    // 5
1372 #define LIVES_TEXT_SIZE_XX_LARGE "xx-large"   // 6
1373 #define LIVES_TEXT_SIZE_NORMAL LIVES_TEXT_SIZE_MEDIUM
1374 #define N_TEXT_SIZES 7
1375 
1376 /// stock labels, these are set up in widget_helper_init()
1377 char LIVES_STOCK_LABEL_CANCEL[32];
1378 char LIVES_STOCK_LABEL_OK[32];
1379 char LIVES_STOCK_LABEL_YES[32];
1380 char LIVES_STOCK_LABEL_NO[32];
1381 char LIVES_STOCK_LABEL_SAVE[32];
1382 char LIVES_STOCK_LABEL_SAVE_AS[32];
1383 char LIVES_STOCK_LABEL_OPEN[32];
1384 char LIVES_STOCK_LABEL_QUIT[32];
1385 char LIVES_STOCK_LABEL_APPLY[32];
1386 char LIVES_STOCK_LABEL_CLOSE[32];
1387 char LIVES_STOCK_LABEL_REVERT[32];
1388 char LIVES_STOCK_LABEL_REFRESH[32];
1389 char LIVES_STOCK_LABEL_DELETE[32];
1390 char LIVES_STOCK_LABEL_SELECT_ALL[32];
1391 char LIVES_STOCK_LABEL_GO_FORWARD[32];
1392 
1393 char LIVES_STOCK_LABEL_MEDIA_FORWARD[32];
1394 char LIVES_STOCK_LABEL_MEDIA_REWIND[32];
1395 char LIVES_STOCK_LABEL_MEDIA_STOP[32];
1396 char LIVES_STOCK_LABEL_MEDIA_PLAY[32];
1397 char LIVES_STOCK_LABEL_MEDIA_PAUSE[32];
1398 char LIVES_STOCK_LABEL_MEDIA_RECORD[32];
1399 
1400 char LIVES_STOCK_LABEL_CLOSE_WINDOW[32];
1401 char LIVES_STOCK_LABEL_SKIP[32];
1402 char LIVES_STOCK_LABEL_SELECT[32];
1403 
1404 typedef struct {
1405   /// commonly adjusted values //////
1406   LiVESWidget *last_label; ///< label widget of last standard widget (spin,radio,check,entry,combo) (READONLY)
1407   LiVESWidget *last_container; ///< container which wraps last widget created + subwidgets (READONLY)
1408   lives_expand_t expand; ///< how much space to apply between widgets
1409   int apply_theme; ///< theming variation for widget (0 -> no theme, 1 -> normal colours, 2+ -> theme variants)
1410   int packing_width; ///< horizontal pixels between widgets
1411   int packing_height; ///< vertical pixels between widgets
1412   LiVESJustification justify; ///< justify for labels
1413 
1414   /// specialised values /////
1415   const char *text_size; ///< size of text for label widgets etc (e.g. LIVES_TEXT_SIZE_MEDIUM)
1416   int border_width; ///< border width in pixels
1417   boolean swap_label; ///< swap label/widget position
1418   boolean pack_end; ///< pack widget at end or start
1419   boolean line_wrap; ///< line wrapping for labels
1420   boolean mnemonic_label; ///< if underscore in label text should be mnemonic accelerator
1421   boolean use_markup; ///< whether markup should be used in labels
1422   boolean non_modal; ///< non-modal for dialogs
1423   LiVESWindow *transient; ///< transient window for dialogs, if NULL then use the default (READ / WRITE)
1424   int filler_len; ///< length of extra "fill" between widgets
1425 
1426   /// rarely changed values /////
1427   int css_min_width;
1428   int css_min_height;
1429   int icon_size; ///< icon size for tooltips image, warn image, toolbar img, etc.
1430   char *font_name; ///< readonly for now
1431   int font_size; ///< ditto
1432   boolean no_gui; ///< show nothing !
1433   double scale; ///< scale factor for all sizes
1434   boolean alt_button_order; ///< unused for now
1435   char **image_filter; ///</ NULL or NULL terminated list of image extensions which can be loaded
1436   char *title_prefix; ///< Text which is prepended to window titles, etc.
1437   int monitor; ///< monitor we are displaying on
1438   boolean show_button_images; ///< whether to show small images in buttons or not
1439   void *icon_theme; /// pointer to opaque "icon_theme"
1440 } widget_opts_t;
1441 
1442 widget_opts_t widget_opts;
1443 widget_opts_t def_widget_opts;
1444 
1445 #ifdef NEED_DEF_WIDGET_OPTS
1446 
1447 const widget_opts_t _def_widget_opts = {
1448   NULL, ///< last_label
1449   NULL, ///< last_container
1450   LIVES_EXPAND_DEFAULT, ///< default expand
1451   0, ///< no themeing
1452   W_PACKING_WIDTH, ///< def packing width
1453   W_PACKING_HEIGHT, ///< def packing height
1454   LIVES_JUSTIFY_START, ///< justify
1455   LIVES_TEXT_SIZE_MEDIUM, ///< default font size
1456   W_BORDER_WIDTH, ///< def border width
1457 
1458   FALSE, ///< swap_label (TRUE for RTL ?)
1459   FALSE, ///<pack_end
1460   FALSE, ///< line_wrap
1461   TRUE, ///< mnemonic_label
1462   FALSE, ///< use markup
1463   FALSE, ///< non_modal
1464   NULL, ///< transient window
1465   W_FILL_LENGTH, ///< def fill width (in pixels)
1466 
1467   W_CSS_MIN_WIDTH, ///< css_min_width
1468   W_CSS_MIN_HEIGHT, ///< css_min_height
1469   LIVES_ICON_SIZE_LARGE_TOOLBAR, ///< icon_size
1470   NULL, ///< font name
1471   -1, ///< font size
1472   FALSE, ///< no_gui
1473   1.0, ///< default scale
1474   FALSE, ///< alt button order
1475   NULL, ///< image_filter
1476   "", ///< title_prefix
1477   0, ///< monitor
1478   FALSE, ///< show button images
1479   NULL ///< icon theme
1480 };
1481 
1482 #endif
1483 
1484 // object data keys
1485 #define HIDDEN_KEY "hidden"
1486 #define SECLIST_KEY "secondary_list"
1487 #define SECLIST_VAL_KEY "secondary_list_value"
1488 #define ISDIR_KEY "is_dir"
1489 #define FILTER_KEY "filter"
1490 #define DEFDIR_KEY "def_dir"
1491 #define RFX_KEY "rfx"
1492 #define TEXTWIDGET_KEY "def_dir"
1493 #define FILESEL_TYPE_KEY "filesel_type"
1494 #define PARAM_NUMBER_KEY "param_number"
1495 #define WH_LAYOUT_KEY "_wh_layout"
1496 
1497 #endif
1498 
1499