Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
gtk.h File Reference

GTK utils. More...

#include "zrythm-config.h"
#include <stdbool.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include <cyaml/cyaml.h>
Include dependency graph for gtk.h:

Go to the source code of this file.

Data Structures

struct  ZGObjectImpl
 GObject struct (from GObject source code), used where hacks are needed. More...
 

Macros

#define DEFAULT_CLIPBOARD   gdk_display_get_clipboard (gdk_display_get_default ())
 
#define CREATE_MIDI_LEARN_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("MIDI learn"), "signal-midi", action)
 
#define CREATE_CUT_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("Cu_t"), "edit-cut", action)
 
#define CREATE_COPY_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("_Copy"), "edit-copy", action)
 
#define CREATE_PASTE_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("_Paste"), "edit-paste", action)
 
#define CREATE_DELETE_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("_Delete"), "edit-delete", action)
 
#define CREATE_CLEAR_SELECTION_MENU_ITEM(action)
 
#define CREATE_SELECT_ALL_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("Select A_ll"), "edit-select-all", action)
 
#define CREATE_DUPLICATE_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("Duplicate"), "edit-duplicate", action)
 
#define CREATE_MUTE_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("Mute"), "mute", action)
 
#define CREATE_UNMUTE_MENU_ITEM(action)    z_gtk_create_menu_item (_ ("Unmute"), NULL, action)
 
#define z_gtk_assistant_set_current_page_complete(assistant, complete)
 
#define Z_GDK_RGBA_INIT(r, g, b, a)
 
#define Z_GDK_RECTANGLE_INIT(_x, _y, _w, _h)
 
#define Z_GDK_RECTANGLE_INIT_UNIT(_x, _y)
 
#define z_gtk_create_menu_item(lbl_name, icn_name, action_name)    z_gtk_create_menu_item_full (lbl_name, icn_name, action_name)
 

Typedefs

typedef enum IconType IconType
 

Enumerations

enum  ZGtkResize { Z_GTK_NO_RESIZE , Z_GTK_RESIZE }
 
enum  ZGtkShrink { Z_GTK_NO_SHRINK , Z_GTK_SHRINK }
 

Functions

GdkMonitor * z_gtk_get_primary_monitor (void)
 
int z_gtk_get_primary_monitor_scale_factor (void)
 
int z_gtk_get_primary_monitor_refresh_rate (void)
 
bool z_gtk_is_wayland (void)
 
void z_gtk_tree_view_remove_all_columns (GtkTreeView *treeview)
 
void z_gtk_column_view_remove_all_columnes (GtkColumnView *column_view)
 
GListStore * z_gtk_column_view_get_list_store (GtkColumnView *column_view)
 
void z_gtk_list_store_splice (GListStore *store, GPtrArray *ptr_array)
 Removes all items and re-populates the list store.
 
void z_gtk_widget_remove_all_children (GtkWidget *widget)
 
void z_gtk_widget_destroy_all_children (GtkWidget *widget)
 
void z_gtk_widget_remove_children_of_type (GtkWidget *widget, GType type)
 
void z_gtk_overlay_add_if_not_exists (GtkOverlay *overlay, GtkWidget *widget)
 
void z_gtk_button_set_icon_name_and_text (GtkButton *btn, const char *name, const char *text, bool icon_first, GtkOrientation orientation, int spacing)
 Sets the icon name and optionally text.
 
GtkToggleButton * z_gtk_toggle_button_new_with_icon (const char *name)
 Creates a toggle button with the given icon name.
 
GtkToggleButton * z_gtk_toggle_button_new_with_icon_and_text (const char *name, const char *text, bool icon_first, GtkOrientation orientation, int spacing)
 Creates a toggle button with the given icon name.
 
GtkButton * z_gtk_button_new_with_icon_and_text (const char *name, const char *text, bool icon_first, GtkOrientation orientation, int spacing)
 Creates a button with the given icon name and text.
 
GMenuItem * z_gtk_create_menu_item_full (const gchar *label_name, const gchar *icon_name, const char *detailed_action)
 Creates a menu item.
 
char * z_gtk_get_tooltip_for_action (const char *detailed_action, const char *tooltip)
 Gets the tooltip for the given action on the given widget.
 
void z_gtk_widget_set_tooltip_for_action (GtkWidget *widget, const char *detailed_action, const char *tooltip)
 Sets the tooltip for the given action on the given widget.
 
void z_gtk_set_tooltip_for_actionable (GtkActionable *actionable, const char *tooltip)
 Sets the tooltip and finds the accel keys and appends them to the tooltip in small text.
 
GtkWidget * z_gtk_widget_get_nth_child (GtkWidget *widget, int index)
 Returns the nth child of a container.
 
void z_gtk_button_set_emblem (GtkButton *btn, const char *emblem_icon)
 Sets the given emblem to the button, or unsets the emblem if emblem_icon is NULL.
 
void z_gtk_setup_foldable_notebook (GtkNotebook *notebook)
 Makes the given notebook foldable.
 
void z_gtk_widget_set_margin (GtkWidget *widget, int margin)
 Sets the margin on all 4 sides on the widget.
 
GtkFlowBoxChild * z_gtk_flow_box_get_selected_child (GtkFlowBox *self)
 
bool z_gtk_activate_dir_link_func (GtkLabel *label, char *uri, void *data)
 Callback to use for simple directory links.
 
GtkSourceLanguageManager * z_gtk_source_language_manager_get (void)
 
void z_gtk_notebook_make_detachable (GtkNotebook *notebook, GtkWindow *parent_window)
 Makes the given GtkNotebook detachable to a new window.
 
char * z_gtk_text_buffer_get_full_text (GtkTextBuffer *buffer)
 Returns the full text contained in the text buffer.
 
void z_gtk_generate_screenshot_image (GtkWidget *widget, const char *type, char **option_keys, char **option_values, char **ret_dir, char **ret_path, bool accept_fallback)
 Generates a screenshot image for the given widget.
 
void z_gtk_actionable_set_action_from_setting (GtkActionable *actionable, GSettings *settings, const char *key)
 Sets the action target of the given GtkActionable to be binded to the given setting.
 
bool z_gtk_is_event_button (GdkEvent *ev)
 
void z_gtk_scrolled_window_get_visible_rect (GtkScrolledWindow *scroll, graphene_rect_t *rect)
 Gets the visible rectangle from the scrolled window's adjustments.
 
void z_gtk_graphene_rect_t_to_gdk_rectangle (GdkRectangle *rect, graphene_rect_t *grect)
 
void z_gdk_rectangle_to_graphene_rect_t (graphene_rect_t *grect, GdkRectangle *rect)
 
void z_gdk_rectangle_print (const GdkRectangle *rect)
 
int z_gtk_dialog_run (GtkDialog *dialog, bool destroy_on_close)
 Mimics the blocking behavior.
 
void z_gtk_show_context_menu_from_g_menu (GtkPopoverMenu *popover_menu, double x, double y, GMenu *menu)
 The popover must already exist as a children of its intended widget (or a common parent).
 
GdkDragAction z_gtk_drop_target_get_selected_action (GtkDropTarget *drop_target)
 Returns the bitmask of the selected action during a drop (eg, GDK_ACTION_COPY).
 
GtkIconTheme * z_gtk_icon_theme_get_default (void)
 
char * z_gdk_clipboard_get_text (GdkClipboard *clipboard)
 Returns the text on the clipboard, or NULL if there is nothing or the content is not text.
 
GdkPixbuf * z_gdk_pixbuf_new_from_icon_name (const char *icon_name, int width, int height, int scale, GError **error)
 Creates a new pixbuf for the given icon scaled at the given width/height.
 
GdkTexture * z_gdk_texture_new_from_icon_name (const char *icon_name, int width, int height, int scale)
 Creates a new texture for the given icon scaled at the given width/height.
 
void z_gtk_print_graphene_rect (graphene_rect_t *rect)
 
void z_gtk_widget_print_hierarchy (GtkWidget *widget)
 Prints the widget's hierarchy (parents).
 
const char * z_gtk_get_gsk_renderer_type (void)
 
gboolean z_gtk_simple_action_shortcut_func (GtkWidget *widget, GVariant *args, gpointer user_data)
 A shortcut callback to use for simple actions.
 
GtkWidget * z_gtk_widget_find_child_of_type (GtkWidget *widget, GType type)
 Recursively searches the children of widget for a child of type type.
 
void z_gtk_list_box_remove_all_children (GtkListBox *list_box)
 
void z_graphene_rect_print (const graphene_rect_t *rect)
 
GtkStringList * z_gtk_string_list_new_from_cyaml_strvals (const cyaml_strval_t *strvals, size_t num_vals, bool localized)
 
GtkWidget * z_gtk_get_first_focusable_child (GtkWidget *parent)
 
bool z_gtk_descendant_has_focus (GtkWidget *parent)
 
void z_gtk_window_make_escapable (GtkWindow *self)
 
void z_gtk_drop_down_list_item_header_setup_common (GtkSignalListItemFactory *factory, GObject *list_item, gpointer user_data)
 A common "setup" signal handler for GtkDropDown header factories.
 
void z_gtk_drop_down_factory_setup_common (GtkSignalListItemFactory *factory, GObject *list_item, gpointer user_data)
 
void z_gtk_drop_down_factory_setup_common_ellipsized (GtkSignalListItemFactory *factory, GObject *list_item, gpointer user_data)
 

Detailed Description

GTK utils.

Definition in file gtk.h.