21#ifndef GEANY_UI_UTILS_H
22#define GEANY_UI_UTILS_H 1
39#define ui_hookup_widget(owner, widget, widget_name) \
40 g_object_set_data_full(G_OBJECT(owner), widget_name, \
41 g_object_ref(widget), (GDestroyNotify)g_object_unref);
96#define GEANY_STOCK_SAVE_ALL "geany-save-all"
97#define GEANY_STOCK_CLOSE_ALL "geany-close-all"
98#define GEANY_STOCK_BUILD "geany-build"
105void ui_table_add_row(GtkTable *table, gint row, ...) G_GNUC_NULL_TERMINATED;
126 GCallback callback, GCompareFunc sort_func);
135 const gchar *
text, gint history_len);
142#ifndef GEANY_DISABLE_DEPRECATED
157typedef struct UIPrefs
162 gboolean sidebar_visible;
164 gboolean msgwindow_visible;
165 gboolean allow_always_save;
166 gchar *statusbar_template;
167 gboolean new_document_after_close;
170 GQueue *recent_queue;
171 GQueue *recent_projects_queue;
172 gchar *custom_date_format;
173 gchar **custom_commands;
174 gchar **custom_commands_labels;
177 gchar *color_picker_palette;
185typedef struct UIWidgets
188 GtkWidget *toolbar_menu;
189 GtkWidget *recent_files_menuitem;
190 GtkWidget *recent_files_menu_menubar;
191 GtkWidget *print_page_setup;
192 GtkWidget *recent_projects_menuitem;
193 GtkWidget *recent_projects_menu_menubar;
194 GtkWidget *config_files_filetype_menu;
197 GtkWidget *open_colorsel;
198 GtkWidget *open_fontsel;
202 GtkWidget *statusbar;
212typedef struct GeanyAutoSeparator
223 GEANY_EDITOR_SHOW_MARKERS_MARGIN,
224 GEANY_EDITOR_SHOW_LINE_NUMBERS,
225 GEANY_EDITOR_SHOW_WHITE_SPACE,
226 GEANY_EDITOR_SHOW_INDENTATION_GUIDES,
227 GEANY_EDITOR_SHOW_LINE_ENDINGS
229GeanyUIEditorFeatures;
243 GtkFileChooserAction action, GtkEntry *
entry);
261 gint new_text_len, gint *
position, gpointer data);
282 GtkContainer *parent);
340typedef gboolean TVMatchCallback(gboolean);
Document related actions: new, save, open, etc.
#define GEANY_DEPRECATED_FOR(x)
Structure for representing an open tab with all its properties.
gint tab_pos_editor
positions of editor's tabs
gint symbols_sort_mode
symbol list sorting mode
gboolean statusbar_visible
whether the status bar is visible
gboolean show_symbol_list_expanders
whether to show expanders in the symbol list
gint sidebar_pos
position of the sidebar (left or right)
gboolean use_native_windows_dialogs
whether to use native Windows' dialogs (only used on Windows)
gboolean compiler_tab_autoscroll
whether compiler messages window is automatically scrolled to show new messages
gboolean msgwin_status_visible
whether message window's status tab is visible
gboolean sidebar_symbol_visible
whether the symbol sidebar is visible
gint tab_pos_sidebar
positions of sidebar's tabs
gchar * editor_font
editor font
gboolean highlighting_invert_all
whether highlighting colors are inverted
gboolean sidebar_openfiles_visible
whether the open file list is visible
gchar * msgwin_font
message window font
gboolean show_notebook_tabs
whether editor tabs are visible
gboolean msgwin_compiler_visible
whether message window's compiler tab is visible
gint tab_pos_msgwin
positions of message window's tabs
gboolean msgwin_scribble_visible
whether message window's scribble tab is visible
gint msgwin_orientation
orientation of the message window
gboolean msgwin_messages_visible
whether message window's messages tab is visible
gboolean notebook_double_click_hides_widgets
whether a double click on notebook tabs hides all other windows
gchar * tagbar_font
symbol sidebar font
Important widgets in the main window.
GtkWidget * window
Main window.
GtkWidget * notebook
Document notebook.
GtkWidget * message_window_notebook
Message Window notebook.
GtkWidget * editor_menu
Popup editor menu.
GtkWidget * progressbar
Progress bar widget in the status bar to show progress of various actions.
GtkWidget * toolbar
Main toolbar.
GtkWidget * project_menu
Plugins modifying the project can add their items to the Project menu.
GtkWidget * tools_menu
Most plugins add menu items to the Tools menu.
GtkWidget * sidebar_notebook
Sidebar notebook.
void ui_init_toolbar_widgets(void)
void ui_update_statusbar(GeanyDocument *doc, gint pos)
void ui_set_fullscreen(void)
void ui_init_builder(void)
void ui_widget_show_hide(GtkWidget *widget, gboolean show)
void ui_create_insert_menu_items(void)
void ui_sidebar_show_hide(void)
void ui_update_menu_copy_items(GeanyDocument *doc)
void ui_update_popup_goto_items(gboolean enable)
GtkWidget * create_toolbar_popup_menu1(void)
void ui_dialog_set_primary_button_order(GtkDialog *dialog, gint response,...)
void ui_statusbar_showhide(gboolean state)
void ui_label_set_markup(GtkLabel *label, const gchar *format,...)
void ui_update_tab_status(GeanyDocument *doc)
void ui_create_recent_menus(void)
GtkWidget * create_edit_menu1(void)
gboolean ui_tree_view_find_next(GtkTreeView *treeview, TVMatchCallback cb)
gpointer ui_builder_get_object(const gchar *name)
gboolean ui_tree_view_find_previous(GtkTreeView *treeview, TVMatchCallback cb)
void ui_set_editor_font(const gchar *font_name)
GtkWidget * create_project_dialog(void)
gboolean ui_encodings_combo_box_set_active_encoding(GtkComboBox *combo, gint enc)
void ui_update_popup_copy_items(GeanyDocument *doc)
GIcon * ui_get_mime_icon(const gchar *mime_type)
void ui_save_buttons_toggle(gboolean enable)
void ui_add_recent_project_file(const gchar *utf8_filename)
void ui_combo_box_prepend_text_once(GtkComboBoxText *combo, const gchar *text)
GtkWidget * create_prefs_dialog(void)
void ui_set_window_title(GeanyDocument *doc)
void ui_swap_sidebar_pos(void)
void ui_hbutton_box_copy_layout(GtkButtonBox *master, GtkButtonBox *copy)
gboolean ui_tree_model_iter_any_next(GtkTreeModel *model, GtkTreeIter *iter, gboolean down)
void ui_entry_add_activate_backward_signal(GtkEntry *entry)
GtkWidget * ui_create_encodings_combo_box(gboolean has_detect, gint default_enc)
gchar * ui_menu_item_get_text(GtkMenuItem *menu_item)
static GtkWidget * prefs_dialog
GeanyMainWidgets main_widgets
void ui_menu_copy_items_set_sensitive(gboolean sensitive)
void ui_auto_separator_add_ref(GeanyAutoSeparator *autosep, GtkWidget *item)
void ui_document_show_hide(GeanyDocument *doc)
void ui_focus_current_document(void)
gint ui_encodings_combo_box_get_active_encoding(GtkComboBox *combo)
void ui_update_view_editor_menu_items(void)
void ui_add_recent_document(GeanyDocument *doc)
void ui_document_buttons_update(void)
void ui_update_fold_items(void)
void ui_toggle_editor_features(GeanyUIEditorFeatures feature)
GtkWidget * create_window1(void)
void ui_add_config_file_menu_item(const gchar *real_path, const gchar *label, GtkContainer *parent)
void ui_update_recent_project_menu(void)
GtkWidget * ui_label_new_bold(const gchar *text)
void ui_widget_set_sensitive(GtkWidget *widget, gboolean set)
void ui_set_search_entry_background(GtkWidget *widget, gboolean success)
void ui_init_stock_items(void)
void ui_finalize_builder(void)
void ui_editable_insert_text_callback(GtkEditable *editable, gchar *new_text, gint new_text_len, gint *position, gpointer data)
void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title, GtkFileChooserAction action, GtkEntry *entry)
void ui_update_popup_reundo_items(GeanyDocument *doc)
void ui_update_insert_include_item(GeanyDocument *doc, gint item)
GeanyInterfacePrefs interface_prefs
void ui_create_insert_date_menu_items(void)
struct GeanyInterfacePrefs GeanyInterfacePrefs
Interface preferences.
struct GeanyMainWidgets GeanyMainWidgets
Important widgets in the main window.
const gchar * ui_lookup_stock_label(const gchar *stock_id)
Finds the label text associated with stock_id.
void ui_add_document_sensitive(GtkWidget *widget)
Adds a widget to the list of widgets that should be set sensitive/insensitive when some documents are...
void ui_progress_bar_start(const gchar *text)
Starts a constantly pulsing progressbar in the right corner of the statusbar (if the statusbar is vis...
void ui_widget_modify_font_from_string(GtkWidget *wid, const gchar *str)
Modifies the font of a widget using gtk_widget_modify_font().
gint ui_get_gtk_settings_integer(const gchar *property_name, gint default_value)
Reads an integer from the GTK default settings registry (see http://library.gnome....
GtkWidget * ui_dialog_vbox_new(GtkDialog *dialog)
Makes a fixed border for dialogs without increasing the button box border.
void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback)
<simplesect kind="geany:skip"></simplesect> Adds a list of document items to menu.
gboolean ui_is_keyval_enter_or_return(guint keyval)
Checks whether the passed keyval is the Enter or Return key.
void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active, GCallback callback, GCompareFunc sort_func)
<simplesect kind="geany:skip"></simplesect> Adds a list of document items to menu.
void ui_widget_set_tooltip_text(GtkWidget *widget, const gchar *text)
Sets text as the contents of the tooltip for widget.
GtkWidget * ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry)
Creates a GtkHBox with entry packed into it and an open button which runs a file chooser,...
void ui_table_add_row(GtkTable *table, gint row,...) G_GNUC_NULL_TERMINATED
Packs all GtkWidgets passed after the row argument into a table, using one widget per cell.
void ui_entry_add_clear_icon(GtkEntry *entry)
Adds a small clear icon to the right end of the passed entry.
void ui_set_statusbar(gboolean log, const gchar *format,...)
Displays text on the statusbar.
void ui_progress_bar_stop(void)
Stops a running progress bar and hides the widget again.
void ui_combo_box_add_to_history(GtkComboBoxText *combo_entry, const gchar *text, gint history_len)
Prepends text to the drop down list, removing a duplicate element in the list if found.
GtkWidget * ui_button_new_with_image(const gchar *stock_id, const gchar *text)
Creates a GtkButton with custom text and a stock image similar to gtk_button_new_from_stock().
GtkWidget * ui_image_menu_item_new(const gchar *stock_id, const gchar *label)
Creates a GtkImageMenuItem with a stock image and a custom label.
GtkWidget * ui_lookup_widget(GtkWidget *widget, const gchar *widget_name)
Returns a widget from a name in a component, usually created by Glade.
void ui_tree_view_set_tooltip_text_column(GtkTreeView *tree_view, gint column)
Adds text tooltips to a tree view.
GtkWidget * ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment)
Creates a GNOME HIG-style frame (with no border and indented child alignment).