Port MatrixAccountKind to C

This commit is contained in:
Gergely Polonkai 2017-11-02 09:01:37 +01:00
parent 51a4b1492c
commit d3be50a6a0
4 changed files with 24 additions and 21 deletions

View File

@ -89,3 +89,12 @@
* Gets the Matrix error #GQuark * Gets the Matrix error #GQuark
*/ */
G_DEFINE_QUARK(matrix-error-quark, matrix_error); G_DEFINE_QUARK(matrix-error-quark, matrix_error);
/**
* MatrixAccountKind:
* @MATRIX_ACCOUNT_KIND_DEFAULT: use the server default (usually #MATRIX_ACCOUNT_KIND_USER)
* @MATRIX_ACCOUNT_KIND_USER: normal user
* @MATRIX_ACCOUNT_KIND_GUEST: guest user
*
* User account types.
*/

View File

@ -74,4 +74,10 @@ typedef enum {
# define MATRIX_ERROR matrix_error_quark() # define MATRIX_ERROR matrix_error_quark()
GQuark matrix_error_quark(void); GQuark matrix_error_quark(void);
typedef enum {
MATRIX_ACCOUNT_KIND_DEFAULT,
MATRIX_ACCOUNT_KIND_USER,
MATRIX_ACCOUNT_KIND_GUEST
} MatrixAccountKind;
#endif /* __MATRIX_TYPE_H__ */ #endif /* __MATRIX_TYPE_H__ */

View File

@ -17,27 +17,6 @@
*/ */
namespace Matrix { namespace Matrix {
/**
* User account types.
*/
public enum AccountKind {
/**
* use the server default (usually
* {@link Matrix.AccountKind.USER})
*/
DEFAULT,
/**
* normal user
*/
USER,
/**
* guest user
*/
GUEST;
}
/** /**
* Direction of events when requesting an event context. * Direction of events when requesting an event context.
*/ */

View File

@ -62,6 +62,15 @@ namespace Matrix {
public static GLib.Quark quark (); public static GLib.Quark quark ();
} }
public const int MATRIX_ERROR;
[CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_ACCOUNT_KIND_")]
public enum AccountKind {
DEFAULT,
USER,
GUEST;
}
/** /**
* The major version number of the Matrix.org GLib SDK. * The major version number of the Matrix.org GLib SDK.
*/ */