changeset 224:6f6c49b95f77

doc: add libcore API
author David Demelier <markand@malikania.fr>
date Wed, 18 Nov 2020 19:43:40 +0100
parents 560303066120
children d5263d467934
files doc/CMakeLists.txt doc/api.rst doc/api/core/action.rst doc/api/core/alloc.rst doc/api/core/animation.rst doc/api/core/clock.rst doc/api/core/color.rst doc/api/core/core.rst doc/api/core/drawable.rst doc/api/core/error.rst doc/api/core/event.rst doc/api/core/font.rst doc/api/core/game.rst doc/api/core/image.rst doc/api/core/inhibit.rst doc/api/core/key.rst doc/api/core/maths.rst doc/api/core/mouse.rst doc/api/core/music.rst doc/api/core/painter.rst doc/api/core/panic.rst doc/api/core/plat.rst doc/api/core/save.rst doc/api/core/script.rst doc/api/core/sound.rst doc/api/core/sprite.rst doc/api/core/state.rst doc/api/core/sys.rst doc/api/core/texture.rst doc/api/core/trace.rst doc/api/core/util.rst doc/api/core/wait.rst doc/api/core/window.rst doc/api/libcore.rst doc/conf.py doc/index.rst doxygen/CMakeLists.txt
diffstat 37 files changed, 234 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/CMakeLists.txt	Wed Nov 18 19:09:23 2020 +0100
+++ b/doc/CMakeLists.txt	Wed Nov 18 19:43:40 2020 +0100
@@ -35,12 +35,18 @@
 		${doc_SOURCE_DIR}/tools.rst
 	)
 
+	configure_file(
+		${doc_SOURCE_DIR}/conf.py
+		${doc_BINARY_DIR}/conf.py
+	)
+
 	add_custom_target(
 		doc
 		ALL VERBATIM
 		SOURCES ${SOURCES}
-		COMMAND ${SPHINX_EXE} -q . ${doc_BINARY_DIR}
+		COMMAND ${SPHINX_EXE} -c ${doc_BINARY_DIR} -q . ${doc_BINARY_DIR}
 		WORKING_DIRECTORY ${doc_SOURCE_DIR}
 		COMMENT "Generating documentation"
+		DEPENDS doxygen
 	)
 endif ()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,22 @@
+=============
+API Reference
+=============
+
+Official C API reference.
+
+The API is split into individual libraries:
+
+``libcore``
+  Low level access to the library that provides input, sound, animations and
+  windowing system.
+
+``libui``
+  User interface elements.
+
+``librpg``
+  Every other components that are related to the RPG gameplay.
+
+.. toctree::
+   :maxdepth: 1
+
+   api/libcore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/action.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+========================
+#include <core/action.h>
+========================
+
+.. doxygenfile:: core/action.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/alloc.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/alloc.h>
+=======================
+
+.. doxygenfile:: core/alloc.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/animation.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+===========================
+#include <core/animation.h>
+===========================
+
+.. doxygenfile:: core/animation.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/clock.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/clock.h>
+=======================
+
+.. doxygenfile:: core/clock.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/color.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/color.h>
+=======================
+
+.. doxygenfile:: core/color.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/core.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/core.h>
+======================
+
+.. doxygenfile:: core/core.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/drawable.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+==========================
+#include <core/drawable.h>
+==========================
+
+.. doxygenfile:: core/drawable.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/error.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/error.h>
+=======================
+
+.. doxygenfile:: core/error.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/event.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/event.h>
+=======================
+
+.. doxygenfile:: core/event.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/font.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/font.h>
+======================
+
+.. doxygenfile:: core/font.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/game.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/game.h>
+======================
+
+.. doxygenfile:: core/game.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/image.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/image.h>
+=======================
+
+.. doxygenfile:: core/image.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/inhibit.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=========================
+#include <core/inhibit.h>
+=========================
+
+.. doxygenfile:: core/inhibit.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/key.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=====================
+#include <core/key.h>
+=====================
+
+.. doxygenfile:: core/key.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/maths.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/maths.h>
+=======================
+
+.. doxygenfile:: core/maths.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/mouse.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/mouse.h>
+=======================
+
+.. doxygenfile:: core/mouse.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/music.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/music.h>
+=======================
+
+.. doxygenfile:: core/music.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/painter.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=========================
+#include <core/painter.h>
+=========================
+
+.. doxygenfile:: core/painter.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/panic.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/panic.h>
+=======================
+
+.. doxygenfile:: core/panic.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/plat.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/plat.h>
+======================
+
+.. doxygenfile:: core/plat.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/save.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/save.h>
+======================
+
+.. doxygenfile:: core/save.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/script.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+========================
+#include <core/script.h>
+========================
+
+.. doxygenfile:: core/script.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/sound.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/sound.h>
+=======================
+
+.. doxygenfile:: core/sound.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/sprite.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+========================
+#include <core/sprite.h>
+========================
+
+.. doxygenfile:: core/sprite.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/state.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/state.h>
+=======================
+
+.. doxygenfile:: core/state.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/sys.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=====================
+#include <core/sys.h>
+=====================
+
+.. doxygenfile:: core/sys.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/texture.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=========================
+#include <core/texture.h>
+=========================
+
+.. doxygenfile:: core/texture.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/trace.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+=======================
+#include <core/trace.h>
+=======================
+
+.. doxygenfile:: core/trace.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/util.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/util.h>
+======================
+
+.. doxygenfile:: core/util.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/wait.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+======================
+#include <core/wait.h>
+======================
+
+.. doxygenfile:: core/wait.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/core/window.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,5 @@
+========================
+#include <core/window.h>
+========================
+
+.. doxygenfile:: core/window.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/libcore.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -0,0 +1,39 @@
+================
+Library: libcore
+================
+
+.. toctree::
+   :maxdepth: 1
+
+   core/action
+   core/alloc
+   core/animation
+   core/clock
+   core/color
+   core/core
+   core/drawable
+   core/error
+   core/event
+   core/font
+   core/game
+   core/image
+   core/inhibit
+   core/key
+   core/maths
+   core/mouse
+   core/music
+   core/painter
+   core/panic
+   core/plat
+   core/save
+   core/script
+   core/sound
+   core/sprite
+   core/state
+   core/sys
+   core/texture
+   core/trace
+   core/util
+   core/util
+   core/wait
+   core/window
--- a/doc/conf.py	Wed Nov 18 19:09:23 2020 +0100
+++ b/doc/conf.py	Wed Nov 18 19:43:40 2020 +0100
@@ -27,5 +27,12 @@
 exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
 
 # HTML output.
-html_theme = "sphinx_rtd_theme"
+html_theme = "haiku"
 html_static_path = ["_static"]
+
+# Doxygen bridge through breathe.
+extensions = [ "breathe" ]
+breathe_projects = {
+    "molko": "@doxygen_BINARY_DIR@/doxygen/xml"
+}
+breathe_default_project = "molko"
--- a/doc/index.rst	Wed Nov 18 19:09:23 2020 +0100
+++ b/doc/index.rst	Wed Nov 18 19:43:40 2020 +0100
@@ -22,6 +22,7 @@
    about
    specifications
    tools
+   api
 
 Indices and tables
 ==================
--- a/doxygen/CMakeLists.txt	Wed Nov 18 19:09:23 2020 +0100
+++ b/doxygen/CMakeLists.txt	Wed Nov 18 19:43:40 2020 +0100
@@ -53,6 +53,8 @@
 	set(DOXYGEN_FILE_PATTERNS *.h)
 	set(DOXYGEN_GENERATE_LATEX NO)
 	set(DOXYGEN_GENERATE_MAN NO)
+	set(DOXYGEN_GENERATE_XML YES)
+	set(DOXYGEN_GENERATE_HTML NO)
 	set(DOXYGEN_INPUT_ENCODING UTF-8)
 	set(DOXYGEN_MAX_INITIALIZER_LINES 0)
 	set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)