utils/ui.h file

User Interface utils.

Contents

Enums

enum UiCursorState { UI_CURSOR_STATE_DEFAULT, UI_CURSOR_STATE_RESIZE_L, UI_CURSOR_STATE_REPEAT_L, UI_CURSOR_STATE_RESIZE_R, UI_CURSOR_STATE_REPEAT_R, UI_CURSOR_STATE_RESIZE_UP }
Various cursor states to be shared.
enum UiOverlayAction { UI_OVERLAY_ACTION_NONE, UI_OVERLAY_ACTION_CREATING_RESIZING_R, UI_OVERLAY_ACTION_CREATING_MOVING, UI_OVERLAY_ACTION_RESIZING_L, UI_OVERLAY_ACTION_RESIZING_R, UI_OVERLAY_ACTION_RESIZING_UP, UI_OVERLAY_ACTION_STRETCHING_L, UI_OVERLAY_ACTION_STRETCHING_R, UI_OVERLAY_ACTION_AUDITIONING, UI_OVERLAY_ACTION_AUTOFILLING, UI_OVERLAY_ACTION_ERASING, UI_OVERLAY_ACTION_STARTING_MOVING, UI_OVERLAY_ACTION_STARTING_MOVING_COPY, UI_OVERLAY_ACTION_STARTING_MOVING_LINK, UI_OVERLAY_ACTION_MOVING, UI_OVERLAY_ACTION_MOVING_COPY, UI_OVERLAY_ACTION_MOVING_LINK, UI_OVERLAY_ACTION_STARTING_CHANGING_CURVE, UI_OVERLAY_ACTION_CHANGING_CURVE, UI_OVERLAY_ACTION_STARTING_SELECTION, UI_OVERLAY_ACTION_SELECTING, UI_OVERLAY_ACTION_STARTING_DELETE_SELECTION, UI_OVERLAY_ACTION_DELETE_SELECTING, UI_OVERLAY_ACTION_STARTING_RAMP, UI_OVERLAY_ACTION_RAMPING, UI_OVERLAY_ACTION_CUTTING }
Various overlay actions to be shared.

Typedefs

using UiCursorState = enum UiCursorState
Various cursor states to be shared.
using UiOverlayAction = enum UiOverlayAction
Various overlay actions to be shared.

Functions

void ui_set_cursor_from_icon_name(GtkWidget* widget, const char* name, int offset_x, int offset_y)
Sets cursor from icon name.
void ui_set_cursor_from_name(GtkWidget* widget, char* name)
Sets cursor from standard cursor name.
void ui_show_error_message_full(GtkWindow* parent_window, const char* message)
Shows error popup.
static auto ui_is_child_hit(GtkContainer* parent, GtkWidget* child, const int check_x, const int check_y, const double x, const double y, const double x_padding, const double y_padding) -> int
Returns if the child is hit or not by the coordinates in parent.
auto ui_get_hit_child(GtkContainer* parent, double x, double y, GType type) -> GtkWidget*
Returns the matching hit child, or NULL.
void ui_px_to_pos_timeline(double px, Position* pos, int has_padding)
Converts from pixels to position.
auto ui_px_to_frames_timeline(double px, int has_padding) -> long
Converts from pixels to frames.
auto ui_px_to_frames_editor(double px, int has_padding) -> long
Converts from pixels to frames.
auto ui_pos_to_px_timeline(Position* pos, int use_padding) -> int
Converts position to px, optionally adding the ruler padding.
auto ui_pos_to_px_editor(Position* pos, int use_padding) -> int
Converts position to px, optionally adding the ruler padding.
void ui_px_to_pos_editor(double px, Position* pos, int has_padding)
Converts from pixels to position.
void ui_show_notification(const char* msg)
Shows a notification in the revealer.
auto ui_show_notification_idle_func(char* msg) -> int
Show notification from non-GTK threads.
void ui_get_modifier_type_from_gesture(GtkGestureSingle* gesture, GdkModifierType* state_mask)
Returns the modifier type (state mask) from the given gesture.
void ui_setup_language_combo_box(GtkComboBox* language)
Sets up a combo box to have a selection of languages.
void ui_setup_audio_backends_combo_box(GtkComboBox* cb)
Sets up an audio backends combo box.
void ui_setup_midi_backends_combo_box(GtkComboBox* cb)
Sets up a MIDI backends combo box.
void ui_setup_pan_algo_combo_box(GtkComboBox* cb)
Sets up a pan algorithm combo box.
void ui_setup_pan_law_combo_box(GtkComboBox* cb)
Sets up a pan law combo box.
void ui_get_contrast_text_color(GdkRGBA* src, GdkRGBA* dest)
Returns the contrasting color (variation of black or white) based on if the given color is dark enough or not.

Defines

#define RESIZE_CURSOR_SPACE
Space on the edges to show resize cursors.
#define TARGET_ENTRY_PLUGIN_DESCR
Drag n Drop related.
#define TARGET_ENTRY_TRACK
Track target entry.
#define ui_show_notification_idle(msg)
Shows the notification when idle.
#define ui_show_error_message(win, msg)
Wrapper to show error message so that no casting of the window is needed on the caller side.
#define UI_GET_STATE_MASK(gesture)
Used in handlers to get the state mask.

Define documentation

#define TARGET_ENTRY_TRACK

Track target entry.

This is just the identifier. The TracklistSelections will be used.

#define ui_show_notification_idle(msg)

Shows the notification when idle.

This should be called from threads other than GTK main thread.