# HG changeset patch
# Node ID 294ca962a58c
# Parent  4d22ff23a3b7
diff --git a/doc/reference/protocols/facebook/facebook.toml.in b/doc/reference/protocols/facebook/facebook.toml.in
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/facebook/facebook.toml.in
@@ -0,0 +1,53 @@
+[library]
+version = "@PURPLE_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 Facebook Protocol Plugin"
+dependencies = [ "GLib-2.0", "GObject-2.0", "GModule-2.0", "Gtk-3.0", "Purple-3.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."GModule-2.0"]
+  name = "GModule"
+  description = "Portable API for dynamically loading modules"
+  docs_url = "https://docs.gtk.org/gmodule/"
+
+  [dependencies."Gtk-3.0"]
+  name = "Gtk"
+  description = "The GTK toolkit"
+  docs_url = "https://docs.gtk.org/gtk3/"
+
+  [dependencies."Purple-3.0"]
+  name = "Purple"
+  description = "Purple Universal Chat Library"
+  docs_url = "https://docs.imfreedom.org/purple3/"
+
+[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"
diff --git a/doc/reference/protocols/facebook/meson.build b/doc/reference/protocols/facebook/meson.build
--- a/doc/reference/protocols/facebook/meson.build
+++ b/doc/reference/protocols/facebook/meson.build
@@ -1,33 +1,32 @@
-DOC_MODULE = 'facebook'
-
-# Header files or dirs to ignore when scanning. Use base file/dir names
-ignore_hfiles = [
-]
+facebook_doc_content_files = []
 
-# Extra options to supply to gtkdoc-scan.
-scan_args = [
-    '--deprecated-guards=PURPLE_DISABLE_DEPRECATED',
-    '--rebuild-types',
-    '--rebuild-sections',
-    '--ignore-headers=' + ' '.join(ignore_hfiles),
-]
+if get_option('doc')
+	facebook_toml = configure_file(
+		input : 'facebook.toml.in',
+		output : 'facebook.toml',
+		configuration : version_conf,
+		install : true,
+		install_dir : docs_dir / 'facebook',
+	)
 
-# Extra options to supply to fixxref
-fixxref_args = [
-    '--extra-dir=../../libpurple',
-]
-
-# Extra SGML files that are included by $(DOC_MAIN_XML_FILE).
-content_files = [
-    libpurple_version_xml,
-]
+	facebook_doc = custom_target('facebook-doc',
+		input : [ facebook_toml, facebook_gir[0] ],
+		output : 'facebook',
+		command : [
+			gidocgen,
+			'generate',
+			'--quiet',
+			'--fatal-warnings',
+			'--config=@INPUT0@',
+			'--output-dir=@OUTPUT@',
+			'--no-namespace-dir',
+			'--content-dir=@0@'.format(meson.current_source_dir()),
+			'@INPUT1@'
+		],
+		depend_files : [ facebook_doc_content_files ],
+		build_by_default : true,
+		install : true,
+		install_dir : docs_dir,
+	)
+endif
 
-facebook_doc = gnome.gtkdoc(DOC_MODULE,
-    main_xml : DOC_MODULE + '-docs.xml',
-    src_dir : facebook_inc,
-    dependencies : facebook_dep,
-    install : true,
-    scan_args : scan_args,
-    fixxref_args : fixxref_args,
-    gobject_typesfile : DOC_MODULE + '.types',
-    content_files : content_files)
diff --git a/doc/reference/protocols/facebook/urlmap.js b/doc/reference/protocols/facebook/urlmap.js
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/facebook/urlmap.js
@@ -0,0 +1,11 @@
+// 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/' ],
+    [ 'GModule', 'https://docs.gtk.org/gmodule/' ],
+    [ 'Gtk', 'https://docs.gtk.org/gtk3/' ],
+    [ 'Purple3', 'https://docs.imfreedom.org/purple3/' ],
+]
diff --git a/libpurple/protocols/facebook/api.h b/libpurple/protocols/facebook/api.h
--- a/libpurple/protocols/facebook/api.h
+++ b/libpurple/protocols/facebook/api.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_API_H
 #define PURPLE_FACEBOOK_API_H
 
-/**
- * SECTION:api
- * @section_id: facebook-api
- * @short_description: <filename>api.h</filename>
- * @title: Facebook API
- *
- * The API for interacting with the Facebook Messenger protocol.
- */
-
 #include <glib.h>
 
 #include <purple.h>
@@ -529,11 +520,6 @@
 	gchar *csum;
 };
 
-/**
- * fb_api_get_type:
- *
- * Returns: The #GType for an #FbApi.
- */
 G_DECLARE_FINAL_TYPE(FbApi, fb_api, FB, API, GObject)
 
 /**
diff --git a/libpurple/protocols/facebook/data.h b/libpurple/protocols/facebook/data.h
--- a/libpurple/protocols/facebook/data.h
+++ b/libpurple/protocols/facebook/data.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_DATA_H
 #define PURPLE_FACEBOOK_DATA_H
 
-/**
- * SECTION:data
- * @section_id: facebook-data
- * @short_description: <filename>data.h</filename>
- * @title: Connection Data
- *
- * The Connection Data.
- */
-
 #include <glib.h>
 
 #include <purple.h>
@@ -56,18 +47,8 @@
  */
 #define FB_DATA_ICON_SIZE_MAX  0xa00000 /* 10MiB */
 
-/**
- * fb_data_get_type:
- *
- * Returns: The #GType for an #FbData.
- */
 G_DECLARE_FINAL_TYPE(FbData, fb_data, FB, DATA, GObject)
 
-/**
- * fb_data_image_get_type:
- *
- * Returns: The #GType for an #FbDataImage.
- */
 G_DECLARE_FINAL_TYPE(FbDataImage, fb_data_image, FB, DATA_IMAGE, GObject)
 
 /**
diff --git a/libpurple/protocols/facebook/facebook.h b/libpurple/protocols/facebook/facebook.h
--- a/libpurple/protocols/facebook/facebook.h
+++ b/libpurple/protocols/facebook/facebook.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_FACEBOOK_H
 #define PURPLE_FACEBOOK_FACEBOOK_H
 
-/**
- * SECTION:facebook
- * @section_id: facebook-plugin
- * @short_description: <filename>facebook.h</filename>
- * @title: Facebook Plugin
- *
- * The Facebook Messenger #PurpleProtocol.
- */
-
 #include <glib.h>
 #include <gmodule.h>
 
@@ -57,10 +48,4 @@
  * The base class for all #FacebookProtocol's.
  */
 
-/**
- * facebook_protocol_get_type:
- *
- * Returns: The #GType for a #FacebookProtocol.
- */
-
 #endif /* PURPLE_FACEBOOK_FACEBOOK_H */
diff --git a/libpurple/protocols/facebook/http.h b/libpurple/protocols/facebook/http.h
--- a/libpurple/protocols/facebook/http.h
+++ b/libpurple/protocols/facebook/http.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_HTTP_H
 #define PURPLE_FACEBOOK_HTTP_H
 
-/**
- * SECTION:http
- * @section_id: facebook-http
- * @short_description: <filename>http.h</filename>
- * @title: HTTP Utilities
- *
- * The HTTP utilities.
- */
-
 #include <glib.h>
 #include <libsoup/soup.h>
 
diff --git a/libpurple/protocols/facebook/id.h b/libpurple/protocols/facebook/id.h
--- a/libpurple/protocols/facebook/id.h
+++ b/libpurple/protocols/facebook/id.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_ID_H
 #define PURPLE_FACEBOOK_ID_H
 
-/**
- * SECTION:id
- * @section_id: facebook-id
- * @short_description: <filename>id.h</filename>
- * @title: Facebook Identifier
- *
- * The Facebook identifier utilities.
- */
-
 #include <glib.h>
 #include <glib/gprintf.h>
 
diff --git a/libpurple/protocols/facebook/json.h b/libpurple/protocols/facebook/json.h
--- a/libpurple/protocols/facebook/json.h
+++ b/libpurple/protocols/facebook/json.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_JSON_H
 #define PURPLE_FACEBOOK_JSON_H
 
-/**
- * SECTION:json
- * @section_id: facebook-json
- * @short_description: <filename>json.h</filename>
- * @title: JSON Utilities
- *
- * The JSON utilities.
- */
-
 #include <glib.h>
 #include <json-glib/json-glib.h>
 
@@ -83,11 +74,6 @@
 	FB_JSON_TYPE_STR = G_TYPE_STRING
 } FbJsonType;
 
-/**
- * fb_json_values_get_type:
- *
- * Returns: The #GType for an #FbJsonValues.
- */
 G_DECLARE_FINAL_TYPE(FbJsonValues, fb_json_values, FB, JSON_VALUES,
 		GObject)
 
diff --git a/libpurple/protocols/facebook/meson.build b/libpurple/protocols/facebook/meson.build
--- a/libpurple/protocols/facebook/meson.build
+++ b/libpurple/protocols/facebook/meson.build
@@ -37,4 +37,23 @@
 	    dependencies : [json, libpurple_dep, glib])
 
 	devenv.append('PURPLE_PLUGIN_PATH', meson.current_build_dir())
+
+	if enable_introspection
+		introspection_sources = FACEBOOK_SOURCES
+
+		facebook_gir_includes = ['GObject-2.0', 'Gio-2.0', 'Gst-1.0']
+
+		facebook_gir = gnome.generate_gir(facebook_prpl,
+		    sources : introspection_sources,
+		    includes : facebook_gir_includes,
+		    namespace : 'Facebook',
+		    symbol_prefix : 'fb',
+		    identifier_prefix : 'Fb',
+		    nsversion : '@0@.@1@'.format(purple_major_version,
+		                                 purple_minor_version),
+		    dependencies: [gplugin_dep, libpurple_dep],
+		    install : false,
+		    extra_args : ['-DPURPLE_COMPILATION', '--quiet'])
+	endif
+
 endif
diff --git a/libpurple/protocols/facebook/mqtt.h b/libpurple/protocols/facebook/mqtt.h
--- a/libpurple/protocols/facebook/mqtt.h
+++ b/libpurple/protocols/facebook/mqtt.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_MQTT_H
 #define PURPLE_FACEBOOK_MQTT_H
 
-/**
- * SECTION:mqtt
- * @section_id: facebook-mqtt
- * @short_description: <filename>mqtt.h</filename>
- * @title: MQTT Connection
- *
- * The MQTT connection.
- */
-
 #include <glib.h>
 #include <string.h>
 
@@ -199,18 +190,8 @@
 	FB_MQTT_MESSAGE_TYPE_DISCONNECT = 14
 } FbMqttMessageType;
 
-/**
- * fb_mqtt_get_type:
- *
- * Returns: The #GType for an #FbMqtt.
- */
 G_DECLARE_FINAL_TYPE(FbMqtt, fb_mqtt, FB, MQTT, GObject)
 
-/**
- * fb_mqtt_message_get_type:
- *
- * Returns: The #GType for an #FbMqttMessage.
- */
 G_DECLARE_FINAL_TYPE(FbMqttMessage, fb_mqtt_message, FB, MQTT_MESSAGE,
 		GObject)
 
diff --git a/libpurple/protocols/facebook/thrift.h b/libpurple/protocols/facebook/thrift.h
--- a/libpurple/protocols/facebook/thrift.h
+++ b/libpurple/protocols/facebook/thrift.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_THRIFT_H
 #define PURPLE_FACEBOOK_THRIFT_H
 
-/**
- * SECTION:thrift
- * @section_id: facebook-thrift
- * @short_description: <filename>thrift.h</filename>
- * @title: Thrift Reader/Writer
- *
- * The Thrift reader/writer.
- */
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -76,11 +67,6 @@
 	FB_THRIFT_TYPE_UNKNOWN
 } FbThriftType;
 
-/**
- * fb_thrift_get_type:
- *
- * Returns: The #GType for an #FbThrift.
- */
 G_DECLARE_FINAL_TYPE(FbThrift, fb_thrift, FB, THRIFT, GObject)
 
 /**
diff --git a/libpurple/protocols/facebook/util.h b/libpurple/protocols/facebook/util.h
--- a/libpurple/protocols/facebook/util.h
+++ b/libpurple/protocols/facebook/util.h
@@ -22,15 +22,6 @@
 #ifndef PURPLE_FACEBOOK_UTIL_H
 #define PURPLE_FACEBOOK_UTIL_H
 
-/**
- * SECTION:util
- * @section_id: facebook-util
- * @short_description: <filename>util.h</filename>
- * @title: General Utilities
- *
- * The general utilities.
- */
-
 #include <glib.h>
 
 #include <purple.h>
