18
18
* along with this program; if not, write to the Free Software
19
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* $Id: ui_utils.h 817 2006-09-15 14:25:42Z ntrel $
21
* $Id: ui_utils.h 2287 2008-02-27 13:17:29Z eht16 $
24
24
#ifndef GEANY_UI_UTILS_H
25
25
#define GEANY_UI_UTILS_H 1
27
/* allow_override is TRUE if text can be ignored when another message has been set
28
* that didn't use allow_override and has not timed out. */
29
void ui_set_statusbar(const gchar *text, gboolean allow_override);
27
/* User Interface settings not shown in the Prefs dialog. */
28
typedef struct UIPrefs
30
/* State of the main window when Geany was closed */
31
gint geometry[5]; /* 0:x, 1:y, 2:width, 3:height, flag for maximized state */
33
gboolean sidebar_visible;
34
gboolean msgwindow_visible;
36
/* Menu-item related data */
38
gchar *custom_date_format;
39
gchar **custom_commands;
43
extern UIPrefs ui_prefs;
46
/* Less commonly used widgets */
47
typedef struct UIWidgets
50
GtkWidget *toolbar_menu;
51
GtkWidget *new_file_menu;
52
GtkWidget *recent_files_menuitem;
53
GtkWidget *recent_files_menubar;
54
GtkWidget *recent_files_toolbar;
55
GtkWidget *print_page_setup;
56
GtkWidget *menu_insert_include_items[2];
57
GtkWidget *popup_goto_items[3];
58
GtkWidget *popup_copy_items[3];
59
GtkWidget *menu_copy_items[3];
60
GtkWidget *redo_items[3];
61
GtkWidget *undo_items[3];
62
GtkWidget *save_buttons[4];
65
GtkWidget *open_colorsel;
66
GtkWidget *open_fontsel;
67
GtkWidget *open_filesel;
68
GtkWidget *save_filesel;
69
GtkWidget *prefs_dialog;
73
extern UIWidgets ui_widgets;
76
/* The following block of functions are more generic functions and closely related to
77
* certain GTK+ widgets. */
79
void ui_widget_show_hide(GtkWidget *widget, gboolean show);
81
void ui_widget_modify_font_from_string(GtkWidget *wid, const gchar *str);
83
GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment);
85
GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog);
87
GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text);
89
void ui_hbutton_box_copy_layout(GtkButtonBox *master, GtkButtonBox *copy);
91
void ui_combo_box_add_to_history(GtkComboBox *combo, const gchar *text);
93
GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry);
95
void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
96
GtkFileChooserAction action, GtkEntry *entry);
98
void ui_table_add_row(GtkTable *table, gint row, ...) G_GNUC_NULL_TERMINATED;
100
/* End of 'generic' functions */
106
void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
31
108
void ui_update_statusbar(gint idx, gint pos);
54
128
void ui_update_insert_include_item(gint idx, gint item);
56
void ui_update_fold_items();
59
void ui_create_insert_menu_items();
61
void ui_create_insert_date_menu_items();
130
void ui_update_fold_items(void);
133
void ui_create_insert_menu_items(void);
135
void ui_create_insert_date_menu_items(void);
64
138
void ui_save_buttons_toggle(gboolean enable);
66
void ui_close_buttons_toggle();
69
void ui_widget_show_hide(GtkWidget *widget, gboolean show);
71
void ui_build_show_hide(gint);
73
void ui_treeviews_show_hide(gboolean force);
140
void ui_document_buttons_update(void);
143
void ui_sidebar_show_hide(void);
75
145
void ui_document_show_hide(gint idx);
78
148
void ui_update_toolbar_icons(GtkIconSize size);
80
void ui_update_toolbar_items();
150
void ui_update_toolbar_items(void);
83
153
GdkPixbuf *ui_new_pixbuf_from_inline(gint img, gboolean small_img);
85
155
GtkWidget *ui_new_image_from_inline(gint img, gboolean small_img);
88
void ui_create_recent_menu();
158
void ui_create_recent_menu(void);
90
160
void ui_add_recent_file(const gchar *utf8_filename);
93
void ui_show_markers_margin();
95
void ui_show_linenumber_margin();
98
GtkContainer *ui_frame_new(GtkContainer *parent, const gchar *label_text);
163
void ui_show_markers_margin(void);
165
void ui_show_linenumber_margin(void);
168
void ui_update_tab_status(gint idx);
171
typedef gboolean TVMatchCallback(void);
173
gboolean ui_tree_view_find_next(GtkTreeView *treeview, TVMatchCallback cb);
176
void ui_statusbar_showhide(gboolean state);