Move MatrixAPIError to matrix-api-types.[ch]

This commit is contained in:
Gergely Polonkai 2016-01-11 10:41:28 +01:00
parent ad8e202367
commit 127c1b4b61
5 changed files with 47 additions and 47 deletions

View File

@ -19,6 +19,10 @@ matrix_client_get_type
<FILE>matrix-api-types</FILE>
<TITLE>Fundamental types for MatrixAPI</TITLE>
<SUBSECTION>
MatrixAPIError
MATRIX_API_ERROR
<SUBSECTION>
MatrixAPIEventFormat
@ -216,10 +220,6 @@ matrix_api_add_room_tag
<SUBSECTION>
matrix_api_get_turn_server
<SUBSECTION>
MatrixAPIError
MATRIX_API_ERROR
<SUBSECTION>
MatrixAPIStateEvent

View File

@ -28,6 +28,36 @@
* communication with the homeserver.
*/
/**
* MatrixAPIError:
* @MATRIX_API_ERROR_NONE: no error
* @MATRIX_API_ERROR_MISSING_TOKEN: authorization token is missing
* from the request
* @MATRIX_API_ERROR_FORBIDDEN: access was forbidden (e.g. due to a
* missing/invalid token, or using a bad
* password during login)
* @MATRIX_API_ERROR_UNKNOWN: an error unknown to the Matrix server
* @MATRIX_API_ERROR_UNKNOWN_ERROR: an error unknown to this library
*
* Value mappings from Matrix.org API error codes
* (e.g. <code>M_MISSING_TOKEN</code>). They should be set
* automatically by API calls, if the response contains an error code.
*/
/**
* MATRIX_API_ERROR:
*
* Error domain for Matrix GLib SDK API. See #GError for more
* information on error domains.
*/
/**
* matrix_api_error_quark:
*
* Gets the Matrix API error #GQuark
*/
G_DEFINE_QUARK(matrix-api-error-quark, matrix_api_error);
/**
* MatrixAPIEventFormat:
* @MATRIX_API_EVENT_FORMAT_DEFAULT: event format will be omitted from

View File

@ -24,6 +24,19 @@
G_BEGIN_DECLS
typedef enum {
MATRIX_API_ERROR_NONE,
MATRIX_API_ERROR_MISSING_TOKEN,
MATRIX_API_ERROR_FORBIDDEN,
MATRIX_API_ERROR_UNKNOWN,
/* Allow for a lot of Matrix.org defined codes
Do not define error codes after this! */
MATRIX_API_ERROR_UNKNOWN_ERROR = 16384
} MatrixAPIError;
#define MATRIX_API_ERROR matrix_api_error_quark()
GQuark matrix_api_error_quark(void);
typedef enum {
MATRIX_API_EVENT_FORMAT_DEFAULT,
MATRIX_API_EVENT_FORMAT_CLIENT,

View File

@ -75,29 +75,6 @@
* A callback function to use with API calls.
*/
/**
* MatrixAPIError:
* @MATRIX_API_ERROR_NONE: no error
* @MATRIX_API_ERROR_MISSING_TOKEN: authorization token is missing
* from the request
* @MATRIX_API_ERROR_FORBIDDEN: access was forbidden (e.g. due to a
* missing/invalid token, or using a bad
* password during login)
* @MATRIX_API_ERROR_UNKNOWN: an error unknown to the Matrix server
* @MATRIX_API_ERROR_UNKNOWN_ERROR: an error unknown to this library
*
* Value mappings from Matrix.org API error codes
* (e.g. <code>M_MISSING_TOKEN</code>). They should be set
* automatically by API calls, if the response contains an error code.
*/
/**
* MATRIX_API_ERROR:
*
* Error domain for Matrix GLib SDK API. See #GError for more
* information on error domains.
*/
/**
* MatrixAPIRoomPreset:
* @MATRIX_API_ROOM_PRESET_NONE: no preset
@ -291,13 +268,6 @@
* A struct to hold a state event filter.
*/
/**
* matrix_api_error_quark:
*
* Gets the Matrix API error #GQuark
*/
G_DEFINE_QUARK(matrix-api-error-quark, matrix_api_error);
G_DEFINE_INTERFACE(MatrixAPI, matrix_api, G_TYPE_OBJECT);
static void

View File

@ -26,19 +26,6 @@
G_BEGIN_DECLS
typedef enum {
MATRIX_API_ERROR_NONE,
MATRIX_API_ERROR_MISSING_TOKEN,
MATRIX_API_ERROR_FORBIDDEN,
MATRIX_API_ERROR_UNKNOWN,
/* Allow for a lot of Matrix.org defined codes
Do not define error codes after this! */
MATRIX_API_ERROR_UNKNOWN_ERROR = 16384
} MatrixAPIError;
#define MATRIX_API_ERROR matrix_api_error_quark()
GQuark matrix_api_error_quark(void);
#define MATRIX_TYPE_API (matrix_api_get_type())
#define MATRIX_API(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_API, MatrixAPI))
#define MATRIX_IS_API(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_API))