77 Commits

Author SHA1 Message Date
8d95dd913c WIP: Refactor GIR creation 2018-03-12 07:59:54 +01:00
4f630186d7 WIP: Add API methods for listing and fetching devices 2018-03-12 07:59:54 +01:00
429b1711cd Add API method for /notifications 2018-03-12 07:59:54 +01:00
d3c6760d27 Add API method for /joined_rooms 2018-03-12 07:59:54 +01:00
723d7c5485 Add API method for email based account registration 2018-03-12 07:59:54 +01:00
cec83e7bae Add API method for /account/whoami 2018-03-12 07:59:54 +01:00
d310f34228 Add MATRIX_RECEIPT_TYPE_UNKNOWN 2018-03-12 07:59:54 +01:00
4132035bcd Create setter for MatrixAPI.user_id and MatrixAPI.homeserver 2018-03-12 07:59:54 +01:00
c8bc5e7d6b Remove the refresh_token
It was removed from the spec, and from HS implementations for a while.
2018-03-12 07:59:54 +01:00
3149fff095 Don’t download avatar if it is NULL in test-api-client 2018-03-12 07:59:54 +01:00
5242549a68 WIP: Completely remove Vala as a dependency 2018-03-12 07:59:54 +01:00
08f3dc66cd LOCAL ONLY! Add Makefile rule to generate a .dir-locals.el file 2018-03-12 07:59:54 +01:00
b8a98209dd Hide deprecation warnings during library compilation
We now define `__MATRIX_GLIB_SDK_COMPILATION` in `src/Makefile.am`, which in turn disables
deprecation of symbols.
2018-03-12 07:59:54 +01:00
cfa4ec43d9 Make use of configure --enable-maintainer-mode
Currently it adds `-O0` to `CFLAGS`.
2018-03-12 07:59:54 +01:00
55fcb3cbf7 Move from valadoc generation to GTK-Doc 2018-03-12 07:59:54 +01:00
8aad092c6f Port MatrixHTTPClient to C 2018-03-12 07:59:54 +01:00
0f848dec5e Port MatrixClient to C 2018-03-12 07:59:53 +01:00
b03bddd20d Port MatrixHTTPAPI to C 2018-03-12 07:59:53 +01:00
623de1e432 Port MatrixAPI to C 2018-03-12 07:59:53 +01:00
664f3a0ff6 Port MatrixEventCallCandidates to C 2018-03-12 07:59:53 +01:00
d51ab6ec50 Port MatrixEventRoomThirdPartyInvite to C 2018-03-12 07:59:53 +01:00
fffc0a615b Port MatrixEventRoomRedaction to C 2018-03-12 07:59:53 +01:00
2a083ab105 Port MatrixEventRoomGuestAccess to C 2018-03-12 07:59:53 +01:00
25cb2e33d9 Port MatrixEventRoomMessageFeedback to C 2018-03-12 07:59:53 +01:00
e461e05250 Port MatrixEventRoomPowerLevels to C 2018-03-12 07:59:53 +01:00
284e1b7390 Port MatrixEventRoomCreate to C 2018-03-12 07:59:53 +01:00
42ae6bd943 Port MatrixEventRoomCanonicalAlias to C 2018-03-12 07:59:53 +01:00
c5ccfe7a8b Port MatrixEventCallInvite to C 2018-03-12 07:59:53 +01:00
89fe509792 Port MatrixEventCallHangup to C 2018-03-12 07:59:53 +01:00
fc4a0a8433 Port MatrixEventCallAnswer to C 2018-03-12 07:59:53 +01:00
ed579294d2 Port MatrixEventRoomJoinRules to C 2018-03-12 07:59:53 +01:00
b0b1d5d26d Port MatrixEventRoomHistoryVisibility to C 2018-03-12 07:59:53 +01:00
7299d04285 Add parameter descriptions to test-client’s parameters 2018-03-12 07:59:53 +01:00
5f004a3965 Port MatrixEventRoomMessage to C 2018-03-12 07:59:53 +01:00
358fa883ef Port MatrixMessageNotice to C 2018-03-12 07:59:53 +01:00
aede0eeef9 Port MatrixRoom to C 2018-03-12 07:59:53 +01:00
0a2d65b0fd Port MatrixMessageVideo to C 2018-02-28 15:09:05 +01:00
d2ec7e9507 Port MatrixMessageAudio to C 2018-02-28 15:09:05 +01:00
a599541184 Port MatrixMessageImage to C 2018-02-28 15:09:05 +01:00
a9cddf4303 Port MatrixMessageFile to C 2018-02-28 15:09:05 +01:00
3c825c663f Port MatrixEventCall to C 2018-02-28 15:09:05 +01:00
d43f6517d7 Port MatrixEventRoomName to C 2018-02-28 15:09:05 +01:00
350afd8ca1 Port MatrixEventRoomAvatar to C 2018-02-28 15:09:05 +01:00
a6899e054f Port MatrixMessageEmote to C 2018-02-28 15:09:05 +01:00
3b61d2997e Port MatrixMessageLocation to C 2018-02-28 15:09:05 +01:00
49a2bf4aa9 Port MatrixMessageText to C 2018-02-28 15:09:05 +01:00
81521688e8 Port MatrixMessageBase to C 2018-02-28 15:09:04 +01:00
10a27bef17 Port MatrixEventRoomAliases to C 2018-02-28 15:09:04 +01:00
171f76e678 Port MatrixEventRoomTopic to C 2018-02-28 15:09:04 +01:00
75c255ac9d Port MatrixEventReceipt to C 2018-02-28 15:09:04 +01:00
068f85d0c1 Port MatrixEventTyping to C 2018-02-28 15:09:04 +01:00
e23a177851 Port MatrixEventRoomMember to C 2018-02-28 15:09:04 +01:00
68058c60ff Port MatrixEventPresence to C 2018-02-28 15:09:04 +01:00
3dcaf44540 Port MatrixEventTag to C 2018-02-28 15:09:04 +01:00
149c9fec36 Port MatrixEventState to C 2018-02-28 15:09:04 +01:00
64d1674816 Port MatrixEventRoom to C 2018-02-28 15:09:04 +01:00
552a36d65d Port MatrixEventBase to C 2018-02-28 15:09:04 +01:00
89376c0890 Port _matrix_json_node_deep_copy() to C 2018-02-28 15:09:04 +01:00
532bb0d153 Port MatrixSearchCategories to C 2018-02-28 15:09:04 +01:00
fce95296eb Port MatrixSearchRoomEvents to C 2018-02-28 15:09:04 +01:00
cb170dc4d9 Upgrade _matrix_g_enum_to_string() so it can convert dashes to any character 2018-02-28 15:09:04 +01:00
91fb94de91 Port MatrixSearchGroupings to C 2018-02-28 15:09:04 +01:00
7644e8f2e0 Upgrade free_str_array() so it can free any type of arrays 2018-02-28 15:09:04 +01:00
0917378fea Port MatrixSearchGrouping to C 2018-02-28 15:09:04 +01:00
de33224f55 Port MatrixEventContext to C 2018-02-28 15:09:04 +01:00
d3db60e50d Port MatrixPusher to C 2018-02-28 15:09:04 +01:00
f5df3831a3 Port Matrix3PidCredential to C 2018-02-28 15:09:03 +01:00
eff98aad31 Port MatrixFilter to C 2018-02-28 08:01:22 +01:00
161b60a2b0 Port MatrixRoomFilter to C 2018-02-28 08:01:22 +01:00
5108a2a825 Port MatrixFilterRules to C 2018-02-28 08:01:22 +01:00
57a519b8db Port MatrixJsonCompact to C 2018-02-28 08:01:22 +01:00
41295e4b33 Port MatrixProfile to C 2018-02-28 08:01:22 +01:00
bd06d8d14a Port MatrixVideoInfo to C 2018-02-28 08:01:22 +01:00
1edee561ae Port MatrixAudioInfo to C 2018-02-28 08:01:07 +01:00
817dc4800e Port MatrixImageInfo to C 2018-02-28 08:01:07 +01:00
668bedb816 Port MatrixFileInfo to C 2017-12-12 11:50:09 +01:00
f6f6f78cdc Port _g_enum_nick_to_value() to C 2017-12-12 11:50:09 +01:00
109 changed files with 1831 additions and 641 deletions

1
.gitignore vendored
View File

@@ -36,6 +36,7 @@ Makefile.in
/GTAGS /GTAGS
/INSTALL /INSTALL
/ChangeLog /ChangeLog
/.dir-locals.el
/src/matrix-version.h /src/matrix-version.h
/src/matrix-enumtypes.[ch] /src/matrix-enumtypes.[ch]
/src/matrix-marshalers.[ch] /src/matrix-marshalers.[ch]

84
Makefile.am Normal file
View File

@@ -0,0 +1,84 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# Set up subdirectories to traverse
SUBDIRS = src
if ENABLE_GTK_DOC
SUBDIRS += docs/reference/matrix-glib-sdk
endif
# Specify files to include in dist
# in share/doc/
matrixglibdocdir = ${prefix}/doc/matrix-glib
matrixglibdoc_DATA = \
README \
COPYING \
AUTHORS \
ChangeLog \
INSTALL \
NEWS
# with make dist
EXTRA_DIST = $(matrixglibdoc_DATA) \
autogen.sh \
config.rpath
# Lists of generated files you want to be able to clean
MAINTAINERCLEANFILES = \
$(srcdir)/aclocal.m4 \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.rpath \
$(srcdir)/config.sub \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/ChangeLog \
`find "$(srcdir)" -type f -name Makefile.in -print` \
$(NULL)
DISTCLEANFILES = \
ChangeLog
# Automatically generate ChangeLog from git
ChangeLog:
@echo Creating $@
@touch ChangeLog
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log --stat) | fmt > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: ChangeLog .dir-locals.el
.dir-locals.el:
@echo -n ""; \
includes=`echo -I$(top_srcdir) $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(VALA_CFLAGS) | tr " " "\n" | grep '^-I' | sed 's/^-I//'`; \
flycheck_path='('; \
company_path='('; \
for incl in $$includes; \
do \
if [ "$$incl" == "." ]; \
then \
incl="$(abs_top_srcdir)"; \
fi; \
flycheck_path="$$flycheck_path \"$$incl\""; \
company_path="$$company_path \"-I$$incl\""; \
done; \
flycheck_path="$$flycheck_path)"; \
company_path="$$company_path)"; \
echo "((c-mode . ((flycheck-clang-include-path . $$flycheck_path) (company-clang-arguments . $$company_path))))" > $@

130
autogen.sh Executable file
View File

@@ -0,0 +1,130 @@
#! /bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
DIE=0
PKG_NAME="matrix-glib"
(test -f "$srcdir/configure.ac" \
&& test -f "$srcdir/src/matrix-client.c") || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
(gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gtkdocize' installed."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnome.org/"
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
coin="$srcdir/configure.ac"
dr=`dirname $coin`
cd $dr
m4dir=`grep '^AC_CONFIG_MACRO_DIR' configure.ac \
| sed -n -e 's/AC_CONFIG_MACRO_DIR(\([^()]*\))/\1/p' \
| sed -e 's/^\[\(.*\)\]$/\1/' \
| sed -e 1q`
m4_dir=$m4dir
if test -n "$m4dir"]; then
m4dir="-I $m4dir"
fi
aclocalinclude="$ACLOCAL_FLAGS"
if grep "^LT_INIT" "$coin" > /dev/null; then
if test -z "$NO_LIBTOOLIZE"; then
echo "Running libtoolize ..."
libtoolize --force --copy || exit $?
fi
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $m4dir $ACLOCAL_FLAGS $aclocalinclude || exit $?
if grep "^GTK_DOC_CHECK" "$coin" > /dev/null; then
echo "Running gtkdocize ..."
gtkdocize || exit $?
fi
if grep "^A[CM]_CONFIG_HEADER" "$coin" > /dev/null; then
echo "Running autoheader ..."
autoheader || exit $?
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --copy --gnu $am_opt -Wno-portability || exit $?
echo "Running autoconf ..."
autoconf || exit $?
if test x$NOCONFIGURE = x; then
echo Running "$srcdir/configure" "$@" ...
"$srcdir/configure" "$@" \
&& echo Now type \`make\' to compile. || exit 1
else
echo Skipping configure process.
fi

190
configure.ac Normal file
View File

@@ -0,0 +1,190 @@
# Process this file with autoconf to produce a configure script
# Sections
# Version numbers
# Setup
# Dependencies
# Output
### Version numbers
# Release Version
m4_define([matrix_glib_major_version], [0])
m4_define([matrix_glib_minor_version], [0])
m4_define([matrix_glib_micro_version], [1])
m4_define([matrix_glib_nano_version], [0])
# LT_VERSION
# If library source has changed since last release, increment revision
# If public symbols have been added, removed or changed since last
# release, increment current and set revision to 0
# If public symbols have been added since last release, increment age
# If public symbols have been removed since last release, set age to 0
m4_define([matrix_glib_lt_current], [0])
m4_define([matrix_glib_lt_revision], [0])
m4_define([matrix_glib_lt_age], [0])
# Combine numbers to various version variables (different uses)
# Display the nano_version only if it's not '0'
m4_define([matrix_glib_base_version],
matrix_glib_major_version.matrix_glib_minor_version.matrix_glib_micro_version)
m4_define([matrix_glib_full_version],
[m4_if(matrix_glib_nano_version, [0],
matrix_glib_base_version,
matrix_glib_base_version.matrix_glib_nano_version)])
# You should set project_released to one in order to mark this as a
# released version and to avoid date on version numbers
m4_define(matrix_glib_released, [0])
m4_define([matrix_glib_maybe_datestamp],
m4_if(matrix_glib_released, [1],
[],
[m4_esyscmd([date +.%Y%m%d | tr -d '\n\r'])]))
m4_define([matrix_glib_version], matrix_glib_full_version[]matrix_glib_maybe_datestamp)
m4_define([matrix_glib_major_minor_version], matrix_glib_major_version.matrix_glib_minor_version)
m4_define([matrix_glib_module_version], matrix_glib_lt_current)
m4_define([matrix_glib_api_version], [matrix_glib_major_version.0])
### Setup
# Initialise autoconf with project details, version
AC_INIT([MatrixGlib], matrix_glib_version,
[gergely@polonkai.eu], [matrix-glib])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_PREREQ([2.65])
AC_COPYRIGHT([Copyright (C) 2015,2016 Gergely Polonkai])
# Configure various files and settings for autoconf/automake
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([1.11 dist-xz no-define
no-dist-gzip tar-ustar -Wno-portability])
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_LIBTOOL
# Initialise libtool (handles library creation) with versions from above
LT_INIT(win32-dll)
PKG_PROG_PKG_CONFIG([0.21])
AC_SUBST([CFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([LDFLAGS])
AC_SUBST([LT_CURRENT], matrix_glib_lt_current)
AC_SUBST([LT_REVISION], matrix_glib_lt_revision)
AC_SUBST([LT_AGE], matrix_glib_lt_age)
AC_SUBST([MATRIX_GLIB_VERSION], matrix_glib_base_version)
### Dependencies
GLIB_REQUIRED=2.40.0
VALA_REQUIRED=0.30.0
LIBVALA_REQUIRED=0.30
GIO_REQUIRED=2.22
SOUP_REQUIRED=2.44.2
JSON_REQUIRED=0.16.2
# Check GLib
PKG_CHECK_MODULES([GLIB],
[glib-2.0 >= $GLIB_REQUIRED
gobject-2.0 >= $GLIB_REQUIRED])
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.25], [--flavour no-tmpl])
], [
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
# Check for GIO
PKG_CHECK_MODULES([GIO], [gio-2.0 >= $GIO_REQUIRED])
# Check for libSoup
PKG_CHECK_MODULES([SOUP], [libsoup-2.4 >= $SOUP_REQUIRED])
# Check for JSON-GLib
PKG_CHECK_MODULES([JSON], [json-glib-1.0 >= $JSON_REQUIRED])
# Check for GObject Introspection
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.32.0])
],[
AM_CONDITIONAL([HAVE_INTROSPECTION], false)
])
m4_ifdef([VALA_PROG_VAPIGEN], [
VALAC_CHECK([0.38], [0.38])
VALA_PROG_VAPIGEN([0.38])
AM_CONDITIONAL([HAVE_VAPIGEN], true)
],[
AM_CONDITIONAL([HAVE_VAPIGEN], false)
])
debug=no
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[compile with debugging support]),
[debug=$enableval], [debug=no])
AM_CONDITIONAL([DEBUG], [test $debug = yes])
if test x"$debug" = x"$enableval"; then
AC_DEFINE([DEBUG], [1], [Define as 1 if debugging should be enabled])
if test x"$cflags_set" != x"set"; then
case " $CFLAGS " in
*[[\ \ ]]-g[[\ \ ]]*) ;;
*)
CFLAGS="$CFLAGS -g"
if test x"$USE_MAINTAINER_MODE" = x"$enableval"; then
CFLAGS="$CFLAGS -O0"
fi
;;
esac
fi
else
AC_DEFINE([DEBUG], [0], [Define as 1 if debugging should be enabled])
fi
AC_SUBST([MATRIX_GLIB_MAJOR_VERSION], matrix_glib_major_version)
AC_SUBST([MATRIX_GLIB_MINOR_VERSION], matrix_glib_minor_version)
AC_SUBST([MATRIX_GLIB_MICRO_VERSION], matrix_glib_micro_version)
# This is used to identify a set of API compatible between versions
# - If new versions are compatible with the actual one, just leave
# this untouched
# - If new version breaks API change it in order to allow parallel
# installations with old versions. Change name of pc files to use
# a new API, too
AC_SUBST([MATRIX_GLIB_API_VERSION], matrix_glib_api_version)
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/matrix-version.h
src/matrix-glib-0.0.pc
docs/reference/matrix-glib-sdk/Makefile
])
AC_OUTPUT
# Print configuration summary
echo ""
echo " Configuration summary for Matrix-$MATRIX_GLIB_VERSION"
echo " Installation prefix: $prefix"
echo " Documentation: ${enable_gtk_doc}"
echo " Debug: $debug"
echo ""

1
docs/Makefile.am Normal file
View File

@@ -0,0 +1 @@
SUBDIRS =

View File

@@ -1,3 +0,0 @@
if get_option('gtk-doc')
subdir('reference')
endif

View File

@@ -0,0 +1,85 @@
# This is a blank Makefile.am for using gtk-doc.
# Copy this to your project's API docs directory and modify the variables to
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
# The name of the module, e.g. 'glib'.
DOC_MODULE=matrix-glib-sdk
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
#DOC_MODULE_VERSION=2
# The top-level XML file.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# Directories containing the source code.
# gtk-doc will search all .c and .h files beneath these paths
# for inline comments documenting functions and macros.
# e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk
DOC_SOURCE_DIR=$(top_srcdir)/src
# Extra options to pass to gtkdoc-scangobj. Normally not needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
MKDB_OPTIONS=--xml-mode --output-format=xml
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=
# Extra options to supply to gtkdoc-fixref. Normally not needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/src/*.h
CFILE_GLOB=$(top_srcdir)/src/*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
EXTRA_HFILES=
# Header files or dirs to ignore when scanning. Use base file/dir names
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
IGNORE_HFILES=utils.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=
# Extra files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.xml building.xml changes-2.0.xml
content_files=
# Files where gtk-doc abbrevations (#GtkWidget) are expanded
# e.g. expand_content_files=running.xml
expand_content_files=
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_srcdir)/src
GTKDOC_LIBS=$(top_builddir)/src/libmatrix-glib-0.0.la
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Comment this out if you want 'make check' to test you doc status
# and run some sanity checks
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = \
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
TESTS = $(GTKDOC_CHECK)
endif
-include $(top_srcdir)/git.mk

View File

@@ -3,14 +3,16 @@
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[ [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]> ]>
<book id="index"> <book id="index">
<bookinfo> <bookinfo>
<title>Matrix-GLib-SDK Reference Manual</title> <title>&package_name; Reference Manual</title>
<releaseinfo> <releaseinfo>
for Matrix-GLib-SDK 0.0.1. for &package_string;.
The latest version of this documentation can be found on-line at The latest version of this documentation can be found on-line at
<ulink role="online-location" url="https://gergely.polonkai.eu/matrxix-glib-sdk/">https://gergely.polonkai.eu/matrix-glib-sdk/</ulink>. <ulink role="online-location" url="http://[SERVER]/&package_name;/index.html">http://[SERVER]/&package_name;/</ulink>.
</releaseinfo> </releaseinfo>
</bookinfo> </bookinfo>
@@ -78,6 +80,11 @@
<xi:include href="xml/matrix-http-client.xml"/> <xi:include href="xml/matrix-http-client.xml"/>
</chapter> </chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full"> <index id="api-index-full">
<title>API Index</title> <title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>

View File

@@ -2,7 +2,9 @@
<FILE>matrix-api</FILE> <FILE>matrix-api</FILE>
<TITLE>MatrixAPI</TITLE> <TITLE>MatrixAPI</TITLE>
MATRIX_DEPRECATED_FOR MATRIX_DEPRECATED_FOR
MATRIX_TYPE_API
MatrixAPICallback MatrixAPICallback
MatrixAPIInterface
matrix_api_abort_pending matrix_api_abort_pending
matrix_api_get_3pids matrix_api_get_3pids
matrix_api_add_3pid matrix_api_add_3pid
@@ -72,17 +74,15 @@ matrix_api_get_turn_server
matrix_api_media_download matrix_api_media_download
matrix_api_media_thumbnail matrix_api_media_thumbnail
matrix_api_media_upload matrix_api_media_upload
matrix_api_get_devices
matrix_api_get_device
matrix_api_get_token matrix_api_get_token
matrix_api_set_token matrix_api_set_token
matrix_api_get_user_id matrix_api_get_user_id
matrix_api_set_user_id matrix_api_set_user_id
matrix_api_get_homeserver matrix_api_get_homeserver
matrix_api_set_homeserver matrix_api_set_homeserver
<SUBSECTION Standard>
MatrixAPI MatrixAPI
MATRIX_TYPE_API
MatrixAPIInterface
matrix_api_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>

View File

@@ -1,6 +0,0 @@
gnome.gtkdoc('matrix-glib-sdk',
main_xml : 'matrix-glib-sdk-docs.xml',
src_dir : join_paths(meson.source_root(), 'src'),
mkdb_args : ['--xml-mode', '--output-format=xml'],
ignore_headers : 'utils.h',
install : true)

View File

@@ -1 +0,0 @@
subdir('matrix-glib-sdk')

227
git.mk Normal file
View File

@@ -0,0 +1,227 @@
# git.mk
#
# Copyright 2009, Red Hat, Inc.
# Copyright 2010,2011 Behdad Esfahbod
# Written by Behdad Esfahbod
#
# Copying and distribution of this file, with or without modification,
# is permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# The latest version of this file can be downloaded from:
# https://raw.github.com/behdad/git.mk/master/git.mk
# Bugs, etc, should be reported upstream at:
# https://github.com/behdad/git.mk
#
# To use in your project, import this file in your git repo's toplevel,
# then do "make -f git.mk". This modifies all Makefile.am files in
# your project to -include git.mk. Remember to add that line to new
# Makefile.am files you create in your project, or just rerun the
# "make -f git.mk".
#
# This enables automatic .gitignore generation. If you need to ignore
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
# But think twice before doing that. If a file has to be in .gitignore,
# chances are very high that it's a generated file and should be in one
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
#
# The only case that you need to manually add a file to GITIGNOREFILES is
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
# or maintainer-clean-local make targets.
#
# Note that for files like editor backup, etc, there are better places to
# ignore them. See "man gitignore".
#
# If "make maintainer-clean" removes the files but they are not recognized
# by this script (that is, if "git status" shows untracked files still), send
# me the output of "git status" as well as your Makefile.am and Makefile for
# the directories involved and I'll diagnose.
#
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
# Makefile.am.sample in the git.mk git repo.
#
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
# not tarballs. It serves no useful purpose in tarballs and clutters the
# build dir.
#
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu.
#
# This makefile provides the following targets:
#
# - all: "make all" will build all gitignore files.
# - gitignore: makes all gitignore files in the current dir and subdirs.
# - .gitignore: make gitignore file for the current dir.
# - gitignore-recurse: makes all gitignore files in the subdirs.
#
# KNOWN ISSUES:
#
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
# submodule doesn't find us. If you have configure.{in,ac} files in
# subdirs, add a proxy git.mk file in those dirs that simply does:
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
# And add those files to git. See vte/gnome-pty-helper/git.mk for
# example.
#
git-all: git-mk-install
git-mk-install:
@echo Installing git makefile
@any_failed=; \
find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \
if grep 'include .*/git.mk' $$x >/dev/null; then \
echo $$x already includes git.mk; \
else \
failed=; \
echo "Updating $$x"; \
{ cat $$x; \
echo ''; \
echo '-include $$(top_srcdir)/git.mk'; \
} > $$x.tmp || failed=1; \
if test x$$failed = x; then \
mv $$x.tmp $$x || failed=1; \
fi; \
if test x$$failed = x; then : else \
echo Failed updating $$x; >&2 \
any_failed=1; \
fi; \
fi; done; test -z "$$any_failed"
.PHONY: git-all git-mk-install
### .gitignore generation
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
$(AM_V_GEN) \
{ \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
for x in \
$(DOC_MODULE)-decl-list.txt \
$(DOC_MODULE)-decl.txt \
tmpl/$(DOC_MODULE)-unused.sgml \
"tmpl/*.bak" \
xml html \
; do echo /$$x; done; \
fi; \
if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
for lc in $(DOC_LINGUAS); do \
for x in \
$(if $(DOC_MODULE),$(DOC_MODULE).xml) \
$(DOC_PAGES) \
$(DOC_INCLUDES) \
; do echo /$$lc/$$x; done; \
done; \
for x in \
$(_DOC_OMF_ALL) \
$(_DOC_DSK_ALL) \
$(_DOC_HTML_ALL) \
$(_DOC_MOFILES) \
$(DOC_H_FILE) \
"*/.xml2po.mo" \
"*/*.omf.out" \
; do echo /$$x; done; \
fi; \
if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \
for lc in $(HELP_LINGUAS); do \
for x in \
$(HELP_FILES) \
"$$lc.stamp" \
"$$lc.mo" \
; do echo /$$lc/$$x; done; \
done; \
fi; \
if test "x$(gsettings_SCHEMAS)" = x; then :; else \
for x in \
$(gsettings_SCHEMAS:.xml=.valid) \
$(gsettings__enum_file) \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/po/Makefile.in.in; then \
for x in \
po/Makefile.in.in \
po/Makefile.in \
po/Makefile \
po/POTFILES \
po/stamp-it \
po/.intltool-merge-cache \
"po/*.gmo" \
"po/*.mo" \
po/$(GETTEXT_PACKAGE).pot \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/configure; then \
for x in \
autom4te.cache \
configure \
config.h \
stamp-h1 \
libtool \
config.lt \
; do echo /$$x; done; \
fi; \
if test "x$(DEJATOOL)" = x; then :; else \
for x in \
$(DEJATOOL) \
; do echo /$$x.sum; echo /$$x.log; done; \
echo /site.exp; \
fi; \
for x in \
.gitignore \
$(GITIGNOREFILES) \
$(CLEANFILES) \
$(PROGRAMS) $(check_PROGRAMS) $(EXTRA_PROGRAMS) \
$(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \
$(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \
so_locations \
.libs _libs \
$(MOSTLYCLEANFILES) \
"*.$(OBJEXT)" \
"*.lo" \
$(DISTCLEANFILES) \
$(am__CONFIG_DISTCLEAN_FILES) \
$(CONFIG_CLEAN_FILES) \
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
"*.tab.c" \
$(MAINTAINERCLEANFILES) \
$(BUILT_SOURCES) \
$(DEPDIR) \
Makefile \
Makefile.in \
"*.orig" \
"*.rej" \
"*.bak" \
"*~" \
".*.sw[nop]" \
".dirstamp" \
; do echo /$$x; done; \
} | \
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
sed 's@/[.]/@/@g' | \
LC_ALL=C sort | uniq > $@.tmp && \
mv $@.tmp $@;
all: $(srcdir)/.gitignore gitignore-recurse-maybe
gitignore: $(srcdir)/.gitignore gitignore-recurse
gitignore-recurse-maybe:
@for subdir in $(DIST_SUBDIRS); do \
case " $(SUBDIRS) " in \
*" $$subdir "*) :;; \
*) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse-maybe || echo "Skipping $$subdir");; \
esac; \
done
gitignore-recurse:
@for subdir in $(DIST_SUBDIRS); do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
done
maintainer-clean: gitignore-clean
gitignore-clean:
-rm -f $(srcdir)/.gitignore
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe

76
m4/valac.m4 Normal file
View File

@@ -0,0 +1,76 @@
dnl vapigen.m4
dnl
dnl Copyright 2014 Daniel Espinosa
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# VALAC_CHECK([VERSION], [API_VERSION])
# --------------------------------------
# Check valac existence and version.
m4_define([_VALAC_CHECK_INTERNAL],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AS_IF([ test "x$2" = "x" ], [
AM_PROG_VALAC($1)
AS_IF([ test "x$VALAC" = "xno"], [
check_prog=no
AC_MSG_ERROR([valac is not installed])
], [
check_prog=yes
VALAC_VERSION=`$VALAC --api-version`
VAPIDIR=$datadir/vala-$VALAC_VERSION/vapi
VAPIDIR_UNVERSIONED=$datadir/vala-$VALAC_VERSION/vapi
])
], [
AS_IF([ test "x$1" = "x"], [
vala_pkg="libvala-$2"
], [
vala_pkg="libvala-$2 >= $1"
])
AC_MSG_CHECKING([for $vala_pkg])
PKG_CHECK_EXISTS([ $vala_pkg ], [
vala_pkg_found=yes
VAPIGEN=`$PKG_CONFIG --variable=vapigen libvala-$2`
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir libvala-$2`/vala/Makefile.vapigen
VAPIDIR=`$PKG_CONFIG --variable=vapidir libvala-$2`
GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect libvala-$2`
vala_datadir=`$PKG_CONFIG --variable=datadir libvala-$2`
VAPIDIR_UNVERSIONED=$vala_datadir/vala/vapi
VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=vala_gen_introspect libvala-$2`
], [
vala_pkg_found=no
AC_MSG_ERROR([no package libvala-$2 is installed])
])
AC_MSG_RESULT([$vala_pkg_found])
])
AC_SUBST([VAPIGEN])
AC_SUBST([VAPIGEN_VAPIDIR])
AC_SUBST([VAPIDIR])
AC_SUBST([VAPIDIR_UNVERSIONED])
AC_SUBST([VAPIGEN_MAKEFILE])
AC_SUBST([GEN_INTROSPECT])
AC_SUBST([VALA_GEN_INTROSPECT])
AC_SUBST([VALAC_VERSION])
])
dnl Check VAPIGEN
# VALAC_CHECK([VERSION], [API_VERSION], [DEFAULT])
# --------------------------------------
# Check vapigen existence and version.
AC_DEFUN([VALAC_CHECK],
[
_VALAC_CHECK_INTERNAL($1,$2,$3)
]
)

View File

@@ -1,72 +0,0 @@
project('matrix-glib', 'c', version : '0.0.1')
gnome = import('gnome')
pkg = import('pkgconfig')
sdk_version = meson.project_version()
ver_arr = sdk_version.split('.')
matrix_glib_major_version = ver_arr[0]
matrix_glib_minor_version = ver_arr[1]
matrix_glib_micro_version = ver_arr[2]
matrix_glib_nano_version = '0'
lt_current = ver_arr[0]
matrix_glib_lt_revision = '0'
matrix_glib_lt_age = '0'
matrix_glib_base_version = meson.project_version()
matrix_glib_full_version = meson.project_version()
if matrix_glib_nano_version != '0'
matrix_glib_full_version += '.' + matrix_glib_nano_version
endif
matrix_glib_released = '0'
if matrix_glib_released == '1'
matrix_glib_maybe_datestamp = ''
else
datestamp = run_command('date', '+.%Y%m%d')
matrix_glib_maybe_datestamp = datestamp.stdout().strip()
endif
matrix_glib_version = matrix_glib_full_version + matrix_glib_maybe_datestamp
matrix_glib_major_minor_version = matrix_glib_major_version + '.' + matrix_glib_minor_version
matrix_glib_module_version = lt_current
matrix_glib_api_version = matrix_glib_major_version + '.0'
glib_required = '>= 2.40.0'
vala_required = '>= 0.30.0'
libvala_required = '>= 0.30'
gio_required = '>= 2.22'
soup_required = '>= 2.44.2'
json_required = '>= 0.16.2'
glib = dependency('glib-2.0', version : glib_required)
gobject = dependency('gobject-2.0', version : glib_required)
gio = dependency('gio-2.0', version : gio_required)
soup = dependency('libsoup-2.4', version : soup_required)
json = dependency('json-glib-1.0', version : json_required)
conf = configuration_data()
if get_option('debug')
conf.set('DEBUG', 1)
add_global_arguments('-g', language : 'c')
if get_option('maintainer-mode')
add_global_arguments('-O0', language : 'c')
endif
else
conf.set('DEBUG', 0)
endif
configure_file(output : 'config.h',
configuration : conf)
config_inc = include_directories('.')
subdir('src')
subdir('docs')

View File

@@ -1,24 +0,0 @@
option('debug',
type : 'boolean',
value : false,
description : 'compile with debugging support')
option('maintainer-mode',
type : 'boolean',
value : false,
description : 'enable maintainer mode')
option('gtk-doc',
type : 'boolean',
value : false,
description : 'generate API reference')
option('introspection',
type : 'boolean',
value : true,
description : 'generate GObject Introspection data')
option('test-clients',
type : 'boolean',
value : false,
description : 'compile the test clients')

283
src/Makefile.am Normal file
View File

@@ -0,0 +1,283 @@
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Matrix-GLib\" -D__MATRIX_GLIB_SDK_COMPILATION
# Empty variables for elements to be added later
CLEANFILES =
BUILT_SOURCES =
EXTRA_DIST =
# Libraries to create
lib_LTLIBRARIES = libmatrix-glib-0.0.la
AM_CPPFLAGS += \
-include $(CONFIG_HEADER) \
-I$(top_srcdir) \
-g \
-Wall \
$(GLIB_CFLAGS) \
$(GOBJECT_CFLAGS) \
$(SOUP_CFLAGS) \
$(JSON_CFLAGS) \
$(NULL)
# Binaries to create
bin_PROGRAMS = test-api-client test-client
EVENT_H_FILES = \
matrix-event-base.h \
matrix-event-call-base.h \
matrix-event-call-answer.h \
matrix-event-call-hangup.h \
matrix-event-call-invite.h \
matrix-event-call-candidates.h \
$(NULL)
MESSAGE_H_FILES = \
matrix-message-base.h \
matrix-message-text.h \
matrix-message-location.h \
matrix-message-emote.h \
matrix-message-file.h \
matrix-message-image.h \
matrix-message-audio.h \
matrix-message-video.h \
matrix-message-notice.h \
matrix-event-room-base.h \
matrix-event-state-base.h \
matrix-event-tag.h \
matrix-event-presence.h \
matrix-event-room-member.h \
matrix-event-room-topic.h \
matrix-event-room-aliases.h \
matrix-event-room-avatar.h \
matrix-event-room-name.h \
matrix-event-room-message.h \
matrix-event-room-history-visibility.h \
matrix-event-room-join-rules.h \
matrix-event-room-canonical-alias.h \
matrix-event-room-create.h \
matrix-event-room-power-levels.h \
matrix-event-room-guest-access.h \
matrix-event-room-message-feedback.h \
matrix-event-room-redaction.h \
matrix-event-room-third-party-invite.h \
matrix-event-typing.h \
matrix-event-receipt.h \
$(NULL)
INST_H_SRC_FILES = \
matrix-types.h \
matrix-compacts.h \
matrix-api.h \
matrix-http-api.h \
matrix-client.h \
matrix-http-client.h \
$(EVENT_H_FILES) \
$(MESSAGE_H_FILES) \
utils.h \
matrix-profile.h \
matrix-room.h \
$(NULL)
INST_H_BUILT_FILES = \
matrix-version.h \
matrix-enumtypes.h \
matrix-marshalers.h \
$(NULL)
matrix_enum_headers = \
matrix-types.h \
$(NULL)
libmatrix_glib_0_0_la_SOURCES = \
$(INST_H_BUILT_FILES) \
matrix-marshalers.c \
matrix-event-types.c \
matrix-version.c \
matrix-api.c \
matrix-http-api.c \
matrix-client.c \
matrix-http-client.c \
matrix-types.c \
matrix-compacts.c \
matrix-event-base.c \
matrix-event-call-base.c \
matrix-event-call-answer.c \
matrix-event-call-hangup.c \
matrix-event-call-invite.c \
matrix-event-call-candidates.c \
matrix-message-base.c \
matrix-message-text.c \
matrix-message-location.c \
matrix-message-emote.c \
matrix-message-file.c \
matrix-message-image.c \
matrix-message-audio.c \
matrix-message-video.c \
matrix-message-notice.c \
matrix-event-tag.c \
matrix-event-presence.c \
matrix-event-room-member.c \
matrix-event-typing.c \
matrix-event-room-base.c \
matrix-event-state-base.c \
matrix-event-receipt.c \
matrix-event-room-topic.c \
matrix-event-room-aliases.c \
matrix-event-room-avatar.c \
matrix-event-room-name.c \
matrix-event-room-message.c \
matrix-event-room-history-visibility.c \
matrix-event-room-join-rules.c \
matrix-event-room-canonical-alias.c \
matrix-event-room-create.c \
matrix-event-room-power-levels.c \
matrix-event-room-message-feedback.c \
matrix-event-room-redaction.c \
matrix-event-room-guest-access.c \
matrix-event-room-third-party-invite.c \
matrix-profile.c \
matrix-room.c \
utils.c \
matrix-enumtypes.c \
$(INST_H_SRC_FILES) \
$(NULL)
libmatrix_glib_0_0_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GOBJECT_CFLAGS) \
$(SOUP_CFLAGS) \
$(JSON_CFLAGS) \
$(NULL)
libmatrix_glib_0_0_la_LIBADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(SOUP_LIBS) \
$(JSON_LIBS) \
$(NULL)
libmatrix_glib_0_0_la_LDFLAGS = \
-version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)"
BUILT_SOURCES += \
matrix-enumtypes.c \
matrix-enumtypes.h \
matrix-marshalers.c \
matrix-marshalers.h \
$(NULL)
test_api_client_SOURCES = test-api-client.c
test_api_client_CFLAGS = $(libmatrix_glib_0_0_la_CFLAGS) $(AM_CFLAGS)
test_api_client_LDADD = \
$(libmatrix_glib_0_0_la_LIBADD) \
libmatrix-glib-$(MATRIX_GLIB_API_VERSION).la \
$(NULL)
test_client_SOURCES = test-client.c
test_client_CFLAGS = $(libmatrix_glib_0_0_la_CFLAGS) $(AM_CFLAGS)
test_client_LDADD = \
$(libmatrix_glib_0_0_la_LIBADD) \
libmatrix-glib-$(MATRIX_GLIB_API_VERSION).la \
$(NULL)
CLEANFILES += $(BUILT_SOURCES)
EXTRA_DIST += \
matrix-enumtypes.h.template \
matrix-enumtypes.c.template \
matrix-marshalers.list \
$(INST_H_SRC_FILES) \
$(NULL)
matrix-enumtypes.h: $(matrix_enum_headers) matrix-enumtypes.h.template
$(AM_V_GEN) $(GLIB_MKENUMS) --template $(filter %.template,$^) \
$(filter-out %.template,$^) > $@.tmp \
&& mv $@.tmp $@
matrix-enumtypes.c: $(matrix_enum_headers) matrix-enumtypes.h matrix-enumtypes.c.template
$(AM_V_GEN) $(GLIB_MKENUMS) --template $(filter %.template,$^) \
$(filter-out %.template,$^) > $@.tmp \
&& mv $@.tmp $@
matrix-marshalers.h: stamp-matrix-marshalers
@true
stamp-matrix-marshalers: matrix-marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_matrix_marshal \
$(srcdir)/matrix-marshalers.list \
--header \
--valist-marshallers >> xgen-gmlh \
&& (cmp -s xgen-gmlh matrix-marshalers.h \
|| cp xgen-gmlh matrix-marshalers.h) \
&& rm -f xgen-gmlh \
&& echo timestamp > $(@F)
matrix-marshalers.c: matrix-marshalers.h
$(AM_V_GEN) (echo "#include \"matrix-marshalers.h\""; \
echo "#undef G_ENABLE_DEBUG"; \
$(GLIB_GENMARSHAL) --prefix=_matrix_marshal \
$(srcdir)/matrix-marshalers.list \
--body \
--valist-marshallers) >> xgen-gmlc \
&& cp xgen-gmlc matrix-marshalers.c \
&& rm -f xgen-gmlc
CLEANFILES += stamp-matrix-marshalers
libmatrix_glib_dlname = \
`$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" libmatrix-glib-0.0.la`¬
if HAVE_INTROSPECTION
include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = \
Matrix-$(MATRIX_GLIB_API_VERSION).gir \
$(NULL)
Matrix-$(MATRIX_GLIB_API_VERSION).gir: libmatrix-glib-0.0.la
Matrix_0_0_gir_FILES = $(INST_H_SRC_FILE) $(INST_H_BUILT_FILES) $(filter %.c,$(libmatrix_glib_0_0_la_SOURCES))
Matrix_0_0_gir_LIBS = libmatrix-glib-0.0.la
Matrix_0_0_gir_SCANNERFLAGS = --identifier-prefix=Matrix --symbol-prefix=matrix --warn-all
Matrix_0_0_gir_INCLUDES = GLib-2.0 GObject-2.0
Matrix_0_0_gir_CFLAGS = -D_MATRIX_GLIB_SDK_COMPILATION -I$(top_srcdir) -I$(srcdir) -I$(builddir) $(AM_CPPFLAGS)
Matrix_0_0_gir_EXPORT_PACKAGES = MatrixGLib
girdir = $(INTROSPECTION_GIRDIR)
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(INTROSPECTION_TYPELIBDIR)
typelib_DATA = Matrix-$(MATRIX_GLIB_API_VERSION).typelib
headerdir = $(includedir)/matrix-glib-$(MATRIX_GLIB_API_VERSION)
header_DATA = \
$(INST_H_SRC_FILES) \
$(INST_H_BUILT_FILES) \
$(NULL)
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
if HAVE_VAPIGEN
include $(VAPIGEN_MAKEFILE)
VAPIGEN_VAPIS = Matrix-$(MATRIX_GLIB_API_VERSION).vapi
Matrix_0_0_vapi_DEPS = \
json-glib-1.0 \
gio-2.0 \
libsoup-2.4 \
$(NULL)
Matrix_0_0_vapi_GIRS = $(INTROSPECTION_GIRS)
Matrix_0_0_vapi_FILES = $(INTROSPECTION_GIRS)
vapidir = $(datadir)/vala/vapi
vapi_DATA = $(VAPIGEN_VAPIS)
endif
endif
pkgconfig_in = matrix-glib-$(MATRIX_GLIB_API_VERSION).pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pkgconfig_in:.in=)
EXTRA_DIST += $(pkgconfig_in)

3
src/Matrix-0.0.deps Normal file
View File

@@ -0,0 +1,3 @@
gio-2.0
Json-1.0
libsoup-2.4

View File

@@ -102,6 +102,8 @@
* @media_download: the virtual function pointer to matrix_api_media_download() * @media_download: the virtual function pointer to matrix_api_media_download()
* @media_thumbnail: the virtual function pointer to matrix_api_media_thumbnail() * @media_thumbnail: the virtual function pointer to matrix_api_media_thumbnail()
* @media_upload: the virtual function pointer to matrix_api_media_upload() * @media_upload: the virtual function pointer to matrix_api_media_upload()
* @get_devices: the virtual function pointer to matrix_api_get_devices()
* @get_device: the virtual function pointer to matrix_api_get_device()
* @get_token: the virtual function pointer to matrix_api_get_token() * @get_token: the virtual function pointer to matrix_api_get_token()
* @set_token: the virtual function pointer to matrix_api_set_token() * @set_token: the virtual function pointer to matrix_api_set_token()
* @get_user_id: the virtual function pointer to matrix_api_get_user_id() * @get_user_id: the virtual function pointer to matrix_api_get_user_id()
@@ -138,7 +140,7 @@ matrix_api_abort_pending(MatrixAPI *matrix_api)
/** /**
* matrix_api_get_3pids: * matrix_api_get_3pids:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the callback function to call when the request is finished * @callback: the callback function to call when the request is finished
* @user_data: user data to pass to the callback function * @user_data: user data to pass to the callback function
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -168,7 +170,7 @@ matrix_api_get_3pids(MatrixAPI *matrix_api,
* @bind_creds: whether the homeserver should also bind this third party identifier to the * @bind_creds: whether the homeserver should also bind this third party identifier to the
* accounts Matrix ID with the passed Identity Server. * accounts Matrix ID with the passed Identity Server.
* @threepid_creds: (not nullable): the credentials to associate with the account * @threepid_creds: (not nullable): the credentials to associate with the account
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -193,7 +195,7 @@ matrix_api_add_3pid(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @session: optional session token provided by the server * @session: optional session token provided by the server
* @login_type: the login type the client is trying to complete * @login_type: the login type the client is trying to complete
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -216,7 +218,7 @@ matrix_api_deactivate_account(MatrixAPI *matrix_api,
* matrix_api_change_password: * matrix_api_change_password:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @new_password: (not nullable): the new password for the account * @new_password: (not nullable): the new password for the account
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -238,7 +240,7 @@ matrix_api_change_password(MatrixAPI *matrix_api,
/** /**
* matrix_api_whoami: * matrix_api_whoami:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -259,7 +261,7 @@ matrix_api_whoami(MatrixAPI *api,
* matrix_api_get_profile: * matrix_api_get_profile:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose profile to get * @user_id: (not nullable): the user whose profile to get
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -282,7 +284,7 @@ matrix_api_get_profile(MatrixAPI *matrix_api,
* matrix_api_get_avatar_url: * matrix_api_get_avatar_url:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose avatar URL to get * @user_id: (not nullable): the user whose avatar URL to get
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -304,7 +306,7 @@ matrix_api_get_avatar_url(MatrixAPI *matrix_api,
/** /**
* matrix_api_set_avatar_url: * matrix_api_set_avatar_url:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_id: (not nullable): the user whose avatar URL to set * @user_id: (not nullable): the user whose avatar URL to set
* @avatar_url: the avatar URL info * @avatar_url: the avatar URL info
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
@@ -330,7 +332,7 @@ matrix_api_set_avatar_url(MatrixAPI *matrix_api,
* matrix_api_get_display_name: * matrix_api_get_display_name:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose display name to get * @user_id: (not nullable): the user whose display name to get
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -354,7 +356,7 @@ matrix_api_get_display_name(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose display name to set * @user_id: (not nullable): the user whose display name to set
* @display_name: the display name info * @display_name: the display name info
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -383,7 +385,7 @@ matrix_api_set_display_name(MatrixAPI *matrix_api,
* @username: the local part of the desired Matrix ID. If omitted, the server will generate a * @username: the local part of the desired Matrix ID. If omitted, the server will generate a
* local part * local part
* @password: (not nullable): the desired password for the account * @password: (not nullable): the desired password for the account
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -407,10 +409,6 @@ matrix_api_register_account(MatrixAPI *matrix_api,
MATRIX_API_GET_IFACE(matrix_api)->register_account(matrix_api, callback, user_data, account_kind, bind_email, username, password, error); MATRIX_API_GET_IFACE(matrix_api)->register_account(matrix_api, callback, user_data, account_kind, bind_email, username, password, error);
} }
/**
* matrix_api_register_account_email:
* @callback: (scope async): the function to call when the request is finished
*/
void void
matrix_api_register_account_email(MatrixAPI *api, matrix_api_register_account_email(MatrixAPI *api,
const gchar *id_server, const gchar *id_server,
@@ -438,7 +436,7 @@ matrix_api_register_account_email(MatrixAPI *api,
* @event_type: (not nullable): the event type of the account data to set. Custom types * @event_type: (not nullable): the event type of the account data to set. Custom types
* should be namespaced to avoid clashes * should be namespaced to avoid clashes
* @content: (not nullable): the content of the account data * @content: (not nullable): the content of the account data
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -469,7 +467,7 @@ matrix_api_set_account_data(MatrixAPI *matrix_api,
* @user_id: (not nullable): the ID of the user to get the tags for. An access token must be * @user_id: (not nullable): the ID of the user to get the tags for. An access token must be
* set, and it must be authorised to make requests for this user ID * set, and it must be authorised to make requests for this user ID
* @room_id: (not nullable): the room to get tags for * @room_id: (not nullable): the room to get tags for
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -496,7 +494,7 @@ matrix_api_get_room_tags(MatrixAPI *matrix_api,
* @user_id: (not nullable): the id of the user to remove a tag for * @user_id: (not nullable): the id of the user to remove a tag for
* @room_id: (not nullable): the id of the room to remove the tag from * @room_id: (not nullable): the id of the room to remove the tag from
* @tag: (not nullable): the tag to remove * @tag: (not nullable): the tag to remove
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -526,7 +524,7 @@ matrix_api_delete_room_tag(MatrixAPI *matrix_api,
* @room_id: (not nullable): the ID of the room to add the tag for * @room_id: (not nullable): the ID of the room to add the tag for
* @tag: (not nullable): the tag to add * @tag: (not nullable): the tag to add
* @content: extra data for the tag, e.g. ordering * @content: extra data for the tag, e.g. ordering
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -554,7 +552,7 @@ matrix_api_add_room_tag(MatrixAPI *matrix_api,
* matrix_api_whois: * matrix_api_whois:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user ID to look up * @user_id: (not nullable): the user ID to look up
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -576,7 +574,7 @@ matrix_api_whois(MatrixAPI *matrix_api,
/** /**
* matrix_api_versions: * matrix_api_versions:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -608,7 +606,7 @@ matrix_api_versions(MatrixAPI *matrix_api,
* @n_invitees: the length of @invitees * @n_invitees: the length of @invitees
* @invite_3pids: a list of 3rd party credentials to invite to the new room * @invite_3pids: a list of 3rd party credentials to invite to the new room
* @n_invite_3pids: the length of @invite_3pids * @n_invite_3pids: the length of @invite_3pids
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -641,7 +639,7 @@ matrix_api_create_room(MatrixAPI *matrix_api,
* matrix_api_delete_room_alias: * matrix_api_delete_room_alias:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_alias: (not nullable): the alias name to remove * @room_alias: (not nullable): the alias name to remove
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -666,7 +664,7 @@ matrix_api_delete_room_alias(MatrixAPI *matrix_api,
/** /**
* matrix_api_get_joined_rooms: * matrix_api_get_joined_rooms:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -687,7 +685,7 @@ matrix_api_get_joined_rooms(MatrixAPI *api,
* matrix_api_get_room_id: * matrix_api_get_room_id:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_alias: (not nullable): the room alias * @room_alias: (not nullable): the room alias
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -711,7 +709,7 @@ matrix_api_get_room_id(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to add this alias to * @room_id: (not nullable): the room ID to add this alias to
* @room_alias: (not nullable): the room alias to set * @room_alias: (not nullable): the room alias to set
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -737,7 +735,7 @@ matrix_api_create_room_alias(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @from_token: events will be listed from this token * @from_token: events will be listed from this token
* @timeout: timeout of the request * @timeout: timeout of the request
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -763,7 +761,7 @@ matrix_api_event_stream(MatrixAPI *matrix_api,
* matrix_api_get_event: * matrix_api_get_event:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @event_id: (not nullable): the event ID to get * @event_id: (not nullable): the event ID to get
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -787,7 +785,7 @@ matrix_api_get_event(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @limit: the maximum number of events to get * @limit: the maximum number of events to get
* @archived: whether to include rooms that the user has left * @archived: whether to include rooms that the user has left
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -813,7 +811,7 @@ matrix_api_initial_sync(MatrixAPI *matrix_api,
* @event_id: (not nullable): the event to get context around * @event_id: (not nullable): the event to get context around
* @limit: the maximum number of events to get. If 0, a default value is used(10, according * @limit: the maximum number of events to get. If 0, a default value is used(10, according
* to the specification) * to the specification)
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -837,7 +835,7 @@ matrix_api_get_event_context(MatrixAPI *matrix_api,
* matrix_api_initial_sync_room: * matrix_api_initial_sync_room:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room to get the data for * @room_id: (not nullable): the room to get the data for
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -860,7 +858,7 @@ matrix_api_initial_sync_room(MatrixAPI *matrix_api,
* matrix_api_list_room_members: * matrix_api_list_room_members:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room to get the member events for * @room_id: (not nullable): the room to get the member events for
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -888,7 +886,7 @@ matrix_api_list_room_members(MatrixAPI *matrix_api,
* @direction: the direction of the returned events * @direction: the direction of the returned events
* @limit: the maximum number of events to return. If 0, a default value will be used(10, * @limit: the maximum number of events to return. If 0, a default value will be used(10,
* according to the specification * according to the specification
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -919,7 +917,7 @@ matrix_api_list_room_messages(MatrixAPI *matrix_api,
* @event_id: (not nullable): the event ID to acknowledge up to * @event_id: (not nullable): the event ID to acknowledge up to
* @receipt: (not nullable): extra receipt information to attach. Note that the server will automatically * @receipt: (not nullable): extra receipt information to attach. Note that the server will automatically
* attach the `ta` field * attach the `ta` field
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -951,7 +949,7 @@ matrix_api_send_event_receipt(MatrixAPI *matrix_api,
* @txn_id: (not nullable): the transaction ID for this event. Clients should generate a * @txn_id: (not nullable): the transaction ID for this event. Clients should generate a
* unique ID; it will be used by the server to ensure idempotency of requests * unique ID; it will be used by the server to ensure idempotency of requests
* @reason: the reason for the event being redacted * @reason: the reason for the event being redacted
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -982,7 +980,7 @@ matrix_api_redact_event(MatrixAPI *matrix_api,
/** /**
* matrix_api_send_event: * matrix_api_send_event:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @room_id: the room to send the event to * @room_id: the room to send the event to
* @event_type: the type of event to send * @event_type: the type of event to send
* @txn_id: the transaction ID for this event. Clients should generate a unique ID; it will be * @txn_id: the transaction ID for this event. Clients should generate a unique ID; it will be
@@ -1019,7 +1017,7 @@ matrix_api_send_event(MatrixAPI *matrix_api,
* @event_type: the type of state to look up * @event_type: the type of state to look up
* @state_key: the key of the state to look up. If @event_type is %NULL, this parameter is * @state_key: the key of the state to look up. If @event_type is %NULL, this parameter is
* ignored * ignored
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1058,7 +1056,7 @@ matrix_api_get_room_state(MatrixAPI *matrix_api,
* @event_type: the type of state to look up * @event_type: the type of state to look up
* @state_key: the key of the state to look up. If @event_type is %NULL, this parameter is ignored * @state_key: the key of the state to look up. If @event_type is %NULL, this parameter is ignored
* @content: (not nullable): the content of the state event * @content: (not nullable): the content of the state event
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1102,7 +1100,7 @@ matrix_api_send_state_event(MatrixAPI *matrix_api,
* @room_id: (not nullable): the room in which the user is typing * @room_id: (not nullable): the room in which the user is typing
* @timeout: the length of time in milliseconds to mark this user as typing * @timeout: the length of time in milliseconds to mark this user as typing
* @typing: whether the user is typing or not. If %FALSE, @timeout can be omitted (ie. set to 0) * @typing: whether the user is typing or not. If %FALSE, @timeout can be omitted (ie. set to 0)
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1136,7 +1134,7 @@ matrix_api_notify_room_typing(MatrixAPI *matrix_api,
* @set_presence: controls whether the client is automatically marked as online by polling * @set_presence: controls whether the client is automatically marked as online by polling
* this API. * this API.
* @timeout: the maximum time to poll in milliseconds * @timeout: the maximum time to poll in milliseconds
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1168,7 +1166,7 @@ matrix_api_sync(MatrixAPI *matrix_api,
* specifying one with matrix_api_set_token() or requested from the server via * specifying one with matrix_api_set_token() or requested from the server via
* matrix_api_register_account() or matrix_api_login()). * matrix_api_register_account() or matrix_api_login()).
* @filter: (not nullable): the filter to upload * @filter: (not nullable): the filter to upload
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1195,7 +1193,7 @@ matrix_api_create_filter(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user ID to download a filter from * @user_id: (not nullable): the user ID to download a filter from
* @filter_id: (not nullable): the filter ID to download * @filter_id: (not nullable): the filter ID to download
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1219,7 +1217,7 @@ matrix_api_download_filter(MatrixAPI *matrix_api,
/** /**
* matrix_api_join_room_id_or_alias: * matrix_api_join_room_id_or_alias:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the reuest is finished * @callback: the function to call when the reuest is finished
* @room_id_or_alias: (not nullable): the ID or alias of a room to join * @user_data: user data to be passed to @callback * @room_id_or_alias: (not nullable): the ID or alias of a room to join * @user_data: user data to be passed to @callback
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
@@ -1242,7 +1240,7 @@ matrix_api_join_room_id_or_alias(MatrixAPI *matrix_api,
/** /**
* matrix_api_ban_user: * matrix_api_ban_user:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @room_id: (not nullable): the room ID where the user should be banned * @room_id: (not nullable): the room ID where the user should be banned
* @user_id: (not nullable): the user ID to ban * @user_id: (not nullable): the user ID to ban
* @reason: the reason of the ban * @reason: the reason of the ban
@@ -1271,7 +1269,7 @@ matrix_api_ban_user(MatrixAPI *matrix_api,
* matrix_api_forget_room: * matrix_api_forget_room:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to forget * @room_id: (not nullable): the room ID to forget
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1302,7 +1300,7 @@ matrix_api_forget_room(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: the room ID to which to invite the user * @room_id: the room ID to which to invite the user
* @credential: (not nullable): a {@link Matrix.3PidCredential} that identifies a user to invite * @credential: (not nullable): a {@link Matrix.3PidCredential} that identifies a user to invite
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1332,7 +1330,7 @@ matrix_api_invite_user_3rdparty(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to invite the user to * @room_id: (not nullable): the room ID to invite the user to
* @user_id: (not nullable): the user ID to invite * @user_id: (not nullable): the user ID to invite
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1357,7 +1355,7 @@ matrix_api_invite_user(MatrixAPI *matrix_api,
* matrix_api_join_room: * matrix_api_join_room:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to join to * @room_id: (not nullable): the room ID to join to
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1382,7 +1380,7 @@ matrix_api_join_room(MatrixAPI *matrix_api,
* @room_id: (not nullable): the room ID to kick the user from * @room_id: (not nullable): the room ID to kick the user from
* @user_id: the user ID to kick from the room * @user_id: the user ID to kick from the room
* @reason: a reason * @reason: a reason
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1407,7 +1405,7 @@ matrix_api_kick_user(MatrixAPI *matrix_api,
* matrix_api_leave_room: * matrix_api_leave_room:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to kick the user from * @room_id: (not nullable): the room ID to kick the user from
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1431,7 +1429,7 @@ matrix_api_leave_room(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @room_id: (not nullable): the room ID to unban the user from * @room_id: (not nullable): the room ID to unban the user from
* @user_id: the user ID to unban from the room * @user_id: the user ID to unban from the room
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1456,7 +1454,7 @@ matrix_api_unban_user(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @login_type: the login type to use * @login_type: the login type to use
* @content: parameters to pass for the login request * @content: parameters to pass for the login request
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1481,7 +1479,7 @@ matrix_api_login(MatrixAPI *matrix_api,
/** /**
* matrix_api_logout: * matrix_api_logout:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1502,7 +1500,7 @@ matrix_api_logout(MatrixAPI *matrix_api,
* matrix_api_get_presence_list: * matrix_api_get_presence_list:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose presence list should be retrieved * @user_id: (not nullable): the user whose presence list should be retrieved
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1529,7 +1527,7 @@ matrix_api_get_presence_list(MatrixAPI *matrix_api,
* @n_drop_ids: the length of @drop_ids * @n_drop_ids: the length of @drop_ids
* @invite_ids: a list of user IDs to add to the list * @invite_ids: a list of user IDs to add to the list
* @n_invite_ids: the length of @invite_ids * @n_invite_ids: the length of @invite_ids
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1566,7 +1564,7 @@ matrix_api_update_presence_list(MatrixAPI *matrix_api,
* matrix_api_get_presence: * matrix_api_get_presence:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @user_id: (not nullable): the user whose presence list is being modified * @user_id: (not nullable): the user whose presence list is being modified
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1591,7 +1589,7 @@ matrix_api_get_presence(MatrixAPI *matrix_api,
* @user_id: (not nullable): the user whose presence list is being modified * @user_id: (not nullable): the user whose presence list is being modified
* @presence: the new presence state * @presence: the new presence state
* @status_message: a status message attached to this state * @status_message: a status message attached to this state
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1615,7 +1613,7 @@ matrix_api_set_presence(MatrixAPI *matrix_api,
/** /**
* matrix_api_list_public_rooms: * matrix_api_list_public_rooms:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1632,7 +1630,7 @@ matrix_api_list_public_rooms(MatrixAPI *matrix_api, MatrixAPICallback callback,
/** /**
* matrix_api_get_pushers: * matrix_api_get_pushers:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1653,7 +1651,7 @@ matrix_api_get_pushers(MatrixAPI *matrix_api,
* matrix_api_update_pusher: * matrix_api_update_pusher:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @pusher: (not nullable): a #MatrixPusher * @pusher: (not nullable): a #MatrixPusher
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1678,7 +1676,7 @@ matrix_api_update_pusher(MatrixAPI *matrix_api,
* @limit: Limit on the number of events to return in the request. Set to 0 for no limit * @limit: Limit on the number of events to return in the request. Set to 0 for no limit
* @filter: (nullable): Allows basic filtering of the events returned. Set it to `"highlight"` to * @filter: (nullable): Allows basic filtering of the events returned. Set it to `"highlight"` to
* return only events where the notification had the highlight tweak set. * return only events where the notification had the highlight tweak set.
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1701,7 +1699,7 @@ matrix_api_get_notifications(MatrixAPI *api,
/** /**
* matrix_api_get_pushrules: * matrix_api_get_pushrules:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1725,7 +1723,7 @@ matrix_api_get_pushrules(MatrixAPI *matrix_api,
* `device/&lt;profile tag&gt;` for rules for a given `profile tag` * `device/&lt;profile tag&gt;` for rules for a given `profile tag`
* @kind: the kind of rule * @kind: the kind of rule
* @rule_id: (not nullable): an identifier for the rule * @rule_id: (not nullable): an identifier for the rule
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1754,7 +1752,7 @@ matrix_api_delete_pushrule(MatrixAPI *matrix_api,
* `device/&lt;profile tag&gt;` for rules for a given `profile tag`. * `device/&lt;profile tag&gt;` for rules for a given `profile tag`.
* @kind: the kind of rule * @kind: the kind of rule
* @rule_id: (not nullable): an identifier for the rule * @rule_id: (not nullable): an identifier for the rule
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1790,7 +1788,7 @@ matrix_api_get_pushrule(MatrixAPI *matrix_api,
* @conditions: the conditions that must hold true for an event for a rule to be applied. * @conditions: the conditions that must hold true for an event for a rule to be applied.
* A rule with no conditions always matches * A rule with no conditions always matches
* @n_conditions: the length of @conditions * @n_conditions: the length of @conditions
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1827,7 +1825,7 @@ matrix_api_add_pushrule(MatrixAPI *matrix_api,
* @kind: the kind of rule * @kind: the kind of rule
* @rule_id: (not nullable): an identifier for the rule * @rule_id: (not nullable): an identifier for the rule
* @enabled: if %TRUE, the rule will be enabled, otherwise it gets disabled * @enabled: if %TRUE, the rule will be enabled, otherwise it gets disabled
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1856,7 +1854,7 @@ matrix_api_toggle_pushrule(MatrixAPI *matrix_api,
* @next_batch: the point to return events from. If given, this should be a next_batch result * @next_batch: the point to return events from. If given, this should be a next_batch result
* from a previous call to this method * from a previous call to this method
* @search_categories: describes which categories to search, and their criteria * @search_categories: describes which categories to search, and their criteria
* @callback: (scope async): a function to call when the request is finished * @user_data: user data to be passed to @callback * @callback: a function to call when the request is finished * @user_data: user data to be passed to @callback
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1878,7 +1876,7 @@ matrix_api_search(MatrixAPI *matrix_api,
/** /**
* matrix_api_get_turn_server: * matrix_api_get_turn_server:
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @callback: (scope async): the function to call when the request is finished * @callback: the function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1900,7 +1898,7 @@ matrix_api_get_turn_server(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @server_name: (not nullable): the server name from the `mxc:` URI * @server_name: (not nullable): the server name from the `mxc:` URI
* @media_id: (not nullable): the media ID from the `mxc:` URI * @media_id: (not nullable): the media ID from the `mxc:` URI
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1929,7 +1927,7 @@ matrix_api_media_download(MatrixAPI *matrix_api,
* @width: the width of the media, in pixels * @width: the width of the media, in pixels
* @height: the height of the media, in pixels * @height: the height of the media, in pixels
* @method: the resize method to use * @method: the resize method to use
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1959,7 +1957,7 @@ matrix_api_media_thumbnail(MatrixAPI *matrix_api,
* @api: a #MatrixAPI * @api: a #MatrixAPI
* @content_type: the type of the content to be uploaded * @content_type: the type of the content to be uploaded
* @content: (not nullable): the content to be uploaded * @content: (not nullable): the content to be uploaded
* @callback: (scope async): a function to call when the request is finished * @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback * @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors * @error: (nullable): a #GError, or %NULL to ignore errors
* *
@@ -1979,6 +1977,49 @@ matrix_api_media_upload(MatrixAPI *matrix_api,
MATRIX_API_GET_IFACE(matrix_api)->media_upload(matrix_api, callback, user_data, content_type, content, error); MATRIX_API_GET_IFACE(matrix_api)->media_upload(matrix_api, callback, user_data, content_type, content, error);
} }
/**
* matrix_api_get_devices:
* @api: a #MatrixAPI
* @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors
*
* Get the list of devices for the current user.
*/
void
matrix_api_get_devices(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error)
{
g_return_if_fail(api != NULL);
MATRIX_API_GET_IFACE(api)->get_devices(api, callback, user_data, error);
}
/**
* matrix_api_get_device:
* @api: a #MatrixAPI
* @device_id: a device ID
* @callback: a function to call when the request is finished
* @user_data: user data to be passed to @callback
* @error: (nullable): a #GError, or %NULL to ignore errors
*
* Get the details of the given device.
*/
void
matrix_api_get_device(MatrixAPI *api,
const gchar *device_id,
MatrixAPICallback callback,
gpointer user_data,
GError **error)
{
g_return_if_fail(api != NULL);
g_return_if_fail(device_id != NULL);
MATRIX_API_GET_IFACE(api)->get_device(api, device_id, callback, user_data, error);
}
/** /**
* matrix_api_get_token: * matrix_api_get_token:
* @api: a #MatrixAPI * @api: a #MatrixAPI

View File

@@ -33,7 +33,7 @@ G_BEGIN_DECLS
# endif # endif
# define MATRIX_TYPE_API matrix_api_get_type() # define MATRIX_TYPE_API matrix_api_get_type()
G_DECLARE_INTERFACE(MatrixAPI, matrix_api, MATRIX, API, GObject) G_DECLARE_INTERFACE(MatrixAPI, matrix_api, MATRIX, API, GObject);
typedef void (*MatrixAPICallback)(MatrixAPI *api, typedef void (*MatrixAPICallback)(MatrixAPI *api,
const gchar *content_type, const gchar *content_type,
@@ -161,11 +161,11 @@ struct _MatrixAPIInterface {
MatrixRoomVisibility visibility, MatrixRoomVisibility visibility,
JsonNode *creation_content, JsonNode *creation_content,
MatrixEventState **initial_state, MatrixEventState **initial_state,
int n_initial_state, int initial_state_length1,
gchar **invitees, gchar **invitees,
int n_invitees, int invitees_length1,
Matrix3PidCredential **invite_3pids, Matrix3PidCredential **invite_3pids,
int n_invite_3pids, int invite_3pids_length1,
GError **error); GError **error);
void (*delete_room_alias)(MatrixAPI *api, void (*delete_room_alias)(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,
@@ -370,9 +370,9 @@ struct _MatrixAPIInterface {
gpointer user_data, gpointer user_data,
const gchar *user_id, const gchar *user_id,
gchar **drop_ids, gchar **drop_ids,
int n_drop_ids, int drop_ids_length1,
gchar **invite_ids, gchar **invite_ids,
int n_invite_ids, int invite_ids_length1,
GError **error); GError **error);
void (*get_presence)(MatrixAPI *api, void (*get_presence)(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,
@@ -433,9 +433,9 @@ struct _MatrixAPIInterface {
const gchar *before, const gchar *before,
const gchar *after, const gchar *after,
gchar **actions, gchar **actions,
int n_actions, int actions_length1,
MatrixPusherConditionKind *conditions, MatrixPusherConditionKind *conditions,
int n_conditions, int conditions_length1,
GError **error); GError **error);
void (*toggle_pushrule)(MatrixAPI *api, void (*toggle_pushrule)(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,
@@ -476,8 +476,17 @@ struct _MatrixAPIInterface {
const gchar *content_type, const gchar *content_type,
GByteArray *content, GByteArray *content,
GError **error); GError **error);
void (*get_devices)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
void (*get_device)(MatrixAPI *api,
const gchar *device_id,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
const gchar *(*get_token)(MatrixAPI *api); const gchar *(*get_token)(MatrixAPI *api);
void (*set_token)(MatrixAPI *api, const gchar *token); void (*set_token)(MatrixAPI *api, const gchar *value);
const gchar *(*get_user_id)(MatrixAPI *api); const gchar *(*get_user_id)(MatrixAPI *api);
void (*set_user_id)(MatrixAPI *api, const gchar *user_id); void (*set_user_id)(MatrixAPI *api, const gchar *user_id);
const gchar *(*get_homeserver)(MatrixAPI *api); const gchar *(*get_homeserver)(MatrixAPI *api);
@@ -920,6 +929,15 @@ void matrix_api_media_upload(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,
gpointer user_data, gpointer user_data,
GError **error); GError **error);
void matrix_api_get_devices(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
void matrix_api_get_device(MatrixAPI *api,
const gchar *device_id,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
const gchar *matrix_api_get_token(MatrixAPI *api); const gchar *matrix_api_get_token(MatrixAPI *api);
void matrix_api_set_token(MatrixAPI *api, const gchar *token); void matrix_api_set_token(MatrixAPI *api, const gchar *token);
const gchar *matrix_api_get_user_id(MatrixAPI *api); const gchar *matrix_api_get_user_id(MatrixAPI *api);

View File

@@ -217,7 +217,7 @@ matrix_client_incoming_event(MatrixClient *matrix_client, const gchar *room_id,
* room-specific profile. If the users profile is not cached yet, @error is set to * room-specific profile. If the users profile is not cached yet, @error is set to
* #MATRIX_ERROR_UNAVAILABLE. * #MATRIX_ERROR_UNAVAILABLE.
* *
* Returns: (nullable) (transfer none): a #MatrixProfile object * Returns: (nullable): a #MatrixProfile object
*/ */
MatrixProfile * MatrixProfile *
matrix_client_get_user_profile(MatrixClient *matrix_client, const gchar *user_id, const gchar *room_id, GError **error) matrix_client_get_user_profile(MatrixClient *matrix_client, const gchar *user_id, const gchar *room_id, GError **error)
@@ -258,7 +258,7 @@ matrix_client_get_user_presence(MatrixClient *matrix_client, const gchar *user_i
* Get a room object by the room ID specified in @room_id. If room data is not cached yet, error * Get a room object by the room ID specified in @room_id. If room data is not cached yet, error
* is set to #MATRIX_ERROR_UNAVAILABLE and %NULL is returned. * is set to #MATRIX_ERROR_UNAVAILABLE and %NULL is returned.
* *
* Returns: (nullable) (transfer none): a #MatrixRoom object corresponding to @room_id * Returns: (nullable): a #MatrixRoom object corresponding to @room_id
*/ */
MatrixRoom * MatrixRoom *
matrix_client_get_room_by_id(MatrixClient *matrix_client, const gchar *room_id, GError **error) matrix_client_get_room_by_id(MatrixClient *matrix_client, const gchar *room_id, GError **error)
@@ -280,7 +280,7 @@ matrix_client_get_room_by_id(MatrixClient *matrix_client, const gchar *room_id,
* Please note that this may be a lengthy operation, especially if there are many rooms with many * Please note that this may be a lengthy operation, especially if there are many rooms with many
* aliases. * aliases.
* *
* Returns: (nullable) (transfer none): a #MatrixRoom object with @room_alias * Returns: (nullable): a #MatrixRoom object with @room_alias
*/ */
MatrixRoom * MatrixRoom *
matrix_client_get_room_by_alias(MatrixClient *matrix_client, const gchar *room_alias, GError **error) matrix_client_get_room_by_alias(MatrixClient *matrix_client, const gchar *room_alias, GError **error)
@@ -295,7 +295,7 @@ matrix_client_get_room_by_alias(MatrixClient *matrix_client, const gchar *room_a
* @client: a #MatrixClient * @client: a #MatrixClient
* @room_id: the room to send the event to * @room_id: the room to send the event to
* @evt: the event to send * @evt: the event to send
* @callback: (scope async): the callback function to call when the request is finished * @callback: the callback function to call when the request is finished
* @user_data: user data to pass to the callback function * @user_data: user data to pass to the callback function
* @txn_id: the transaction ID to be used during this request. In case of a state event, it will be * @txn_id: the transaction ID to be used during this request. In case of a state event, it will be
* untouched * untouched
@@ -451,7 +451,7 @@ matrix_client_default_init(MatrixClientInterface *iface)
* matrix_client_connect_event: * matrix_client_connect_event:
* @client: a #MatrixClient * @client: a #MatrixClient
* @event_gtype: the #GType of a #MatrixEventBase derived type * @event_gtype: the #GType of a #MatrixEventBase derived type
* @callback: (scope async): the callback function to connect * @event_callback: the callback function to connect
* @user_data: user data passed to the callback function * @user_data: user data passed to the callback function
* @destroy_notify: function to call on @user_data when it can be destroyed * @destroy_notify: function to call on @user_data when it can be destroyed
* *

View File

@@ -28,7 +28,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_TYPE_CLIENT matrix_client_get_type() # define MATRIX_TYPE_CLIENT matrix_client_get_type()
G_DECLARE_INTERFACE(MatrixClient, matrix_client, MATRIX, CLIENT, GObject) G_DECLARE_INTERFACE(MatrixClient, matrix_client, MATRIX, CLIENT, GObject);
typedef void (*MatrixClientSendCallback)(MatrixClient *client, const gchar *event_id, GError *error, void *user_data); typedef void (*MatrixClientSendCallback)(MatrixClient *client, const gchar *event_id, GError *error, void *user_data);
typedef void (*MatrixClientEventCallback)(MatrixClient *client, const gchar *room_id, JsonNode *raw_event, MatrixEventBase *matrix_event, void *user_data); typedef void (*MatrixClientEventCallback)(MatrixClient *client, const gchar *room_id, JsonNode *raw_event, MatrixEventBase *matrix_event, void *user_data);
@@ -61,7 +61,7 @@ struct _MatrixClientInterface {
void (*send)(MatrixClient *client, void (*send)(MatrixClient *client,
const gchar *room_id, const gchar *room_id,
MatrixEventBase *evt, MatrixEventBase *evt,
MatrixClientSendCallback callback, void *user_data, MatrixClientSendCallback cb, void *cb_target,
gulong txn_id, gulong txn_id,
GError **error); GError **error);
void (*save_state)(MatrixClient *client, void (*save_state)(MatrixClient *client,
@@ -77,6 +77,7 @@ struct _MatrixClientInterface {
MatrixEventBase *matrix_event); MatrixEventBase *matrix_event);
}; };
GType matrix_client_get_type(void) G_GNUC_CONST;
void matrix_client_login_with_password(MatrixClient *client, void matrix_client_login_with_password(MatrixClient *client,
const gchar *username, const gchar *username,
const gchar *password, const gchar *password,
@@ -95,7 +96,7 @@ void matrix_client_incoming_event(MatrixClient *client,
MatrixEventBase *matrix_event); MatrixEventBase *matrix_event);
void matrix_client_connect_event(MatrixClient *client, void matrix_client_connect_event(MatrixClient *client,
GType event_gtype, GType event_gtype,
MatrixClientEventCallback callback, MatrixClientEventCallback event_callback,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy_notify); GDestroyNotify destroy_notify);
MatrixProfile *matrix_client_get_user_profile(MatrixClient *client, MatrixProfile *matrix_client_get_user_profile(MatrixClient *client,
@@ -121,6 +122,11 @@ void matrix_client_send(MatrixClient *client,
GError **error); GError **error);
void matrix_client_save_state(MatrixClient *client, const gchar *filename, GError **error); void matrix_client_save_state(MatrixClient *client, const gchar *filename, GError **error);
void matrix_client_load_state(MatrixClient *client, const gchar *filename, GError **error); void matrix_client_load_state(MatrixClient *client, const gchar *filename, GError **error);
void matrix_client_connect_event(MatrixClient *client,
GType event_gtype,
MatrixClientEventCallback callback,
gpointer user_data,
GDestroyNotify destroy_notify);
G_END_DECLS G_END_DECLS

View File

@@ -40,12 +40,6 @@ matrix_json_compact_class_init(MatrixJsonCompactClass *klass)
((MatrixJsonCompactClass *)klass)->get_json_node = matrix_json_compact_get_json_node_impl; ((MatrixJsonCompactClass *)klass)->get_json_node = matrix_json_compact_get_json_node_impl;
} }
/**
* matrix_json_compact_construct:
* @object_type: the #GType to construct
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixJsonCompact * MatrixJsonCompact *
matrix_json_compact_construct(GType object_type) matrix_json_compact_construct(GType object_type)
{ {
@@ -794,6 +788,16 @@ matrix_room_filter_get_json_node(MatrixJsonCompact *matrix_json_compact, GError
return result; return result;
} }
MatrixRoomFilter *
matrix_room_filter_construct(GType object_type)
{
MatrixRoomFilter *matrix_room_filter = NULL;
matrix_room_filter = (MatrixRoomFilter *)matrix_json_compact_construct(object_type);
return matrix_room_filter;
}
/** /**
* matrix_room_filter_new: * matrix_room_filter_new:
* *
@@ -804,7 +808,7 @@ matrix_room_filter_get_json_node(MatrixJsonCompact *matrix_json_compact, GError
MatrixRoomFilter * MatrixRoomFilter *
matrix_room_filter_new(void) matrix_room_filter_new(void)
{ {
return (MatrixRoomFilter *)matrix_json_compact_construct(MATRIX_TYPE_ROOM_FILTER); return matrix_room_filter_construct(MATRIX_TYPE_ROOM_FILTER);
} }
/** /**
@@ -1079,6 +1083,12 @@ matrix_filter_get_json_node(MatrixJsonCompact *matrix_json_compact, GError **err
return node; return node;
} }
MatrixFilter *
matrix_filter_construct(GType object_type)
{
return (MatrixFilter *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_filter_new: * matrix_filter_new:
* *
@@ -1089,7 +1099,7 @@ matrix_filter_get_json_node(MatrixJsonCompact *matrix_json_compact, GError **err
MatrixFilter * MatrixFilter *
matrix_filter_new(void) matrix_filter_new(void)
{ {
return (MatrixFilter *)matrix_json_compact_construct(MATRIX_TYPE_FILTER); return matrix_filter_construct(MATRIX_TYPE_FILTER);
} }
/** /**
@@ -1347,6 +1357,12 @@ matrix_3pid_credential_get_json_node(MatrixJsonCompact *matrix_json_compact, GEr
return node; return node;
} }
Matrix3PidCredential *
matrix_3pid_credential_construct(GType object_type)
{
return (Matrix3PidCredential *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_3pid_credential_new: * matrix_3pid_credential_new:
* *
@@ -1357,7 +1373,7 @@ matrix_3pid_credential_get_json_node(MatrixJsonCompact *matrix_json_compact, GEr
Matrix3PidCredential * Matrix3PidCredential *
matrix_3pid_credential_new(void) matrix_3pid_credential_new(void)
{ {
return (Matrix3PidCredential *)matrix_json_compact_construct(MATRIX_TYPE_3PID_CREDENTIAL); return matrix_3pid_credential_construct (MATRIX_TYPE_3PID_CREDENTIAL);
} }
/** /**
@@ -1597,6 +1613,12 @@ matrix_pusher_get_json_node(MatrixJsonCompact *matrix_json_compact, GError **err
return result; return result;
} }
MatrixPusher *
matrix_pusher_construct(GType object_type)
{
return (MatrixPusher *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_pusher_new: * matrix_pusher_new:
* *
@@ -1607,7 +1629,7 @@ matrix_pusher_get_json_node(MatrixJsonCompact *matrix_json_compact, GError **err
MatrixPusher * MatrixPusher *
matrix_pusher_new(void) matrix_pusher_new(void)
{ {
return (MatrixPusher *)matrix_json_compact_construct(MATRIX_TYPE_PUSHER); return matrix_pusher_construct(MATRIX_TYPE_PUSHER);
} }
/* /*
@@ -2011,6 +2033,12 @@ matrix_event_context_get_json_node(MatrixJsonCompact *matrix_json_compact, GErro
return result; return result;
} }
MatrixEventContext *
matrix_event_context_construct(GType object_type)
{
return (MatrixEventContext *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_event_context_new: * matrix_event_context_new:
* *
@@ -2021,7 +2049,7 @@ matrix_event_context_get_json_node(MatrixJsonCompact *matrix_json_compact, GErro
MatrixEventContext * MatrixEventContext *
matrix_event_context_new(void) matrix_event_context_new(void)
{ {
return (MatrixEventContext *)matrix_json_compact_construct(MATRIX_TYPE_EVENT_CONTEXT); return matrix_event_context_construct(MATRIX_TYPE_EVENT_CONTEXT);
} }
/** /**
@@ -2213,6 +2241,12 @@ matrix_search_grouping_get_json_node(MatrixJsonCompact *matrix_json_compact, GEr
return result; return result;
} }
MatrixSearchGrouping *
matrix_search_grouping_construct(GType object_type)
{
return (MatrixSearchGrouping * )matrix_json_compact_construct(object_type);
}
/** /**
* matrix_search_grouping_new: * matrix_search_grouping_new:
* *
@@ -2223,7 +2257,7 @@ matrix_search_grouping_get_json_node(MatrixJsonCompact *matrix_json_compact, GEr
MatrixSearchGrouping * MatrixSearchGrouping *
matrix_search_grouping_new(void) matrix_search_grouping_new(void)
{ {
return (MatrixSearchGrouping * )matrix_json_compact_construct(MATRIX_TYPE_SEARCH_GROUPING); return matrix_search_grouping_construct(MATRIX_TYPE_SEARCH_GROUPING);
} }
/** /**
@@ -2351,6 +2385,12 @@ matrix_search_groupings_get_json_node(MatrixJsonCompact *matrix_json_compact, GE
return result; return result;
} }
MatrixSearchGroupings *
matrix_search_groupings_construct(GType object_type)
{
return (MatrixSearchGroupings *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_search_groupings_new: * matrix_search_groupings_new:
* *
@@ -2361,7 +2401,7 @@ matrix_search_groupings_get_json_node(MatrixJsonCompact *matrix_json_compact, GE
MatrixSearchGroupings * MatrixSearchGroupings *
matrix_search_groupings_new(void) matrix_search_groupings_new(void)
{ {
return (MatrixSearchGroupings *)matrix_json_compact_construct(MATRIX_TYPE_SEARCH_GROUPINGS); return matrix_search_groupings_construct(MATRIX_TYPE_SEARCH_GROUPINGS);
} }
/** /**
@@ -2566,6 +2606,12 @@ matrix_search_room_events_get_json_node(MatrixJsonCompact *matrix_json_compact,
return result; return result;
} }
MatrixSearchRoomEvents *
matrix_search_room_events_construct(GType object_type)
{
return (MatrixSearchRoomEvents *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_search_room_events_new: * matrix_search_room_events_new:
* *
@@ -2576,7 +2622,7 @@ matrix_search_room_events_get_json_node(MatrixJsonCompact *matrix_json_compact,
MatrixSearchRoomEvents * MatrixSearchRoomEvents *
matrix_search_room_events_new(void) matrix_search_room_events_new(void)
{ {
return (MatrixSearchRoomEvents *)matrix_json_compact_construct(MATRIX_TYPE_SEARCH_ROOM_EVENTS); return matrix_search_room_events_construct(MATRIX_TYPE_SEARCH_ROOM_EVENTS);
} }
/** /**
@@ -3010,6 +3056,12 @@ matrix_search_categories_get_json_node(MatrixJsonCompact *matrix_json_compact, G
return result; return result;
} }
MatrixSearchCategories *
matrix_search_categories_construct(GType object_type)
{
return (MatrixSearchCategories *)matrix_json_compact_construct(object_type);
}
/** /**
* matrix_search_categories_new: * matrix_search_categories_new:
* *
@@ -3020,7 +3072,7 @@ matrix_search_categories_get_json_node(MatrixJsonCompact *matrix_json_compact, G
MatrixSearchCategories * MatrixSearchCategories *
matrix_search_categories_new(void) matrix_search_categories_new(void)
{ {
return (MatrixSearchCategories *)matrix_json_compact_construct(MATRIX_TYPE_SEARCH_CATEGORIES); return matrix_search_categories_construct(MATRIX_TYPE_SEARCH_CATEGORIES);
} }
/** /**

View File

@@ -36,7 +36,7 @@ G_BEGIN_DECLS
typedef struct _MatrixJsonCompactClass MatrixJsonCompactClass; typedef struct _MatrixJsonCompactClass MatrixJsonCompactClass;
typedef struct _MatrixJsonCompact MatrixJsonCompact; typedef struct _MatrixJsonCompact MatrixJsonCompact;
void matrix_json_compact_unref(MatrixJsonCompact *json_compact); void matrix_json_compact_unref(MatrixJsonCompact *json_compact);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixJsonCompact, matrix_json_compact_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixJsonCompact, matrix_json_compact_unref);
struct _MatrixJsonCompact { struct _MatrixJsonCompact {
GTypeInstance parent_instance; GTypeInstance parent_instance;
@@ -59,7 +59,7 @@ JsonNode *matrix_json_compact_get_json_node(MatrixJsonCompact *json_compact, GEr
gchar *matrix_json_compact_get_json_data(MatrixJsonCompact *json_compact, gsize *datalen, GError **error); gchar *matrix_json_compact_get_json_data(MatrixJsonCompact *json_compact, gsize *datalen, GError **error);
#define MATRIX_TYPE_FILTER_RULES matrix_filter_rules_get_type() #define MATRIX_TYPE_FILTER_RULES matrix_filter_rules_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixFilterRules, matrix_filter_rules, MATRIX, FILTER_RULES, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixFilterRules, matrix_filter_rules, MATRIX, FILTER_RULES, MatrixJsonCompact);
struct _MatrixFilterRulesClass { struct _MatrixFilterRulesClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
@@ -90,6 +90,7 @@ struct _MatrixRoomFilterClass {
}; };
MatrixRoomFilter *matrix_room_filter_new(void); MatrixRoomFilter *matrix_room_filter_new(void);
MatrixRoomFilter *matrix_room_filter_construct(GType object_type);
gboolean matrix_room_filter_get_include_leave(MatrixRoomFilter *room_filter); gboolean matrix_room_filter_get_include_leave(MatrixRoomFilter *room_filter);
void matrix_room_filter_set_include_leave(MatrixRoomFilter *room_filter, gboolean include_leave); void matrix_room_filter_set_include_leave(MatrixRoomFilter *room_filter, gboolean include_leave);
MatrixFilterRules *matrix_room_filter_get_ephemeral(MatrixRoomFilter *room_filter); MatrixFilterRules *matrix_room_filter_get_ephemeral(MatrixRoomFilter *room_filter);
@@ -100,13 +101,14 @@ MatrixFilterRules *matrix_room_filter_get_timeline(MatrixRoomFilter *room_filter
void matrix_room_filter_set_timeline(MatrixRoomFilter *room_filter, MatrixFilterRules *timeline_rules); void matrix_room_filter_set_timeline(MatrixRoomFilter *room_filter, MatrixFilterRules *timeline_rules);
# define MATRIX_TYPE_FILTER matrix_filter_get_type() # define MATRIX_TYPE_FILTER matrix_filter_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixFilter, matrix_filter, MATRIX, FILTER, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixFilter, matrix_filter, MATRIX, FILTER, MatrixJsonCompact);
struct _MatrixFilterClass { struct _MatrixFilterClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixFilter *matrix_filter_new(void); MatrixFilter *matrix_filter_new(void);
MatrixFilter *matrix_filter_construct(GType object_type);
gchar **matrix_filter_get_event_fields(MatrixFilter *filter, int *n_event_fields); gchar **matrix_filter_get_event_fields(MatrixFilter *filter, int *n_event_fields);
void matrix_filter_set_event_fields(MatrixFilter *filter, gchar **event_fields, int n_event_fields); void matrix_filter_set_event_fields(MatrixFilter *filter, gchar **event_fields, int n_event_fields);
MatrixEventFormat matrix_filter_get_event_format(MatrixFilter *filter); MatrixEventFormat matrix_filter_get_event_format(MatrixFilter *filter);
@@ -117,13 +119,14 @@ MatrixRoomFilter *matrix_filter_get_room_filter(MatrixFilter *filter);
void matrix_filter_set_room_filter(MatrixFilter *filter, MatrixRoomFilter *room_filter); void matrix_filter_set_room_filter(MatrixFilter *filter, MatrixRoomFilter *room_filter);
# define MATRIX_TYPE_3PID_CREDENTIAL matrix_3pid_credential_get_type() # define MATRIX_TYPE_3PID_CREDENTIAL matrix_3pid_credential_get_type()
G_DECLARE_DERIVABLE_TYPE(Matrix3PidCredential, matrix_3pid_credential, MATRIX, 3PID_CREDENTIAL, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(Matrix3PidCredential, matrix_3pid_credential, MATRIX, 3PID_CREDENTIAL, MatrixJsonCompact);
struct _Matrix3PidCredentialClass { struct _Matrix3PidCredentialClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
Matrix3PidCredential *matrix_3pid_credential_new(void); Matrix3PidCredential *matrix_3pid_credential_new(void);
Matrix3PidCredential *matrix_3pid_credential_construct(GType object_type);
const gchar *matrix_3pid_credential_get_id_server(Matrix3PidCredential *credential); const gchar *matrix_3pid_credential_get_id_server(Matrix3PidCredential *credential);
void matrix_3pid_credential_set_id_server(Matrix3PidCredential *credential, const gchar *id_server); void matrix_3pid_credential_set_id_server(Matrix3PidCredential *credential, const gchar *id_server);
const gchar *matrix_3pid_credential_get_session_id(Matrix3PidCredential *credential); const gchar *matrix_3pid_credential_get_session_id(Matrix3PidCredential *credential);
@@ -132,13 +135,14 @@ const gchar *matrix_3pid_credential_get_client_secret(Matrix3PidCredential *cred
void matrix_3pid_credential_set_client_secret(Matrix3PidCredential *credential, const gchar *client_secret); void matrix_3pid_credential_set_client_secret(Matrix3PidCredential *credential, const gchar *client_secret);
# define MATRIX_TYPE_PUSHER matrix_pusher_get_type() # define MATRIX_TYPE_PUSHER matrix_pusher_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixPusher, matrix_pusher, MATRIX, PUSHER, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixPusher, matrix_pusher, MATRIX, PUSHER, MatrixJsonCompact);
struct _MatrixPusherClass { struct _MatrixPusherClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixPusher *matrix_pusher_new(void); MatrixPusher *matrix_pusher_new(void);
MatrixPusher *matrix_pusher_construct(GType object_type);
const gchar *matrix_pusher_get_device_display_name(MatrixPusher *pusher); const gchar *matrix_pusher_get_device_display_name(MatrixPusher *pusher);
void matrix_pusher_set_device_display_name(MatrixPusher *pusher, const gchar *device_display_name); void matrix_pusher_set_device_display_name(MatrixPusher *pusher, const gchar *device_display_name);
const gchar *matrix_pusher_get_app_display_name(MatrixPusher *pusher); const gchar *matrix_pusher_get_app_display_name(MatrixPusher *pusher);
@@ -159,13 +163,14 @@ JsonNode *matrix_pusher_get_data(MatrixPusher *pusher);
void matrix_pusher_set_data(MatrixPusher *pusher, JsonNode *data); void matrix_pusher_set_data(MatrixPusher *pusher, JsonNode *data);
# define MATRIX_TYPE_EVENT_CONTEXT matrix_event_context_get_type() # define MATRIX_TYPE_EVENT_CONTEXT matrix_event_context_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventContext, matrix_event_context, MATRIX, EVENT_CONTEXT, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixEventContext, matrix_event_context, MATRIX, EVENT_CONTEXT, MatrixJsonCompact);
struct _MatrixEventContextClass { struct _MatrixEventContextClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixEventContext *matrix_event_context_new (void); MatrixEventContext *matrix_event_context_new (void);
MatrixEventContext *matrix_event_context_construct (GType object_type);
gint matrix_event_context_get_before_limit (MatrixEventContext *event_context); gint matrix_event_context_get_before_limit (MatrixEventContext *event_context);
void matrix_event_context_set_before_limit (MatrixEventContext *event_context, gint before_limit); void matrix_event_context_set_before_limit (MatrixEventContext *event_context, gint before_limit);
gint matrix_event_context_get_after_limit (MatrixEventContext *event_context); gint matrix_event_context_get_after_limit (MatrixEventContext *event_context);
@@ -174,35 +179,38 @@ gboolean matrix_event_context_get_include_profile (MatrixEventContext *event_con
void matrix_event_context_set_include_profile (MatrixEventContext *event_context, gboolean include_profile); void matrix_event_context_set_include_profile (MatrixEventContext *event_context, gboolean include_profile);
# define MATRIX_TYPE_SEARCH_GROUPING matrix_search_grouping_get_type() # define MATRIX_TYPE_SEARCH_GROUPING matrix_search_grouping_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixSearchGrouping, matrix_search_grouping, MATRIX, SEARCH_GROUPING, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixSearchGrouping, matrix_search_grouping, MATRIX, SEARCH_GROUPING, MatrixJsonCompact);
struct _MatrixSearchGroupingClass { struct _MatrixSearchGroupingClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixSearchGrouping *matrix_search_grouping_new(void); MatrixSearchGrouping *matrix_search_grouping_new(void);
MatrixSearchGrouping *matrix_search_grouping_construct(GType object_type);
MatrixSearchGroupBy matrix_search_grouping_get_key(MatrixSearchGrouping *search_grouping); MatrixSearchGroupBy matrix_search_grouping_get_key(MatrixSearchGrouping *search_grouping);
void matrix_search_grouping_set_key(MatrixSearchGrouping *search_grouping, MatrixSearchGroupBy key); void matrix_search_grouping_set_key(MatrixSearchGrouping *search_grouping, MatrixSearchGroupBy key);
# define MATRIX_TYPE_SEARCH_GROUPINGS matrix_search_groupings_get_type() # define MATRIX_TYPE_SEARCH_GROUPINGS matrix_search_groupings_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixSearchGroupings, matrix_search_groupings, MATRIX, SEARCH_GROUPINGS, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixSearchGroupings, matrix_search_groupings, MATRIX, SEARCH_GROUPINGS, MatrixJsonCompact);
struct _MatrixSearchGroupingsClass { struct _MatrixSearchGroupingsClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixSearchGroupings *matrix_search_groupings_new(void); MatrixSearchGroupings *matrix_search_groupings_new(void);
MatrixSearchGroupings *matrix_search_groupings_construct(GType object_type);
MatrixSearchGrouping **matrix_search_groupings_get_group_by(MatrixSearchGroupings *search_groupings, int *n_group_by); MatrixSearchGrouping **matrix_search_groupings_get_group_by(MatrixSearchGroupings *search_groupings, int *n_group_by);
void matrix_search_groupings_set_group_by(MatrixSearchGroupings *search_groupings, MatrixSearchGrouping **group_by, int n_group_by); void matrix_search_groupings_set_group_by(MatrixSearchGroupings *search_groupings, MatrixSearchGrouping **group_by, int n_group_by);
# define MATRIX_TYPE_SEARCH_ROOM_EVENTS matrix_search_room_events_get_type() # define MATRIX_TYPE_SEARCH_ROOM_EVENTS matrix_search_room_events_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixSearchRoomEvents, matrix_search_room_events, MATRIX, SEARCH_ROOM_EVENTS, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixSearchRoomEvents, matrix_search_room_events, MATRIX, SEARCH_ROOM_EVENTS, MatrixJsonCompact);
struct _MatrixSearchRoomEventsClass { struct _MatrixSearchRoomEventsClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixSearchRoomEvents *matrix_search_room_events_new(void); MatrixSearchRoomEvents *matrix_search_room_events_new(void);
MatrixSearchRoomEvents *matrix_search_room_events_construct(GType object_type);
MatrixSearchOrder matrix_search_room_events_get_order_by(MatrixSearchRoomEvents *search_room_events); MatrixSearchOrder matrix_search_room_events_get_order_by(MatrixSearchRoomEvents *search_room_events);
void matrix_search_room_events_set_order_by(MatrixSearchRoomEvents *search_room_events, MatrixSearchOrder order_by); void matrix_search_room_events_set_order_by(MatrixSearchRoomEvents *search_room_events, MatrixSearchOrder order_by);
MatrixSearchKey *matrix_search_room_events_get_keys(MatrixSearchRoomEvents *search_room_events, guint *n_keys); MatrixSearchKey *matrix_search_room_events_get_keys(MatrixSearchRoomEvents *search_room_events, guint *n_keys);
@@ -221,13 +229,14 @@ MatrixSearchGroupings *matrix_search_room_events_get_groupings(MatrixSearchRoomE
void matrix_search_room_events_set_groupings(MatrixSearchRoomEvents *search_room_events, MatrixSearchGroupings *groupings); void matrix_search_room_events_set_groupings(MatrixSearchRoomEvents *search_room_events, MatrixSearchGroupings *groupings);
# define MATRIX_TYPE_SEARCH_CATEGORIES matrix_search_categories_get_type() # define MATRIX_TYPE_SEARCH_CATEGORIES matrix_search_categories_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixSearchCategories, matrix_search_categories, MATRIX, SEARCH_CATEGORIES, MatrixJsonCompact) G_DECLARE_DERIVABLE_TYPE(MatrixSearchCategories, matrix_search_categories, MATRIX, SEARCH_CATEGORIES, MatrixJsonCompact);
struct _MatrixSearchCategoriesClass { struct _MatrixSearchCategoriesClass {
MatrixJsonCompactClass parent_class; MatrixJsonCompactClass parent_class;
}; };
MatrixSearchCategories *matrix_search_categories_new(void); MatrixSearchCategories *matrix_search_categories_new(void);
MatrixSearchCategories *matrix_search_categories_construct(GType object_type);
MatrixSearchRoomEvents *matrix_search_categories_get_room_events(MatrixSearchCategories *search_categories); MatrixSearchRoomEvents *matrix_search_categories_get_room_events(MatrixSearchCategories *search_categories);
void matrix_search_categories_set_room_events(MatrixSearchCategories *search_categories, MatrixSearchRoomEvents *room_events); void matrix_search_categories_set_room_events(MatrixSearchCategories *search_categories, MatrixSearchRoomEvents *room_events);

View File

@@ -0,0 +1,59 @@
/*** BEGIN file-header ***/
/*
* This file is part of matrix-glib-sdk
*
* matrix-glib-sdk is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* matrix-glib-sdk is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with matrix-glib-sdk. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "matrix-enumtypes.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from @filename@ */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type(void)
{
static volatile gsize g_define_type_id__volatile = 0;
if (g_once_init_enter(&g_define_type_id__volatile)) {
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{
@VALUENAME@,
"@VALUENAME@",
"@valuenick@"
},
/*** END value-production ***/
/*** BEGIN value-tail ***/
{0, NULL, NULL}
};
GType g_define_type_id = g_@type@_register_static(
g_intern_static_string("@EnumName@"),
values);
g_once_init_leave(&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/

View File

@@ -0,0 +1,42 @@
/*** BEGIN file-header ***/
/*
* This file is part of matrix-glib-sdk
*
* matrix-glib-sdk is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* matrix-glib-sdk is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with matrix-glib-sdk. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __MATRIX_ENUMTYPES_H__
#define __MATRIX_ENUMTYPES_H__
#include <glib-object.h>
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
#include "@filename@"
/*** END file-production ***/
/*** BEGIN value-header ***/
GType @enum_name@_get_type(void);
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
/*** END value-header ***/
/*** BEGIN file-tail ***/
#endif /* __MATRIX_ENUMTYPES_H__ */
/*** END file-tail ***/

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-base.h" #include "matrix-event-base.h"
#include "matrix-types.h"
#include "matrix-enumtypes.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
@@ -306,12 +305,6 @@ matrix_event_base_new_from_json(const gchar *event_type, JsonNode *json_data, GE
return ret; return ret;
} }
/**
* matrix_event_base_construct:
* @object_type: a #GType to construct
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixEventBase * MatrixEventBase *
matrix_event_base_construct(GType object_type) matrix_event_base_construct(GType object_type)
{ {

View File

@@ -31,7 +31,7 @@
typedef struct _MatrixEventBase MatrixEventBase; typedef struct _MatrixEventBase MatrixEventBase;
typedef struct _MatrixEventBaseClass MatrixEventBaseClass; typedef struct _MatrixEventBaseClass MatrixEventBaseClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventBase, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventBase, g_object_unref);
struct _MatrixEventBase { struct _MatrixEventBase {
GObject parent_instance; GObject parent_instance;
@@ -40,8 +40,8 @@ struct _MatrixEventBase {
struct _MatrixEventBaseClass { struct _MatrixEventBaseClass {
GObjectClass parent_instance; GObjectClass parent_instance;
void (*from_json)(MatrixEventBase *event, JsonNode *json_data, GError **error); void (*from_json)(MatrixEventBase *matrix_event_base, JsonNode *json_data, GError **error);
void (*to_json)(MatrixEventBase *event, JsonNode *json_data, GError **error); void (*to_json)(MatrixEventBase *matrix_event_base, JsonNode *json_data, GError **error);
}; };
GType matrix_event_get_handler(const gchar *event_type); GType matrix_event_get_handler(const gchar *event_type);

View File

@@ -18,7 +18,6 @@
#include "matrix-event-call-answer.h" #include "matrix-event-call-answer.h"
#include "utils.h" #include "utils.h"
#include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -144,6 +143,12 @@ matrix_event_call_answer_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MATRIX_EVENT_BASE_CLASS(matrix_event_call_answer_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_call_answer_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventCallAnswer *
matrix_event_call_answer_construct(GType object_type)
{
return (MatrixEventCallAnswer *)matrix_event_call_construct(object_type);
}
/** /**
* matrix_event_call_answer_new: * matrix_event_call_answer_new:
* *
@@ -154,7 +159,7 @@ matrix_event_call_answer_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MatrixEventCallAnswer * MatrixEventCallAnswer *
matrix_event_call_answer_new(void) matrix_event_call_answer_new(void)
{ {
return (MatrixEventCallAnswer *)matrix_event_call_construct(MATRIX_EVENT_TYPE_CALL_ANSWER); return matrix_event_call_answer_construct(MATRIX_EVENT_TYPE_CALL_ANSWER);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-call-base.h" # include "matrix-event-call-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_CALL_ANSWER (matrix_event_call_answer_get_type ()) # define MATRIX_EVENT_TYPE_CALL_ANSWER (matrix_event_call_answer_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventCallAnswer, matrix_event_call_answer, MATRIX_EVENT, CALL_ANSWER, MatrixEventCall) G_DECLARE_DERIVABLE_TYPE(MatrixEventCallAnswer, matrix_event_call_answer, MATRIX_EVENT, CALL_ANSWER, MatrixEventCall);
struct _MatrixEventCallAnswerClass { struct _MatrixEventCallAnswerClass {
MatrixEventCallClass parent_class; MatrixEventCallClass parent_class;
}; };
MatrixEventCallAnswer* matrix_event_call_answer_new (void); MatrixEventCallAnswer* matrix_event_call_answer_new (void);
MatrixEventCallAnswer* matrix_event_call_answer_construct (GType object_type);
MatrixCallAnswerType matrix_event_call_answer_get_answer_type (MatrixEventCallAnswer *event); MatrixCallAnswerType matrix_event_call_answer_get_answer_type (MatrixEventCallAnswer *event);
void matrix_event_call_answer_set_answer_type (MatrixEventCallAnswer *event, MatrixCallAnswerType answer_type); void matrix_event_call_answer_set_answer_type (MatrixEventCallAnswer *event, MatrixCallAnswerType answer_type);
const gchar* matrix_event_call_answer_get_answer_sdp (MatrixEventCallAnswer *event); const gchar* matrix_event_call_answer_get_answer_sdp (MatrixEventCallAnswer *event);

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-call-base.h" #include "matrix-event-call-base.h"
#include "matrix-types.h"
#include "matrix-enumtypes.h" #include "matrix-enumtypes.h"
/** /**
@@ -116,12 +115,6 @@ matrix_event_call_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *jso
MATRIX_EVENT_BASE_CLASS(matrix_event_call_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_call_parent_class)->to_json(matrix_event_base, json_data, error);
} }
/**
* matrix_event_call_construct:
* @object_type: the #GType of the object to be created
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixEventCall * MatrixEventCall *
matrix_event_call_construct(GType object_type) matrix_event_call_construct(GType object_type)
{ {

View File

@@ -33,7 +33,7 @@ G_BEGIN_DECLS
typedef struct _MatrixEventCall MatrixEventCall; typedef struct _MatrixEventCall MatrixEventCall;
typedef struct _MatrixEventCallClass MatrixEventCallClass; typedef struct _MatrixEventCallClass MatrixEventCallClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventCall, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventCall, g_object_unref);
struct _MatrixEventCall { struct _MatrixEventCall {
MatrixEventRoom parent_instance; MatrixEventRoom parent_instance;

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-call-candidates.h" #include "matrix-event-call-candidates.h"
#include "matrix-types.h"
#include "matrix-enumtypes.h" #include "matrix-enumtypes.h"
/** /**
@@ -28,7 +27,7 @@
struct _MatrixCallCandidate { struct _MatrixCallCandidate {
gchar *sdp_mid; /// The SDP media type this candidate is intended for. gchar *sdp_mid; /// The SDP media type this candidate is intended for.
gint *sdp_line_index; /// The index of the SDP 'm' line this candidate is intended for. int sdp_line_index; /// The index of the SDP 'm' line this candidate is intended for.
gchar *candidate; /// The SDP 'a' line of the candidate. gchar *candidate; /// The SDP 'a' line of the candidate.
guint refcount; guint refcount;
@@ -137,7 +136,7 @@ matrix_call_candidate_set_sdp_mid(MatrixCallCandidate *matrix_call_candidate, co
* *
* Returns: (transfer none) (nullable): the SDP line * Returns: (transfer none) (nullable): the SDP line
*/ */
gint * int
matrix_call_candidate_get_sdp_line_index(MatrixCallCandidate *matrix_call_candidate) matrix_call_candidate_get_sdp_line_index(MatrixCallCandidate *matrix_call_candidate)
{ {
g_return_val_if_fail(matrix_call_candidate != NULL, 0); g_return_val_if_fail(matrix_call_candidate != NULL, 0);
@@ -148,22 +147,16 @@ matrix_call_candidate_get_sdp_line_index(MatrixCallCandidate *matrix_call_candid
/** /**
* matrix_call_candidate_set_sdp_line_index: * matrix_call_candidate_set_sdp_line_index:
* @candidate: a #MatrixCallCandidate * @candidate: a #MatrixCallCandidate
* @sdp_line_index: (nullable) (transfer none): an SDP line index * @sdp_line_index: an SDP line index
* *
* Set the SDP line index of @candidate. * Set the SDP line index of @candidate.
*/ */
void void
matrix_call_candidate_set_sdp_line_index(MatrixCallCandidate *matrix_call_candidate, gint *sdp_line_index) matrix_call_candidate_set_sdp_line_index(MatrixCallCandidate *matrix_call_candidate, int sdp_line_index)
{ {
g_return_if_fail(matrix_call_candidate != NULL); g_return_if_fail(matrix_call_candidate != NULL);
matrix_call_candidate->sdp_line_index = (g_free(matrix_call_candidate->sdp_line_index), NULL); matrix_call_candidate->sdp_line_index = sdp_line_index;
if (sdp_line_index != NULL) {
matrix_call_candidate->sdp_line_index = g_new0(gint, 1);
*(matrix_call_candidate->sdp_line_index) = *sdp_line_index;
}
} }
/** /**
@@ -255,9 +248,7 @@ matrix_event_call_candidates_real_from_json(MatrixEventBase *matrix_event_base,
} }
if ((node = json_object_get_member(cand_root, "sdpMLineIndex")) != NULL) { if ((node = json_object_get_member(cand_root, "sdpMLineIndex")) != NULL) {
gint line_index = json_node_get_int(node); priv->_candidates[i]->sdp_line_index = json_node_get_int(node);
matrix_call_candidate_set_sdp_line_index(priv->_candidates[i], &line_index);
} else { } else {
g_warning("sdpMLineIndex is missing from a candidate of a m.call.candidates event"); g_warning("sdpMLineIndex is missing from a candidate of a m.call.candidates event");
} }
@@ -328,12 +319,9 @@ matrix_event_call_candidates_real_to_json(MatrixEventBase *matrix_event_base, Js
json_node_set_object(cand_node, cand_root); json_node_set_object(cand_node, cand_root);
json_object_set_string_member(cand_root, "sdpMid", entry->sdp_mid); json_object_set_string_member(cand_root, "sdpMid", entry->sdp_mid);
json_object_set_int_member(cand_root, "sdpMLineIndex", entry->sdp_line_index);
json_object_set_string_member(cand_root, "candidate", entry->candidate); json_object_set_string_member(cand_root, "candidate", entry->candidate);
if (entry->sdp_line_index != NULL) {
json_object_set_int_member(cand_root, "sdpMLineIndex", *(entry->sdp_line_index));
}
json_array_add_element(cands, cand_node); json_array_add_element(cands, cand_node);
} }
@@ -347,6 +335,12 @@ matrix_event_call_candidates_real_to_json(MatrixEventBase *matrix_event_base, Js
MATRIX_EVENT_BASE_CLASS(matrix_event_call_candidates_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_call_candidates_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventCallCandidates *
matrix_event_call_candidates_construct(GType object_type)
{
return (MatrixEventCallCandidates *)matrix_event_call_construct(object_type);
}
/** /**
* matrix_event_call_candidates_new: * matrix_event_call_candidates_new:
* *
@@ -357,7 +351,7 @@ matrix_event_call_candidates_real_to_json(MatrixEventBase *matrix_event_base, Js
MatrixEventCallCandidates * MatrixEventCallCandidates *
matrix_event_call_candidates_new(void) matrix_event_call_candidates_new(void)
{ {
return (MatrixEventCallCandidates *)matrix_event_call_construct(MATRIX_EVENT_TYPE_CALL_CANDIDATES); return matrix_event_call_candidates_construct(MATRIX_EVENT_TYPE_CALL_CANDIDATES);
} }
/** /**

View File

@@ -33,19 +33,20 @@ MatrixCallCandidate *matrix_call_candidate_ref(MatrixCallCandidate *candidate);
void matrix_call_candidate_unref(MatrixCallCandidate *candidate); void matrix_call_candidate_unref(MatrixCallCandidate *candidate);
const gchar *matrix_call_candidate_get_sdp_mid(MatrixCallCandidate *candidate); const gchar *matrix_call_candidate_get_sdp_mid(MatrixCallCandidate *candidate);
void matrix_call_candidate_set_sdp_mid(MatrixCallCandidate *candidate, const gchar *sdp_mid); void matrix_call_candidate_set_sdp_mid(MatrixCallCandidate *candidate, const gchar *sdp_mid);
gint *matrix_call_candidate_get_sdp_line_index(MatrixCallCandidate *candidate); int matrix_call_candidate_get_sdp_line_index(MatrixCallCandidate *candidate);
void matrix_call_candidate_set_sdp_line_index(MatrixCallCandidate *candidate, gint *sdp_line_index); void matrix_call_candidate_set_sdp_line_index(MatrixCallCandidate *candidate, int sdp_line_index);
const gchar *matrix_call_candidate_get_candidate(MatrixCallCandidate *candidate); const gchar *matrix_call_candidate_get_candidate(MatrixCallCandidate *candidate);
void matrix_call_candidate_set_candidate(MatrixCallCandidate *candidate, const gchar *candidate_name); void matrix_call_candidate_set_candidate(MatrixCallCandidate *candidate, const gchar *candidate_name);
#define MATRIX_EVENT_TYPE_CALL_CANDIDATES (matrix_event_call_candidates_get_type ()) #define MATRIX_EVENT_TYPE_CALL_CANDIDATES (matrix_event_call_candidates_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventCallCandidates, matrix_event_call_candidates, MATRIX_EVENT, CALL_CANDIDATES, MatrixEventCall) G_DECLARE_DERIVABLE_TYPE(MatrixEventCallCandidates, matrix_event_call_candidates, MATRIX_EVENT, CALL_CANDIDATES, MatrixEventCall);
struct _MatrixEventCallCandidatesClass { struct _MatrixEventCallCandidatesClass {
MatrixEventCallClass parent_class; MatrixEventCallClass parent_class;
}; };
MatrixEventCallCandidates* matrix_event_call_candidates_new (void); MatrixEventCallCandidates* matrix_event_call_candidates_new (void);
MatrixEventCallCandidates* matrix_event_call_candidates_construct (GType object_type);
MatrixCallCandidate* matrix_event_call_candidates_candidate_dup (const MatrixCallCandidate *event); MatrixCallCandidate* matrix_event_call_candidates_candidate_dup (const MatrixCallCandidate *event);
MatrixCallCandidate** matrix_event_call_candidates_get_candidates (MatrixEventCallCandidates *event, int *n_candidates); MatrixCallCandidate** matrix_event_call_candidates_get_candidates (MatrixEventCallCandidates *event, int *n_candidates);
void matrix_event_call_candidates_set_candidates (MatrixEventCallCandidates *event, MatrixCallCandidate **candidates, int n_candidates); void matrix_event_call_candidates_set_candidates (MatrixEventCallCandidates *event, MatrixCallCandidate **candidates, int n_candidates);

View File

@@ -48,6 +48,12 @@ matrix_event_call_hangup_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MATRIX_EVENT_BASE_CLASS(matrix_event_call_hangup_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_call_hangup_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventCallHangup *
matrix_event_call_hangup_construct(GType object_type)
{
return (MatrixEventCallHangup *)matrix_event_call_construct(object_type);
}
/** /**
* matrix_event_call_hangup_new: * matrix_event_call_hangup_new:
* *
@@ -58,7 +64,7 @@ matrix_event_call_hangup_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MatrixEventCallHangup * MatrixEventCallHangup *
matrix_event_call_hangup_new(void) matrix_event_call_hangup_new(void)
{ {
return (MatrixEventCallHangup *)matrix_event_call_construct(MATRIX_EVENT_TYPE_CALL_HANGUP); return matrix_event_call_hangup_construct(MATRIX_EVENT_TYPE_CALL_HANGUP);
} }
static void static void

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_CALL_HANGUP matrix_event_call_hangup_get_type() # define MATRIX_EVENT_TYPE_CALL_HANGUP matrix_event_call_hangup_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventCallHangup, matrix_event_call_hangup, MATRIX_EVENT, CALL_HANGUP, MatrixEventCall) G_DECLARE_DERIVABLE_TYPE(MatrixEventCallHangup, matrix_event_call_hangup, MATRIX_EVENT, CALL_HANGUP, MatrixEventCall);
struct _MatrixEventCallHangupClass { struct _MatrixEventCallHangupClass {
MatrixEventCallClass parent_class; MatrixEventCallClass parent_class;
}; };
MatrixEventCallHangup* matrix_event_call_hangup_new (void); MatrixEventCallHangup* matrix_event_call_hangup_new (void);
MatrixEventCallHangup* matrix_event_call_hangup_construct (GType object_type);
G_END_DECLS G_END_DECLS

View File

@@ -19,7 +19,6 @@
#include "matrix-event-call-invite.h" #include "matrix-event-call-invite.h"
#include "utils.h" #include "utils.h"
#include "config.h" #include "config.h"
#include "matrix-enumtypes.h"
/** /**
* SECTION:matrix-event-call-invite * SECTION:matrix-event-call-invite
@@ -159,6 +158,12 @@ matrix_event_call_invite_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MATRIX_EVENT_BASE_CLASS(matrix_event_call_invite_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_call_invite_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventCallInvite *
matrix_event_call_invite_construct(GType object_type)
{
return (MatrixEventCallInvite *)matrix_event_call_construct(object_type);
}
/** /**
* matrix_event_call_invite_new: * matrix_event_call_invite_new:
* *
@@ -168,7 +173,7 @@ matrix_event_call_invite_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
*/ */
MatrixEventCallInvite * MatrixEventCallInvite *
matrix_event_call_invite_new(void) { matrix_event_call_invite_new(void) {
return (MatrixEventCallInvite *)matrix_event_call_construct(MATRIX_EVENT_TYPE_CALL_INVITE); return matrix_event_call_invite_construct(MATRIX_EVENT_TYPE_CALL_INVITE);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-call-base.h" # include "matrix-event-call-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_CALL_INVITE (matrix_event_call_invite_get_type ()) #define MATRIX_EVENT_TYPE_CALL_INVITE (matrix_event_call_invite_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventCallInvite, matrix_event_call_invite, MATRIX_EVENT, CALL_INVITE, MatrixEventCall) G_DECLARE_DERIVABLE_TYPE(MatrixEventCallInvite, matrix_event_call_invite, MATRIX_EVENT, CALL_INVITE, MatrixEventCall);
struct _MatrixEventCallInviteClass { struct _MatrixEventCallInviteClass {
MatrixEventCallClass parent_class; MatrixEventCallClass parent_class;
}; };
MatrixEventCallInvite* matrix_event_call_invite_new (void); MatrixEventCallInvite* matrix_event_call_invite_new (void);
MatrixEventCallInvite* matrix_event_call_invite_construct (GType object_type);
MatrixCallOfferType matrix_event_call_invite_get_offer_type (MatrixEventCallInvite *event); MatrixCallOfferType matrix_event_call_invite_get_offer_type (MatrixEventCallInvite *event);
void matrix_event_call_invite_set_offer_type (MatrixEventCallInvite *event, MatrixCallOfferType offer_type); void matrix_event_call_invite_set_offer_type (MatrixEventCallInvite *event, MatrixCallOfferType offer_type);
const gchar* matrix_event_call_invite_get_sdp (MatrixEventCallInvite *event); const gchar* matrix_event_call_invite_get_sdp (MatrixEventCallInvite *event);

View File

@@ -195,6 +195,12 @@ matrix_event_presence_real_to_json(MatrixEventBase *matrix_event_base, JsonNode
} }
} }
MatrixEventPresence *
matrix_event_presence_construct(GType object_type)
{
return (MatrixEventPresence *)matrix_event_base_construct(object_type);
}
/** /**
* matrix_event_presence_new: * matrix_event_presence_new:
* *
@@ -205,7 +211,7 @@ matrix_event_presence_real_to_json(MatrixEventBase *matrix_event_base, JsonNode
MatrixEventPresence * MatrixEventPresence *
matrix_event_presence_new(void) matrix_event_presence_new(void)
{ {
return (MatrixEventPresence *)matrix_event_base_construct(MATRIX_EVENT_TYPE_PRESENCE); return matrix_event_presence_construct(MATRIX_EVENT_TYPE_PRESENCE);
} }
/** /**

View File

@@ -26,13 +26,15 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_PRESENCE matrix_event_presence_get_type() # define MATRIX_EVENT_TYPE_PRESENCE matrix_event_presence_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventPresence, matrix_event_presence, MATRIX_EVENT, PRESENCE, MatrixEventBase) G_DECLARE_DERIVABLE_TYPE(MatrixEventPresence, matrix_event_presence, MATRIX_EVENT, PRESENCE, MatrixEventBase);
struct _MatrixEventPresenceClass { struct _MatrixEventPresenceClass {
MatrixEventBaseClass parent_class; MatrixEventBaseClass parent_class;
}; };
GType matrix_event_presence_get_type (void) G_GNUC_CONST;
MatrixEventPresence* matrix_event_presence_new (void); MatrixEventPresence* matrix_event_presence_new (void);
MatrixEventPresence* matrix_event_presence_construct (GType object_type);
const gchar* matrix_event_presence_get_avatar_url (MatrixEventPresence *event); const gchar* matrix_event_presence_get_avatar_url (MatrixEventPresence *event);
void matrix_event_presence_set_avatar_url (MatrixEventPresence *event, const gchar *avatar_url); void matrix_event_presence_set_avatar_url (MatrixEventPresence *event, const gchar *avatar_url);
const gchar* matrix_event_presence_get_display_name (MatrixEventPresence *event); const gchar* matrix_event_presence_get_display_name (MatrixEventPresence *event);

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-receipt.h" #include "matrix-event-receipt.h"
#include "matrix-types.h"
#include "matrix-enumtypes.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
@@ -258,6 +257,12 @@ matrix_event_receipt_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *
} }
} }
MatrixEventReceipt *
matrix_event_receipt_construct(GType object_type)
{
return (MatrixEventReceipt *)matrix_event_base_construct(object_type);
}
/** /**
* matrix_event_receipt_new: * matrix_event_receipt_new:
* *
@@ -268,7 +273,7 @@ matrix_event_receipt_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *
MatrixEventReceipt * MatrixEventReceipt *
matrix_event_receipt_new(void) matrix_event_receipt_new(void)
{ {
return (MatrixEventReceipt *)matrix_event_base_construct(MATRIX_EVENT_TYPE_RECEIPT); return matrix_event_receipt_construct(MATRIX_EVENT_TYPE_RECEIPT);
} }
/** /**

View File

@@ -25,13 +25,15 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_RECEIPT matrix_event_receipt_get_type() # define MATRIX_EVENT_TYPE_RECEIPT matrix_event_receipt_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventReceipt, matrix_event_receipt, MATRIX_EVENT, RECEIPT, MatrixEventBase) G_DECLARE_DERIVABLE_TYPE(MatrixEventReceipt, matrix_event_receipt, MATRIX_EVENT, RECEIPT, MatrixEventBase);
struct _MatrixEventReceiptClass { struct _MatrixEventReceiptClass {
MatrixEventBaseClass parent_class; MatrixEventBaseClass parent_class;
}; };
GType matrix_event_receipt_get_type (void) G_GNUC_CONST;
MatrixEventReceipt* matrix_event_receipt_new (void); MatrixEventReceipt* matrix_event_receipt_new (void);
MatrixEventReceipt* matrix_event_receipt_construct (GType object_type);
const gchar* matrix_event_receipt_get_room_id (MatrixEventReceipt *event); const gchar* matrix_event_receipt_get_room_id (MatrixEventReceipt *event);
void matrix_event_receipt_set_room_id (MatrixEventReceipt *event, const gchar *room_id); void matrix_event_receipt_set_room_id (MatrixEventReceipt *event, const gchar *room_id);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-aliases.h" #include "matrix-event-room-aliases.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -144,6 +144,12 @@ matrix_event_room_aliases_real_to_json(MatrixEventBase *matrix_event_base, JsonN
} }
} }
MatrixEventRoomAliases *
matrix_event_room_aliases_construct (GType object_type)
{
return (MatrixEventRoomAliases *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_aliases_new: * matrix_event_room_aliases_new:
* *
@@ -154,7 +160,7 @@ matrix_event_room_aliases_real_to_json(MatrixEventBase *matrix_event_base, JsonN
MatrixEventRoomAliases * MatrixEventRoomAliases *
matrix_event_room_aliases_new(void) matrix_event_room_aliases_new(void)
{ {
return (MatrixEventRoomAliases *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_ALIASES); return matrix_event_room_aliases_construct(MATRIX_EVENT_TYPE_ROOM_ALIASES);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_ROOM_ALIASES matrix_event_room_aliases_get_type() # define MATRIX_EVENT_TYPE_ROOM_ALIASES matrix_event_room_aliases_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomAliases, matrix_event_room_aliases, MATRIX_EVENT, ROOM_ALIASES, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomAliases, matrix_event_room_aliases, MATRIX_EVENT, ROOM_ALIASES, MatrixEventState);
struct _MatrixEventRoomAliasesClass { struct _MatrixEventRoomAliasesClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomAliases* matrix_event_room_aliases_new (void); MatrixEventRoomAliases* matrix_event_room_aliases_new (void);
MatrixEventRoomAliases* matrix_event_room_aliases_construct (GType object_type);
const gchar** matrix_event_room_aliases_get_aliases (MatrixEventRoomAliases *event, int *n_aliases); const gchar** matrix_event_room_aliases_get_aliases (MatrixEventRoomAliases *event, int *n_aliases);
void matrix_event_room_aliases_set_aliases (MatrixEventRoomAliases *event, const gchar **aliases, int n_aliases); void matrix_event_room_aliases_set_aliases (MatrixEventRoomAliases *event, const gchar **aliases, int n_aliases);

View File

@@ -172,6 +172,12 @@ matrix_event_room_avatar_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MATRIX_EVENT_BASE_CLASS(matrix_event_room_avatar_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_avatar_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomAvatar *
matrix_event_room_avatar_construct(GType object_type)
{
return (MatrixEventRoomAvatar *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_avatar_new: * matrix_event_room_avatar_new:
* *
@@ -182,7 +188,7 @@ matrix_event_room_avatar_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MatrixEventRoomAvatar * MatrixEventRoomAvatar *
matrix_event_room_avatar_new(void) matrix_event_room_avatar_new(void)
{ {
return (MatrixEventRoomAvatar *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_AVATAR); return matrix_event_room_avatar_construct(MATRIX_EVENT_TYPE_ROOM_AVATAR);
} }
/** /**

View File

@@ -26,13 +26,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_ROOM_AVATAR matrix_event_room_avatar_get_type() # define MATRIX_EVENT_TYPE_ROOM_AVATAR matrix_event_room_avatar_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomAvatar, matrix_event_room_avatar, MATRIX_EVENT, ROOM_AVATAR, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomAvatar, matrix_event_room_avatar, MATRIX_EVENT, ROOM_AVATAR, MatrixEventState);
struct _MatrixEventRoomAvatarClass { struct _MatrixEventRoomAvatarClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomAvatar* matrix_event_room_avatar_new (void); MatrixEventRoomAvatar* matrix_event_room_avatar_new (void);
MatrixEventRoomAvatar* matrix_event_room_avatar_construct (GType object_type);
const gchar *matrix_event_room_avatar_get_url (MatrixEventRoomAvatar *event); const gchar *matrix_event_room_avatar_get_url (MatrixEventRoomAvatar *event);
void matrix_event_room_avatar_set_url (MatrixEventRoomAvatar *event, const gchar *url); void matrix_event_room_avatar_set_url (MatrixEventRoomAvatar *event, const gchar *url);
const gchar *matrix_event_room_avatar_get_thumbnail_url (MatrixEventRoomAvatar *event); const gchar *matrix_event_room_avatar_get_thumbnail_url (MatrixEventRoomAvatar *event);

View File

@@ -189,12 +189,6 @@ matrix_event_room_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *jso
} }
} }
/**
* matrix_event_room_construct:
* @object_type: the #GType of the object to be created
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixEventRoom * MatrixEventRoom *
matrix_event_room_construct(GType object_type) matrix_event_room_construct(GType object_type)
{ {

View File

@@ -23,7 +23,7 @@
# include "matrix-event-base.h" # include "matrix-event-base.h"
# define MATRIX_EVENT_TYPE_ROOM matrix_event_room_get_type() # define MATRIX_EVENT_TYPE_ROOM matrix_event_room_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoom, matrix_event_room, MATRIX_EVENT, ROOM, MatrixEventBase) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoom, matrix_event_room, MATRIX_EVENT, ROOM, MatrixEventBase);
struct _MatrixEventRoomClass { struct _MatrixEventRoomClass {
MatrixEventBaseClass parent_class; MatrixEventBaseClass parent_class;

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-canonical-alias.h" #include "matrix-event-room-canonical-alias.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -113,6 +113,12 @@ matrix_event_room_canonical_alias_real_to_json(MatrixEventBase *matrix_event_bas
MATRIX_EVENT_BASE_CLASS(matrix_event_room_canonical_alias_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_canonical_alias_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomCanonicalAlias *
matrix_event_room_canonical_alias_construct(GType object_type)
{
return (MatrixEventRoomCanonicalAlias *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_canonical_alias_new: * matrix_event_room_canonical_alias_new:
* *
@@ -123,7 +129,7 @@ matrix_event_room_canonical_alias_real_to_json(MatrixEventBase *matrix_event_bas
MatrixEventRoomCanonicalAlias * MatrixEventRoomCanonicalAlias *
matrix_event_room_canonical_alias_new(void) matrix_event_room_canonical_alias_new(void)
{ {
return (MatrixEventRoomCanonicalAlias *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_CANONICAL_ALIAS); return matrix_event_room_canonical_alias_construct(MATRIX_EVENT_TYPE_ROOM_CANONICAL_ALIAS);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_CANONICAL_ALIAS (matrix_event_room_canonical_alias_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_CANONICAL_ALIAS (matrix_event_room_canonical_alias_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomCanonicalAlias, matrix_event_room_canonical_alias, MATRIX_EVENT, ROOM_CANONICAL_ALIAS, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomCanonicalAlias, matrix_event_room_canonical_alias, MATRIX_EVENT, ROOM_CANONICAL_ALIAS, MatrixEventState);
struct _MatrixEventRoomCanonicalAliasClass { struct _MatrixEventRoomCanonicalAliasClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomCanonicalAlias *matrix_event_room_canonical_alias_new (void); MatrixEventRoomCanonicalAlias *matrix_event_room_canonical_alias_new (void);
MatrixEventRoomCanonicalAlias *matrix_event_room_canonical_alias_construct (GType object_type);
const gchar *matrix_event_room_canonical_alias_get_canonical_alias (MatrixEventRoomCanonicalAlias *event); const gchar *matrix_event_room_canonical_alias_get_canonical_alias (MatrixEventRoomCanonicalAlias *event);
void matrix_event_room_canonical_alias_set_canonical_alias (MatrixEventRoomCanonicalAlias *event, const gchar *canonical_alias); void matrix_event_room_canonical_alias_set_canonical_alias (MatrixEventRoomCanonicalAlias *event, const gchar *canonical_alias);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-create.h" #include "matrix-event-room-create.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -128,6 +128,12 @@ matrix_event_room_create_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MATRIX_EVENT_BASE_CLASS (matrix_event_room_create_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS (matrix_event_room_create_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomCreate *
matrix_event_room_create_construct(GType object_type)
{
return (MatrixEventRoomCreate *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_create_new: * matrix_event_room_create_new:
* *
@@ -138,7 +144,7 @@ matrix_event_room_create_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MatrixEventRoomCreate * MatrixEventRoomCreate *
matrix_event_room_create_new(void) matrix_event_room_create_new(void)
{ {
return (MatrixEventRoomCreate *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_CREATE); return matrix_event_room_create_construct(MATRIX_EVENT_TYPE_ROOM_CREATE);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_CREATE (matrix_event_room_create_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_CREATE (matrix_event_room_create_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomCreate, matrix_event_room_create, MATRIX_EVENT, ROOM_CREATE, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomCreate, matrix_event_room_create, MATRIX_EVENT, ROOM_CREATE, MatrixEventState);
struct _MatrixEventRoomCreateClass { struct _MatrixEventRoomCreateClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomCreate *matrix_event_room_create_new (void); MatrixEventRoomCreate *matrix_event_room_create_new (void);
MatrixEventRoomCreate *matrix_event_room_create_construct (GType object_type);
const gchar *matrix_event_room_create_get_creator (MatrixEventRoomCreate *event); const gchar *matrix_event_room_create_get_creator (MatrixEventRoomCreate *event);
void matrix_event_room_create_set_creator (MatrixEventRoomCreate *event, const gchar *creator); void matrix_event_room_create_set_creator (MatrixEventRoomCreate *event, const gchar *creator);
gboolean matrix_event_room_create_get_federate (MatrixEventRoomCreate *event); gboolean matrix_event_room_create_get_federate (MatrixEventRoomCreate *event);

View File

@@ -18,7 +18,6 @@
#include "matrix-event-room-guest-access.h" #include "matrix-event-room-guest-access.h"
#include "utils.h" #include "utils.h"
#include "matrix-enumtypes.h"
/** /**
* SECTION:matrix-event-room-guest-access * SECTION:matrix-event-room-guest-access
@@ -132,6 +131,12 @@ matrix_event_room_guest_access_real_to_json(MatrixEventBase *matrix_event_base,
MATRIX_EVENT_BASE_CLASS(matrix_event_room_guest_access_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_guest_access_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomGuestAccess *
matrix_event_room_guest_access_construct(GType object_type)
{
return (MatrixEventRoomGuestAccess *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_guest_access_new: * matrix_event_room_guest_access_new:
* *
@@ -142,7 +147,7 @@ matrix_event_room_guest_access_real_to_json(MatrixEventBase *matrix_event_base,
MatrixEventRoomGuestAccess * MatrixEventRoomGuestAccess *
matrix_event_room_guest_access_new(void) matrix_event_room_guest_access_new(void)
{ {
return (MatrixEventRoomGuestAccess *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_GUEST_ACCESS); return matrix_event_room_guest_access_construct(MATRIX_EVENT_TYPE_ROOM_GUEST_ACCESS);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-state-base.h" # include "matrix-event-state-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_GUEST_ACCESS (matrix_event_room_guest_access_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_GUEST_ACCESS (matrix_event_room_guest_access_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomGuestAccess, matrix_event_room_guest_access, MATRIX_EVENT, ROOM_GUEST_ACCESS, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomGuestAccess, matrix_event_room_guest_access, MATRIX_EVENT, ROOM_GUEST_ACCESS, MatrixEventState);
struct _MatrixEventRoomGuestAccessClass { struct _MatrixEventRoomGuestAccessClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomGuestAccess *matrix_event_room_guest_access_new(void); MatrixEventRoomGuestAccess *matrix_event_room_guest_access_new(void);
MatrixEventRoomGuestAccess *matrix_event_room_guest_access_construct(GType object_type);
MatrixGuestAccess matrix_event_room_guest_access_get_guest_access(MatrixEventRoomGuestAccess *event); MatrixGuestAccess matrix_event_room_guest_access_get_guest_access(MatrixEventRoomGuestAccess *event);
void matrix_event_room_guest_access_set_guest_access(MatrixEventRoomGuestAccess *event, MatrixGuestAccess guest_access); void matrix_event_room_guest_access_set_guest_access(MatrixEventRoomGuestAccess *event, MatrixGuestAccess guest_access);

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-room-history-visibility.h" #include "matrix-event-room-history-visibility.h"
#include "matrix-enumtypes.h"
#include "utils.h" #include "utils.h"
/** /**
@@ -132,6 +131,12 @@ matrix_event_room_history_visibility_real_to_json(MatrixEventBase *matrix_event_
MATRIX_EVENT_BASE_CLASS(matrix_event_room_history_visibility_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_history_visibility_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomHistoryVisibility *
matrix_event_room_history_visibility_construct(GType object_type)
{
return (MatrixEventRoomHistoryVisibility *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_history_visibility_new: * matrix_event_room_history_visibility_new:
* *
@@ -142,7 +147,7 @@ matrix_event_room_history_visibility_real_to_json(MatrixEventBase *matrix_event_
MatrixEventRoomHistoryVisibility * MatrixEventRoomHistoryVisibility *
matrix_event_room_history_visibility_new(void) matrix_event_room_history_visibility_new(void)
{ {
return (MatrixEventRoomHistoryVisibility *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_HISTORY_VISIBILITY); return matrix_event_room_history_visibility_construct(MATRIX_EVENT_TYPE_ROOM_HISTORY_VISIBILITY);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-state-base.h" # include "matrix-event-state-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_HISTORY_VISIBILITY (matrix_event_room_history_visibility_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_HISTORY_VISIBILITY (matrix_event_room_history_visibility_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomHistoryVisibility, matrix_event_room_history_visibility, MATRIX_EVENT, ROOM_HISTORY_VISIBILITY, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomHistoryVisibility, matrix_event_room_history_visibility, MATRIX_EVENT, ROOM_HISTORY_VISIBILITY, MatrixEventState);
struct _MatrixEventRoomHistoryVisibilityClass { struct _MatrixEventRoomHistoryVisibilityClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomHistoryVisibility *matrix_event_room_history_visibility_new(void); MatrixEventRoomHistoryVisibility *matrix_event_room_history_visibility_new(void);
MatrixEventRoomHistoryVisibility *matrix_event_room_history_visibility_construct(GType object_type);
MatrixHistoryVisibility matrix_event_room_history_visibility_get_visibility(MatrixEventRoomHistoryVisibility *event); MatrixHistoryVisibility matrix_event_room_history_visibility_get_visibility(MatrixEventRoomHistoryVisibility *event);
void matrix_event_room_history_visibility_set_visibility(MatrixEventRoomHistoryVisibility *event, MatrixHistoryVisibility history_visibility); void matrix_event_room_history_visibility_set_visibility(MatrixEventRoomHistoryVisibility *event, MatrixHistoryVisibility history_visibility);

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-event-room-join-rules.h" #include "matrix-event-room-join-rules.h"
#include "matrix-enumtypes.h"
#include "utils.h" #include "utils.h"
/** /**
@@ -137,6 +136,12 @@ matrix_event_room_join_rules_real_to_json(MatrixEventBase *matrix_event_base, Js
MATRIX_EVENT_BASE_CLASS(matrix_event_room_join_rules_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_join_rules_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomJoinRules *
matrix_event_room_join_rules_construct(GType object_type)
{
return (MatrixEventRoomJoinRules *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_join_rules_new: * matrix_event_room_join_rules_new:
* *
@@ -146,7 +151,7 @@ matrix_event_room_join_rules_real_to_json(MatrixEventBase *matrix_event_base, Js
*/ */
MatrixEventRoomJoinRules * MatrixEventRoomJoinRules *
matrix_event_room_join_rules_new(void) { matrix_event_room_join_rules_new(void) {
return (MatrixEventRoomJoinRules *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_JOIN_RULES); return matrix_event_room_join_rules_construct(MATRIX_EVENT_TYPE_ROOM_JOIN_RULES);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-state-base.h" # include "matrix-event-state-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_JOIN_RULES (matrix_event_room_join_rules_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_JOIN_RULES (matrix_event_room_join_rules_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomJoinRules, matrix_event_room_join_rules, MATRIX_EVENT, ROOM_JOIN_RULES, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomJoinRules, matrix_event_room_join_rules, MATRIX_EVENT, ROOM_JOIN_RULES, MatrixEventState);
struct _MatrixEventRoomJoinRulesClass { struct _MatrixEventRoomJoinRulesClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomJoinRules *matrix_event_room_join_rules_new (void); MatrixEventRoomJoinRules *matrix_event_room_join_rules_new (void);
MatrixEventRoomJoinRules *matrix_event_room_join_rules_construct (GType object_type);
MatrixJoinRules matrix_event_room_join_rules_get_join_rules (MatrixEventRoomJoinRules *event); MatrixJoinRules matrix_event_room_join_rules_get_join_rules (MatrixEventRoomJoinRules *event);
void matrix_event_room_join_rules_set_join_rules (MatrixEventRoomJoinRules *event, MatrixJoinRules join_rules); void matrix_event_room_join_rules_set_join_rules (MatrixEventRoomJoinRules *event, MatrixJoinRules join_rules);

View File

@@ -18,7 +18,6 @@
#include "matrix-event-room-member.h" #include "matrix-event-room-member.h"
#include "config.h" #include "config.h"
#include "matrix-enumtypes.h"
#include "utils.h" #include "utils.h"
/** /**
@@ -339,6 +338,12 @@ matrix_event_room_member_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
} }
} }
MatrixEventRoomMember *
matrix_event_room_member_construct(GType object_type)
{
return (MatrixEventRoomMember *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_member_new: * matrix_event_room_member_new:
* *
@@ -349,7 +354,7 @@ matrix_event_room_member_real_to_json(MatrixEventBase *matrix_event_base, JsonNo
MatrixEventRoomMember * MatrixEventRoomMember *
matrix_event_room_member_new(void) matrix_event_room_member_new(void)
{ {
return (MatrixEventRoomMember *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_MEMBER); return matrix_event_room_member_construct(MATRIX_EVENT_TYPE_ROOM_MEMBER);
} }
/** /**

View File

@@ -21,18 +21,19 @@
# include <glib-object.h> # include <glib-object.h>
# include "matrix-event-state-base.h" # include "matrix-event-state-base.h"
# include "matrix-types.h" # include "matrix-enumtypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_ROOM_MEMBER matrix_event_room_member_get_type() # define MATRIX_EVENT_TYPE_ROOM_MEMBER matrix_event_room_member_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMember, matrix_event_room_member, MATRIX_EVENT, ROOM_MEMBER, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMember, matrix_event_room_member, MATRIX_EVENT, ROOM_MEMBER, MatrixEventState);
struct _MatrixEventRoomMemberClass { struct _MatrixEventRoomMemberClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomMember *matrix_event_room_member_new (void); MatrixEventRoomMember *matrix_event_room_member_new (void);
MatrixEventRoomMember *matrix_event_room_member_construct (GType object_type);
MatrixRoomMembership matrix_event_room_member_get_membership (MatrixEventRoomMember *event); MatrixRoomMembership matrix_event_room_member_get_membership (MatrixEventRoomMember *event);
void matrix_event_room_member_set_membership (MatrixEventRoomMember *event, MatrixRoomMembership membership); void matrix_event_room_member_set_membership (MatrixEventRoomMember *event, MatrixRoomMembership membership);
const gchar *matrix_event_room_member_get_avatar_url (MatrixEventRoomMember *event); const gchar *matrix_event_room_member_get_avatar_url (MatrixEventRoomMember *event);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-message-feedback.h" #include "matrix-event-room-message-feedback.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
/** /**
* SECTION:matrix-event-room-message-feedback * SECTION:matrix-event-room-message-feedback
@@ -113,6 +113,12 @@ matrix_event_room_message_feedback_real_to_json(MatrixEventBase *matrix_event_ba
MATRIX_EVENT_BASE_CLASS(matrix_event_room_message_feedback_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_message_feedback_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomMessageFeedback *
matrix_event_room_message_feedback_construct(GType object_type)
{
return (MatrixEventRoomMessageFeedback *)matrix_event_room_construct(object_type);
}
/** /**
* matrix_event_room_message_feedback_new: * matrix_event_room_message_feedback_new:
* *
@@ -123,7 +129,7 @@ matrix_event_room_message_feedback_real_to_json(MatrixEventBase *matrix_event_ba
MatrixEventRoomMessageFeedback * MatrixEventRoomMessageFeedback *
matrix_event_room_message_feedback_new(void) matrix_event_room_message_feedback_new(void)
{ {
return (MatrixEventRoomMessageFeedback *)matrix_event_room_construct(MATRIX_EVENT_TYPE_ROOM_MESSAGE_FEEDBACK); return matrix_event_room_message_feedback_construct(MATRIX_EVENT_TYPE_ROOM_MESSAGE_FEEDBACK);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_MESSAGE_FEEDBACK (matrix_event_room_message_feedback_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_MESSAGE_FEEDBACK (matrix_event_room_message_feedback_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMessageFeedback, matrix_event_room_message_feedback, MATRIX_EVENT, ROOM_MESSAGE_FEEDBACK, MatrixEventRoom) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMessageFeedback, matrix_event_room_message_feedback, MATRIX_EVENT, ROOM_MESSAGE_FEEDBACK, MatrixEventRoom);
struct _MatrixEventRoomMessageFeedbackClass { struct _MatrixEventRoomMessageFeedbackClass {
MatrixEventRoomClass parent_class; MatrixEventRoomClass parent_class;
}; };
MatrixEventRoomMessageFeedback *matrix_event_room_message_feedback_new(void); MatrixEventRoomMessageFeedback *matrix_event_room_message_feedback_new(void);
MatrixEventRoomMessageFeedback *matrix_event_room_message_feedback_construct(GType object_type);
const gchar *matrix_event_room_message_feedback_get_feedback_type(MatrixEventRoomMessageFeedback *event); const gchar *matrix_event_room_message_feedback_get_feedback_type(MatrixEventRoomMessageFeedback *event);
void matrix_event_room_message_feedback_set_feedback_type(MatrixEventRoomMessageFeedback *event, const gchar *feedback_type); void matrix_event_room_message_feedback_set_feedback_type(MatrixEventRoomMessageFeedback *event, const gchar *feedback_type);
const gchar *matrix_event_room_message_feedback_get_target_event_id(MatrixEventRoomMessageFeedback *event); const gchar *matrix_event_room_message_feedback_get_target_event_id(MatrixEventRoomMessageFeedback *event);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-message.h" #include "matrix-event-room-message.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
/** /**
* SECTION:matrix-event-room-message * SECTION:matrix-event-room-message
@@ -132,6 +132,12 @@ matrix_event_room_message_real_to_json(MatrixEventBase *matrix_event_base, JsonN
MATRIX_EVENT_BASE_CLASS(matrix_event_room_message_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_message_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomMessage *
matrix_event_room_message_construct(GType object_type)
{
return (MatrixEventRoomMessage *)matrix_event_room_construct(object_type);
}
/** /**
* matrix_event_room_message_new: * matrix_event_room_message_new:
* *
@@ -141,7 +147,7 @@ matrix_event_room_message_real_to_json(MatrixEventBase *matrix_event_base, JsonN
*/ */
MatrixEventRoomMessage * MatrixEventRoomMessage *
matrix_event_room_message_new(void) { matrix_event_room_message_new(void) {
return (MatrixEventRoomMessage *)matrix_event_room_construct(MATRIX_EVENT_TYPE_ROOM_MESSAGE); return matrix_event_room_message_construct(MATRIX_EVENT_TYPE_ROOM_MESSAGE);
} }
/** /**

View File

@@ -26,13 +26,15 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_MESSAGE matrix_event_room_message_get_type() #define MATRIX_EVENT_TYPE_ROOM_MESSAGE matrix_event_room_message_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMessage, matrix_event_room_message, MATRIX_EVENT, ROOM_MESSAGE, MatrixEventRoom) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomMessage, matrix_event_room_message, MATRIX_EVENT, ROOM_MESSAGE, MatrixEventRoom);
struct _MatrixEventRoomMessageClass { struct _MatrixEventRoomMessageClass {
MatrixEventRoomClass parent_class; MatrixEventRoomClass parent_class;
}; };
MatrixEventRoomMessage *matrix_event_room_message_new(void); MatrixEventRoomMessage *matrix_event_room_message_new(void);
MatrixEventRoomMessage *matrix_event_room_message_construct(GType object_type);
GType matrix_message_base_get_type(void) G_GNUC_CONST;
MatrixMessageBase *matrix_event_room_message_get_message(MatrixEventRoomMessage *event); MatrixMessageBase *matrix_event_room_message_get_message(MatrixEventRoomMessage *event);
void matrix_event_room_message_set_message(MatrixEventRoomMessage *event, MatrixMessageBase *message); void matrix_event_room_message_set_message(MatrixEventRoomMessage *event, MatrixMessageBase *message);
JsonNode *matrix_event_room_message_get_fallback_content(MatrixEventRoomMessage *event); JsonNode *matrix_event_room_message_get_fallback_content(MatrixEventRoomMessage *event);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-name.h" #include "matrix-event-room-name.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -119,6 +119,12 @@ matrix_event_room_name_real_to_json(MatrixEventBase *matrix_event_base, JsonNode
MATRIX_EVENT_BASE_CLASS(matrix_event_room_name_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_name_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomName *
matrix_event_room_name_construct(GType object_type)
{
return (MatrixEventRoomName *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_name_new: * matrix_event_room_name_new:
* *
@@ -129,7 +135,7 @@ matrix_event_room_name_real_to_json(MatrixEventBase *matrix_event_base, JsonNode
MatrixEventRoomName * MatrixEventRoomName *
matrix_event_room_name_new(void) matrix_event_room_name_new(void)
{ {
return (MatrixEventRoomName *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_NAME); return matrix_event_room_name_construct(MATRIX_EVENT_TYPE_ROOM_NAME);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_ROOM_NAME matrix_event_room_name_get_type() # define MATRIX_EVENT_TYPE_ROOM_NAME matrix_event_room_name_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomName, matrix_event_room_name, MATRIX_EVENT, ROOM_NAME, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomName, matrix_event_room_name, MATRIX_EVENT, ROOM_NAME, MatrixEventState);
struct _MatrixEventRoomNameClass { struct _MatrixEventRoomNameClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomName *matrix_event_room_name_new(void); MatrixEventRoomName *matrix_event_room_name_new(void);
MatrixEventRoomName *matrix_event_room_name_construct(GType object_type);
const gchar *matrix_event_room_name_get_name(MatrixEventRoomName *event); const gchar *matrix_event_room_name_get_name(MatrixEventRoomName *event);
void matrix_event_room_name_set_name(MatrixEventRoomName *event, const gchar *name); void matrix_event_room_name_set_name(MatrixEventRoomName *event, const gchar *name);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-power-levels.h" #include "matrix-event-room-power-levels.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -289,6 +289,12 @@ matrix_event_room_power_levels_set_event_level(MatrixEventRoomPowerLevels *matri
g_hash_table_insert(priv->_event_levels, g_strdup(event_type), GINT_TO_POINTER(level)); g_hash_table_insert(priv->_event_levels, g_strdup(event_type), GINT_TO_POINTER(level));
} }
MatrixEventRoomPowerLevels *
matrix_event_room_power_levels_construct(GType object_type)
{
return (MatrixEventRoomPowerLevels *)matrix_event_state_construct(object_type);
}
/** /**
* matrix_event_room_power_levels_new: * matrix_event_room_power_levels_new:
* *
@@ -299,7 +305,7 @@ matrix_event_room_power_levels_set_event_level(MatrixEventRoomPowerLevels *matri
MatrixEventRoomPowerLevels * MatrixEventRoomPowerLevels *
matrix_event_room_power_levels_new(void) matrix_event_room_power_levels_new(void)
{ {
return (MatrixEventRoomPowerLevels *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS); return matrix_event_room_power_levels_construct(MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS);
} }
/** /**
@@ -527,12 +533,6 @@ matrix_event_room_power_levels_set_invite(MatrixEventRoomPowerLevels *matrix_eve
} }
} }
/**
* matrix_event_room_power_levels_get_event_levels:
* @event: a #MatrixEventRoomPowerLevels
*
* Returns: (transfer none): the list of event type power level requirements
*/
GHashTable * GHashTable *
matrix_event_room_power_levels_get_event_levels(MatrixEventRoomPowerLevels *matrix_event_room_power_levels) matrix_event_room_power_levels_get_event_levels(MatrixEventRoomPowerLevels *matrix_event_room_power_levels)
{ {

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS (matrix_event_room_power_levels_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS (matrix_event_room_power_levels_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomPowerLevels, matrix_event_room_power_levels, MATRIX_EVENT, ROOM_POWER_LEVELS, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomPowerLevels, matrix_event_room_power_levels, MATRIX_EVENT, ROOM_POWER_LEVELS, MatrixEventState);
struct _MatrixEventRoomPowerLevelsClass { struct _MatrixEventRoomPowerLevelsClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomPowerLevels *matrix_event_room_power_levels_new(void); MatrixEventRoomPowerLevels *matrix_event_room_power_levels_new(void);
MatrixEventRoomPowerLevels *matrix_event_room_power_levels_construct(GType object_type);
void matrix_event_room_power_levels_set_user_level(MatrixEventRoomPowerLevels *event, const gchar *user_id, gint level); void matrix_event_room_power_levels_set_user_level(MatrixEventRoomPowerLevels *event, const gchar *user_id, gint level);
void matrix_event_room_power_levels_set_event_level(MatrixEventRoomPowerLevels *event, const gchar *event_type, gint level); void matrix_event_room_power_levels_set_event_level(MatrixEventRoomPowerLevels *event, const gchar *event_type, gint level);
gint matrix_event_room_power_levels_get_users_default(MatrixEventRoomPowerLevels *event); gint matrix_event_room_power_levels_get_users_default(MatrixEventRoomPowerLevels *event);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-redaction.h" #include "matrix-event-room-redaction.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
/** /**
* SECTION:matrix-event-room-redaction * SECTION:matrix-event-room-redaction
@@ -114,6 +114,12 @@ matrix_event_room_redaction_real_to_json(MatrixEventBase *matrix_event_base, Jso
MATRIX_EVENT_BASE_CLASS(matrix_event_room_redaction_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_redaction_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomRedaction *
matrix_event_room_redaction_construct(GType object_type)
{
return (MatrixEventRoomRedaction *)matrix_event_room_construct(object_type);
}
/** /**
* matrix_event_room_redaction_new: * matrix_event_room_redaction_new:
* *
@@ -124,7 +130,7 @@ matrix_event_room_redaction_real_to_json(MatrixEventBase *matrix_event_base, Jso
MatrixEventRoomRedaction * MatrixEventRoomRedaction *
matrix_event_room_redaction_new(void) matrix_event_room_redaction_new(void)
{ {
return (MatrixEventRoomRedaction *)matrix_event_room_construct(MATRIX_EVENT_TYPE_ROOM_REDACTION); return matrix_event_room_redaction_construct(MATRIX_EVENT_TYPE_ROOM_REDACTION);
} }
const gchar * const gchar *

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_EVENT_TYPE_ROOM_REDACTION (matrix_event_room_redaction_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_REDACTION (matrix_event_room_redaction_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomRedaction, matrix_event_room_redaction, MATRIX_EVENT, ROOM_REDACTION, MatrixEventRoom) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomRedaction, matrix_event_room_redaction, MATRIX_EVENT, ROOM_REDACTION, MatrixEventRoom);
struct _MatrixEventRoomRedactionClass { struct _MatrixEventRoomRedactionClass {
MatrixEventRoomClass parent_class; MatrixEventRoomClass parent_class;
}; };
MatrixEventRoomRedaction* matrix_event_room_redaction_new (void); MatrixEventRoomRedaction* matrix_event_room_redaction_new (void);
MatrixEventRoomRedaction* matrix_event_room_redaction_construct (GType object_type);
const gchar* matrix_event_room_redaction_get_reason (MatrixEventRoomRedaction* self); const gchar* matrix_event_room_redaction_get_reason (MatrixEventRoomRedaction* self);
void matrix_event_room_redaction_set_reason (MatrixEventRoomRedaction* self, const gchar* value); void matrix_event_room_redaction_set_reason (MatrixEventRoomRedaction* self, const gchar* value);
const gchar* matrix_event_room_redaction_get_redacted_event_id (MatrixEventRoomRedaction* self); const gchar* matrix_event_room_redaction_get_redacted_event_id (MatrixEventRoomRedaction* self);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-third-party-invite.h" #include "matrix-event-room-third-party-invite.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -278,9 +278,15 @@ matrix_event_room_third_party_invite_real_to_json(MatrixEventBase *matrix_event_
MATRIX_EVENT_BASE_CLASS(matrix_event_room_third_party_invite_parent_class)->to_json(matrix_event_base, json_data, error); MATRIX_EVENT_BASE_CLASS(matrix_event_room_third_party_invite_parent_class)->to_json(matrix_event_base, json_data, error);
} }
MatrixEventRoomThirdPartyInvite *
matrix_event_room_third_party_invite_construct(GType object_type)
{
return (MatrixEventRoomThirdPartyInvite *)matrix_event_state_construct(object_type);
}
MatrixEventRoomThirdPartyInvite *matrix_event_room_third_party_invite_new(void) MatrixEventRoomThirdPartyInvite *matrix_event_room_third_party_invite_new(void)
{ {
return (MatrixEventRoomThirdPartyInvite *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_THIRD_PARTY_INVITE); return matrix_event_room_third_party_invite_construct(MATRIX_EVENT_TYPE_ROOM_THIRD_PARTY_INVITE);
} }
const gchar * const gchar *

View File

@@ -38,13 +38,14 @@ const gchar *matrix_third_party_invite_public_key_get_validity_url(MatrixThirdPa
void matrix_third_party_invite_public_key_set_validity_url(MatrixThirdPartyInvitePublicKey *matrix_third_party_invite_public_key, const gchar *validity_url); void matrix_third_party_invite_public_key_set_validity_url(MatrixThirdPartyInvitePublicKey *matrix_third_party_invite_public_key, const gchar *validity_url);
#define MATRIX_EVENT_TYPE_ROOM_THIRD_PARTY_INVITE (matrix_event_room_third_party_invite_get_type ()) #define MATRIX_EVENT_TYPE_ROOM_THIRD_PARTY_INVITE (matrix_event_room_third_party_invite_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomThirdPartyInvite, matrix_event_room_third_party_invite, MATRIX_EVENT, ROOM_THIRD_PARTY_INVITE, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomThirdPartyInvite, matrix_event_room_third_party_invite, MATRIX_EVENT, ROOM_THIRD_PARTY_INVITE, MatrixEventState);
struct _MatrixEventRoomThirdPartyInviteClass { struct _MatrixEventRoomThirdPartyInviteClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomThirdPartyInvite* matrix_event_room_third_party_invite_new (void); MatrixEventRoomThirdPartyInvite* matrix_event_room_third_party_invite_new (void);
MatrixEventRoomThirdPartyInvite* matrix_event_room_third_party_invite_construct (GType object_type);
const gchar* matrix_event_room_third_party_invite_get_display_name (MatrixEventRoomThirdPartyInvite* self); const gchar* matrix_event_room_third_party_invite_get_display_name (MatrixEventRoomThirdPartyInvite* self);
void matrix_event_room_third_party_invite_set_display_name (MatrixEventRoomThirdPartyInvite* self, const gchar* value); void matrix_event_room_third_party_invite_set_display_name (MatrixEventRoomThirdPartyInvite* self, const gchar* value);
const gchar* matrix_event_room_third_party_invite_get_key_validity_url (MatrixEventRoomThirdPartyInvite* self); const gchar* matrix_event_room_third_party_invite_get_key_validity_url (MatrixEventRoomThirdPartyInvite* self);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-room-topic.h" #include "matrix-event-room-topic.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -122,9 +122,15 @@ matrix_event_room_topic_real_to_json(MatrixEventBase *matrix_event_base, JsonNod
} }
} }
MatrixEventRoomTopic *
matrix_event_room_topic_construct(GType object_type)
{
return (MatrixEventRoomTopic *)matrix_event_state_construct(object_type);
}
MatrixEventRoomTopic * MatrixEventRoomTopic *
matrix_event_room_topic_new(void) { matrix_event_room_topic_new(void) {
return (MatrixEventRoomTopic *)matrix_event_state_construct(MATRIX_EVENT_TYPE_ROOM_TOPIC); return matrix_event_room_topic_construct(MATRIX_EVENT_TYPE_ROOM_TOPIC);
} }
const gchar * const gchar *

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_ROOM_TOPIC matrix_event_room_topic_get_type () # define MATRIX_EVENT_TYPE_ROOM_TOPIC matrix_event_room_topic_get_type ()
G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomTopic, matrix_event_room_topic, MATRIX_EVENT, ROOM_TOPIC, MatrixEventState) G_DECLARE_DERIVABLE_TYPE(MatrixEventRoomTopic, matrix_event_room_topic, MATRIX_EVENT, ROOM_TOPIC, MatrixEventState);
struct _MatrixEventRoomTopicClass { struct _MatrixEventRoomTopicClass {
MatrixEventStateClass parent_class; MatrixEventStateClass parent_class;
}; };
MatrixEventRoomTopic* matrix_event_room_topic_new (void); MatrixEventRoomTopic* matrix_event_room_topic_new (void);
MatrixEventRoomTopic* matrix_event_room_topic_construct (GType object_type);
const gchar* matrix_event_room_topic_get_topic (MatrixEventRoomTopic* self); const gchar* matrix_event_room_topic_get_topic (MatrixEventRoomTopic* self);
void matrix_event_room_topic_set_topic (MatrixEventRoomTopic* self, const gchar* value); void matrix_event_room_topic_set_topic (MatrixEventRoomTopic* self, const gchar* value);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-state-base.h" #include "matrix-event-state-base.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -154,12 +154,6 @@ matrix_event_state_get_stripped_node(MatrixEventState *matrix_event_state)
return matrix_event_base_get_json(matrix_event_base); return matrix_event_base_get_json(matrix_event_base);
} }
/**
* matrix_event_state_construct:
* @object_type: the #GType of the object to be created
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixEventState * MatrixEventState *
matrix_event_state_construct(GType object_type) matrix_event_state_construct(GType object_type)
{ {

View File

@@ -32,7 +32,7 @@
typedef struct _MatrixEventStateClass MatrixEventStateClass; typedef struct _MatrixEventStateClass MatrixEventStateClass;
typedef struct _MatrixEventState MatrixEventState; typedef struct _MatrixEventState MatrixEventState;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventState, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixEventState, g_object_unref);
struct _MatrixEventStateClass { struct _MatrixEventStateClass {
MatrixEventRoomClass parent_class; MatrixEventRoomClass parent_class;

View File

@@ -130,6 +130,12 @@ matrix_event_tag_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *json
} }
} }
MatrixEventTag *
matrix_event_tag_construct(GType object_type)
{
return (MatrixEventTag *)matrix_event_base_construct(object_type);
}
/** /**
* matrix_event_tag_new: * matrix_event_tag_new:
* *
@@ -140,7 +146,7 @@ matrix_event_tag_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *json
MatrixEventTag * MatrixEventTag *
matrix_event_tag_new(void) matrix_event_tag_new(void)
{ {
return (MatrixEventTag *)matrix_event_base_construct(MATRIX_EVENT_TYPE_TAG); return matrix_event_tag_construct(MATRIX_EVENT_TYPE_TAG);
} }
/** /**

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_TAG matrix_event_tag_get_type() # define MATRIX_EVENT_TYPE_TAG matrix_event_tag_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventTag, matrix_event_tag, MATRIX_EVENT, TAG, MatrixEventBase) G_DECLARE_DERIVABLE_TYPE(MatrixEventTag, matrix_event_tag, MATRIX_EVENT, TAG, MatrixEventBase);
struct _MatrixEventTagClass { struct _MatrixEventTagClass {
MatrixEventBaseClass parent_class; MatrixEventBaseClass parent_class;
}; };
MatrixEventTag* matrix_event_tag_new(void); MatrixEventTag* matrix_event_tag_new(void);
MatrixEventTag* matrix_event_tag_construct(GType object_type);
GHashTable *matrix_event_tag_get_tags(MatrixEventTag *event); GHashTable *matrix_event_tag_get_tags(MatrixEventTag *event);
void matrix_event_tag_set_tags(MatrixEventTag *event, GHashTable *tags); void matrix_event_tag_set_tags(MatrixEventTag *event, GHashTable *tags);

View File

@@ -17,7 +17,7 @@
*/ */
#include "matrix-event-typing.h" #include "matrix-event-typing.h"
#include "matrix-types.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
/** /**
@@ -144,10 +144,16 @@ matrix_event_typing_real_to_json(MatrixEventBase *matrix_event_base, JsonNode *j
} }
} }
MatrixEventTyping *
matrix_event_typing_construct(GType object_type)
{
return (MatrixEventTyping *)matrix_event_base_construct(object_type);
}
MatrixEventTyping * MatrixEventTyping *
matrix_event_typing_new(void) matrix_event_typing_new(void)
{ {
return (MatrixEventTyping *)matrix_event_base_construct(MATRIX_EVENT_TYPE_TYPING); return matrix_event_typing_construct(MATRIX_EVENT_TYPE_TYPING);
} }
const gchar * const gchar *
@@ -179,13 +185,6 @@ matrix_event_typing_set_room_id(MatrixEventTyping *matrix_event_typing, const gc
} }
} }
/**
* matrix_event_typing_get_user_ids:
* @event: a #MatrixEventTyping
* @n_user_ids: (nullable): placeholder for the length of the returned list
*
* Returns: (transfer none): a list of typing users
*/
gchar ** gchar **
matrix_event_typing_get_user_ids(MatrixEventTyping *matrix_event_typing, int *n_user_ids) matrix_event_typing_get_user_ids(MatrixEventTyping *matrix_event_typing, int *n_user_ids)
{ {

View File

@@ -25,17 +25,18 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_EVENT_TYPE_TYPING matrix_event_typing_get_type() # define MATRIX_EVENT_TYPE_TYPING matrix_event_typing_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixEventTyping, matrix_event_typing, MATRIX_EVENT, TYPING, MatrixEventBase) G_DECLARE_DERIVABLE_TYPE(MatrixEventTyping, matrix_event_typing, MATRIX_EVENT, TYPING, MatrixEventBase);
struct _MatrixEventTypingClass { struct _MatrixEventTypingClass {
MatrixEventBaseClass parent_class; MatrixEventBaseClass parent_class;
}; };
MatrixEventTyping* matrix_event_typing_new(void); MatrixEventTyping* matrix_event_typing_new (void);
const gchar* matrix_event_typing_get_room_id(MatrixEventTyping *event); MatrixEventTyping* matrix_event_typing_construct (GType object_type);
void matrix_event_typing_set_room_id(MatrixEventTyping *event, const gchar *room_id); const gchar* matrix_event_typing_get_room_id (MatrixEventTyping* self);
gchar **matrix_event_typing_get_user_ids(MatrixEventTyping *event, int *n_user_ids); void matrix_event_typing_set_room_id (MatrixEventTyping* self, const gchar* value);
void matrix_event_typing_set_user_ids(MatrixEventTyping *event, gchar **user_ids, int n_user_ids); gchar** matrix_event_typing_get_user_ids (MatrixEventTyping* self, int* result_length1);
void matrix_event_typing_set_user_ids (MatrixEventTyping* self, gchar** value, int value_length1);
G_END_DECLS G_END_DECLS

14
src/matrix-glib-0.0.pc.in Normal file
View File

@@ -0,0 +1,14 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
datarootdir=@datarootdir@
datadir=@datadir@
includedir=@includedir@
Name: libmatrix-glib
Description: GObject API for communicating with a Matrix.org Homeserver
URL: http://gergely.polonkai.eu/matrix-glib-sdk
Version: @MATRIX_GLIB_VERSION@
Requires: glib-2.0 gobject-2.0 gio-2.0 json-glib-1.0
Libs: -L${libdir} -lmatrix-glib-@MATRIX_GLIB_API_VERSION@
Cflags: -I${includedir}/matrix-glib-@MATRIX_GLIB_API_VERSION@

View File

@@ -1,6 +0,0 @@
{
global:
matrix_*;
local:
*;
}

View File

@@ -98,6 +98,25 @@ _matrix_http_api_set_url(MatrixHTTPAPI *matrix_http_api, SoupURI **uri, const gc
g_free(url); g_free(url);
} }
MatrixHTTPAPI *
matrix_http_api_construct(GType object_type, const gchar *base_url, const gchar *token)
{
MatrixHTTPAPI *ret;
MatrixHTTPAPIPrivate *priv;
g_return_val_if_fail(base_url != NULL, NULL);
ret = (MatrixHTTPAPI*) g_object_new(object_type,
"base-url", base_url,
"token", token,
NULL);
priv = matrix_http_api_get_instance_private(ret);
g_object_set(priv->soup_session, "ssl-strict", TRUE, NULL);
return ret;
}
/** /**
* matrix_http_api_new: * matrix_http_api_new:
* @base_url: the base URL of the homeserver to use * @base_url: the base URL of the homeserver to use
@@ -110,20 +129,7 @@ _matrix_http_api_set_url(MatrixHTTPAPI *matrix_http_api, SoupURI **uri, const gc
MatrixHTTPAPI * MatrixHTTPAPI *
matrix_http_api_new(const gchar *base_url, const gchar *token) matrix_http_api_new(const gchar *base_url, const gchar *token)
{ {
MatrixHTTPAPI *ret; return matrix_http_api_construct(MATRIX_TYPE_HTTP_API, base_url, token);
MatrixHTTPAPIPrivate *priv;
g_return_val_if_fail(base_url != NULL, NULL);
ret = (MatrixHTTPAPI*) g_object_new(MATRIX_TYPE_HTTP_API,
"base-url", base_url,
"token", token,
NULL);
priv = matrix_http_api_get_instance_private(ret);
g_object_set(priv->soup_session, "ssl-strict", TRUE, NULL);
return ret;
} }
static GHashTable * static GHashTable *

View File

@@ -33,7 +33,7 @@ G_BEGIN_DECLS
typedef struct _MatrixHTTPAPI MatrixHTTPAPI; typedef struct _MatrixHTTPAPI MatrixHTTPAPI;
typedef struct _MatrixHTTPAPIClass MatrixHTTPAPIClass; typedef struct _MatrixHTTPAPIClass MatrixHTTPAPIClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixHTTPAPI, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixHTTPAPI, g_object_unref);
struct _MatrixHTTPAPI { struct _MatrixHTTPAPI {
GObject parent_instance; GObject parent_instance;
@@ -45,6 +45,7 @@ struct _MatrixHTTPAPIClass {
GType matrix_http_api_get_type(void) G_GNUC_CONST; GType matrix_http_api_get_type(void) G_GNUC_CONST;
MatrixHTTPAPI *matrix_http_api_new(const gchar *base_url, const gchar *token); MatrixHTTPAPI *matrix_http_api_new(const gchar *base_url, const gchar *token);
MatrixHTTPAPI *matrix_http_api_construct(GType object_type, const gchar *base_url, const gchar *token);
const gchar *matrix_http_api_get_base_url(MatrixHTTPAPI *http_api); const gchar *matrix_http_api_get_base_url(MatrixHTTPAPI *http_api);
void matrix_http_api_set_base_url(MatrixHTTPAPI *http_api, const gchar *base_url); void matrix_http_api_set_base_url(MatrixHTTPAPI *http_api, const gchar *base_url);
gboolean matrix_http_api_get_validate_certificate(MatrixHTTPAPI *http_api); gboolean matrix_http_api_get_validate_certificate(MatrixHTTPAPI *http_api);

View File

@@ -53,15 +53,21 @@ typedef struct {
G_DEFINE_TYPE_EXTENDED(MatrixHTTPClient, matrix_http_client, MATRIX_TYPE_HTTP_API, 0, G_ADD_PRIVATE(MatrixHTTPClient) G_IMPLEMENT_INTERFACE(MATRIX_TYPE_CLIENT, matrix_http_client_matrix_client_interface_init)); G_DEFINE_TYPE_EXTENDED(MatrixHTTPClient, matrix_http_client, MATRIX_TYPE_HTTP_API, 0, G_ADD_PRIVATE(MatrixHTTPClient) G_IMPLEMENT_INTERFACE(MATRIX_TYPE_CLIENT, matrix_http_client_matrix_client_interface_init));
MatrixHTTPClient * MatrixHTTPClient *
matrix_http_client_new(const gchar* base_url) matrix_http_client_construct(GType object_type, const gchar *base_url)
{ {
g_return_val_if_fail(base_url != NULL, NULL); g_return_val_if_fail(base_url != NULL, NULL);
return (MatrixHTTPClient *)g_object_new(MATRIX_TYPE_HTTP_CLIENT, return (MatrixHTTPClient *)g_object_new(object_type,
"base-url", base_url, "base-url", base_url,
NULL); NULL);
} }
MatrixHTTPClient *
matrix_http_client_new(const gchar* base_url)
{
return matrix_http_client_construct(MATRIX_TYPE_HTTP_CLIENT, base_url);
}
static void static void
login_callback(MatrixAPI *matrix_api, const gchar *content_type, JsonNode *json_content, GByteArray *raw_content, GError *err, gpointer user_data) login_callback(MatrixAPI *matrix_api, const gchar *content_type, JsonNode *json_content, GByteArray *raw_content, GError *err, gpointer user_data)
{ {
@@ -824,8 +830,6 @@ matrix_http_client_real_load_state(MatrixClient *matrix_client, const gchar *fil
g_debug("Loaded access token %s", matrix_api_get_token(MATRIX_API(matrix_client))); g_debug("Loaded access token %s", matrix_api_get_token(MATRIX_API(matrix_client)));
#endif #endif
} }
json_node_unref(root_node);
} }
static void static void

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_TYPE_HTTP_CLIENT matrix_http_client_get_type() # define MATRIX_TYPE_HTTP_CLIENT matrix_http_client_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixHTTPClient, matrix_http_client, MATRIX, HTTP_CLIENT, MatrixHTTPAPI) G_DECLARE_DERIVABLE_TYPE(MatrixHTTPClient, matrix_http_client, MATRIX, HTTP_CLIENT, MatrixHTTPAPI);
struct _MatrixHTTPClientClass { struct _MatrixHTTPClientClass {
MatrixHTTPAPIClass parent_class; MatrixHTTPAPIClass parent_class;
}; };
MatrixHTTPClient* matrix_http_client_new(const gchar* base_url); MatrixHTTPClient* matrix_http_client_new(const gchar* base_url);
MatrixHTTPClient* matrix_http_client_construct(GType object_type, const gchar* base_url);
gulong matrix_http_client_next_txn_id(MatrixHTTPClient *client); gulong matrix_http_client_next_txn_id(MatrixHTTPClient *client);
G_END_DECLS G_END_DECLS

View File

@@ -107,10 +107,16 @@ matrix_message_audio_real_to_json(MatrixMessageBase *matrix_message_base, JsonNo
MATRIX_MESSAGE_BASE_CLASS(matrix_message_audio_parent_class)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_CLASS(matrix_message_audio_parent_class)->to_json(matrix_message_base, json_data, error);
} }
MatrixMessageAudio *
matrix_message_audio_construct(GType object_type)
{
return (MatrixMessageAudio *)matrix_message_base_construct(object_type);
}
MatrixMessageAudio * MatrixMessageAudio *
matrix_message_audio_new(void) matrix_message_audio_new(void)
{ {
return (MatrixMessageAudio *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_AUDIO); return matrix_message_audio_construct(MATRIX_MESSAGE_TYPE_AUDIO);
} }
const gchar * const gchar *

View File

@@ -26,13 +26,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_MESSAGE_TYPE_AUDIO (matrix_message_audio_get_type ()) #define MATRIX_MESSAGE_TYPE_AUDIO (matrix_message_audio_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixMessageAudio, matrix_message_audio, MATRIX_MESSAGE, AUDIO, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageAudio, matrix_message_audio, MATRIX_MESSAGE, AUDIO, MatrixMessageBase);
struct _MatrixMessageAudioClass { struct _MatrixMessageAudioClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageAudio* matrix_message_audio_new (void); MatrixMessageAudio* matrix_message_audio_new (void);
MatrixMessageAudio* matrix_message_audio_construct (GType object_type);
const gchar* matrix_message_audio_get_url (MatrixMessageAudio* self); const gchar* matrix_message_audio_get_url (MatrixMessageAudio* self);
void matrix_message_audio_set_url (MatrixMessageAudio* self, const gchar* value); void matrix_message_audio_set_url (MatrixMessageAudio* self, const gchar* value);
MatrixAudioInfo* matrix_message_audio_get_info (MatrixMessageAudio* self); MatrixAudioInfo* matrix_message_audio_get_info (MatrixMessageAudio* self);

View File

@@ -17,7 +17,6 @@
*/ */
#include "matrix-message-base.h" #include "matrix-message-base.h"
#include "matrix-types.h"
#include "matrix-enumtypes.h" #include "matrix-enumtypes.h"
#include "config.h" #include "config.h"
@@ -313,12 +312,6 @@ matrix_message_base_to_json(MatrixMessageBase *matrix_message_base, JsonNode *js
MATRIX_MESSAGE_BASE_GET_CLASS(matrix_message_base)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_GET_CLASS(matrix_message_base)->to_json(matrix_message_base, json_data, error);
} }
/**
* matrix_message_base_construct:
* @object_type: the #GType of the object to be created
*
* Returns: (transfer full): a new instance of @object_type
*/
MatrixMessageBase * MatrixMessageBase *
matrix_message_base_construct(GType object_type) matrix_message_base_construct(GType object_type)
{ {

View File

@@ -33,7 +33,7 @@ G_BEGIN_DECLS
typedef struct _MatrixMessageBase MatrixMessageBase; typedef struct _MatrixMessageBase MatrixMessageBase;
typedef struct _MatrixMessageBaseClass MatrixMessageBaseClass; typedef struct _MatrixMessageBaseClass MatrixMessageBaseClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixMessageBase, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(MatrixMessageBase, g_object_unref);
struct _MatrixMessageBase { struct _MatrixMessageBase {
GObject parent_instance; GObject parent_instance;
@@ -42,8 +42,8 @@ struct _MatrixMessageBase {
struct _MatrixMessageBaseClass { struct _MatrixMessageBaseClass {
GObjectClass parent_class; GObjectClass parent_class;
void (*from_json)(MatrixMessageBase *message, JsonNode *json_data, GError **error); void (*from_json)(MatrixMessageBase *matrix_message_base, JsonNode *json_data, GError **error);
void (*to_json)(MatrixMessageBase *message, JsonNode *json_data, GError **error); void (*to_json)(MatrixMessageBase *matrix_message_base, JsonNode *json_data, GError **error);
}; };
GType matrix_message_base_get_type(void) G_GNUC_CONST; GType matrix_message_base_get_type(void) G_GNUC_CONST;

View File

@@ -44,9 +44,15 @@ matrix_message_emote_real_to_json(MatrixMessageBase *matrix_message_base, JsonNo
MATRIX_MESSAGE_BASE_CLASS(matrix_message_emote_parent_class)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_CLASS(matrix_message_emote_parent_class)->to_json(matrix_message_base, json_data, error);
} }
MatrixMessageEmote *
matrix_message_emote_construct(GType object_type)
{
return (MatrixMessageEmote *)matrix_message_base_construct(object_type);
}
MatrixMessageEmote * MatrixMessageEmote *
matrix_message_emote_new(void) { matrix_message_emote_new(void) {
return (MatrixMessageEmote *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_EMOTE); return matrix_message_emote_construct(MATRIX_MESSAGE_TYPE_EMOTE);
} }
static void static void

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_MESSAGE_TYPE_EMOTE matrix_message_emote_get_type() # define MATRIX_MESSAGE_TYPE_EMOTE matrix_message_emote_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixMessageEmote, matrix_message_emote, MATRIX_MESSAGE, EMOTE, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageEmote, matrix_message_emote, MATRIX_MESSAGE, EMOTE, MatrixMessageBase);
struct _MatrixMessageEmoteClass { struct _MatrixMessageEmoteClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageEmote *matrix_message_emote_new(void); MatrixMessageEmote *matrix_message_emote_new(void);
MatrixMessageEmote *matrix_message_emote_construct(GType object_type);
G_END_DECLS G_END_DECLS

View File

@@ -146,10 +146,16 @@ matrix_message_file_real_to_json(MatrixMessageBase *matrix_message_base, JsonNod
MATRIX_MESSAGE_BASE_CLASS(matrix_message_file_parent_class)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_CLASS(matrix_message_file_parent_class)->to_json(matrix_message_base, json_data, error);
} }
MatrixMessageFile *
matrix_message_file_construct(GType object_type)
{
return (MatrixMessageFile *)matrix_message_base_construct(object_type);
}
MatrixMessageFile * MatrixMessageFile *
matrix_message_file_new(void) matrix_message_file_new(void)
{ {
return (MatrixMessageFile *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_FILE); return matrix_message_file_construct(MATRIX_MESSAGE_TYPE_FILE);
} }
const gchar * const gchar *

View File

@@ -26,13 +26,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_MESSAGE_TYPE_FILE matrix_message_file_get_type() # define MATRIX_MESSAGE_TYPE_FILE matrix_message_file_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixMessageFile, matrix_message_file, MATRIX_MESSAGE, FILE, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageFile, matrix_message_file, MATRIX_MESSAGE, FILE, MatrixMessageBase);
struct _MatrixMessageFileClass { struct _MatrixMessageFileClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageFile* matrix_message_file_new (void); MatrixMessageFile* matrix_message_file_new (void);
MatrixMessageFile* matrix_message_file_construct (GType object_type);
const gchar* matrix_message_file_get_filename (MatrixMessageFile* self); const gchar* matrix_message_file_get_filename (MatrixMessageFile* self);
void matrix_message_file_set_filename (MatrixMessageFile* self, const gchar* value); void matrix_message_file_set_filename (MatrixMessageFile* self, const gchar* value);
const gchar* matrix_message_file_get_url (MatrixMessageFile* self); const gchar* matrix_message_file_get_url (MatrixMessageFile* self);

View File

@@ -138,10 +138,16 @@ matrix_message_image_real_to_json(MatrixMessageBase *matrix_message_base, JsonNo
MATRIX_MESSAGE_BASE_CLASS(matrix_message_image_parent_class)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_CLASS(matrix_message_image_parent_class)->to_json(matrix_message_base, json_data, error);
} }
MatrixMessageImage *
matrix_message_image_construct(GType object_type)
{
return (MatrixMessageImage *)matrix_message_base_construct(object_type);
}
MatrixMessageImage * MatrixMessageImage *
matrix_message_image_new(void) matrix_message_image_new(void)
{ {
return (MatrixMessageImage *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_IMAGE); return matrix_message_image_construct(MATRIX_MESSAGE_TYPE_IMAGE);
} }
const gchar * const gchar *

View File

@@ -26,13 +26,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_MESSAGE_TYPE_IMAGE matrix_message_image_get_type() # define MATRIX_MESSAGE_TYPE_IMAGE matrix_message_image_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixMessageImage, matrix_message_image, MATRIX_MESSAGE, IMAGE, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageImage, matrix_message_image, MATRIX_MESSAGE, IMAGE, MatrixMessageBase);
struct _MatrixMessageImageClass { struct _MatrixMessageImageClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageImage* matrix_message_image_new (void); MatrixMessageImage* matrix_message_image_new (void);
MatrixMessageImage* matrix_message_image_construct (GType object_type);
const gchar* matrix_message_image_get_url (MatrixMessageImage* self); const gchar* matrix_message_image_get_url (MatrixMessageImage* self);
void matrix_message_image_set_url (MatrixMessageImage* self, const gchar* value); void matrix_message_image_set_url (MatrixMessageImage* self, const gchar* value);
const gchar* matrix_message_image_get_thumbnail_url (MatrixMessageImage* self); const gchar* matrix_message_image_get_thumbnail_url (MatrixMessageImage* self);

View File

@@ -127,10 +127,16 @@ matrix_message_location_real_to_json(MatrixMessageBase *matrix_message_base, Jso
} }
} }
MatrixMessageLocation *
matrix_message_location_construct(GType object_type)
{
return (MatrixMessageLocation *)matrix_message_base_construct(object_type);
}
MatrixMessageLocation * MatrixMessageLocation *
matrix_message_location_new(void) matrix_message_location_new(void)
{ {
return (MatrixMessageLocation *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_LOCATION); return matrix_message_location_construct(MATRIX_MESSAGE_TYPE_LOCATION);
} }
const gchar * const gchar *

View File

@@ -26,13 +26,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
# define MATRIX_MESSAGE_TYPE_LOCATION matrix_message_location_get_type() # define MATRIX_MESSAGE_TYPE_LOCATION matrix_message_location_get_type()
G_DECLARE_DERIVABLE_TYPE(MatrixMessageLocation, matrix_message_location, MATRIX_MESSAGE, LOCATION, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageLocation, matrix_message_location, MATRIX_MESSAGE, LOCATION, MatrixMessageBase);
struct _MatrixMessageLocationClass { struct _MatrixMessageLocationClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageLocation* matrix_message_location_new (void); MatrixMessageLocation* matrix_message_location_new (void);
MatrixMessageLocation* matrix_message_location_construct (GType object_type);
const gchar* matrix_message_location_get_geo_uri (MatrixMessageLocation* self); const gchar* matrix_message_location_get_geo_uri (MatrixMessageLocation* self);
void matrix_message_location_set_geo_uri (MatrixMessageLocation* self, const gchar* value); void matrix_message_location_set_geo_uri (MatrixMessageLocation* self, const gchar* value);
const gchar* matrix_message_location_get_thumbnail_url (MatrixMessageLocation* self); const gchar* matrix_message_location_get_thumbnail_url (MatrixMessageLocation* self);

View File

@@ -45,9 +45,15 @@ matrix_message_notice_real_to_json(MatrixMessageBase *matrix_message_base, JsonN
MATRIX_MESSAGE_BASE_CLASS(matrix_message_notice_parent_class)->to_json(matrix_message_base, json_data, error); MATRIX_MESSAGE_BASE_CLASS(matrix_message_notice_parent_class)->to_json(matrix_message_base, json_data, error);
} }
MatrixMessageNotice *
matrix_message_notice_construct(GType object_type)
{
return (MatrixMessageNotice *)matrix_message_base_construct(object_type);
}
MatrixMessageNotice * MatrixMessageNotice *
matrix_message_notice_new(void) { matrix_message_notice_new(void) {
return (MatrixMessageNotice *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_NOTICE); return matrix_message_notice_construct(MATRIX_MESSAGE_TYPE_NOTICE);
} }
static void static void

View File

@@ -25,13 +25,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define MATRIX_MESSAGE_TYPE_NOTICE (matrix_message_notice_get_type ()) #define MATRIX_MESSAGE_TYPE_NOTICE (matrix_message_notice_get_type ())
G_DECLARE_DERIVABLE_TYPE(MatrixMessageNotice, matrix_message_notice, MATRIX_MESSAGE, NOTICE, MatrixMessageBase) G_DECLARE_DERIVABLE_TYPE(MatrixMessageNotice, matrix_message_notice, MATRIX_MESSAGE, NOTICE, MatrixMessageBase);
struct _MatrixMessageNoticeClass { struct _MatrixMessageNoticeClass {
MatrixMessageBaseClass parent_class; MatrixMessageBaseClass parent_class;
}; };
MatrixMessageNotice* matrix_message_notice_new (void); MatrixMessageNotice* matrix_message_notice_new (void);
MatrixMessageNotice* matrix_message_notice_construct (GType object_type);
G_END_DECLS G_END_DECLS

View File

@@ -54,9 +54,15 @@ matrix_message_text_real_to_json(MatrixMessageBase *matrix_message_base, JsonNod
} }
} }
MatrixMessageText *
matrix_message_text_construct(GType object_type)
{
return (MatrixMessageText *)matrix_message_base_construct(object_type);
}
MatrixMessageText * MatrixMessageText *
matrix_message_text_new(void) { matrix_message_text_new(void) {
return (MatrixMessageText *)matrix_message_base_construct(MATRIX_MESSAGE_TYPE_TEXT); return matrix_message_text_construct(MATRIX_MESSAGE_TYPE_TEXT);
} }
static void static void

Some files were not shown because too many files have changed in this diff Show More