74 Commits

Author SHA1 Message Date
Colomban Wendling
87331093a9 Merge pull request #361 from techee/prj_write
Add project_write_config() to force project file rewrite
2014-12-11 00:07:41 +01:00
Jiří Techet
a95fc1a994 Don't expose the source file update function to plugins 2014-11-05 21:50:07 +01:00
Jiří Techet
71cc1ecb20 Cleaner and safer TMWorkspace API
With the previous TMWorkspace API it was possible to make the workspace
inconsistent by e.g. removing source files and forgetting to update
workspace. This could lead to non-obvious and not immediately visible
crashes.

The new set of the public (but also Geany private) API calls always
updates the workspace accordingly and neither of the calls can lead
to an inconsistent state of the workspace.

In addition, perform some minor cleanups and simplifications - unify
parsing from buffer and from file, support "parsing" of 0-sized buffers
and improve documentation.
2014-11-02 11:39:57 +01:00
Jiří Techet
0285ec28a5 Move tm_source_file_update() to tm_workspace.c
The placement of this function in tm_source_file is not right - by moving
it to the workspace we can make the source file unaware of the existence
of the workspace (no inclusion of tm_workspace.h in tm_source_file any
more). Also change tm_source_file_new() so it doesn't offer the source file
update.

After this change
* TMWorkspace knows TMSourceFile and TMTag
* TMSourceFile knows TMTag
* TMTag knows TMSourceFile
2014-10-30 22:08:17 +01:00
Jiří Techet
233ca08e88 Add project_write_config() to force project file rewrite
Since plugins don't have direct access to the project file,
only through the project-save signal, they need some way to emit this
signal when saving their preferences outside the project dialog,
which is what this function does.
2014-10-25 22:30:54 +02:00
Jiří Techet
8c25ff871c Make tm_workspace_update() public 2014-10-18 21:40:10 +02:00
Jiří Techet
26587454b0 Remove TmWorkObject and all the OO related stuff
In addition, rename all functions, parameters, comments etc. mentioning
work_object and remove unnecessary parameters of various functions.
Delete dead code paths.

Also move common functions like tm_get_real_path() from tm_work_object to
tm_source_file.
2014-10-18 21:40:10 +02:00
Nick Treleaven
9d669a72f7 API: Rename document_reload_file -> document_reload_force
New name is clearer against document_reload_prompt.
Add deprecated alias.
2014-09-25 11:45:49 +01:00
Nick Treleaven
18181c2e90 Support pseudo-unique IDs for documents
Add GeanyDocument::id, document_find_by_id() to plugin API.

This also fixes clicking on a Messages item whose document has been
closed and reused. Now the click will be ignored instead of jumping to
an unexpected line in the new document.
2014-08-19 15:40:05 +01:00
Matthew Brush
13ec6ffbea Add new API function plugin_builder_connect_signals() 2013-06-09 15:22:25 -07:00
Dimitar Zhekov
f2d33bc16e Add stash_group_free_settings() function to API
Frees the memory allocated for setting values in a group.
2012-04-06 14:04:01 +01:00
Lex Trotman
fa118fb12a Add build command access to plugin interface
Add ability for plugins to read and edit the fields of the build commands.
2012-02-15 14:18:34 +11:00
Nick Treleaven
eb04c514ba Add API function ui_lookup_stock_label()
Using this can avoid adding i18n strings unnecessarily.
2012-01-08 17:37:58 +00:00
Nick Treleaven
2a45938205 Add utils_find_open_xml_tag_pos() API function (patch by Eugene
Arshinov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5733 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-23 11:44:31 +00:00
Enrico Tröger
9f8c5103a8 Add document_compare_by_tab_order() and document_compare_by_tab_order_reverse() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5727 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-17 13:40:04 +00:00
Enrico Tröger
d478a5cc01 Add missing parts from previous commit, oops
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5715 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-12 17:24:13 +00:00
Enrico Tröger
66c8b7faee Add ui_menu_add_document_items_sorted() and document_sort_by_display_name() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5705 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-10 17:03:41 +00:00
Colomban Wendling
ef9360c78b Add plugin_{idle_add,timeout_add,timeout_add_seconds}() to the plugin API
These functions does the same as the corresponding GLib functions but
makes sure that the added GSource will be removed when the plugin is
unloaded, preventing possible crashes.

These are only convenience functions for the plugin author not to have to
care about the case the plugin gets unloaded, he can still manually
manage hes GSources if he wants to.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5650 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-29 23:20:14 +00:00
Nick Treleaven
22038400cc Add filetypes_get_sorted_by_name() to API.
Fix --ft-names sorting to print in name order, not title order.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5649 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-29 18:06:26 +00:00
Nick Treleaven
4c17428732 Add filetypes_get_display_name() to API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5497 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-12-22 16:59:38 +00:00
Nick Treleaven
b9a42fa6d1 Add dialogs_show_input() to API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5418 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-18 18:27:01 +00:00
Nick Treleaven
ddefb0a0b4 Add API functions (patch by Eugene Arshinov, thanks):
Move editor.c: is_{string,comment,code}_style() functions to
highlighting.c, add to API.
Add editor_find_snippet(), editor_insert_snippet(),
utils_find_open_xml_tag() to API.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5409 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-16 15:07:40 +00:00
Nick Treleaven
e7206f35b8 Add sci_get_lexer() to plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5352 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-02 12:55:17 +00:00
Nick Treleaven
98e6efb3b4 Add msgwin_set_messages_dir() to API (patch by Jiří Techet, thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5237 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-16 15:31:23 +00:00
Enrico Tröger
0f7d1928cc Add editor_goto_pos() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5164 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-08-15 17:44:31 +00:00
Enrico Tröger
befcb63e59 Ensure inserted templates always have proper line ending characters
according to the current document's preference.
This is also fixes problems with templates on Windows which had
always Unix line ending characters but now since they are read
from files, these have Windows line ending characters and had been
converted twice.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5114 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-08-01 17:20:50 +00:00
Nick Treleaven
c41b55d692 Add ui_combo_box_add_to_history() to API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5048 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-06-18 12:20:15 +00:00
Nick Treleaven
fdfbd2efb4 Add symbols_get_context_separator() to plugin API (patch by Colomban
Wendling, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4876 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-05 16:26:25 +00:00
Nick Treleaven
700e6e96bf Add sci_set_line_indentation(), sci_get_line_indentation() to API
(patch by Colomban Wendling, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4869 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-03 14:46:32 +00:00
Enrico Tröger
e28ca32274 Add option 'System Default' for toolbar icon style and size to use the GTK default value.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4817 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-04-11 21:56:08 +00:00
Nick Treleaven
a8bc1cb59a Add Stash widget functions to API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4795 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-31 16:21:28 +00:00
Nick Treleaven
90acc27a7a Add Stash setting functions to API.
Remove unnecessary argument to stash_group_load_from_file().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4790 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-30 16:29:38 +00:00
Enrico Tröger
31a4eddf44 Add utils_copy_environment() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4764 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-15 14:48:43 +00:00
Enrico Tröger
f72f6381df Add and use convenience function ui_is_keyval_enter_or_return() and add it to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4737 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-07 19:33:15 +00:00
Nick Treleaven
9021717031 Use full function name for GeanyFunctions function pointers. This
avoids naming conflicts e.g. with C++'s 'new' keyword.
Remove deprecated header pluginmacros.h - use geanyfunctions.h instead.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4552 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-25 15:53:54 +00:00
Frank Lanitz
383841ce01 Add editor_insert_text_block() to plugin API
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4521 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-12 18:44:38 +00:00
Enrico Tröger
4021505786 Add sci_find_text() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4516 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-12-31 15:47:56 +00:00
Enrico Tröger
09afb37dad Add editor_get_eol_char_name(), editor_get_eol_char_len() and editor_get_eol_char() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4508 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-12-29 18:23:54 +00:00
Enrico Tröger
bb81104fcb Add main_is_realized() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4453 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-11-29 13:36:26 +00:00
Enrico Tröger
d7e8d98649 Add sci_goto_line() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4363 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-25 22:27:13 +00:00
Enrico Tröger
192997370a Add ui_widget_modify_font_from_string() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4361 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-25 12:30:36 +00:00
Nick Treleaven
0b8c46a8a8 Add highlighting_set_styles() to API, use for Split Window plugin so
filetypes.common settings get set too.
Make highlighting_set_styles() take GeanyFiletype pointer instead of
filetype id.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4322 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-15 16:54:15 +00:00
Nick Treleaven
539f8b3068 Add document_get_notebook_page() to API.
Minor edits of dox.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4311 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-14 12:21:18 +00:00
Nick Treleaven
39cdcac742 Make Split Window 'Show current document' button have a drop-down menu
to select the other documents.
Add new API function ui_menu_add_document_items().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4308 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-13 17:14:25 +00:00
Nick Treleaven
d8a5b10864 Commit forgotten file (oops).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4266 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-29 13:56:37 +00:00
Nick Treleaven
8c38bdd745 Add plugin_show_configure() API utility function.
Add File Browser popup menu 'Preferences' item.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4244 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-27 14:07:24 +00:00
Nick Treleaven
c100272031 Add sci_set_marker_at_line(), sci_delete_marker_at_line(),
sci_is_marker_set_at_line() to the plugin API (thanks to Yura
Siamashka).
Add sci_toggle_marker_at_line().
Fix SciFuncs alignment.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4178 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-12 17:39:49 +00:00
Enrico Tröger
316f77f1f8 Add new plugin signal: "document-before-save".
Add get_line_end_position(), set_target_start(), set_target_end(), replace_target() to the plugin API (patch by Eugene Arshinov, thanks).
Add new plugin signal: "document-filetype-set" (closes #2852286).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4162 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-09-06 16:51:11 +00:00
Nick Treleaven
43620e7ce4 Remove GeanyKeyGroup struct from the API - plugins should not set
these fields.
Make keybindings_set_item() duplicate the name and label fields
(needed by GeanyLua) and return a keybinding pointer.
Add keybindings_get_item() to the API (in case it's useful).
Move some keybinding code out of plugin source files.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4123 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-08-25 16:55:56 +00:00
Nick Treleaven
770d40ab98 Update PLUGIN_KEY_GROUP() macro so it doesn't allocate any
GeanyKeyBinding or GeanyKeyGroup structs, so we don't need to break
the ABI when adding fields to them.
Add plugin_set_key_group() for plugins to dynamically set a
keybinding group (e.g. for the Lua script plugin). Used in Split
Window plugin as an example.
Improve keybinding docs a little.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4115 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-08-24 11:35:13 +00:00