35 Commits

Author SHA1 Message Date
Thomas Martitz
43737733ac plugin api: convert StashGroup to GBoxed internally
Because the stash_group_new() is an exported API, it has to be at least a boxed
type to be usable for gobject introspection. The boxed type uses reference
counting as opposed to memory duplication.

The obligatory stash_group_dup() is not exported (doesn't have to).
2016-01-19 17:08:59 +01:00
Thomas Martitz
11b5c0216f stash_group_add_boolean is an API function, misplaced within GEANY_PRIVATE 2015-04-10 16:16:19 +02:00
Jiří Techet
10a28b4191 Protect private definitions by the GEANY_PRIVATE macro in headers
In addition, this patch defines the GEANY_PRIVATE macro for the tag
manager library where it wasn't defined before, removes 2 tag manager
headers from distribution as they are not needed by plugins and
in the tag manager changes the docstrings to ordinary comments for
private definitions.
2014-10-09 20:51:32 +02: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
6f87aac118 Normalize use of header guards and extern "C" guards
* Always define GEANY_FOO_H to 1 in the header guards
* Always put a G_BEGIN_DECLS/G_END_DECLS guard in every header for
consistency, even private ones where it doesn't matter.
* Always include either <glib.h>, <gtk/gtk.h> or some other header
that will provide G_BEGIN_DECLS before using it. In a lot of headers
that use glib.h and gtk/gtk.h stuff anyway, this resolves an implicit
dependency they had on them being included before that header.
* Always put a comment at the #endif part of the guard so it's
easier to see what it applies to.
* Always use an underscore between the header guard identifier's words
even though the filename doesn't have one.
2014-05-21 12:18:26 -07:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02: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
Matthew Brush
51dc2e9baf Support plugins written in C++
Rename use of C++ `template` keyword in plugin API function argument
and add `G_BEGIN_DECLS` and `G_END_DECLS` to public header files to
make them easier to include in C++ code. TagManager and Scintilla
headers already have these `extern "C"` blocks so they shouldn't
require any modifications.

The Autotools build system already adds in a `dummy.cxx` to hint
Automake into C++ linking to support Scintilla, which is quite
convenient for dynamically loading of C++ plugins at run-time into
the otherwise C-only program. The other build systems seem to also
use the correct linking.
2012-03-30 23:35:10 -07:00
Nick Treleaven
cf88abfe4d Speed up & simplify stash tree display/update
Store a pointer to the stash pref for each row, so display/update is just
O(n) instead of O(n^2) time.

This changes the order prefs are updated in, but this doesn't matter.
2011-10-17 18:03:56 +01:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Nick Treleaven
4d3959ac2f Fix making various prefs tree sync with data values when showing
the prefs dialog (patch by Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5942 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-09-21 15:50:36 +00:00
Colomban Wendling
44e5687e0b Allow editing of formerly hidden preferences in the preferences dialog
Patch by Dimitar Zhekov, thanks! (closes P#3313315)

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5871 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-07-28 17:59:22 +00:00
Colomban Wendling
83527f798c Make StashWidgetID map to gconstpointer rather than gpointer
This allows to use constant strings (e.g. string literals) as the
widget ID without triggering tons of compiler warnings.  In cases
widgets or non-constant strings are used, this just don't change
anything, since anyway we don't really need the widget pointer not
to be constant.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5857 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-17 22:53:01 +00:00
Enrico Tröger
6ac2623208 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5528 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-19 19:39:09 +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
Nick Treleaven
809a37ddd2 Add stash_group_load_from_file() and stash_group_save_to_file().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4778 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-19 17:38:27 +00:00
Nick Treleaven
201b595b51 Rename Stash data types to be independently named from Geany (so
Stash can be reused for other projects).
Rename GeanyPrefGroup to StashGroup.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4776 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-18 17:04:17 +00:00
Nick Treleaven
aa872a4545 Add doc-comments for Stash setting functions.
Add an example file showing usage of Stash.
(Not enabled yet until added to the plugin API).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4769 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-17 17:15:47 +00:00
Enrico Tröger
7ba4a81181 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4518 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-01 22:55:18 +00:00
Nick Treleaven
e270ab749f Use typedef instead of pointer for widget_id function arguments.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4393 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-10-30 14:09:46 +00:00
Nick Treleaven
20c66a6816 Add stash_group_add_widget_property() so we can save any widget's
read/write properties.
Use Stash for ui_prefs.sidebar_page setting.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3996 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-07-20 12:00:06 +00:00
Enrico Tröger
39a6eb455e Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3446 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-04 18:30:42 +00:00
Nick Treleaven
0f575ea2b7 Don't forget active plugins after disabling plugin support.
Use Stash for plugin-related prefs.
Add geany_object "save-settings" signal (for core only).
Add stash_group_add_string_vector().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3425 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-28 13:21:35 +00:00
Nick Treleaven
f0d2f92e65 Add Project Indentation prefs, which override the Editor
Preferences dialog options. For new projects, these default to the
editor indent prefs.
- Plugins:
For compatibility with this change, use editor_get_indent_prefs().
- Code changes:
The Project Properties dialog is now created by Glade, but (for
now) the existing options are added manually.
Add GeanyProjectPrivate project field.
Add stash_group_set_use_defaults().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3423 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-27 12:55:04 +00:00
Nick Treleaven
c56f0c450b Add stash_group_add_combo_box_entry(), stash_group_add_entry().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3419 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-22 17:13:37 +00:00
Nick Treleaven
df5b4d85d9 Remove remaining PrefEntry code, use Stash instead.
Add stash_group_add_spin_button_integer(),
stash_group_add_combo_box().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3417 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-22 16:03:16 +00:00
Nick Treleaven
26fc571dcd Rename stash_group_load() -> stash_group_load_from_key_file().
Rename stash_group_save() -> stash_group_save_to_key_file().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3415 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-22 12:50:19 +00:00
Nick Treleaven
f4fd1ea2ca Use Stash radio button prefs instead of RadioPrefEntry.
Add stash_group_add_radio_buttons().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3375 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-15 13:02:29 +00:00
Nick Treleaven
f40aedeffd Fix indentation.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3360 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-11 16:49:59 +00:00
Nick Treleaven
a6992526e8 Add foreach_ptr_array() macro to utils.h.
Merge toggle button prefs code into keyfile.c Stash code.
Add toggle button support to Stash code.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3356 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-11 12:49:26 +00:00
Nick Treleaven
5c5dfe9df5 Move Stash data types to stash.c, so Stash functions could be used
by plugins without breaking the ABI when appending fields. Also the
user code is neater and has type checking.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3349 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-09 13:16:52 +00:00
Nick Treleaven
df1f0943c3 Update copyright info.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3304 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-02 13:38:55 +00:00
Nick Treleaven
4bbdf80b14 Add foreach_c_array() macro in utils.h.
Add stash.[hc] for reading/writing GKeyFile settings and (later)
synchronizing widgets with C variables. Currently this only
supports boolean and integer settings.
Replace keyfile.c SettingEntry code with new stash code.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3285 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-28 12:52:19 +00:00