271 Commits

Author SHA1 Message Date
Jiří Techet
daecf69c9c Make keybindings_get_modifiers() part of plugin API 2015-01-20 19:33:06 +01:00
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
Colomban Wendling
8c77accfd0 Merge PR#356 from 'b4n/techee/tm'
Huge TagManager improvements
2014-11-08 19:37:20 +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
Colomban Wendling
c35dedf35f Rename internal plugin_init() to avoid confusion with plugins entry point 2014-10-20 16:18:05 +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
Nick Treleaven
e1988964c1 Fix Windows build 2014-08-01 12:05:30 +01:00
Matthew Brush
4efcbab332 Include what you use
This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.

Overview of changes:

* Include config.h at the start of each source file if HAVE_CONFIG_H
  is defined (and never in headers).
* Go through each source file and make the includes section generally
  like this:
  - Always config.h first as above
  - Then if the file has a header with the same name, include that
  - Then include in alphabetical order each other internal/geany header.
  - Then include standard headers
  - Then include non-standard system headers
  - Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
  dependencies and it exposed quite a few weird problems with includes
  or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
  - Add a little header file "app.h" for GeanyApp and move it there
  - Move "app" global to new "app.h" file
  - Move "ignore_callback" global to "callbacks.h"
  - Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
  defined there and some plugins included this header to access
  GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
  everywhere sees the same definitions (not a problem in practice AFAIK
  so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
  apparently consider this bad style, despite that it reduces inter-
  header dependencies.

TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test
2014-05-21 15:37:19 -07:00
Matthew Brush
23d9cad7dc Start to make it easier to compile the core in isolation
This is for work on making the files scannable by GObject-Introspection
but is still useful otherwise (even fixes a FIXME in the comments). I
made this by using a simple GNU Make file and trying to compile the
sources each on their own without all the build system infrastructure.

* Add keybindingsprivate.h file to hold private GeanyKeyGroup structure
and remove it from the GEANY_PRIVATE guard in keybindings.h.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyFiletypes to GeanyFiletypesPrivate and remove guarded build.h
include.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyProject to GeanyProjectPrivate.
2014-05-21 12:17:59 -07:00
Colomban Wendling
a13b033d42 Hide column headers in plugin manager dialog
They are not very useful and waste both vertical (the headers
themselves) and horizontal (first column wider because of title)
screen space.
2014-05-01 03:18:04 +02:00
Colomban Wendling
605ec0b02e Cleanup Plugin Manager dialog
Merge "Name" and "Description" columns, and move plugin details to
tooltips.
2014-04-25 18:46:14 +02:00
Colomban Wendling
27a073f1a6 Make plugin_signal_connect() safe on any object
Watch the lifetime of objects referenced in plugin->signal_ids and
remove our references to them if they get destroyed.  This avoids
possibly trying to disconnect signals on destroyed objects when the
plugin is unloaded.

Supporting this case is safer, and is useful for objects that may or
may not outlive the plugin (like ScintillaObjects), because in such
cases plugin_signal_connect() is handy to make sure the signals are
disconnected if the object is still alive, but used to crash if the
object was destroyed.
2014-04-13 19:59:37 +02:00
Matthew Brush
d44dfdb9ac Save configuration when plugin manager dialog is closed
Closes #62
2013-08-15 18:53:21 -07:00
Nick Treleaven
0998f1c19c Make code more readable by renaming poorly named macros NZV and NVL
Closes #159
2013-08-14 21:54:20 -07:00
Matthew Brush
13ec6ffbea Add new API function plugin_builder_connect_signals() 2013-06-09 15:22:25 -07:00
Matthew Brush
44fcdf1b7c Minor tweak to plugin manager button spacing 2013-05-25 17:02:49 -07:00
Pavel Roschin
169a2f4957 Keybindings for plugins 2013-05-25 16:49:06 -07:00
Colomban Wendling
c1a7b1b475 Fix various packing issue affecting GTK3 but compatible with GTK2 2012-09-28 18:06:58 +02:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02:00
Matthew Brush
9a63e05f63 Change plugin manager's OK button response to GTK_RESPONSE_OK
Used to be GTK_RESPONSE_CANCEL for some reason.
2012-08-09 22:36:03 -07:00
Matthew Brush
bc5b68822d Remove indirection from callback handler 2012-08-09 22:35:16 -07:00
Matthew Brush
e62bec43fc Use g_build_filename() instead of g_strconcat() for paths 2012-08-09 18:21:43 -07:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02: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
fb1c6c63e6 Print system plugin path debug message on startup 2011-12-08 17:02:25 +00:00
Nick Treleaven
70b3cae060 Verify active plugin paths on startup
Geany saves the path for each active plugin on shutdown, but the 3
valid plugin paths can each change.
2011-11-16 17:27:32 +00:00
Enrico Tröger
639e88add0 Display the plugin's description in the list of plugins instead of the plugin's filename
In the dialog, the plugin's description is more interesting and useful than the full filename.
Instead, show the filename in the bottom box for those interested in.
2011-11-13 13:32:05 +01:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Colomban Wendling
ddb4ad5fa5 Fix some whitespace style errors
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5886 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-06 18:34:14 +00:00
Colomban Wendling
9fa8cd8bf9 Fix a few GCC warnings
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5856 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-17 22:52:43 +00:00
Enrico Tröger
4b206e86be Check whether the custom plugin path is one of the user or system plugin paths and if so, ignore it.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5825 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-29 20:08:53 +00:00
Enrico Tröger
8693bde80d Do not add active plugins to the list of plugins when they are already in the list (closes #3308191).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5824 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-29 19:45:16 +00:00
Enrico Tröger
b96aa6628f Fix typo
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5823 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-29 19:38:47 +00:00
Enrico Tröger
247689ec64 Define and use get_plugin_path() always and move platform dependent code into the function definition.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5822 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-29 19:35:38 +00:00
Colomban Wendling
edc8457e8a Cleanup GeanyWrapLabel a bit
* Do all mandatory initializations in _init() rather than _new();
 * Drop geany_wrap_label_set_text() in favor of plain
   gtk_label_set_text(), making the widget a little simpler and more
   transparent to the caller.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5795 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-10 23:51:01 +00:00
Colomban Wendling
c42c384079 Improve the plugin manager dialog a little
* Add a paned to allow the plugin description part to be resized;
 * Split plugin name, description and authors into distinct entities
   and show aligned and bold titles for them.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5794 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-10 23:50:21 +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
211a963773 Rename document_sort_by_display_name() into document_compare_by_display_name(), thanks again Nick.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5714 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-12 17:20:59 +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