73#include <glib/gi18n.h>
74#ifdef GDK_WINDOWING_QUARTZ
80#include <pango/pangocairo.h>
82#ifdef GDK_WINDOWING_WAYLAND
83#include <gdk/gdkwayland.h>
191 GtkAllocation allocation;
225 GtkAllocation allocation;
281 if(!
d->entries->len)
return 0.;
288 for(
int i = 0;
i <
d->entries->len;
i++)
412 for(
int i = 0;
i <
d->entries->len;
i++)
443#define DT_BAUHAUS_FOCUS_IDLE_SOURCE_KEY "dt-bauhaus-focus-idle-source"
444#define DT_BAUHAUS_FOCUS_IDLE_TRIES_KEY "dt-bauhaus-focus-idle-tries"
445#define DT_BAUHAUS_FOCUS_IDLE_MAX_TRIES 20
486 dt_widget_log(
"[bauhaus] ensure_focus_idle success target=%s(%p) gtk_focus=%s(%p) scroll_focus=%s(%p)\n",
499 dt_widget_log(
"[bauhaus] ensure_focus_idle abort target=%s(%p) tries=%d drawable=%d\n",
539 GdkModifierType modifier, gpointer
data)
544 fprintf(
stderr,
"The target widget of the action does not exist anymore");
555 if(w->module->ensure_visible) w->module->ensure_visible(w->module);
556 w->module->focus(w->module,
FALSE);
594 void *
data,
void (*free_func)(
void *))
637 GdkRGBA
color = {.red = 1.0f, .green = 0.0f, .blue = 0.0f, .alpha = 1.0f};
825 y = (y - line_height) / (1.0 - line_height);
826 offset = (
x -
sqf(y) * .5 - (1.0 -
sqf(y)) * pos)
827 / (.5 *
sqf(y) / scale + (1.0 -
sqf(y)));
830 if(pos + offset > 1.0) offset = 1.0 - pos;
831 if(pos + offset < 0.0) offset = -pos;
841 const int steps = 128;
850 const double x =
sqf(y) * .5f * (1.f + off / scale) + (1.0f -
sqf(y)) * (pos + off);
864 d->min =
d->soft_min;
865 d->max =
d->soft_max;
872 const float multiplier =
exp2f(zoom / 2.f);
957 && (event->time >=
bh->opentime + delay) && !
bh->hiding)
978 if(event->button == 1)
981 && event->time <
bh->opentime + delay)
1015 const float value =
d->pos;
1245#ifdef GDK_WINDOWING_QUARTZ
1414 d->min =
MAX(
d->min,
d->hard_min);
1415 d->soft_min =
MAX(
d->soft_min,
d->hard_min);
1439 d->max =
MIN(
d->max,
d->hard_max);
1440 d->soft_max =
MIN(
d->soft_max,
d->hard_max);
1462 d->min =
d->soft_min =
CLAMP(
val,
d->hard_min,
d->hard_max);
1479 d->max =
d->soft_max =
CLAMP(
val,
d->hard_min,
d->hard_max);
1565 fprintf(
stderr,
"[dt_bauhaus_widget_set_field] bauhaus label '%s' set before field (needs to be after)\n", w->
label);
1632 float defval,
int digits)
1638 float step,
float defval,
int digits,
int feedback)
1659 float step,
float defval,
int digits,
int feedback)
1664 d->
min =
d->soft_min =
d->hard_min =
min;
1665 d->max =
d->soft_max =
d->hard_max =
max;
1680 d->fill_feedback = feedback;
1741 if(
d->active >=
d->entries->len)
d->
active = -1;
1775 for(
int i = 0;
i <
d->entries->len;
i++)
1810 w->data.combobox.populate =
fct;
1833 if(
d->active < 0)
d->active = (int)
d->entries->len - 1;
1842 gpointer
data,
void (free_func)(
void *
data), gboolean sensitive)
1850 if(
d->active < 0)
d->active = (int)
d->entries->len - 1;
1892 return d ?
d->editable : 0;
1915 if(
d->active >
entry_pos ||
d->active ==
d->entries->len-1)
1927 gpointer
data,
void (*free_func)(
void *),
int pos)
1972 return d->editable ?
d->text :
NULL;
1978 return entry->
label;
2009 return entry->
label;
2036 fprintf(
stderr,
"ERROR: %s - %s is set to use default callback but none is provided\n", w->module->name,
2042 fprintf(
stderr,
"WARNING: %s - %s has an IOP module but doesn't use default callback\n", w->module->name,
2062 const int new_pos = (
d->entries) ?
CLAMP(pos, -1, (
int)
d->entries->len - 1)
2101 for(
int i = 0;
d &&
i <
d->entries->len;
i++)
2118 for(
int i = 0;
d &&
i <
d->entries->len;
i++)
2168 for(
int k = 0;
k <
d->grad_cnt;
k++)
2170 if(
d->grad_pos[
k] == stop)
2172 d->grad_col[
k][0] =
r;
2173 d->grad_col[
k][1] =
g;
2174 d->grad_col[
k][2] = b;
2181 int k =
d->grad_cnt++;
2182 d->grad_pos[
k] = stop;
2183 d->grad_col[
k][0] =
r;
2184 d->grad_col[
k][1] =
g;
2185 d->grad_col[
k][2] = b;
2220 const float radius =
size / 2. - border / 2.;
2294 const double zoom = (
d->max -
d->min) / (
d->hard_max -
d->hard_min);
2295 const double offset = (
d->min -
d->hard_min) / (
d->hard_max -
d->hard_min);
2297 for(
int k = 0;
k <
d->grad_cnt;
k++)
2299 d->grad_col[
k][0],
d->grad_col[
k][1],
d->grad_col[
k][2], 0.4f);
2327 :
d->max +
d->offset/
d->factor)
2328 / (
d->max -
d->min),
2415 for(
int j = 0;
j <
d->entries->len;
j++)
2475 GtkAllocation allocation;
2520 const int num_scales = 1.f / scale;
2523 for(
int k = 0;
k < num_scales;
k++)
2525 const float off =
k * scale -
d->oldpos;
2607 for(
int j = 0;
j <
d->entries->len;
j++)
2637 else if(
j ==
d->active)
2642 else if(
j ==
d->hovered)
2720 for(
int i = 0;
i <
d->entries->len;
i++)
2752 GtkAllocation allocation;
2765 if(max_width < allocation.width)
2766 allocation.width =
ceilf(max_width);
2792 const float box_width = allocation.width - w->
margin->left - w->
margin->right;
2793 const float box_height = allocation.height - w->
margin->top - w->
margin->bottom;
2837 gchar *text =
d->text;
2838 if(
d->active >= 0 &&
d->active <
d->entries->len)
2841 text = entry->
label;
3016 fprintf(
stderr,
"[dt_bauhaus_show_popup] The bauhaus widget has an unknown type\n");
3025 #ifdef GDK_WINDOWING_WAYLAND
3035 gint wx = 0, wy = 0;
3052 .width =
MAX(
tmp.width, 1),
3053 .height =
MAX(
tmp.height, 1)
3081 if(
delta == 0.f)
return;
3244 if(event->button == 3)
3251 else if(event->button == 1)
3280 return d->
min +
d->pos * (
d->max -
d->min);
3292 if((
d->hard_max *
d->factor +
d->offset)*(
d->hard_min *
d->factor +
d->offset) < 0)
3309 const float rpos =
CLAMP(pos,
d->hard_min,
d->hard_max);
3312 float rrpos = (
rpos -
d->soft_min) / (
d->soft_max -
d->soft_min);
3314 d->min =
d->soft_min;
3319 d->max =
d->soft_max;
3363 float step =
d->
step;
3367 const float min =
d->soft_min;
3368 const float max =
d->soft_max;
3396 d->
min =
d->soft_min;
3397 d->max =
d->soft_max;
3410 if(
d->factor == 1.0f)
d->factor = 100;
3414 d->digits =
MAX(
d->digits - 2, 0);
3447 fprintf(
stderr,
"ERROR: %s - %s is set to use default callback but none is provided\n", w->module->name,
3453 fprintf(
stderr,
"WARNING: %s - %s has an IOP module but doesn't use default callback\n", w->module->name,
3503 if(
bh->keys_cnt + 2 < 64
3506 (event->string[0] >= 40 && event->string[0] <= 57) ||
3511 bh->keys[
bh->keys_cnt++] =
'^';
3513 bh->keys[
bh->keys_cnt++] =
event->string[0];
3516 else if(
bh->keys_cnt > 0
3519 bh->keys[--
bh->keys_cnt] = 0;
3522 else if(
bh->keys_cnt > 0 &&
bh->keys_cnt + 1 < 64
3526 bh->keys[
bh->keys_cnt] = 0;
3559 else if(
bh->keys_cnt > 0
3563 -= (
bh->keys +
bh->keys_cnt)
3565 bh->keys[
bh->keys_cnt] = 0;
3568 else if(
bh->keys_cnt > 0 &&
bh->keys_cnt + 1 < 64
3575 bh->end_mouse_y = 0;
3576 bh->keys[
bh->keys_cnt] = 0;
3600 bh->end_mouse_y = -1;
3601 bh->keys[
bh->keys_cnt] = 0;
3644 if(event->button == 1)
3669 else if(event->button == 3)
3675 else if(event->button == 2)
3699 if(event->button == 1)
dt_accels_t * dt_accels_get_global(void)
void dt_accels_new_virtual_shortcut(dt_accels_t *accels, GtkAccelGroup *accel_group, const gchar *accel_path, GtkWidget *widget, guint key_val, GdkModifierType accel_mods)
Add a new virtual shortcut. Virtual shortcuts are immutable, read-only and don't trigger any action....
gchar * dt_accels_build_path(const gchar *scope, const gchar *feature)
void dt_accels_remove_accel(dt_accels_t *accels, const char *path, gpointer data)
Recursively remove all accels for all shortcuts containing path. This is unneeded for accels attached...
Handle default and user-set shortcuts (accelerators)
#define dt_accels_new_darkroom_action(a, b, c, d, e, f, g)
GtkWidget * dt_bauhaus_slider_new(dt_bauhaus_t *bh, dt_gui_module_t *self)
static void dt_bauhaus_widget_accept(struct dt_bauhaus_widget_t *w)
static gboolean dt_bauhaus_popup_motion_notify(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
int dt_bauhaus_slider_get_digits(GtkWidget *widget)
GtkWidget * dt_bauhaus_combobox_new_full(dt_bauhaus_t *bh, dt_gui_module_t *self, const char *label, const char *tip, int pos, GtkCallback callback, gpointer data, const char **texts)
static float _bh_get_row_height(struct dt_bauhaus_widget_t *w)
Get the total height of a GUI row containing a line of text + top and bottom padding.
void dt_bauhaus_slider_set_soft_range(GtkWidget *widget, float soft_min, float soft_max)
static gboolean ensure_focus_idle(gpointer data)
static gboolean dt_bauhaus_popup_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
void dt_bauhaus_slider_set_digits(GtkWidget *widget, int val)
GtkWidget * dt_bauhaus_slider_from_widget(dt_bauhaus_t *bh, dt_bauhaus_widget_t *w, dt_gui_module_t *self, float min, float max, float step, float defval, int digits, int feedback)
void dt_bauhaus_combobox_insert(GtkWidget *widget, const char *text, int pos)
static gboolean _widget_key_press(GtkWidget *widget, GdkEventKey *event)
void dt_bauhaus_slider_set_hard_max(GtkWidget *widget, float val)
static _bh_active_region_t _bh_get_active_region(GtkWidget *widget, double *x, double *y, double *width, GtkWidget *popup)
Check if we have user cursor over quad area or over the slider/main area, then correct cursor coordin...
void dt_bauhaus_combobox_clear(GtkWidget *widget)
static gboolean dt_bauhaus_popup_scroll(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
static void dt_bauhaus_slider_set_normalized(struct dt_bauhaus_widget_t *w, float pos, gboolean raise)
Set the value of a slider as a ratio of the GUI slider width.
static gboolean _widget_scroll(GtkWidget *widget, GdkEventScroll *event)
void dt_bauhaus_slider_clear_stops(GtkWidget *widget)
static gboolean dt_bauhaus_slider_motion_notify(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
static gboolean dt_bauhaus_popup_leave_notify(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static void dt_bauhaus_widget_reject(struct dt_bauhaus_widget_t *w)
char * dt_bauhaus_slider_get_text(GtkWidget *w, float val)
void dt_bauhaus_combobox_set_selected_text_align(GtkWidget *widget, const dt_bauhaus_combobox_alignment_t text_align)
void dt_bauhaus_combobox_set_editable(GtkWidget *widget, int editable)
static double _widget_get_main_width(struct dt_bauhaus_widget_t *w, GtkWidget *widget, double *total_width)
Get the width of the main Bauhaus widget area (slider scale or combobox), accounting for quad space,...
gboolean dt_bauhaus_focus_in_callback(GtkWidget *widget, GdkEventFocus event, gpointer user_data)
void dt_bauhaus_hide_popup(dt_bauhaus_t *bh)
gboolean dt_bauhaus_focus_callback(GtkWidget *widget, GtkDirectionType direction, gpointer data)
static double _get_slider_height(GtkWidget *widget)
void dt_bauhaus_slider_reset(GtkWidget *widget)
static void dt_bauhaus_window_show(GtkWidget *w, gpointer user_data)
static void _style_updated(GtkWidget *widget)
void dt_bauhaus_cleanup(dt_bauhaus_t *bauhaus)
static float _bh_slider_get_min_step(const struct dt_bauhaus_widget_t *const w)
Return the minimum representable value step, for current UI scaling factor and number of digits.
void dt_bauhaus_slider_set_default(GtkWidget *widget, float def)
const char * dt_bauhaus_combobox_get_entry(GtkWidget *widget, int pos)
gboolean dt_bauhaus_focus_out_callback(GtkWidget *widget, GdkEventFocus event, gpointer user_data)
static void dt_bauhaus_draw_baseline(struct dt_bauhaus_widget_t *w, cairo_t *cr, float width)
Draw the slider baseline, aka the backgronud bar.
void dt_bauhaus_slider_set_stop(GtkWidget *widget, float stop, float r, float g, float b)
#define DT_BAUHAUS_FOCUS_IDLE_MAX_TRIES
void dt_bauhaus_load_theme(dt_bauhaus_t *bauhaus)
float dt_bauhaus_slider_get(GtkWidget *widget)
void dt_bauhaus_combobox_set_text(GtkWidget *widget, const char *text)
static void dt_bauhaus_draw_indicator(struct dt_bauhaus_widget_t *w, float pos, cairo_t *cr, float wd)
void dt_bauhaus_combobox_entry_set_sensitive(GtkWidget *widget, int pos, gboolean sensitive)
gboolean dt_bauhaus_combobox_set_from_value(GtkWidget *widget, int value)
void dt_bauhaus_widget_release_quad(GtkWidget *widget)
GtkWidget * dt_bauhaus_slider_new_with_range_and_feedback(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits, int feedback)
void dt_bauhaus_combobox_from_widget(dt_bauhaus_t *bh, dt_bauhaus_widget_t *w, dt_gui_module_t *self)
static void _get_preferred_width(GtkWidget *widget, gint *minimum_size, gint *natural_size)
void dt_bauhaus_combobox_insert_separator_with_height(GtkWidget *widget, int pos, const float row_height_factor)
static gboolean dt_bauhaus_popup_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
float dt_bauhaus_slider_get_soft_max(GtkWidget *widget)
static void free_combobox_entry(gpointer data)
static double _get_combobox_popup_height(struct dt_bauhaus_widget_t *w)
void dt_bauhaus_widget_set_field(GtkWidget *widget, gpointer field, dt_introspection_type_t field_type)
static void _bh_combobox_get_hovered_entry(struct dt_bauhaus_widget_t *w)
float dt_bauhaus_slider_get_soft_min(GtkWidget *widget)
void dt_bauhaus_slider_set_feedback(GtkWidget *widget, int feedback)
static double get_slider_line_offset(const double pos, const double scale, const double x, double y, const double line_height)
void dt_bauhaus_disable_module_list(GtkWidget *widget)
static void _widget_finalize(GObject *widget)
static float _bh_get_combobox_entry_height(struct dt_bauhaus_widget_t *w, const dt_bauhaus_combobox_entry_t *entry)
Get the vertical space used by a combobox popup entry.
float dt_bauhaus_slider_get_val(GtkWidget *widget)
static dt_bauhaus_combobox_data_t * _combobox_data(GtkWidget *widget)
void dt_bauhaus_combobox_insert_full(GtkWidget *widget, const char *text, dt_bauhaus_combobox_alignment_t align, gpointer data, void(*free_func)(void *), int pos)
int dt_bauhaus_combobox_get(GtkWidget *widget)
static void _commit_combobox_value(struct dt_bauhaus_widget_t *w)
void dt_bauhaus_widget_set_quad_toggle(GtkWidget *widget, int toggle)
static int _combobox_selectable_count(const dt_bauhaus_combobox_data_t *d)
Count selectable combobox entries.
static gboolean dt_bauhaus_popup_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void show_pango_text(struct dt_bauhaus_widget_t *w, GtkStyleContext *context, cairo_t *cr, GdkRectangle *bounding_box, const char *text, _bh_halign_t halign, _bh_valign_t valign, PangoEllipsizeMode ellipsize, GdkRGBA *bg_color, float *width, float *height, GtkStateFlags state)
Display text aligned in a bounding box, with pseudo-classes properties handled, and optional backgrou...
void dt_bauhaus_slider_set_offset(GtkWidget *widget, float offset)
static void _dt_bauhaus_slider_set_with_raise(GtkWidget *widget, float pos, gboolean raise)
#define DT_BAUHAUS_FOCUS_IDLE_SOURCE_KEY
static void _combobox_next_sensitive(struct dt_bauhaus_widget_t *w, int delta)
static gboolean dt_bauhaus_slider_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void _combobox_set(GtkWidget *widget, const int pos)
Set a combobox to a given integer position. Private API function, called from user events.
void dt_bauhaus_combobox_set_entries_ellipsis(GtkWidget *widget, PangoEllipsizeMode ellipis)
void dt_bauhaus_slider_set_step(GtkWidget *widget, float val)
static dt_bauhaus_combobox_entry_t * new_combobox_entry(const char *label, const char *tooltip, dt_bauhaus_combobox_alignment_t alignment, gboolean sensitive, void *data, void(*free_func)(void *))
static void _slider_zoom_range(struct dt_bauhaus_widget_t *w, float zoom)
static GdkRGBA * default_color_assign()
void dt_bauhaus_slider_set_soft_max(GtkWidget *widget, float val)
void dt_bauhaus_combobox_insert_separator(GtkWidget *widget, int pos)
void dt_bauhaus_show_popup(GtkWidget *widget)
void dt_bauhaus_set_use_default_callback(GtkWidget *widget)
Tell the widget to use the globally-defined default callback in the bauhaus structure This callback n...
int dt_bauhaus_combobox_length(GtkWidget *widget)
void dt_bauhaus_widget_set_quad_active(GtkWidget *widget, int active)
static _bh_active_region_t _popup_coordinates(dt_bauhaus_t *bh, const double x_root, const double y_root, double *event_x, double *event_y)
void dt_bauhaus_combobox_set_default(GtkWidget *widget, int def)
static double _widget_get_quad_width(struct dt_bauhaus_widget_t *w)
Get the width of the quad without padding.
float dt_bauhaus_slider_get_hard_min(GtkWidget *widget)
static double _widget_get_total_width(struct dt_bauhaus_widget_t *w, GtkWidget *widget)
Get the total width of the main Bauhaus widget area, accounting for padding and margins.
static float _bh_round_to_n_digits(const struct dt_bauhaus_widget_t *const w, float x)
Round a slider numeric value to the number of digits specified in the widget w.
void dt_bauhaus_combobox_add_full(GtkWidget *widget, const char *text, dt_bauhaus_combobox_alignment_t align, gpointer data, void(free_func)(void *data), gboolean sensitive)
gpointer dt_bauhaus_combobox_get_data(GtkWidget *widget)
static void _commit_slider_value(struct dt_bauhaus_widget_t *w)
void dt_bauhaus_combobox_add_populate_fct(GtkWidget *widget, void(*fct)(GtkWidget *w, void *module))
static void _bauhaus_widget_init(dt_bauhaus_t *bauhaus, dt_bauhaus_widget_t *w, dt_gui_module_t *self)
void dt_bauhaus_combobox_add_separator(GtkWidget *widget)
static float _get_combobox_max_width(GtkWidget *widget)
static dt_bauhaus_combobox_entry_t * new_combobox_separator(const float row_height_factor)
Create a new combobox separator entry.
void dt_bauhaus_combobox_add_list(GtkWidget *widget, const char **texts)
gboolean _action_request_focus(GtkAccelGroup *accel_group, GObject *accelerable, guint keyval, GdkModifierType modifier, gpointer data)
static double _get_indicator_y_position(struct dt_bauhaus_widget_t *w)
int dt_bauhaus_combobox_get_editable(GtkWidget *widget)
static void draw_slider_line(cairo_t *cr, const double pos, const double off, const double scale, const double width, const double height, const double line_height, double line_width)
const char * dt_bauhaus_widget_get_label(GtkWidget *widget)
int dt_bauhaus_widget_get_quad_active(GtkWidget *widget)
void dt_bauhaus_slider_set_soft_min(GtkWidget *widget, float val)
void dt_bauhaus_disable_accels(GtkWidget *widget)
static void _margins_retrieve(struct dt_bauhaus_widget_t *w)
Update the box margin and padding properties of the widget w by reading CSS context.
static gboolean dt_bauhaus_slider_button_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static gchar * _build_label(const struct dt_bauhaus_widget_t *w)
const char * dt_bauhaus_combobox_get_text(GtkWidget *widget)
void dt_bauhaus_slider_set_val(GtkWidget *widget, float val)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
static double _widget_get_main_height(struct dt_bauhaus_widget_t *w, GtkWidget *widget)
Get the height of the main Bauhaus widget area (slider scale or combobox), that is the box allocation...
float dt_bauhaus_slider_get_step(GtkWidget *widget)
static gboolean _widget_draw(GtkWidget *widget, cairo_t *crf)
static gboolean _enter_leave(GtkWidget *widget, GdkEventCrossing *event)
static void _slider_add_step(GtkWidget *widget, float delta, guint state)
void dt_bauhaus_widget_press_quad(GtkWidget *widget)
static int _combobox_entry_pos_to_public(const dt_bauhaus_combobox_data_t *d, const int entry_pos)
Convert an internal entry row to the public value index.
void dt_bauhaus_combobox_set(GtkWidget *widget, const int pos)
#define DT_BAUHAUS_FOCUS_IDLE_TRIES_KEY
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
void dt_bauhaus_slider_set_hard_min(GtkWidget *widget, float val)
GtkWidget * dt_bauhaus_slider_new_with_range(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits)
void dt_bauhaus_combobox_remove_at(GtkWidget *widget, int pos)
GtkWidget * dt_bauhaus_combobox_new(dt_bauhaus_t *bh, dt_gui_module_t *self)
void dt_bauhaus_widget_set_quad_visibility(GtkWidget *widget, const gboolean visible)
static double _get_slider_bar_height(struct dt_bauhaus_widget_t *w)
static void _get_preferred_height(GtkWidget *widget, gint *minimum_size, gint *natural_size)
gboolean dt_bauhaus_combobox_set_from_text(GtkWidget *widget, const char *text)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
float dt_bauhaus_slider_get_hard_max(GtkWidget *widget)
static void dt_bauhaus_draw_quad(struct dt_bauhaus_widget_t *w, cairo_t *cr, const double x, const double y)
static int _combobox_public_to_entry_pos(const dt_bauhaus_combobox_data_t *d, const int pos, const gboolean allow_end)
Convert a public value index to the internal entry row.
static void _translate_cursor(double *x, double *y, struct dt_bauhaus_widget_t *const w)
Translate in-place the cursor coordinates within the widget or popup according to padding and margin,...
void dt_bauhaus_combobox_add(GtkWidget *widget, const char *text)
void dt_bauhaus_widget_set_quad_paint(GtkWidget *widget, dt_bauhaus_quad_paint_f f, int paint_flags, void *paint_data)
static gboolean dt_bauhaus_popup_button_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void dt_bauhaus_combobox_add_with_tooltip(GtkWidget *widget, const char *text, const char *tooltip)
void dt_bauhaus_combobox_add_separator_with_height(GtkWidget *widget, const float row_height_factor)
dt_bauhaus_t * dt_bauhaus_init()
static void dt_bh_init(DtBauhausWidget *class)
void dt_bauhaus_slider_set_factor(GtkWidget *widget, float factor)
static gboolean dt_bauhaus_combobox_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void dt_bauhaus_combobox_add_aligned(GtkWidget *widget, const char *text, dt_bauhaus_combobox_alignment_t align)
static double _bh_slider_get_scale(struct dt_bauhaus_widget_t *w)
static void dt_bh_class_init(DtBauhausWidgetClass *class)
static double _get_combobox_height(GtkWidget *widget)
dt_bauhaus_combobox_alignment_t
@ DT_BAUHAUS_COMBOBOX_ALIGN_RIGHT
#define DT_BAUHAUS_COMBO_MAX_TEXT
#define DT_BAUHAUS_WIDGET(obj)
#define DT_BAUHAUS_WIDGET_TYPE
@ DT_BAUHAUS_QUAD_PRESSED_SIGNAL
@ DT_BAUHAUS_VALUE_CHANGED_SIGNAL
#define DT_BAUHAUS_COMBO_SEPARATOR_DEFAULT_HEIGHT_FACTOR
void(* dt_bauhaus_quad_paint_f)(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
#define DT_BAUHAUS_SLIDER_MAX_STOPS
float dt_calculator_solve(const float x, const char *formula)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
static const float const float const float min
static void set_color(cairo_t *cr, GdkRGBA color)
G_DEFINE_TYPE(GtkDarktableDrawingArea, dtgtk_drawing_area, GTK_TYPE_DRAWING_AREA)
static guint dt_keys_mainpad_alternatives(const guint key_val)
Remap keypad keys to usual mainpad ones.
static int precision(double x, double adj)
float *const restrict const size_t k
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static int ipow(int base, int exp)
Fast integer power, computing base^exp.
#define CLAMPF(a, mn, mx)
static void dt_free_gpointer(gpointer ptr)
g_free() one pointer, with the signature GDestroyNotify wants.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
void dt_osx_disallow_fullscreen(GtkWidget *widget)
static const dt_aligned_pixel_simd_t value
const float uint32_t state[4]
PangoEllipsizeMode entries_ellipsis
void(* populate)(GtkWidget *w, void *module)
dt_bauhaus_combobox_alignment_t text_align
void(* free_func)(gpointer)
dt_bauhaus_combobox_alignment_t alignment
GdkRGBA color_value_text_insensitive
GdkRGBA graph_scope_restricted
GdkRGBA colorlabels[DT_COLORLABELS_LAST]
void(* default_value_changed_callback)(GtkWidget *widget)
float mouse_line_distance
GdkRGBA color_value_insensitive
PangoFontDescription * pango_font_desc
struct dt_bauhaus_widget_t * current
GdkRGBA color_fg_insensitive
The dt_gui_module_t type is the intersection between a dt_lib_module_t and a dt_iop_module_t structur...
static G_BEGIN_DECLS cairo_surface_t * dt_cairo_surface_create_at_scale(cairo_format_t format, int width, int height, double scale)
typedef double((*spd)(unsigned long int wavelength, double TempK))
dt_bauhaus_combobox_data_t combobox
dt_bauhaus_slider_data_t slider