Branch: refs/heads/master Author: Pavel Roschin roshin@scriptumplus.ru Committer: Pavel Roschin roshin@scriptumplus.ru Date: Wed, 23 Jul 2014 17:47:00 UTC Commit: 7c9c31022ebebf43560fe915d25f8a52a5aa5499 https://github.com/geany/geany-plugins/commit/7c9c31022ebebf43560fe915d25f8a...
Log Message: ----------- Merge remote-tracking branch 'upstream/master' into autoclose-v0.2.1
Modified Paths: -------------- HACKING geanyextrasel/src/extrasel.c geanyinsertnum/src/insertnum.c geniuspaste/src/geniuspaste.c gproject/src/gproject-project.c gproject/src/gproject-sidebar.c pairtaghighlighter/src/pair_tag_highlighter.c po/fr.po scope/ChangeLog scope/docs/scope.html scope/src/break.c scope/src/menu.c scope/src/scope.c scope/src/scope.h scope/src/store/ChangeLog scope/src/store/fullspeed.html scope/src/store/scptreestore.html scope/src/utils.c scope/src/utils.h
Modified: HACKING 26 lines changed, 25 insertions(+), 1 deletions(-) =================================================================== @@ -192,13 +192,37 @@ build files, which macro is called from configure.ac:: AC_DEFUN([GP_CHECK_YOURFANCYPLUGINNAME], [ GP_ARG_DISABLE([yourfancypluginname], [auto]) - GP_STATUS_PLUGIN_ADD([yourfancypluginname], [$enable_yourfancxpluginname]) + GP_COMMIT_PLUGIN_STATUS([yourfancypluginname]) AC_CONFIG_FILES([ yourplugin/Makefile yourplugin/src/Makefile ]) ])
+You may add checks for dependencies of your plugin between the +``GP_ARG_DISABLE`` and ``GP_COMMIT_PLUGIN_STATUS`` calls. Note that you +must respect the ``$enable_yourfancypluginname`` (lowercase) variable +and try to avoid performing checks if it is set to ``no``, and never +abort unless it is set to ``yes``. If a required dependency is not met +and ``$enable_yourfancypluginname`` is not set to ``yes``, you should +update ``enable_yourfancypluginname`` and set it to ``no`` to disable +building of your plugin. + +To ease checking for modules using *pkg-config*, the +``GP_CHECK_PLUGIN_DEPS`` macro is provided, which wraps +``PKG_CHECK_MODULES`` and follows the above rules about plugin +enabling/disabling. + +While we recommend plugins to work with both GTK 2 and 3, you can use +the ``GP_CHECK_PLUGIN_GTK2_ONLY`` or ``GP_CHECK_PLUGIN_GTK3_ONLY`` +macros if your plugin only works with one version. + +You may also check which GTK version is used for the build using either +the ``$GP_GTK_VERSION`` or ``$GP_GTK_PACKAGE`` variables, or the +``GP_CHECK_GTK3`` macro. For example, if your plugin works with both +GTK 2 and 3 but you want to check for a minimal GTK2 version, you may +use ``$GP_GTK_PACKAGE >= 2.XX`` in a ``GP_CHECK_PLUGIN_DEPS`` call. +
Makefile inside your plugin folder ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Modified: geanyextrasel/src/extrasel.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -32,7 +32,7 @@ GeanyFunctions *geany_functions; PLUGIN_VERSION_CHECK(189)
PLUGIN_SET_INFO(_("Extra Selection"), _("Column mode, select to line / brace / anchor."), - "0.51", "Dimitar Toshkov Zhekov dimitar.zhekov@gmail.com") + "0.52", "Dimitar Toshkov Zhekov dimitar.zhekov@gmail.com")
/* Keybinding(s) */ enum @@ -47,8 +47,6 @@ enum COUNT_KB };
-PLUGIN_KEY_GROUP(extra_select, COUNT_KB) - static GtkWidget *main_menu_item = NULL; static GtkCheckMenuItem *column_mode_item; static GtkWidget *anchor_rect_select_item; @@ -496,8 +494,10 @@ void plugin_init(G_GNUC_UNUSED GeanyData *data) { GtkContainer *menu; GtkWidget *item; + GeanyKeyGroup *plugin_key_group;
main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + plugin_key_group = plugin_set_key_group(geany_plugin, "extra_select", COUNT_KB, NULL);
item = gtk_menu_item_new_with_mnemonic(_("E_xtra Selection")); main_menu_item = item;
Modified: geanyinsertnum/src/insertnum.c 7 lines changed, 4 insertions(+), 3 deletions(-) =================================================================== @@ -42,7 +42,7 @@ GeanyFunctions *geany_functions; PLUGIN_VERSION_CHECK(189)
PLUGIN_SET_INFO(_("Insert Numbers"), _("Insert/Fill columns with numbers."), - "0.2.1", "Dimitar Toshkov Zhekov dimitar.zhekov@gmail.com") + "0.2.2", "Dimitar Toshkov Zhekov dimitar.zhekov@gmail.com")
/* Keybinding(s) */ enum @@ -51,8 +51,6 @@ enum COUNT_KB };
-PLUGIN_KEY_GROUP(insert_numbers, COUNT_KB) - /* when altering the RANGE_ or MAX_LINES, make sure that RANGE_ * MAX_LINES fit in gint64, and that RANGE_LEN is enough for RANGE_ digits and sign */ #define RANGE_MIN (-2147483647 - 1) @@ -468,7 +466,10 @@ static void on_tools_show(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpo
void plugin_init(G_GNUC_UNUSED GeanyData *data) { + GeanyKeyGroup *plugin_key_group; + main_locale_init(LOCALEDIR, GETTEXT_PACKAGE); + plugin_key_group = plugin_set_key_group(geany_plugin, "insert_numbers", COUNT_KB, NULL);
start_value = 1; step_value = 1;
Modified: geniuspaste/src/geniuspaste.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -201,7 +201,7 @@ static void paste(GeanyDocument * doc, const gchar * website) };
gint occ_position; - gint i; + guint i; guint status; gsize f_length;
@@ -440,7 +440,7 @@ static void on_configure_response(GtkDialog * dialog, gint response, gpointer *
GtkWidget *plugin_configure(GtkDialog * dialog) { - gint i; + guint i; GtkWidget *label, *vbox, *author_label;
vbox = gtk_vbox_new(FALSE, 6);
Modified: gproject/src/gproject-project.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -381,9 +381,9 @@ void gprj_project_read_properties_tab(void) source_patterns, header_patterns, ignored_dirs_patterns, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(e->generate_tags)));
- g_free(source_patterns); - g_free(header_patterns); - g_free(ignored_dirs_patterns); + g_strfreev(source_patterns); + g_strfreev(header_patterns); + g_strfreev(ignored_dirs_patterns); }
@@ -473,9 +473,9 @@ void gprj_project_close(void)
deferred_op_queue_clean();
- g_free(g_prj->source_patterns); - g_free(g_prj->header_patterns); - g_free(g_prj->ignored_dirs_patterns); + g_strfreev(g_prj->source_patterns); + g_strfreev(g_prj->header_patterns); + g_strfreev(g_prj->ignored_dirs_patterns);
g_hash_table_destroy(g_prj->file_tag_table);
Modified: gproject/src/gproject-sidebar.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -185,12 +185,14 @@ static gchar *build_path(GtkTreeIter *iter) path = g_strdup(name); else setptr(path, g_build_filename(name, path, NULL)); + g_free(name);
node = parent; }
gtk_tree_model_get(model, &node, FILEVIEW_COLUMN_NAME, &name, -1); setptr(path, g_build_filename(name, path, NULL)); + g_free(name);
setptr(path, g_build_filename(geany_data->app->project->base_path, path, NULL));
Modified: pairtaghighlighter/src/pair_tag_highlighter.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -171,7 +171,7 @@ static gboolean is_tag_empty(gchar *tagName) "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr", "!DOCTYPE"};
- int i; + unsigned int i; for(i=0; i<(sizeof(emptyTags)/sizeof(emptyTags[0])); i++) { if(strcmp(tagName, emptyTags[i]) == 0)
Modified: po/fr.po 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -6420,7 +6420,7 @@ msgstr "Voulez-vous vraiment supprimer « %s » ?"
#: ../treebrowser/src/treebrowser.c:1207 ../treebrowser/src/treebrowser.c:1738 msgid "Go up" -msgstr "Dossier parant" +msgstr "Dossier parent"
#: ../treebrowser/src/treebrowser.c:1211 ../treebrowser/src/treebrowser.c:1753 msgid "Set path from document"
Modified: scope/ChangeLog 14 lines changed, 14 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,17 @@ +2014-06-12 Dimitar Zhekov dimitar.zhekov@gmail.com + + * docs/scope.html: + Small changes in the "Temporary breakpoint on load" description. + * src/menu.c, src/scope.c, src/scope.h: + Replaced scope find_widget() with Geany ui_lookup_widget(). + * src/scope.c: + Insert the Debug menu after Build if possible, instead of using + a fixed position. + * src/scope.c, src/utils.c, src/utils.h: + Sync Geany "Document -> [ ] Read only" state of the current + document if possible when locking/unlocking it on Run/Terminate. + + 2014-04-27 Dimitar Zhekov dimitar.zhekov@gmail.com
* src/conterm.c:
Modified: scope/docs/scope.html 7 lines changed, 3 insertions(+), 4 deletions(-) =================================================================== @@ -204,11 +204,10 @@ from Scope preferences to take advantage of this.</p>
<p><em>Temporary breakpoint on load at</em> - set a temporary breakpoint when the program is -loaded. If you leave the text field empty, Scope will try to detect the 1st line of code and +loaded. If you leave the text field empty, Scope will try to find the 1st line of code and place a breakpoint on it. Any breakpoint options and location are allowed in the text, for -example <em>main</em> for C/C++ programs. Since setting a breakpoint requires a program, the -temporary breakpoint on load will be disabled if both <em>Executable</em> and <em>Load -script</em> are empty. </p> +example <em>main</em> for C/C++ programs. Since setting a breakpoint requires a program, this +option will be disabled if both <em>Executable</em> and <em>Load script</em> are empty.</p>
<p><em>Delete all breakpoints, watches and inspects</em> - usually when setting up a new program. Scope will ask for confirmation.</p>
Modified: scope/src/break.c 12 lines changed, 5 insertions(+), 7 deletions(-) =================================================================== @@ -1201,6 +1201,9 @@ static GtkTreeView *tree; static GtkTreeViewColumn *break_type_column; static GtkTreeViewColumn *break_display_column;
+#define gdk_rectangle_point_in(rect, x, y) ((guint) (x - rect.x) < (guint) rect.width && \ + (guint) (y - rect.y) < (guint) rect.height) + static gboolean on_break_query_tooltip(G_GNUC_UNUSED GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, G_GNUC_UNUSED gpointer gdata) { @@ -1218,21 +1221,16 @@ static gboolean on_break_query_tooltip(G_GNUC_UNUSED GtkWidget *widget, gint x, else { GdkRectangle rect; - GdkRegion *region;
gtk_tree_view_get_background_area(tree, path, break_type_column, &rect); - region = gdk_region_rectangle(&rect); - tip_column = gdk_region_point_in(region, x, y) ? break_type_column : NULL; - gdk_region_destroy(region); + tip_column = gdk_rectangle_point_in(rect, x, y) ? break_type_column : NULL;
if (!tip_column) { gtk_tree_view_get_background_area(tree, path, break_display_column, &rect); - region = gdk_region_rectangle(&rect); - if (gdk_region_point_in(region, x, y)) + if (gdk_rectangle_point_in(rect, x, y)) tip_column = break_display_column; - gdk_region_destroy(region); } }
Modified: scope/src/menu.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -517,7 +517,7 @@ void menu_init(void) { GtkMenuShell *shell = GTK_MENU_SHELL(geany->main_widgets->editor_menu); GList *children = gtk_container_get_children(GTK_CONTAINER(shell)); - GtkWidget *search2 = find_widget(shell, "search2"); + GtkWidget *search2 = ui_lookup_widget(GTK_WIDGET(shell), "search2");
popup_item = get_widget("popup_item"); menu_connect("popup_menu", &popup_menu_info, NULL);
Modified: scope/src/scope.c 11 lines changed, 9 insertions(+), 2 deletions(-) =================================================================== @@ -533,7 +533,7 @@ void plugin_init(G_GNUC_UNUSED GeanyData *gdata) GeanyKeyGroup *scope_key_group; char *gladefile = g_build_filename(PLUGINDATADIR, "scope.glade", NULL); GError *gerror = NULL; - GtkWidget *menubar1 = find_widget(geany->main_widgets->window, "menubar1"); + GtkWidget *menubar1 = ui_lookup_widget(geany->main_widgets->window, "menubar1"); guint item; const MenuKey *menu_key = debug_menu_keys; ToolItem *tool_item = toolbar_items; @@ -564,7 +564,13 @@ void plugin_init(G_GNUC_UNUSED GeanyData *gdata) #endif debug_item = get_widget("debug_item"); if (menubar1) - gtk_menu_shell_insert(GTK_MENU_SHELL(menubar1), debug_item, DEBUG_MENU_ITEM_POS); + { + GList *children = gtk_container_get_children(GTK_CONTAINER(menubar1)); + GtkWidget *menu_build1 = ui_lookup_widget(menubar1, "menu_build1"); + + gtk_menu_shell_insert(GTK_MENU_SHELL(menubar1), debug_item, + menu_build1 ? g_list_index(children, menu_build1) + 1 : DEBUG_MENU_ITEM_POS); + } else gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), debug_item);
@@ -595,6 +601,7 @@ void plugin_init(G_GNUC_UNUSED GeanyData *gdata) inspect_init(); register_init(); parse_init(); + utils_init(); debug_init(); views_init(); thread_init();
Modified: scope/src/scope.h 1 lines changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -26,7 +26,6 @@ void update_state(DebugState state); GObject *get_object(const char *name); GtkWidget *get_widget(const char *name); #define get_column(name) GTK_TREE_VIEW_COLUMN(get_object(name)) -#define find_widget(parent, name) GTK_WIDGET(g_object_get_data(G_OBJECT(parent), (name))) void configure_toolbar(void); void open_debug_panel(void); void configure_panel(void);
Modified: scope/src/store/ChangeLog 20 lines changed, 19 insertions(+), 1 deletions(-) =================================================================== @@ -1,3 +1,19 @@ +2014-03-29 Dimitar Zhekov dimitar.zhekov@gmail.com + + * scptreestore.html: + Clarification about Glade support. + * scptreestore.html, wscript: + Increased version to 0.86.1. + * wscript: + Added ChangeLog to the distribution package. + + +2014-02-18 Dimitar Zhekov dimitar.zhekov@gmail.com + + * scptreestore.c: + Avoid warning when sorting an empty branch. + + 2013-09-29 Dimitar Zhekov dimitar.zhekov@gmail.com
* scptreestore.c, scptreestore.h, scptreestore.html: @@ -6,7 +22,7 @@ Added command line arguments. Different default # of searches for >= 1000 elements. Level 2: is #define, speed test fix. - * scptreestore.html: + * scptreestore.html, wscript: Increased version to 0.86.
@@ -16,6 +32,7 @@ Added scp_tree_store_register_dynamic(). * scptreestore.html, fullspeed.html: Moved the full speed test results to a separate file. + * scptreestore.html, wscript: Increased version to 0.85. * speed.c: Replaced // with /* */ for glib/gtk+ compliance. @@ -29,6 +46,7 @@ Added scp_tree_store_traverse(). * scptreestore.html: Documentation and speed test results for scp_tree_store_traverse(). + * scptreestore.html, wscript Increased version to 0.84. * speed.c: Added speed test for scp_tree_store_traverse().
Modified: scope/src/store/fullspeed.html 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -171,7 +171,7 @@ <tr><td>sublevel 1 set </td><td>10000</td><td>1.159 </td><td>0.110</td><td></td></tr> <tr><td>sublevel 1 remove </td><td>10000</td><td>0.971 </td><td>0.120</td><td></td></tr> <tr><td>sublevel 1 insert with values </td><td>10000</td><td>1.039 </td><td>0.140</td><td></td></tr> -<tr><td>both levels model foreach </td><td>10000</td><td>n/a </td><td>3.218</td><td>2510</td></tr> +<tr><td>both levels model foreach </td><td>10000</td><td>16.602</td><td>3.218</td><td>2510</td></tr> <tr><td>both levels store traverse </td><td>10000</td><td>n/a </td><td>2.224</td><td>2510</td></tr> <tr><td>both levels quick sort double </td><td>10000</td><td>0.218 </td><td>0.046</td><td></td></tr> <tr><td>both levels quick sort string </td><td>10000</td><td>1.383 </td><td>1.083</td><td></td></tr> @@ -272,6 +272,7 @@ <li>top-level only quick sort is always 2x faster</li> <li>all defensive checks are enabled</li> <li>all string tests are with utf8 collation</li> +<li>GtkTreeStore is converted to model with (GtkTreeModel *), not GTK_TREE_MODEL()</li> <li>GtkListStore speed is practically identical to GtkTreeStore.</li> </ul>
Modified: scope/src/store/scptreestore.html 21 lines changed, 12 insertions(+), 9 deletions(-) =================================================================== @@ -454,10 +454,10 @@ <h3><a name="speed">Speed</a></h3>
<p>An unsorted ScpTreeStore is faster than GtkTreeStore, but the difference is not big (20% -on average, depending on the operation and number of elements), and not significant (< 0.5+ -seconds) for stores with less than 10000 elements. Normally, inserting into and removing from -a list is faster than using an array, but all store operations must emit a signal, containing -the row path (numeric index), which negates this advantage.</p> +on average, depending on the operation and number of elements), and not significant for stores +with less than 10000 elements (except foreach or lots of searches). Normally, inserting into +and removing from a list is faster than using an array, but all store operations must emit a +signal, containing the row path (element indexes), which negates this advantage.</p>
<p>The sorted gtk+ stores are slow, since they are based on lists, and sorting by a string with utf-8 collation makes them even slower.</p> @@ -496,15 +496,18 @@
</table>
-<p>The full speed test is <a href="fullspeed.html">here</a>. In general, a sorted ScpTreeStore -can be used as a normal data structure, which is not the case with GtkTree/ListStore.</p> +<p>The full speed test is <a href="fullspeed.html">here</a>. In general, a large sorted +ScpTreeStore can be used as a normal data structure, unlike a GtkTree/ListStore. And, since +ScpTreeStore is not part of gtk+, you can easily recompile it with -DG_DISABLE_CHECKS, but +don't expect any significant difference.</p>
<hr>
<h3><a name="bugs">Bugs</a></h3>
-<p>Incomplete Glade support. You can include ScpTreeStore-s in .glade files with a text -editor, but editing such files with Glade will discard the stores.</p> +<p>Incomplete Glade support. ScpTreeStore-s can be included in .glade files with a text +editor, but saving such files with Glade will discard the stores. I don't plan to fix this. +</p>
<p>The linguistically correct string comparision is not well tested.</p>
@@ -520,7 +523,7 @@ <p>ScpTreeStore was written for the Scope plugin of Geany light IDE, which relies heavily on stores.</p>
-<p><b>ScpTreeStore 0.85, Copyright (C) 2013 Dimitar Toshkov Zhekov</b></p> +<p><b>ScpTreeStore 0.86.1, Copyright (C) 2014 Dimitar Toshkov Zhekov</b></p>
<p>ScpTreeStore is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
Modified: scope/src/utils.c 23 lines changed, 20 insertions(+), 3 deletions(-) =================================================================== @@ -344,11 +344,22 @@ static void line_mark_unmark(GeanyDocument *doc, gboolean lock) } }
+static GtkCheckMenuItem *set_file_readonly1; + static void doc_lock_unlock(GeanyDocument *doc, gboolean lock) { - scintilla_send_message(doc->editor->sci, SCI_SETREADONLY, lock, 0); - doc->readonly = lock; - document_set_text_changed(doc, doc->changed); /* to redraw tab and update sidebar */ + if (set_file_readonly1 && doc == document_get_current()) + { + /* to ensure correct state of Document -> [ ] Read Only */ + if (gtk_check_menu_item_get_active(set_file_readonly1) != lock) + gtk_check_menu_item_set_active(set_file_readonly1, lock); + } + else + { + scintilla_send_message(doc->editor->sci, SCI_SETREADONLY, lock, 0); + doc->readonly = lock; + document_set_text_changed(doc, doc->changed); /* to redraw tab & update sidebar */ + } }
void utils_lock(GeanyDocument *doc) @@ -708,6 +719,12 @@ void utils_tree_set_cursor(GtkTreeSelection *selection, GtkTreeIter *iter, gdoub gtk_tree_path_free(path); }
+void utils_init(void) +{ + set_file_readonly1 = GTK_CHECK_MENU_ITEM(ui_lookup_widget(geany->main_widgets->window, + "set_file_readonly1")); +} + void utils_finalize(void) { guint i;
Modified: scope/src/utils.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -104,6 +104,7 @@ gchar *utils_text_buffer_get_text(GtkTextBuffer *text, gint maxlen); void utils_enter_to_clicked(GtkWidget *widget, GtkWidget *button); void utils_tree_set_cursor(GtkTreeSelection *selection, GtkTreeIter *iter, gdouble alignment);
+void utils_init(void); void utils_finalize(void);
#define UTILS_H 1
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org