[geany/geany] 76ede6: Remove `documents_array` global from plugin API
Matthew Brush
git-noreply at xxxxx
Thu Jun 23 22:04:44 UTC 2016
Branch: refs/heads/master
Author: Matthew Brush <mbrush at codebrainz.ca>
Committer: Matthew Brush <mbrush at codebrainz.ca>
Date: Mon, 14 Mar 2016 21:25:17 UTC
Commit: 76ede69ef49c6f4ac3e11068a3cd5ecdb4425d1b
https://github.com/geany/geany/commit/76ede69ef49c6f4ac3e11068a3cd5ecdb4425d1b
Log Message:
-----------
Remove `documents_array` global from plugin API
The global was never accessible to plugins on Windows and hasn't been
accessible to plugins on Linux and others since the linkage-cleanup
changes.
Move documentation from the global variable to the GeanyData member
of the same name.
Closes #964
Modified Paths:
--------------
src/document.c
src/document.h
src/plugindata.h
Modified: src/document.c
18 lines changed, 0 insertions(+), 18 deletions(-)
===================================================================
@@ -86,24 +86,6 @@
GeanyFilePrefs file_prefs;
-
-
-/** Dynamic array of GeanyDocument pointers.
- * Once a pointer is added to this, it is never freed. This means the same document pointer
- * can represent a different document later on, or it may have been closed and become invalid.
- * For this reason, you should use document_find_by_id() instead of storing
- * document pointers over time if there is a chance the user can close the
- * document.
- *
- * @warning You must check @c GeanyDocument::is_valid when iterating over this array.
- * This is done automatically if you use the foreach_document() macro.
- *
- * @note
- * Never assume that the order of document pointers is the same as the order of notebook tabs.
- * One reason is that notebook tabs can be reordered.
- * Use @c document_get_from_page() to lookup a document from a notebook tab number.
- *
- * @see documents. */
GPtrArray *documents_array = NULL;
Modified: src/document.h
3 lines changed, 1 insertions(+), 2 deletions(-)
===================================================================
@@ -118,8 +118,6 @@ typedef struct GeanyDocument
}
GeanyDocument;
-extern GPtrArray *documents_array;
-
/** Wraps @ref documents_array so it can be used with C array syntax.
* @warning Always check the returned document is valid (@c doc->is_valid).
*
@@ -231,6 +229,7 @@ GeanyDocument *document_find_by_id(guint id);
#endif
extern GeanyFilePrefs file_prefs;
+extern GPtrArray *documents_array;
/* These functions will replace the older functions. For now they have a documents_ prefix. */
Modified: src/plugindata.h
18 lines changed, 17 insertions(+), 1 deletions(-)
===================================================================
@@ -171,7 +171,23 @@ typedef struct GeanyData
{
struct GeanyApp *app; /**< Geany application data fields */
struct GeanyMainWidgets *main_widgets; /**< Important widgets in the main window */
- GPtrArray *documents_array; /**< See document.h#documents_array. @elementtype{GeanyDocument} */
+ /** Dynamic array of GeanyDocument pointers.
+ * Once a pointer is added to this, it is never freed. This means the same document pointer
+ * can represent a different document later on, or it may have been closed and become invalid.
+ * For this reason, you should use document_find_by_id() instead of storing
+ * document pointers over time if there is a chance the user can close the
+ * document.
+ *
+ * @warning You must check @c GeanyDocument::is_valid when iterating over this array.
+ * This is done automatically if you use the foreach_document() macro.
+ *
+ * @note
+ * Never assume that the order of document pointers is the same as the order of notebook tabs.
+ * One reason is that notebook tabs can be reordered.
+ * Use @c document_get_from_page() to lookup a document from a notebook tab number.
+ *
+ * @see documents. */
+ GPtrArray *documents_array;
GPtrArray *filetypes_array; /**< Dynamic array of GeanyFiletype pointers. @elementtype{GeanyFiletype} */
struct GeanyPrefs *prefs; /**< General settings */
struct GeanyInterfacePrefs *interface_prefs; /**< Interface settings */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list