31#include <gdk/gdkkeysyms.h>
36# define OPEN_CMD "explorer \"%d\""
37#elif defined(__APPLE__)
38# define OPEN_CMD "open \"%d\""
40# define OPEN_CMD "nautilus \"%d\""
49PLUGIN_SET_INFO(
_(
"File Browser"),
_(
"Adds a file browser tab to the sidebar."), VERSION,
50 _(
"The Geany developer team"))
114static gboolean win32_check_hidden(
const gchar *
filename)
117 static wchar_t w_filename[MAX_PATH];
118 MultiByteToWideChar(CP_UTF8, 0,
filename, -1, w_filename,
sizeof(w_filename));
119 attrs = GetFileAttributesW(w_filename);
120 if (attrs != INVALID_FILE_ATTRIBUTES && attrs & FILE_ATTRIBUTE_HIDDEN)
136 if (base_name[0] ==
'.')
140 len = strlen(base_name);
141 return base_name[len - 1] ==
'~';
147 gboolean ret = FALSE;
153 if (g_str_has_suffix(base_name, *
ptr))
174 if (
utils_str_equal(*filter_item,
"*") || g_pattern_match_simple(*filter_item, base_name))
188 ctype = g_content_type_guess(fname,
NULL, 0,
NULL);
192 icon = g_content_type_get_icon(ctype);
195 GtkIconInfo *icon_info;
197 icon_info = gtk_icon_theme_lookup_by_gicon(gtk_icon_theme_get_default(), icon, 16, 0);
200 g_object_unref(icon);
204 gtk_icon_info_free(icon_info);
210 icon = g_themed_icon_new(
"text-x-generic");
220 gchar *fname, *utf8_name, *utf8_fullname;
231 dir = g_file_test(fname, G_FILE_TEST_IS_DIR);
260 icon = dir ? g_themed_icon_new(
"folder") :
get_icon(utf8_name);
267 g_object_unref(icon);
270 g_free(utf8_fullname);
290 icon = g_themed_icon_new(
"folder");
297 g_object_unref(icon);
320 if (! g_file_test(
current_dir, G_FILE_TEST_EXISTS))
326 gtk_entry_set_text(GTK_ENTRY(
path_entry), utf8_dir);
327 gtk_widget_set_tooltip_text(
path_entry, utf8_dir);
339 gchar *fname = node->data;
360 const gchar *dir =
NULL;
366 dir =
geany->prefs->default_open_path;
371 return g_get_current_dir();
389 dir = g_path_get_dirname(fname);
420 if (gtk_tree_selection_count_selected_rows(treesel) == 1)
432 GtkTreeModel *model = GTK_TREE_MODEL(
file_store);
433 gboolean dir_found = FALSE;
435 for (item = selected_items; item !=
NULL; item = g_list_next(item))
438 GtkTreePath *treepath;
440 treepath = (GtkTreePath*) item->data;
441 gtk_tree_model_get_iter(model, &iter, treepath);
454 GtkTreeModel *model = GTK_TREE_MODEL(
file_store);
458 gtk_tree_model_get_iter(model, &iter, treepath);
473 GString *cmd_str = g_string_new(
open_cmd);
477 dir = g_path_get_dirname(fname);
479 dir = g_strdup(fname);
484 cmd = g_string_free(cmd_str, FALSE);
488 gchar *c = strchr(cmd,
' ');
493 _(
"Could not execute configured external command '%s' (%s)."),
494 cmd,
error->message);
505 GtkTreeSelection *treesel;
510 treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
file_view));
512 list = gtk_tree_selection_get_selected_rows(treesel, &model);
519 for (item =
list; item !=
NULL; item = g_list_next(item))
521 GtkTreePath *treepath = item->data;
529 g_list_foreach(
list, (GFunc) gtk_tree_path_free,
NULL);
541 for (item =
list; item !=
NULL; item = g_list_next(item))
543 GtkTreePath *treepath = item->data;
551 if (doc !=
NULL && ! do_not_focus)
554 g_slist_foreach(
files, (GFunc) g_free,
NULL);
570 GtkTreeSelection *treesel;
575 treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
file_view));
577 list = gtk_tree_selection_get_selected_rows(treesel, &model);
584 GtkTreePath *treepath =
list->data;
592 g_list_foreach(
list, (GFunc) gtk_tree_path_free,
NULL);
599 GtkTreeSelection *treesel;
603 gboolean is_dir = FALSE;
605 treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
file_view));
607 if (gtk_tree_selection_count_selected_rows(treesel) > 0 &&
611 list = gtk_tree_selection_get_selected_rows(treesel, &model);
616 GtkTreePath *treepath =
list->data;
623 g_list_foreach(
list, (GFunc) gtk_tree_path_free,
NULL);
653 GtkWidget *item, *menu;
655 menu = gtk_menu_new();
658 gtk_widget_show(item);
664 gtk_widget_show(item);
669 item = gtk_separator_menu_item_new();
670 gtk_widget_show(item);
673 item = gtk_image_menu_item_new_from_stock(GTK_STOCK_REFRESH,
NULL);
674 gtk_widget_show(item);
676 g_signal_connect(item,
"activate", G_CALLBACK(
refresh),
NULL);
679 gtk_widget_show(item);
684 item = gtk_separator_menu_item_new();
685 gtk_widget_show(item);
688 item = gtk_check_menu_item_new_with_mnemonic(
_(
"Show _Hidden Files"));
689 gtk_widget_show(item);
694 item = gtk_separator_menu_item_new();
695 gtk_widget_show(item);
698 item = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES,
NULL);
699 gtk_widget_show(item);
703 item = gtk_separator_menu_item_new();
704 gtk_widget_show(item);
708 gtk_widget_show(item);
718 gboolean have_sel = (gtk_tree_selection_count_selected_rows(selection) > 0);
719 gboolean multi_sel = (gtk_tree_selection_count_selected_rows(selection) > 1);
722 gtk_widget_set_sensitive(
popup_items.open, have_sel);
724 gtk_widget_set_sensitive(
popup_items.open_external, have_sel);
726 gtk_widget_set_sensitive(
popup_items.find_in_files, have_sel && ! multi_sel);
730static gboolean
on_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
732 if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
737 else if (event->button == 3)
739 static GtkWidget *popup_menu =
NULL;
741 if (popup_menu ==
NULL)
744 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
popup_items.show_hidden_files),
746 gtk_menu_popup(GTK_MENU(popup_menu),
NULL,
NULL,
NULL,
NULL, event->button, event->time);
753static gboolean
on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
761 if (event->keyval == GDK_KEY_space)
767 if (( (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) && (event->state & GDK_MOD1_MASK)) ||
768 (event->keyval == GDK_KEY_BackSpace) )
774 if ((event->keyval == GDK_KEY_F10 && event->state & GDK_SHIFT_MASK) || event->keyval == GDK_KEY_Menu)
776 GdkEventButton button_event;
778 button_event.time =
event->time;
779 button_event.button = 3;
811 gchar *new_dir = (gchar*) gtk_entry_get_text(
entry);
815 if (g_str_has_suffix(new_dir,
".."))
820 else if (new_dir[0] ==
'~')
822 GString *str = g_string_new(new_dir);
824 new_dir = g_string_free(str, FALSE);
830 new_dir = g_strdup(g_get_home_dir());
841 if (gtk_combo_box_get_active(combo) >= 0)
842 gtk_widget_activate(gtk_bin_get_child(GTK_BIN(combo)));
850 filter = g_strsplit_set(gtk_entry_get_text(
entry),
"; ", -1);
861 GdkEvent *event, gpointer data)
870 GtkCellRenderer *text_renderer, *icon_renderer;
871 GtkTreeViewColumn *column;
872 GtkTreeSelection *selection;
879 icon_renderer = gtk_cell_renderer_pixbuf_new();
880 text_renderer = gtk_cell_renderer_text_new();
881 column = gtk_tree_view_column_new();
882 gtk_tree_view_column_pack_start(column, icon_renderer, FALSE);
884 gtk_tree_view_column_pack_start(column, text_renderer, TRUE);
886 gtk_tree_view_append_column(GTK_TREE_VIEW(
file_view), column);
887 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(
file_view), FALSE);
889 gtk_tree_view_set_enable_search(GTK_TREE_VIEW(
file_view), TRUE);
898 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
file_view));
899 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
911 GtkWidget *wid, *toolbar;
913 toolbar = gtk_toolbar_new();
914 gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), GTK_ICON_SIZE_MENU);
915 gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
917 wid = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_GO_UP));
918 gtk_widget_set_tooltip_text(wid,
_(
"Up"));
919 g_signal_connect(wid,
"clicked", G_CALLBACK(
on_go_up),
NULL);
922 wid = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_REFRESH));
923 gtk_widget_set_tooltip_text(wid,
_(
"Refresh"));
924 g_signal_connect(wid,
"clicked", G_CALLBACK(
refresh),
NULL);
927 wid = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_HOME));
928 gtk_widget_set_tooltip_text(wid,
_(
"Home"));
932 wid = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_JUMP_TO));
933 gtk_widget_set_tooltip_text(wid,
_(
"Set path from document"));
943 GtkWidget *
label, *filterbar;
945 filterbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
947 label = gtk_label_new(
_(
"Filter:"));
956 _(
"Filter your files with the usual wildcards. Separate multiple patterns with a space."));
960 gtk_box_pack_start(GTK_BOX(filterbar),
label, FALSE, FALSE, 0);
961 gtk_box_pack_start(GTK_BOX(filterbar),
filter_combo, TRUE, TRUE, 0);
968 GtkTreeIter *iter, gpointer user_data)
972 gboolean result = FALSE;
974 gtk_tree_model_get(GTK_TREE_MODEL(
file_store), iter,
977 if (str !=
NULL && is_dir && !g_str_has_suffix(key, G_DIR_SEPARATOR_S))
981 gchar *base_name = g_path_get_basename(key);
982 gchar *str_lowered = g_utf8_strdown(str, -1);
983 result = g_str_has_prefix(str_lowered, base_name);
994 GtkTreeIter *iter, gpointer user_data)
1002 gtk_editable_set_position(GTK_EDITABLE(
path_entry), -1);
1031 GKeyFile *config = g_key_file_new();
1033 config_file = g_strconcat(
geany->app->configdir, G_DIR_SEPARATOR_S,
"plugins", G_DIR_SEPARATOR_S,
1034 "filebrowser", G_DIR_SEPARATOR_S,
"filebrowser.conf",
NULL);
1035 g_key_file_load_from_file(config,
config_file, G_KEY_FILE_NONE,
NULL);
1042 ".o .obj .so .dll .a .lib .pyc");
1043 fb_follow_path = g_key_file_get_boolean(config,
"filebrowser",
"fb_follow_path",
NULL);
1046 g_key_file_free(config);
1051 G_GNUC_UNUSED gpointer data)
1060 if (g_path_is_absolute(project->
base_path))
1064 gchar *dir = g_path_get_dirname(project->
file_name);
1066 new_dir = g_strconcat(dir, G_DIR_SEPARATOR_S, project->
base_path,
NULL);
1085 G_GNUC_UNUSED gpointer data)
1094 new_dir = g_path_get_dirname(doc->
file_name);
1116 gtk_notebook_set_current_page(GTK_NOTEBOOK(
geany->main_widgets->sidebar_notebook),
page_number);
1132 GtkWidget *scrollwin, *toolbar, *filterbar;
1138 gtk_box_pack_start(GTK_BOX(
file_view_vbox), toolbar, FALSE, FALSE, 0);
1141 gtk_box_pack_start(GTK_BOX(
file_view_vbox), filterbar, FALSE, FALSE, 0);
1143 path_combo = gtk_combo_box_text_new_with_entry();
1155 scrollwin = gtk_scrolled_window_new(
NULL,
NULL);
1156 gtk_scrolled_window_set_policy(
1157 GTK_SCROLLED_WINDOW(scrollwin),
1158 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
1160 gtk_box_pack_start(GTK_BOX(
file_view_vbox), scrollwin, TRUE, TRUE, 0);
1166 page_number = gtk_notebook_append_page(GTK_NOTEBOOK(
geany->main_widgets->sidebar_notebook),
1172 0, 0,
"focus_file_list",
_(
"Focus File List"),
NULL);
1174 0, 0,
"focus_path_entry",
_(
"Focus Path Entry"),
NULL);
1185 GKeyFile *config = g_key_file_new();
1187 gchar *config_dir = g_path_get_dirname(
config_file);
1189 g_key_file_load_from_file(config,
config_file, G_KEY_FILE_NONE,
NULL);
1191 g_key_file_set_string(config,
"filebrowser",
"open_command",
open_cmd);
1192 g_key_file_set_boolean(config,
"filebrowser",
"show_hidden_files",
show_hidden_files);
1193 g_key_file_set_boolean(config,
"filebrowser",
"hide_object_files",
hide_object_files);
1195 g_key_file_set_boolean(config,
"filebrowser",
"fb_follow_path",
fb_follow_path);
1196 g_key_file_set_boolean(config,
"filebrowser",
"fb_set_project_base_path",
1199 if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) &&
utils_mkdir(config_dir, TRUE) != 0)
1202 _(
"Plugin configuration directory could not be created."));
1207 data = g_key_file_to_data(config,
NULL,
NULL);
1212 g_key_file_free(config);
1230 if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY)
1250 gboolean enabled = !gtk_toggle_button_get_active(
1253 gtk_widget_set_sensitive(
pref_widgets.hide_objects_checkbox, enabled);
1254 enabled &= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
pref_widgets.hide_objects_checkbox));
1255 gtk_widget_set_sensitive(
pref_widgets.hidden_files_entry, enabled);
1261 GtkWidget *
label, *
entry, *checkbox_of, *checkbox_hf, *checkbox_fp, *checkbox_pb, *vbox;
1262 GtkWidget *box, *align;
1264 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
1265 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
1267 label = gtk_label_new(
_(
"External open command:"));
1268 gtk_misc_set_alignment(GTK_MISC(
label), 0, 0.5);
1269 gtk_box_pack_start(GTK_BOX(box),
label, FALSE, FALSE, 0);
1271 entry = gtk_entry_new();
1274 gtk_widget_set_tooltip_text(
entry,
1275 _(
"The command to execute when using \"Open with\". You can use %f and %d wildcards.\n"
1276 "%f will be replaced with the filename including full path\n"
1277 "%d will be replaced with the path name of the selected file without the filename"));
1278 gtk_box_pack_start(GTK_BOX(box),
entry, FALSE, FALSE, 0);
1281 gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 3);
1283 checkbox_hf = gtk_check_button_new_with_label(
_(
"Show hidden files"));
1284 gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_hf), FALSE);
1285 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_hf),
show_hidden_files);
1286 gtk_box_pack_start(GTK_BOX(vbox), checkbox_hf, FALSE, FALSE, 0);
1290 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
1291 checkbox_of = gtk_check_button_new_with_label(
_(
"Hide file extensions:"));
1292 gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_of), FALSE);
1293 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_of),
hide_object_files);
1294 gtk_box_pack_start(GTK_BOX(box), checkbox_of, FALSE, FALSE, 0);
1298 entry = gtk_entry_new();
1301 gtk_box_pack_start(GTK_BOX(box),
entry, FALSE, FALSE, 0);
1304 align = gtk_alignment_new(1, 0.5, 1, 1);
1305 gtk_alignment_set_padding(GTK_ALIGNMENT(align), 0, 0, 12, 0);
1307 gtk_box_pack_start(GTK_BOX(vbox), align, FALSE, FALSE, 0);
1310 checkbox_fp = gtk_check_button_new_with_label(
_(
"Follow the path of the current file"));
1311 gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_fp), FALSE);
1312 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox_fp),
fb_follow_path);
1313 gtk_box_pack_start(GTK_BOX(vbox), checkbox_fp, FALSE, FALSE, 0);
1316 checkbox_pb = gtk_check_button_new_with_label(
_(
"Use the project's base directory"));
1317 gtk_button_set_focus_on_click(GTK_BUTTON(checkbox_pb), FALSE);
1319 gtk_widget_set_tooltip_text(checkbox_pb,
1320 _(
"Change the directory to the base directory of the currently opened project"));
1321 gtk_box_pack_start(GTK_BOX(vbox), checkbox_pb, FALSE, FALSE, 0);
1322 pref_widgets.set_project_base_path_checkbox = checkbox_pb;
void dialogs_show_msgbox(GtkMessageType type, const gchar *text,...)
Shows a message box of the type type with text.
GeanyDocument * document_get_current(void)
Finds the current document.
void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc)
Opens each file in the list filenames.
void error(const errorSelection selection, const char *const format,...)
GtkWidget * open_cmd_entry
static void on_toggle_hidden(void)
static GIcon * get_icon(const gchar *fname)
static void on_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
@ FILEVIEW_COLUMN_FILENAME
static void on_current_path(void)
static void on_find_in_files(GtkMenuItem *menuitem, gpointer user_data)
static gboolean check_filtered(const gchar *base_name)
static GtkWidget * file_view_vbox
static void save_settings(void)
GtkWidget * open_external
static GtkWidget * file_view
static gboolean is_folder_selected(GList *selected_items)
static void on_filter_clear(GtkEntry *entry, gint icon_pos, GdkEvent *event, gpointer data)
static gchar * get_default_dir(void)
static gchar * hidden_file_extensions
GtkWidget * find_in_files
static void ui_combo_box_changed(GtkComboBox *combo, gpointer user_data)
static gboolean check_single_selection(GtkTreeSelection *treesel)
static void open_folder(GtkTreePath *treepath)
static void on_filter_activate(GtkEntry *entry, gpointer user_data)
static void on_go_home(void)
static void on_configure_response(GtkDialog *dialog, gint response, gpointer user_data)
static GtkWidget * make_filterbar(void)
static void add_item(const gchar *name)
static gboolean show_hidden_files
GtkWidget * set_project_base_path_checkbox
static gpointer last_activate_path
GeanyPlugin * geany_plugin
static void document_activate_cb(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, G_GNUC_UNUSED gpointer data)
static GtkWidget * create_popup_menu(void)
static gchar * current_dir
static gboolean check_hidden(const gchar *filename, const gchar *base_name)
static gchar * config_file
static void on_realized(void)
void plugin_cleanup(void)
Called before unloading the plugin.
PluginCallback plugin_callbacks[]
static GtkWidget * path_combo
static gboolean completion_match_selected(GtkEntryCompletion *widget, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
static void on_hidden_files_clicked(GtkCheckMenuItem *item)
static GtkEntryCompletion * entry_completion
static void on_hide_sidebar(void)
static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
GtkWidget * hidden_files_entry
static void on_go_up(void)
static GtkWidget * path_entry
static gboolean check_object(const gchar *base_name)
static void prepare_file_view(void)
void plugin_init(GeanyData *data)
Called after loading the plugin.
static void load_settings(void)
static void on_open_clicked(GtkMenuItem *menuitem, gpointer user_data)
static void completion_create(void)
static gboolean fb_set_project_base_path
static GtkWidget * filter_entry
static gboolean on_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
GtkWidget * plugin_configure(GtkDialog *dialog)
Called before showing the plugin preferences dialog for multiple plugins.
static GtkTreeIter * last_dir_iter
static void on_external_open(GtkMenuItem *menuitem, gpointer user_data)
static void on_show_preferences(void)
static void kb_activate(guint key_id)
static GtkWidget * filter_combo
GtkWidget * hide_objects_checkbox
static gboolean fb_follow_path
GtkWidget * follow_path_checkbox
static void project_open_cb(GObject *obj, GKeyFile *config, gpointer data)
static struct @32 popup_items
static gchar * get_tree_path_filename(GtkTreePath *treepath)
static void clear_filter(void)
GtkWidget * show_hidden_checkbox
static struct @33 pref_widgets
static void add_top_level_entry(void)
static gboolean completion_match_func(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data)
static gboolean hide_object_files
static GtkListStore * file_store
static void open_selected_files(GList *list, gboolean do_not_focus)
static GtkWidget * make_toolbar(void)
static void on_clear_filter(GtkEntry *entry, gpointer user_data)
static void refresh(void)
static void on_path_entry_activate(GtkEntry *entry, gpointer user_data)
static void document_save_cb(GObject *obj, GeanyDocument *doc, gpointer user_data)
Single include for plugins.
void keybindings_send_command(guint group_id, guint key_id)
Mimics a (built-in only) keybinding action.
GeanyKeyBinding * keybindings_set_item(GeanyKeyGroup *group, gsize key_id, GeanyKeyCallback callback, guint key, GdkModifierType mod, const gchar *kf_name, const gchar *label, GtkWidget *menu_item)
<simplesect kind="geany:skip"></simplesect> Fills a GeanyKeyBinding struct item.
@ GEANY_KEY_GROUP_VIEW
Group.
@ GEANY_KEY_GROUP_FOCUS
Group.
@ GEANY_KEYS_VIEW_SIDEBAR
Keybinding.
@ GEANY_KEYS_FOCUS_EDITOR
Keybinding.
#define GEANY_API_VERSION
The Application Programming Interface (API) version, incremented whenever any plugin data types are m...
#define PLUGIN_SET_INFO(p_name, p_description, p_version, p_author)
Sets the plugin name and some other basic information about a plugin.
#define PLUGIN_VERSION_CHECK(api_required)
Defines a function to check the plugin is safe to load.
#define geany
Simple macro for geany_data that reduces typing.
void plugin_show_configure(GeanyPlugin *plugin)
Shows the plugin's configure dialog.
GeanyKeyGroup * plugin_set_key_group(GeanyPlugin *plugin, const gchar *section_name, gsize count, GeanyKeyGroupCallback callback)
<simplesect kind="geany:skip"></simplesect> Sets up or resizes a keybinding group for the plugin.
void plugin_signal_connect(GeanyPlugin *plugin, GObject *object, const gchar *signal_name, gboolean after, GCallback callback, gpointer user_data)
<simplesect kind="geany:skip"></simplesect> Connects a signal which will be disconnected on unloading...
void search_show_find_in_files_dialog(const gchar *dir)
Shows the Find in Files dialog.
gboolean spawn_async(const gchar *working_directory, const gchar *command_line, gchar **argv, gchar **envp, GPid *child_pid, GError **error)
Executes a child asynchronously.
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
gtk_widget_show_all(dialog)
This contains pointers to global variables owned by Geany for plugins to use.
Structure for representing an open tab with all its properties.
gchar * file_name
The UTF-8 encoded file name.
gchar * real_path
The link-dereferenced, locale-encoded file name.
Basic information for the plugin and identification.
Structure for representing a project.
gchar * file_name
Where the project file is stored (in UTF-8).
gchar * base_path
Base path of the project directory (in UTF-8, maybe relative).
Callback array entry type used with the plugin_callbacks symbol.
gboolean ui_is_keyval_enter_or_return(guint keyval)
Checks whether the passed keyval is the Enter or Return key.
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_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_image_menu_item_new(const gchar *stock_id, const gchar *label)
Creates a GtkImageMenuItem with a stock image and a custom label.
void ui_tree_view_set_tooltip_text_column(GtkTreeView *tree_view, gint column)
Adds text tooltips to a tree view.
void ui_widget_modify_font_from_string(GtkWidget *widget, const gchar *str)
Modifies the font of a widget using gtk_widget_modify_font().
gint utils_write_file(const gchar *filename, const gchar *text)
Writes text into a file named filename.
guint utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace)
Replaces all occurrences of needle in haystack with replace.
gboolean utils_get_setting_boolean(GKeyFile *config, const gchar *section, const gchar *key, const gboolean default_value)
Wraps g_key_file_get_boolean() to add a default value argument.
gchar * utils_get_utf8_from_locale(const gchar *locale_text)
Converts the given string (in locale encoding) into UTF-8 encoding.
GSList * utils_get_file_list(const gchar *path, guint *length, GError **error)
Gets a sorted list of files from the specified directory.
gint utils_mkdir(const gchar *path, gboolean create_parent_dirs)
Creates a directory if it doesn't already exist.
gboolean utils_str_equal(const gchar *a, const gchar *b)
NULL-safe string comparison.
gchar * utils_get_setting_string(GKeyFile *config, const gchar *section, const gchar *key, const gchar *default_value)
Wraps g_key_file_get_string() to add a default value argument.
gchar * utils_get_locale_from_utf8(const gchar *utf8_text)
Converts the given UTF-8 encoded string into locale encoding.
guint utils_string_replace_first(GString *haystack, const gchar *needle, const gchar *replace)
Replaces only the first occurrence of needle in haystack with replace.
#define foreach_slist(node, list)
Iterates all the nodes in list.
#define foreach_strv(str_ptr, strv)
Iterates a null-terminated string vector.
#define SETPTR(ptr, result)
Assigns result to ptr, then frees the old value.
#define EMPTY(ptr)
Returns TRUE if ptr is NULL or *ptr is FALSE.