Thu, 08 Aug 2024 21:34:07 -0500
Move the documentation into more appropriate places
This moves the libpurple documentation into the libpurple directory, the Pidgin
documentation into the pidgin directory, and removes the old protocols
documentation remnants.
Testing Done:
Ran the `doc` target and had the turtles check in on things.
Reviewed at https://reviews.imfreedom.org/r/3365/
--- a/doc/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ b/doc/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -1,5 +1,3 @@ -subdir('reference') - if ENABLE_GTK configure_file( input : 'pidgin3.1.in',
--- a/doc/reference/libpurple/contributing.md Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -Title: Contributing -Slug: contributing - -Contributing to libpurple is a bit different than other applications, but we -have documented everything you need to know in the official -[contributors guide](https://docs.imfreedom.org/contributors-guide/).
--- a/doc/reference/libpurple/libpurple.toml.in Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -[library] -version = "@PURPLE_MAJOR_VERSION@.@PURPLE_MINOR_VERSION@.@PURPLE_MICRO_VERSION@" -browse_url = "https://keep.imfreedom.org/pidgin/pidgin/" -repository_url = "https://keep.imfreedom.org/pidgin/pidgin/" -website_url = "https://keep.imfreedom.org/pidgin/pidgin/" -authors = "Pidgin Developers" -logo_url = "" -license = "GPL-2.0-or-later" -description = "Purple Universal Chat Library" -dependencies = [ "GLib-2.0", "GObject-2.0", "GPlugin-1.0" ] -devhelp = true -search_index = true - - [dependencies."GLib-2.0"] - name = "GLib" - description = "General-purpose, portable utility library." - docs_url = "https://docs.gtk.org/glib/" - - [dependencies."GObject-2.0"] - name = "GObject" - description = "The base type system library" - docs_url = "https://docs.gtk.org/gobject/" - - [dependencies."GPlugin-1.0"] - name = "GPlugin" - description = "GPlugin Plugin Library" - docs_urls = "https://docs.imfreedom.org/gplugin/" - -[theme] -name = "basic" -show_index_summary = true -show_class_hierarchy = true - -[source-location] -base_url = "https://keep.imfreedom.org/pidgin/pidgin/file/default/" - -[extra] -# The same order will be used when generating the index -content_files = [ - "contributing.md", - "signals_connection.md", - "signals_core.md", - "tut_c_plugins.md", -] -content_images = [ -] -urlmap_file = "urlmap.js" - -[[object]] -pattern = "DEPRECATED_IN_*" -hidden = true - -[[object]] -name = "DEPRECATED_FOR" -hidden = true - -[[object]] -name = "UNAVAILABLE" -hidden = true - -[[object]] -name = "UNAVAILABLE_MACRO" -hidden = true - -[[object]] -name = "UNAVAILABLE_STATIC_INLINE" -hidden = true - -[[object]] -name = "UNAVAILABLE_TYPE" -hidden = true \ No newline at end of file
--- a/doc/reference/libpurple/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -libpurple_doc_content_files = [ - 'contributing.md', - 'signals_connection.md', - 'signals_core.md', - 'tut_c_plugins.md', -] - -if get_option('doc') - libpurple_toml = configure_file( - input : 'libpurple.toml.in', - output : 'libpurple.toml', - configuration : version_conf, - install : true, - install_dir : docs_dir / 'libpurple', - ) - - libpurple_doc = custom_target('libpurple-doc', - input : [ libpurple_toml, libpurple_gir[0] ], - output : 'libpurple', - command : [ - gidocgen, - 'generate', - '--quiet', - '--fatal-warnings', - '--config=@INPUT0@', - '--output-dir=@OUTPUT@', - '--no-namespace-dir', - '--content-dir=@0@'.format(meson.current_source_dir()), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), - '@INPUT1@' - ], - depend_files : [ libpurple_doc_content_files ], - build_by_default : true, - install : true, - install_dir : docs_dir, - ) - - test('doc-check', - gidocgen, - args: [ - 'check', - '--config', libpurple_toml, - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), - libpurple_gir[0], - ], - depends: libpurple_gir[0], - verbose: true, - ) -endif -
--- a/doc/reference/libpurple/signals_connection.md Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -Title: Connection Signals -Slug: connection-signals - -## Connection Signals - -### Signal List - -* [online](#online) -* [offline](#offline) -* [signing-on](#signing-on) -* [signed-on](#signed-on) -* [autojoin](#autojoin) -* [signing-off](#signing-off) -* [signed-off](#signed-off) -* [connection-error](#connection-error) - -### Signal Details - -#### online - -```c -void user_function(gpointer user_data); -``` - -Emitted when the first connection has connected when all connections were -previously not connected. - -**Parameters:** - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### offline - -```c -void user_function(gpointer user_data); -``` - -Emitted when the last connected connection has disconnected. - - -**Parameters:** - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### signing-on - -```c -void user_function(PurpleConnection *gc, gpointer user_data); -``` - -Emitted when a connection is about to sign on. - -**Parameters:** - -**gc** -: The connection that is about to sign on. - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### signed-on - -```c -void user_function(PurpleConnection *gc, gpointer user_data); -``` - -Emitted when a connection has signed on. - -**Parameters:** - -**gc** -: The connection that has signed on. - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### autojoin - -```c -gboolean user_function(PurpleConnection *gc, gpointer user_data); -``` - -Emitted when a connection has signed on, after the signed-on signal, to signal -UIs to autojoin chats if they wish. UIs should connect to this with -`PURPLE_SIGNAL_PRIORITY_HIGHEST` to allow plugins to block this signal before -the UI sees it and then re-emit it later. - -**Parameters:** - -**gc** -: The connection that has signed on. - -**user_data** -: user data set when the signal handler was connected. - -**Returns:** - -`TRUE` if the signal was handled or `FALSE` otherwise. In practice, the return -value is irrelevant, as it really only exists so plugins can block the UI's -autojoin. - ----- - -#### signing-off - -```c -void user_function(PurpleConnection *gc, gpointer user_data); -``` - -Emitted when a connection is about to sign off. - -**Parameters:** - -**gc** -: The connection that is about to sign off. - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### signed-off - -```c -void user_function(PurpleConnection *gc, gpointer user_data); -``` - -Emitted when a connection has signed off. - -**Parameters:** - -**gc** -: The connection that has signed off. - -**user_data** -: user data set when the signal handler was connected. - ----- - -#### connection-error - -```c -void user_function(PurpleConnection *gc, - PurpleConnectionError err, - const gchar *desc, - gpointer user_data); -``` - -Emitted when a connection error occurs, before `"signed"`-off. - -**Parameters:** - -**gc** -: The connection on which the error has occurred. - -**err** -: The error that occurred. - -**desc** -: A description of the error, giving more information. - -**user_data** -: user data set when the signal handler was connected.
--- a/doc/reference/libpurple/signals_core.md Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -Title: Core Signals -Slug: core-signals - -## Core Signals - -### Signal List - -* [core-uri-handler](#uri-handler) - -### Signal Details - -#### uri-handler - -```c -gboolean user_function(const gchar *proto, - const gchar *cmd, - GHashTable *params, - gpointer user_data); -``` - -Emitted when handling a registered URI. - -**Parameters:** - -**proto** -: The protocol of the URI. - -**cmd** -: The 'command' of the URI. - -**params** -: Any key/value parameters from the URI. - -**user_data** -: User data set when the signal handler was connected.
--- a/doc/reference/libpurple/tut_c_plugins.md Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -Title: C Plugin Tutorial -Slug: c-plugin-tutorial - -## C Plugin Tutorial - -### Introduction - -C plugins are native plugins. They have complete access to all of the API, -and can do basically whatever they want. All of the protocol plugins are -also written in C. - -### Getting Started - -To develop a plugin you need to have the libpurple and (for UI plugins) the -Pidgin/Finch source code or development headers. It is generally a good idea -to compile against the same version of Pidgin that you are running. You may -also want to develop against the code in our Mercurial repository if you need -to use a new feature. Please do not abuse our Mercurial repository, however. - -### An Example - -I know every tutorial has a hello world, so why should libpurple be any -different? - -```c -#include <purple.h> - -static GPluginPluginInfo * -hello_world_query(GError **error) { - const gchar * const authors[] = { - "Author Name <aname@example.com>", - NULL - }; - - return purple_plugin_info_new ( - "id", "hello_world", - "name", "Hello World!", - "version", "1.0", - "category", "Example", - "summary", "Hello World Plugin", - "description", "Displays a \"Hello World!\" message when loaded", - "authors", authors, - "website", "http://helloworld.tld", - "abi-version", PURPLE_ABI_VERSION, - NULL - ); -} - -static gboolean -hello_world_load(GPluginPlugin *plugin, GError **error) { - purple_notify_message(plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!", - "This is the Hello World! plugin :)", - NULL, NULL, NULL, NULL); - - return TRUE; -} - -static gboolean -hello_world_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error) { - return TRUE; -} - -GPLUGIN_NATIVE_PLUGIN_DECLARE(hello_world) -``` - -Okay, so what does all this mean? We start off by including purple.h. This -file includes all the libpurple header files. - -`hello_world_query`, `hello_world_load` and `hello_world_unload` are functions -that must be implemented in every plugin. These functions are named according -to the value passed to `GPLUGIN_NATIVE_PLUGIN_DECLARE` which is described -below. - -`hello_world_query` is called when the plugin is queried by the plugin system, -and returns various information about the plugin in form of a newly created -instance of `GPluginPluginInfo` or a subclass. For a list of all available -properties, see `purple_plugin_info_new()`. - -If anything should go wrong during the query you can return an error by using -`g_set_error()` on the `error` argument. - -`hello_world_load` is called when the plugin is loaded. That is the user has -enabled the plugin or libpurple is loading a plugin that was previously loaded. -You can initialize any variables, register dynamic types, and so on in this -function. Plugins may also want to add their preferences to the pref -tree--more about that later. In this plugin we'll just use it to display a -message. Just like `hello_world_query` if there are any errors that arise, you -can call `g_set_error()` on the `error` argument and return `FALSE`. - -`hello_world_unload` is called when the plugin is unloaded. That is, when the -user has manually unloaded the plugin or the program is shutting down. We can -use it to wrap up everything, and free our variables. If the program is shutting -down, the `shutdown` argument will be `TRUE`. Again, if there are any errors, you -can call `g_set_error()` on the `error` argument and return `FALSE`. - -Finally we have `GPLUGIN_NATIVE_PLUGIN_DECLARE()`. It is a helper macro that -makes creating plugins easier. It has a single argument which is the prefix -used for the `_query`, `_load`, and `_unload` functions. - -### Building - -You may want to compile your plugin by using your libpurple from the packages -on your system. You can easily do this with meson build system. Let's say -you've already wrote the hello world plugin and saved it as `hello_world.c`. -Create a file named `meson.build`: - -```python -project('hello_world_plugin', 'c') - -libpurple_dep = dependency('purple-3') - -PURPLE_PLUGINDIR = libpurple_dep.get_pkgconfig_variable('plugindir') - -library('libhelloworld', 'hello_world.c', - c_args : [ - '-DG_LOG_USE_STRUCTURED', - '-DG_LOG_DOMAIN="PurplePlugin-HelloWorld"' - ], - dependencies : [libpurple_dep], - name_prefix : '', - install : true, - install_dir : PURPLE_PLUGINDIR) -``` - -This `meson.build` file will build your plugin and install it into the right -location for libpurple to find it. - -If you're using this example to compile your own plugin. You -should change the project name at the beginning of the file and change the -library name which in this case is `libhelloworld`. You will also need to -change the `G_LOG_DOMAIN` macro to your own log domain. - -Now, you can quickly build your plugin with the following commands: - -``` -meson setup build -meson compile -C build -meson install -C build -```
--- a/doc/reference/libpurple/urlmap.js Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -// SPDX-FileCopyrightText: 2021 GNOME Foundation -// SPDX-License-Identifier: LGPL-2.1-or-later - -// A map between namespaces and base URLs for their online documentation -baseURLs = [ - [ 'GLib', 'https://docs.gtk.org/glib/' ], - [ 'GObject', 'https://docs.gtk.org/gobject/' ], - [ 'GPlugin', 'https://docs.imfreedom.org/gplugin/' ], -]
--- a/doc/reference/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -if get_option('doc') - -subdir('libpurple') -subdir('protocols') - -if ENABLE_GTK - subdir('pidgin') -else - pidgin_doc = [] -endif - -alias_target('doc', libpurple_doc, protocols_doc, pidgin_doc) - -endif -
--- a/doc/reference/pidgin/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -pidgin_doc_content_files = [ -] - -if get_option('doc') - pidgin_toml = configure_file( - input : 'pidgin.toml.in', - output : 'pidgin.toml', - configuration : version_conf, - install : true, - install_dir : docs_dir / 'pidgin', - ) - - pidgin_doc = custom_target('pidgin-doc', - input : [ pidgin_toml, pidgin_gir[0] ], - output : 'pidgin', - command : [ - gidocgen, - 'generate', - '--quiet', - '--fatal-warnings', - '--config=@INPUT0@', - '--output-dir=@OUTPUT@', - '--no-namespace-dir', - '--content-dir=@0@'.format(meson.current_source_dir()), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin-gtk4'), - '--add-include-path=@0@'.format(meson.project_build_root() / 'libpurple'), - '@INPUT1@' - ], - depends: [ libpurple_gir[0] ], - depend_files : [ pidgin_doc_content_files ], - build_by_default : true, - install : true, - install_dir : docs_dir, - ) - - test('doc-check', - gidocgen, - args: [ - 'check', - '--config', pidgin_toml, - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), - '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin-gtk4'), - '--add-include-path=@0@'.format(meson.project_build_root() / 'libpurple'), - pidgin_gir[0], - ], - depends: [libpurple_gir[0], pidgin_gir[0]], - ) -endif -
--- a/doc/reference/pidgin/pidgin.toml.in Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -[library] -version = "@PURPLE_MAJOR_VERSION@.@PURPLE_MINOR_VERSION@.@PURPLE_MICRO_VERSION@" -browse_url = "https://keep.imfreedom.org/pidgin/pidgin/" -repository_url = "https://keep.imfreedom.org/pidgin/pidgin/" -website_url = "https://keep.imfreedom.org/pidgin/pidgin/" -authors = "Pidgin Developers" -logo_url = "" -license = "GPL-2.0-or-later" -description = "Pidgin Universal Chat Client" -dependencies = [ "GLib-2.0", "GObject-2.0", "Gtk-4.0", "Purple-3.0", "GPlugin-1.0", "GPlugin-Gtk4-1.0" ] -devhelp = true -search_index = true - - [dependencies."GLib-2.0"] - name = "GLib" - description = "General-purpose, portable utility library." - docs_url = "https://docs.gtk.org/glib/" - - [dependencies."GObject-2.0"] - name = "GObject" - description = "The base type system library" - docs_url = "https://docs.gtk.org/gobject/" - - [dependencies."Gtk-4.0"] - name = "Gtk" - description = "The GTK toolkit" - docs_url = "https://docs.gtk.org/gtk4/" - - [dependencies."Purple-3.0"] - name = "Purple" - description = "Purple Universal Chat Library" - docs_url = "https://docs.imfreedom.org/purple3/" - - [dependencies."GPlugin-1.0"] - name = "GPlugin" - description = "GPlugin Plugin Library" - docs_urls = "https://docs.imfreedom.org/gplugin/" - - [dependencies."GPlugin-Gtk4-1.0"] - name = "GPlugin-Gtk" - description = "GPlugin Gtk4 Widget Library" - docs_urls = "https://docs.imfreedom.org/gplugin-gtk4/" - -[theme] -name = "basic" -show_index_summary = true -show_class_hierarchy = true - -[source-location] -base_url = "https://keep.imfreedom.org/pidgin/pidgin/file/default/" - -[extra] -# The same order will be used when generating the index -content_files = [ -] -content_images = [ -] -urlmap_file = "urlmap.js" - -[[object]] -pattern = "DEPRECATED_IN_*" -hidden = true - -[[object]] -name = "DEPRECATED_FOR" -hidden = true - -[[object]] -name = "UNAVAILABLE" -hidden = true - -[[object]] -name = "UNAVAILABLE_MACRO" -hidden = true - -[[object]] -name = "UNAVAILABLE_STATIC_INLINE" -hidden = true - -[[object]] -name = "UNAVAILABLE_TYPE" -hidden = true \ No newline at end of file
--- a/doc/reference/pidgin/urlmap.js Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: 2021 GNOME Foundation -// SPDX-License-Identifier: LGPL-2.1-or-later - -// A map between namespaces and base URLs for their online documentation -baseURLs = [ - [ 'GLib', 'https://docs.gtk.org/glib/' ], - [ 'GObject', 'https://docs.gtk.org/gobject/' ], - [ 'GPlugin', 'https://docs.imfreedom.org/gplugin/' ], - [ 'GPlugin-Gtk4', 'https://docs.imfreedom.org/gplugin-gtk4/' ], - [ 'Gtk', 'https://docs.gtk.org/gtk4/' ], - [ 'Purple3', 'https://docs.imfreedom.org/purple3/' ], -]
--- a/doc/reference/protocols/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -protocols_doc = [] -
--- a/libpurple/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ b/libpurple/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -344,6 +344,7 @@ subdir('tests') subdir('plugins') +subdir('reference') test( 'purple_license_headers',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/contributing.md Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,6 @@ +Title: Contributing +Slug: contributing + +Contributing to libpurple is a bit different than other applications, but we +have documented everything you need to know in the official +[contributors guide](https://docs.imfreedom.org/contributors-guide/).
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/libpurple.toml.in Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,71 @@ +[library] +version = "@PURPLE_MAJOR_VERSION@.@PURPLE_MINOR_VERSION@.@PURPLE_MICRO_VERSION@" +browse_url = "https://keep.imfreedom.org/pidgin/pidgin/" +repository_url = "https://keep.imfreedom.org/pidgin/pidgin/" +website_url = "https://keep.imfreedom.org/pidgin/pidgin/" +authors = "Pidgin Developers" +logo_url = "" +license = "GPL-2.0-or-later" +description = "Purple Universal Chat Library" +dependencies = [ "GLib-2.0", "GObject-2.0", "GPlugin-1.0" ] +devhelp = true +search_index = true + + [dependencies."GLib-2.0"] + name = "GLib" + description = "General-purpose, portable utility library." + docs_url = "https://docs.gtk.org/glib/" + + [dependencies."GObject-2.0"] + name = "GObject" + description = "The base type system library" + docs_url = "https://docs.gtk.org/gobject/" + + [dependencies."GPlugin-1.0"] + name = "GPlugin" + description = "GPlugin Plugin Library" + docs_urls = "https://docs.imfreedom.org/gplugin/" + +[theme] +name = "basic" +show_index_summary = true +show_class_hierarchy = true + +[source-location] +base_url = "https://keep.imfreedom.org/pidgin/pidgin/file/default/" + +[extra] +# The same order will be used when generating the index +content_files = [ + "contributing.md", + "signals_connection.md", + "signals_core.md", + "tut_c_plugins.md", +] +content_images = [ +] +urlmap_file = "urlmap.js" + +[[object]] +pattern = "DEPRECATED_IN_*" +hidden = true + +[[object]] +name = "DEPRECATED_FOR" +hidden = true + +[[object]] +name = "UNAVAILABLE" +hidden = true + +[[object]] +name = "UNAVAILABLE_MACRO" +hidden = true + +[[object]] +name = "UNAVAILABLE_STATIC_INLINE" +hidden = true + +[[object]] +name = "UNAVAILABLE_TYPE" +hidden = true \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,54 @@ +libpurple_doc_content_files = [ + 'contributing.md', + 'signals_connection.md', + 'signals_core.md', + 'tut_c_plugins.md', +] + +if get_option('doc') + libpurple_toml = configure_file( + input : 'libpurple.toml.in', + output : 'libpurple.toml', + configuration : version_conf, + install : true, + install_dir : docs_dir / 'libpurple', + ) + + libpurple_doc = custom_target('libpurple-doc', + input : [ libpurple_toml, libpurple_gir[0] ], + output : 'libpurple', + command : [ + gidocgen, + 'generate', + '--quiet', + '--fatal-warnings', + '--config=@INPUT0@', + '--output-dir=@OUTPUT@', + '--no-namespace-dir', + '--content-dir=@0@'.format(meson.current_source_dir()), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), + '@INPUT1@' + ], + depend_files : [ libpurple_doc_content_files ], + build_by_default : true, + install : true, + install_dir : docs_dir, + ) + + test('doc-check', + gidocgen, + args: [ + 'check', + '--config', libpurple_toml, + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), + libpurple_gir[0], + ], + depends: libpurple_gir[0], + verbose: true, + ) + + doc_targets += libpurple_doc +endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/signals_connection.md Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,173 @@ +Title: Connection Signals +Slug: connection-signals + +## Connection Signals + +### Signal List + +* [online](#online) +* [offline](#offline) +* [signing-on](#signing-on) +* [signed-on](#signed-on) +* [autojoin](#autojoin) +* [signing-off](#signing-off) +* [signed-off](#signed-off) +* [connection-error](#connection-error) + +### Signal Details + +#### online + +```c +void user_function(gpointer user_data); +``` + +Emitted when the first connection has connected when all connections were +previously not connected. + +**Parameters:** + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### offline + +```c +void user_function(gpointer user_data); +``` + +Emitted when the last connected connection has disconnected. + + +**Parameters:** + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### signing-on + +```c +void user_function(PurpleConnection *gc, gpointer user_data); +``` + +Emitted when a connection is about to sign on. + +**Parameters:** + +**gc** +: The connection that is about to sign on. + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### signed-on + +```c +void user_function(PurpleConnection *gc, gpointer user_data); +``` + +Emitted when a connection has signed on. + +**Parameters:** + +**gc** +: The connection that has signed on. + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### autojoin + +```c +gboolean user_function(PurpleConnection *gc, gpointer user_data); +``` + +Emitted when a connection has signed on, after the signed-on signal, to signal +UIs to autojoin chats if they wish. UIs should connect to this with +`PURPLE_SIGNAL_PRIORITY_HIGHEST` to allow plugins to block this signal before +the UI sees it and then re-emit it later. + +**Parameters:** + +**gc** +: The connection that has signed on. + +**user_data** +: user data set when the signal handler was connected. + +**Returns:** + +`TRUE` if the signal was handled or `FALSE` otherwise. In practice, the return +value is irrelevant, as it really only exists so plugins can block the UI's +autojoin. + +---- + +#### signing-off + +```c +void user_function(PurpleConnection *gc, gpointer user_data); +``` + +Emitted when a connection is about to sign off. + +**Parameters:** + +**gc** +: The connection that is about to sign off. + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### signed-off + +```c +void user_function(PurpleConnection *gc, gpointer user_data); +``` + +Emitted when a connection has signed off. + +**Parameters:** + +**gc** +: The connection that has signed off. + +**user_data** +: user data set when the signal handler was connected. + +---- + +#### connection-error + +```c +void user_function(PurpleConnection *gc, + PurpleConnectionError err, + const gchar *desc, + gpointer user_data); +``` + +Emitted when a connection error occurs, before `"signed"`-off. + +**Parameters:** + +**gc** +: The connection on which the error has occurred. + +**err** +: The error that occurred. + +**desc** +: A description of the error, giving more information. + +**user_data** +: user data set when the signal handler was connected.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/signals_core.md Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,35 @@ +Title: Core Signals +Slug: core-signals + +## Core Signals + +### Signal List + +* [core-uri-handler](#uri-handler) + +### Signal Details + +#### uri-handler + +```c +gboolean user_function(const gchar *proto, + const gchar *cmd, + GHashTable *params, + gpointer user_data); +``` + +Emitted when handling a registered URI. + +**Parameters:** + +**proto** +: The protocol of the URI. + +**cmd** +: The 'command' of the URI. + +**params** +: Any key/value parameters from the URI. + +**user_data** +: User data set when the signal handler was connected.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/tut_c_plugins.md Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,139 @@ +Title: C Plugin Tutorial +Slug: c-plugin-tutorial + +## C Plugin Tutorial + +### Introduction + +C plugins are native plugins. They have complete access to all of the API, +and can do basically whatever they want. All of the protocol plugins are +also written in C. + +### Getting Started + +To develop a plugin you need to have the libpurple and (for UI plugins) the +Pidgin/Finch source code or development headers. It is generally a good idea +to compile against the same version of Pidgin that you are running. You may +also want to develop against the code in our Mercurial repository if you need +to use a new feature. Please do not abuse our Mercurial repository, however. + +### An Example + +I know every tutorial has a hello world, so why should libpurple be any +different? + +```c +#include <purple.h> + +static GPluginPluginInfo * +hello_world_query(GError **error) { + const gchar * const authors[] = { + "Author Name <aname@example.com>", + NULL + }; + + return purple_plugin_info_new ( + "id", "hello_world", + "name", "Hello World!", + "version", "1.0", + "category", "Example", + "summary", "Hello World Plugin", + "description", "Displays a \"Hello World!\" message when loaded", + "authors", authors, + "website", "http://helloworld.tld", + "abi-version", PURPLE_ABI_VERSION, + NULL + ); +} + +static gboolean +hello_world_load(GPluginPlugin *plugin, GError **error) { + purple_notify_message(plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!", + "This is the Hello World! plugin :)", + NULL, NULL, NULL, NULL); + + return TRUE; +} + +static gboolean +hello_world_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error) { + return TRUE; +} + +GPLUGIN_NATIVE_PLUGIN_DECLARE(hello_world) +``` + +Okay, so what does all this mean? We start off by including purple.h. This +file includes all the libpurple header files. + +`hello_world_query`, `hello_world_load` and `hello_world_unload` are functions +that must be implemented in every plugin. These functions are named according +to the value passed to `GPLUGIN_NATIVE_PLUGIN_DECLARE` which is described +below. + +`hello_world_query` is called when the plugin is queried by the plugin system, +and returns various information about the plugin in form of a newly created +instance of `GPluginPluginInfo` or a subclass. For a list of all available +properties, see `purple_plugin_info_new()`. + +If anything should go wrong during the query you can return an error by using +`g_set_error()` on the `error` argument. + +`hello_world_load` is called when the plugin is loaded. That is the user has +enabled the plugin or libpurple is loading a plugin that was previously loaded. +You can initialize any variables, register dynamic types, and so on in this +function. Plugins may also want to add their preferences to the pref +tree--more about that later. In this plugin we'll just use it to display a +message. Just like `hello_world_query` if there are any errors that arise, you +can call `g_set_error()` on the `error` argument and return `FALSE`. + +`hello_world_unload` is called when the plugin is unloaded. That is, when the +user has manually unloaded the plugin or the program is shutting down. We can +use it to wrap up everything, and free our variables. If the program is shutting +down, the `shutdown` argument will be `TRUE`. Again, if there are any errors, you +can call `g_set_error()` on the `error` argument and return `FALSE`. + +Finally we have `GPLUGIN_NATIVE_PLUGIN_DECLARE()`. It is a helper macro that +makes creating plugins easier. It has a single argument which is the prefix +used for the `_query`, `_load`, and `_unload` functions. + +### Building + +You may want to compile your plugin by using your libpurple from the packages +on your system. You can easily do this with meson build system. Let's say +you've already wrote the hello world plugin and saved it as `hello_world.c`. +Create a file named `meson.build`: + +```python +project('hello_world_plugin', 'c') + +libpurple_dep = dependency('purple-3') + +PURPLE_PLUGINDIR = libpurple_dep.get_pkgconfig_variable('plugindir') + +library('libhelloworld', 'hello_world.c', + c_args : [ + '-DG_LOG_USE_STRUCTURED', + '-DG_LOG_DOMAIN="PurplePlugin-HelloWorld"' + ], + dependencies : [libpurple_dep], + name_prefix : '', + install : true, + install_dir : PURPLE_PLUGINDIR) +``` + +This `meson.build` file will build your plugin and install it into the right +location for libpurple to find it. + +If you're using this example to compile your own plugin. You +should change the project name at the beginning of the file and change the +library name which in this case is `libhelloworld`. You will also need to +change the `G_LOG_DOMAIN` macro to your own log domain. + +Now, you can quickly build your plugin with the following commands: + +``` +meson setup build +meson compile -C build +meson install -C build +```
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/reference/urlmap.js Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: 2021 GNOME Foundation +// SPDX-License-Identifier: LGPL-2.1-or-later + +// A map between namespaces and base URLs for their online documentation +baseURLs = [ + [ 'GLib', 'https://docs.gtk.org/glib/' ], + [ 'GObject', 'https://docs.gtk.org/gobject/' ], + [ 'GPlugin', 'https://docs.imfreedom.org/gplugin/' ], +]
--- a/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ b/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -74,6 +74,10 @@ output : 'package_revision.h', fallback : meson.project_version()) +# Global variable for doc targets to add themselves to which we use for the +# doc alias below. +doc_targets = [] + # For running `meson devenv`. devenv = environment() @@ -434,6 +438,10 @@ command : ['ninja', '-C', '@BUILD_ROOT@', 'pidgin3-pot', 'all', 'test']) endif +# doc alias target, depends on doc_targets defined above and populated in sub +# directories. +alias_target('doc', doc_targets) + summary({ 'prefix': get_option('prefix'), 'bindir': get_option('bindir'),
--- a/pidgin/meson.build Wed Aug 07 21:52:08 2024 -0500 +++ b/pidgin/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -241,3 +241,5 @@ subdir('data') subdir('plugins') subdir('tests') +subdir('reference') +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/reference/meson.build Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,54 @@ +pidgin_doc_content_files = [ +] + +if get_option('doc') + pidgin_toml = configure_file( + input : 'pidgin.toml.in', + output : 'pidgin.toml', + configuration : version_conf, + install : true, + install_dir : docs_dir / 'pidgin', + ) + + pidgin_doc = custom_target('pidgin-doc', + input : [ pidgin_toml, pidgin_gir[0] ], + output : 'pidgin', + command : [ + gidocgen, + 'generate', + '--quiet', + '--fatal-warnings', + '--config=@INPUT0@', + '--output-dir=@OUTPUT@', + '--no-namespace-dir', + '--content-dir=@0@'.format(meson.current_source_dir()), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin-gtk4'), + '--add-include-path=@0@'.format(meson.project_build_root() / 'libpurple'), + '@INPUT1@' + ], + depends: [ libpurple_gir[0] ], + depend_files : [ pidgin_doc_content_files ], + build_by_default : true, + install : true, + install_dir : docs_dir, + ) + + test('doc-check', + gidocgen, + args: [ + 'check', + '--config', pidgin_toml, + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/birb/birb'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin'), + '--add-include-path=@0@'.format(meson.global_build_root() / 'subprojects/gplugin/gplugin-gtk4'), + '--add-include-path=@0@'.format(meson.project_build_root() / 'libpurple'), + pidgin_gir[0], + ], + depends: [libpurple_gir[0], pidgin_gir[0]], + ) + + doc_targets += pidgin_doc +endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/reference/pidgin.toml.in Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,82 @@ +[library] +version = "@PURPLE_MAJOR_VERSION@.@PURPLE_MINOR_VERSION@.@PURPLE_MICRO_VERSION@" +browse_url = "https://keep.imfreedom.org/pidgin/pidgin/" +repository_url = "https://keep.imfreedom.org/pidgin/pidgin/" +website_url = "https://keep.imfreedom.org/pidgin/pidgin/" +authors = "Pidgin Developers" +logo_url = "" +license = "GPL-2.0-or-later" +description = "Pidgin Universal Chat Client" +dependencies = [ "GLib-2.0", "GObject-2.0", "Gtk-4.0", "Purple-3.0", "GPlugin-1.0", "GPlugin-Gtk4-1.0" ] +devhelp = true +search_index = true + + [dependencies."GLib-2.0"] + name = "GLib" + description = "General-purpose, portable utility library." + docs_url = "https://docs.gtk.org/glib/" + + [dependencies."GObject-2.0"] + name = "GObject" + description = "The base type system library" + docs_url = "https://docs.gtk.org/gobject/" + + [dependencies."Gtk-4.0"] + name = "Gtk" + description = "The GTK toolkit" + docs_url = "https://docs.gtk.org/gtk4/" + + [dependencies."Purple-3.0"] + name = "Purple" + description = "Purple Universal Chat Library" + docs_url = "https://docs.imfreedom.org/purple3/" + + [dependencies."GPlugin-1.0"] + name = "GPlugin" + description = "GPlugin Plugin Library" + docs_urls = "https://docs.imfreedom.org/gplugin/" + + [dependencies."GPlugin-Gtk4-1.0"] + name = "GPlugin-Gtk" + description = "GPlugin Gtk4 Widget Library" + docs_urls = "https://docs.imfreedom.org/gplugin-gtk4/" + +[theme] +name = "basic" +show_index_summary = true +show_class_hierarchy = true + +[source-location] +base_url = "https://keep.imfreedom.org/pidgin/pidgin/file/default/" + +[extra] +# The same order will be used when generating the index +content_files = [ +] +content_images = [ +] +urlmap_file = "urlmap.js" + +[[object]] +pattern = "DEPRECATED_IN_*" +hidden = true + +[[object]] +name = "DEPRECATED_FOR" +hidden = true + +[[object]] +name = "UNAVAILABLE" +hidden = true + +[[object]] +name = "UNAVAILABLE_MACRO" +hidden = true + +[[object]] +name = "UNAVAILABLE_STATIC_INLINE" +hidden = true + +[[object]] +name = "UNAVAILABLE_TYPE" +hidden = true \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/reference/urlmap.js Thu Aug 08 21:34:07 2024 -0500 @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2021 GNOME Foundation +// SPDX-License-Identifier: LGPL-2.1-or-later + +// A map between namespaces and base URLs for their online documentation +baseURLs = [ + [ 'GLib', 'https://docs.gtk.org/glib/' ], + [ 'GObject', 'https://docs.gtk.org/gobject/' ], + [ 'GPlugin', 'https://docs.imfreedom.org/gplugin/' ], + [ 'GPlugin-Gtk4', 'https://docs.imfreedom.org/gplugin-gtk4/' ], + [ 'Gtk', 'https://docs.gtk.org/gtk4/' ], + [ 'Purple3', 'https://docs.imfreedom.org/purple3/' ], +]