Branch: refs/heads/master Author: federeghe federico.dev@reghe.net Committer: federeghe federico.dev@reghe.net Date: Thu, 24 Apr 2014 14:41:37 UTC Commit: f88b188c40436133ddfa6549488f4e3326dc812d https://github.com/geany/geany-plugins/commit/f88b188c40436133ddfa6549488f4e...
Log Message: ----------- Update README and add doc-comments
Modified Paths: -------------- codenav/ChangeLog codenav/README codenav/src/codenavigation.h codenav/src/goto_file.c codenav/src/utils.c
Modified: codenav/ChangeLog 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,7 @@ +2014-04-24 Federico Reghenzani <federico(dot)dev(at)reghe(dot)net> + * src/*: + Implementation of plugin preferences and minor fixes + 2014-03-26 Federico Reghenzani <federico(dot)dev(at)reghe(dot)net> * src/goto_file.c: Implementation directory (absolute/relative path) support.
Modified: codenav/README 10 lines changed, 9 insertions(+), 1 deletions(-) =================================================================== @@ -21,11 +21,20 @@ After installed successfully, load the plugin in Geany's plugin manager and new menu items in the Edit menu will appear. You can change the keyboard shortcuts in Geany's preferences dialog.
+ +*Switch header/implementation* +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +This feature allows you to switch between implementation and header code +(e.g. between 'c' and 'h' files) using defined shortcut or by click on +menu item. You can edit the extensions association via preferences in +Geany's plugin manager. + *Go to File* ^^^^^^^^^^^^ You can open a file in current document directory typing its name. You can also enter an absolute or relative path to a file.
+ Requirements ------------
@@ -33,5 +42,4 @@ Requirements
Contact developers ------------------ - Federico Reghenzani <federico(dot)dev(at)reghe(dot)net>
Modified: codenav/src/codenavigation.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -45,7 +45,7 @@ #include "geanyfunctions.h" /* this wraps geany_functions function pointers */
/* Debug flag */ -#define CODE_NAVIGATION_DEBUG +/*#define CODE_NAVIGATION_DEBUG*/
#define CODE_NAVIGATION_VERSION "0.2"
Modified: codenav/src/goto_file.c 59 lines changed, 37 insertions(+), 22 deletions(-) =================================================================== @@ -49,9 +49,11 @@ create_dialog(GtkWidget**, GtkTreeModel*);
/********************** Functions for the feature *********************/
-/* --------------------------------------------------------------------- - * Initialization - * --------------------------------------------------------------------- +/** + * @brief Initialization function called in plugin_init + * @param void + * @return void + * */ void goto_file_init(void) @@ -81,23 +83,26 @@ goto_file_init(void) menu_item); }
-/* --------------------------------------------------------------------- - * Cleanup - * --------------------------------------------------------------------- +/** + * @brief Cleanup function called in plugin_cleanup + * @param void + * @return void + * */ void goto_file_cleanup(void) { log_func(); - gtk_widget_destroy(menu_item); }
-/* --------------------------------------------------------------------- - * Populate the file list - * --------------------------------------------------------------------- +/** + * @brief Populate the file list with file list of directory + * @param const char* dirname the directory where to find files + * @param const char* prefix file prefix (the path) + * @return GtkTreeModel* + * */ - static GtkTreeModel* build_file_list(const gchar* dirname, const gchar* prefix) { @@ -106,7 +111,7 @@ build_file_list(const gchar* dirname, const gchar* prefix) ret_list = gtk_list_store_new (1, G_TYPE_STRING); GSList* file_iterator; - GSList* files_list; + GSList* files_list; /* used to free later the sub-elements*/ gchar *file; gchar *pathfile; guint files_n; @@ -133,9 +138,12 @@ build_file_list(const gchar* dirname, const gchar* prefix)
}
-/* --------------------------------------------------------------------- - * Entry callback function for sub-directory search - * --------------------------------------------------------------------- +/** + * @brief Entry callback function for sub-directory search + * @param GtkEntry* entry entry object + * @param GtkEntryCompletion* completion completion object + * @return void + * */ static void directory_check(GtkEntry* entry, GtkEntryCompletion* completion) @@ -149,7 +157,7 @@ directory_check(GtkEntry* entry, GtkEntryCompletion* completion) text = gtk_entry_get_text(entry); gint dir_sep = strrpos(text, G_DIR_SEPARATOR_S);
- /* No subdir found */ + /* No subdir separator found */ if (dir_sep == -1) { if (old_model != NULL) @@ -190,9 +198,14 @@ directory_check(GtkEntry* entry, GtkEntryCompletion* completion) g_object_unref(completion_list); }
-/* --------------------------------------------------------------------- - * Create the dialog, return the entry - * --------------------------------------------------------------------- + +/** + * @brief Create the dialog, return the entry object to get the + * response from user + * @param GtkWidget **dialog entry object + * @param GtkTreeModel *completion_model completion object + * @return GtkWidget* entry + * */ static GtkWidget* create_dialog(GtkWidget **dialog, GtkTreeModel *completion_model) @@ -240,9 +253,11 @@ create_dialog(GtkWidget **dialog, GtkTreeModel *completion_model) return entry; }
-/* --------------------------------------------------------------------- - * Callback when the menu item is clicked. - * --------------------------------------------------------------------- +/** + * @brief Callback when the menu item is clicked. + * @param guint key_id not used + * @return void + * */ static void menu_item_activate(guint key_id)
Modified: codenav/src/utils.c 29 lines changed, 24 insertions(+), 5 deletions(-) =================================================================== @@ -21,8 +21,12 @@
#include "utils.h"
-/* Function which returns a newly-allocated string containing the - * extension of the file path which is given, or NULL if it did not found any extension. + /** + * @brief Function which returns the extension of the file path which + * is given, or NULL if it did not found any extension. + * @param gchar* the file path + * @return gchar* newly-allocated string containing the extension + * */ gchar* get_extension(gchar* path) @@ -42,7 +46,11 @@ get_extension(gchar* path) return g_strdup(extension); }
-/* Copy a path and remove the extension +/** + * @brief Copy a path and remove the extension + * @param gchar* the file path + * @return gchar* newly-allocated string containing the filename without ext + * */ gchar* copy_and_remove_extension(gchar* path) @@ -72,14 +80,25 @@ copy_and_remove_extension(gchar* path) return str; }
-/* Comparison of strings, for use with g_slist_find_custom */ +/** + * @brief Comparison of strings, for use with g_slist_find_custom + * @param const gchar*, const gchar* + * @return gint + * + */ gint compare_strings(const gchar* a, const gchar* b) { return (gint)(!utils_str_equal(a, b)); }
-/* A PHP-like reverse strpos implementation */ +/** + * @brief A PHP-like reverse strpos implementation + * @param const gchar* haystack + * @param const gchar* needle + * @return gint position or -1 if not found + * + */ gint strrpos(const gchar *haystack, const gchar *needle) {
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org