7 #ifndef HAS_LIVES_WIDGET_HELPER_H
8 #define HAS_LIVES_WIDGET_HELPER_H
11 #define WIDGET_HELPER_GLOBAL_INLINE inline
12 #define WIDGET_HELPER_LOCAL_INLINE static inline
14 #define WIDGET_HELPER_GLOBAL_INLINE
15 #define WIDGET_HELPER_LOCAL_INLINE
19 #define M_PI 3.1415926536
22 #define LIVES_HAS_GRID_WIDGET 0
23 #define LIVES_HAS_IMAGE_MENU_ITEM 0
24 #define LIVES_HAS_DEVICE_MANAGER 0
26 #define MIN_SPINBUTTON_SIZE 6
28 #define LONG_ENTRY_WIDTH ((int)(120.*widget_opts.scale))
29 #define SHORT_ENTRY_WIDTH ((int)(40.*widget_opts.scale))
30 #define MEDIUM_ENTRY_WIDTH ((int)(60.*widget_opts.scale))
40 #define W_PACKING_WIDTH 10 // packing width for widgets with labels
41 #define W_PACKING_HEIGHT 6 // packing height for widgets
42 #define W_BORDER_WIDTH 10 // default border width
43 #define W_FILL_LENGTH (W_PACKING_WIDTH * 4) // default extra fill size
45 #define ulong_random() lives_random()
47 #if defined (GUI_GTK) || defined (LIVES_PAINTER_IS_CAIRO)
53 #ifdef LIVES_LINGO_IS_PANGO
55 typedef PangoLayout LingoLayout;
56 typedef PangoContext LingoContext;
57 #define lingo_layout_set_alignment(a, b) pango_layout_set_alignment(a, b)
59 #define LINGO_ALIGN_LEFT PANGO_ALIGN_LEFT
60 #define LINGO_ALIGN_RIGHT PANGO_ALIGN_RIGHT
61 #define LINGO_ALIGN_CENTER PANGO_ALIGN_CENTER
63 #define lingo_layout_set_text(a, b, c) pango_layout_set_text(a, b, c)
64 #ifdef LIVES_PAINTER_IS_CAIRO
65 #define lingo_painter_show_layout(a, b) pango_cairo_show_layout(a, b)
68 #define lives_widget_create_lingo_context(a) gtk_widget_create_pango_context(a)
70 #define lingo_layout_get_size(a, b, c, d, e) pango_layout_get_size(a, b, c)
71 #define lingo_layout_new(a) pango_layout_new(a)
72 #define lingo_layout_set_markup(a, b, c) pango_layout_set_markup(a, b, c)
74 #define LINGO_IS_LAYOUT(a) PANGO_IS_LAYOUT(a)
75 #define LINGO_IS_CONTEXT(a) PANGO_IS_CONTEXT(a)
77 #define LINGO_SCALE PANGO_SCALE
80 #ifdef LIVES_PAINTER_IS_CAIRO
83 #include <cairo/cairo.h>
86 typedef cairo_t lives_painter_t;
87 typedef cairo_surface_t lives_painter_surface_t;
91 typedef cairo_format_t lives_painter_format_t;
93 #define LIVES_PAINTER_FORMAT_A1 CAIRO_FORMAT_A1
94 #define LIVES_PAINTER_FORMAT_A8 CAIRO_FORMAT_A8
95 #define LIVES_PAINTER_FORMAT_RGB24 CAIRO_FORMAT_RGB24
96 #define LIVES_PAINTER_FORMAT_ARGB32 CAIRO_FORMAT_ARGB32
98 typedef cairo_content_t lives_painter_content_t;
100 #define LIVES_PAINTER_CONTENT_COLOR CAIRO_CONTENT_COLOR
102 typedef cairo_operator_t lives_painter_operator_t;
104 #define LIVES_PAINTER_OPERATOR_UNKNOWN CAIRO_OPERATOR_OVER
105 #define LIVES_PAINTER_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER
107 #define LIVES_PAINTER_OPERATOR_DEST_OUT CAIRO_OPERATOR_DEST_OUT
108 #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
109 #define LIVES_PAINTER_OPERATOR_DIFFERENCE CAIRO_OPERATOR_OVER
110 #define LIVES_PAINTER_OPERATOR_OVERLAY CAIRO_OPERATOR_OVER
112 #define LIVES_PAINTER_OPERATOR_DIFFERENCE CAIRO_OPERATOR_DIFFERENCE
113 #define LIVES_PAINTER_OPERATOR_OVERLAY CAIRO_OPERATOR_OVERLAY
116 typedef cairo_fill_rule_t lives_painter_fill_rule_t;
118 #define LIVES_PAINTER_FILL_RULE_WINDING CAIRO_FILL_RULE_WINDING
119 #define LIVES_PAINTER_FILL_RULE_EVEN_ODD CAIRO_FILL_RULE_EVEN_ODD
131 int width,
int height,
int stride);
153 boolean lives_painter_arc(lives_painter_t *,
double xc,
double yc,
double radius,
double angle1,
double angle2);
205 int rowstride, LiVESPixbufDestroyNotify lives_free_buffer_fn,
206 livespointer destroy_fn_data);
214 LiVESInterpType interp_type);
224 #define lives_signal_connect(instance, detailed_signal, c_handler, data) g_signal_connect(instance, detailed_signal, c_handler, data)
225 #define lives_signal_connect_swapped(instance, detailed_signal, c_handler, data) g_signal_connect_swapped(instance, detailed_signal, c_handler, data)
226 #define lives_signal_connect_after(instance, detailed_signal, c_handler, data) g_signal_connect_after(instance, detailed_signal, c_handler, data)
227 #define lives_signal_handlers_disconnect_by_func(instance, func, data) g_signal_handlers_disconnect_by_func(instance, func, data)
228 #define lives_signal_handlers_block_by_func(instance, func, data) g_signal_handlers_block_by_func(instance, func, data)
229 #define lives_signal_handlers_unblock_by_func(instance, func, data) g_signal_handlers_unblock_by_func(instance, func, data)
389 double step_increment,
double page_increment,
double page_size);
395 boolean lives_box_pack_start(LiVESBox *, LiVESWidget *child,
boolean expand,
boolean fill, uint32_t padding);
396 boolean lives_box_pack_end(LiVESBox *, LiVESWidget *child,
boolean expand,
boolean fill, uint32_t padding);
428 boolean lives_alignment_set(LiVESWidget *,
float xalign,
float yalign,
float xscale,
float yscale);
479 const LiVESTextIter *where,
boolean left_gravity);
613 LiVESWidget *
lives_message_dialog_new(LiVESWindow *parent, LiVESDialogFlags flags, LiVESMessageType type, LiVESButtonsType buttons,
614 const
char *msg_fmt, ...);
619 boolean lives_ruler_set_range(LiVESRuler *,
double lower,
double upper,
double position,
double max_size);
686 LiVESWidget *
lives_table_new(uint32_t rows, uint32_t cols,
boolean homogeneous);
690 boolean lives_table_attach(LiVESTable *, LiVESWidget *child, uint32_t left, uint32_t right,
691 uint32_t top, uint32_t bottom, LiVESAttachOptions xoptions, LiVESAttachOptions yoptions,
692 uint32_t xpad, uint32_t ypad);
697 #if LIVES_TABLE_IS_GRID
702 LiVESPositionType side,
int width,
int height);
748 #if !GTK_CHECK_VERSION(3, 10, 0)
779 LiVESWidgetClosure *closure);
784 uint32_t accel_key, LiVESXModifierType accel_mods, LiVESAccelFlags accel_flags);
789 boolean lives_display_get_pointer(LiVESXDevice *, LiVESXDisplay *, LiVESXScreen **,
int *x,
int *y, LiVESXModifierType *mask);
810 uint32_t
lives_timer_add(uint32_t interval, LiVESWidgetSourceFunc
function, livespointer data);
848 #define BUTTON_DIM_VAL (0.4 * 65535.) // fg / bg ratio for dimmed buttons (BUTTON_DIM_VAL/65535) (lower is dimmer)
850 #define LOCK_BUTTON_WIDTH 24
851 #define LOCK_BUTTON_HEIGHT 24
879 LiVESBox *,
const char *tooltip);
881 double max,
double step,
double page,
int dp, LiVESBox *,
882 const char *tooltip);
887 LiVESWidget *
lives_standard_entry_new(
const char *labeltext,
const char *txt,
int dispwidth,
int maxchars, LiVESBox *,
888 const char *tooltip);
891 const char *tooltip);
894 LiVESBox *box,
const char *tooltip);
917 LiVESWidget **sb_red, LiVESWidget **sb_green, LiVESWidget **sb_blue, LiVESWidget **sb_alpha);
950 boolean lives_image_scale(LiVESImage *,
int width,
int height, LiVESInterpType interp_type);
989 double step_increment,
double page_increment);
999 boolean label_act_toggle(LiVESWidget *, LiVESXEventButton *, LiVESToggleButton *);
1033 #define LIVES_JUSTIFY_DEFAULT (widget_opts.default_justify)
1055 #define LIVES_EXPAND_NONE 0
1056 #define LIVES_EXPAND_DEFAULT_HEIGHT 1
1057 #define LIVES_EXPAND_DEFAULT_WIDTH 2
1058 #define LIVES_EXPAND_DEFAULT (LIVES_EXPAND_DEFAULT_HEIGHT | LIVES_EXPAND_DEFAULT_WIDTH)
1059 #define LIVES_EXPAND_EXTRA_HEIGHT 4
1060 #define LIVES_EXPAND_EXTRA_WIDTH 8
1061 #define LIVES_EXPAND_EXTRA (LIVES_EXPAND_EXTRA_HEIGHT | LIVES_EXPAND_EXTRA_WIDTH)
1063 #define LIVES_SHOULD_EXPAND (widget_opts.expand != LIVES_EXPAND_NONE)
1064 #define LIVES_SHOULD_EXPAND_DEFAULT (widget_opts.expand == LIVES_EXPAND_DEFAULT)
1065 #define LIVES_SHOULD_EXPAND_EXTRA (widget_opts.expand == LIVES_EXPAND_EXTRA)
1067 #define LIVES_SHOULD_EXPAND_WIDTH (widget_opts.expand & (LIVES_EXPAND_DEFAULT_WIDTH | LIVES_EXPAND_EXTRA_WIDTH))
1068 #define LIVES_SHOULD_EXPAND_HEIGHT (widget_opts.expand & (LIVES_EXPAND_DEFAULT_HEIGHT | LIVES_EXPAND_EXTRA_HEIGHT))
1070 #define LIVES_SHOULD_EXPAND_EXTRA_WIDTH (widget_opts.expand & LIVES_EXPAND_EXTRA_WIDTH)
1071 #define LIVES_SHOULD_EXPAND_EXTRA_HEIGHT (widget_opts.expand & LIVES_EXPAND_EXTRA_HEIGHT)
1073 #define LIVES_SHOULD_EXPAND_DEFAULT_WIDTH (LIVES_SHOULD_EXPAND_WIDTH && !LIVES_SHOULD_EXPAND_EXTRA_WIDTH)
1074 #define LIVES_SHOULD_EXPAND_DEFAULT_HEIGHT (LIVES_SHOULD_EXPAND_HEIGHT && !LIVES_SHOULD_EXPAND_EXTRA_HEIGHT)
1077 #define LIVES_SHOULD_EXPAND_DEFAULT_FOR(box) ((LIVES_IS_HBOX(box) && LIVES_SHOULD_EXPAND_DEFAULT_WIDTH) || (LIVES_IS_VBOX(box) && LIVES_EXPAND_DEFAULT_HEIGHT))
1079 #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))
1081 #define LIVES_SHOULD_EXPAND_FOR(box) (LIVES_SHOULD_EXPAND_DEFAULT_FOR(box) || LIVES_SHOULD_EXPAND_EXTRA_FOR(box))
1087 #define LIVES_LIVES_STOCK_AUDIO "lives-audio"
1088 #define LIVES_LIVES_STOCK_PLAY_SEL "lives-playsel"
1089 #define LIVES_LIVES_STOCK_FULLSCREEN "lives-fullscreen"
1090 #define LIVES_LIVES_STOCK_SEPWIN "lives-sepwin"
1091 #define LIVES_LIVES_STOCK_VOLUME_MUTE "lives-volume_mute"
1092 #define LIVES_LIVES_STOCK_LOOP "lives-loop"
1093 #define LIVES_LIVES_STOCK_ZOOM_IN "lives-zoom-in"
1094 #define LIVES_LIVES_STOCK_ZOOM_OUT "lives-zoom-out"
1095 #define LIVES_LIVES_STOCK_PREF_GUI "lives-pref_gui"
1096 #define LIVES_LIVES_STOCK_PREF_DECODING "lives-pref_decoding"
1097 #define LIVES_LIVES_STOCK_PREF_DIRECTORY "lives-pref_directory"
1098 #define LIVES_LIVES_STOCK_PREF_EFFECTS "lives-pref_effects"
1099 #define LIVES_LIVES_STOCK_PREF_ENCODING "lives-pref_encoding"
1100 #define LIVES_LIVES_STOCK_PREF_JACK "lives-pref_jack"
1101 #define LIVES_LIVES_STOCK_PREF_MIDI "lives-pref_midi"
1102 #define LIVES_LIVES_STOCK_PREF_MISC "lives-pref_misc"
1103 #define LIVES_LIVES_STOCK_PREF_MULTITRACK "lives-pref_multitrack"
1104 #define LIVES_LIVES_STOCK_PREF_NET "lives-pref_net"
1105 #define LIVES_LIVES_STOCK_PREF_PLAYBACK "lives-pref_playback"
1106 #define LIVES_LIVES_STOCK_PREF_RECORD "lives-pref_record"
1107 #define LIVES_LIVES_STOCK_PREF_THEMES "lives-pref_themes"
1108 #define LIVES_LIVES_STOCK_PREF_WARNING "lives-pref_warning"
1125 LiVESWindow *
transient;
1138 #ifdef NEED_DEF_WIDGET_OPTS
1158 LIVES_FONT_SIZE_MEDIUM,
void resize(double scale)
Definition: main.c:7928
#define ulong
Definition: main.h:137
#define TRUE
Definition: videoplugin.h:55
#define WARN_UNUSED
Definition: main.h:262
#define FALSE
Definition: videoplugin.h:56