From 5c3911e6fb93dbd31481a13c57602ed748a2df0b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 2 Nov 2017 10:15:36 +0100 Subject: [PATCH] Port MatrixSearchOrder to C --- src/matrix-c-types.c | 8 ++++++++ src/matrix-c-types.h | 5 +++++ src/matrix-types.vala | 15 --------------- vapi/c-api.vapi | 6 ++++++ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/matrix-c-types.c b/src/matrix-c-types.c index 980968e..6fe14c7 100644 --- a/src/matrix-c-types.c +++ b/src/matrix-c-types.c @@ -220,3 +220,11 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * * Room join rules. */ + +/** + * MatrixSearchOrder: + * @MATRIX_SEARCH_ORDER_RECENT: order messages as they arrived + * @MATRIX_SEARCH_ORDER_RANK: order messages by relevance + * + * Search ordering. + */ diff --git a/src/matrix-c-types.h b/src/matrix-c-types.h index 54a9f4b..63a4fb6 100644 --- a/src/matrix-c-types.h +++ b/src/matrix-c-types.h @@ -154,4 +154,9 @@ typedef enum { MATRIX_JOIN_RULES_KNOCK } MatrixJoinRules; +typedef enum { + MATRIX_SEARCH_ORDER_RECENT, + MATRIX_SEARCH_ORDER_RANK +} MatrixSearchOrder; + #endif /* __MATRIX_TYPE_H__ */ diff --git a/src/matrix-types.vala b/src/matrix-types.vala index 4313e92..b0d765d 100644 --- a/src/matrix-types.vala +++ b/src/matrix-types.vala @@ -17,21 +17,6 @@ */ namespace Matrix { - /** - * Search ordering. - */ - public enum SearchOrder { - /** - * order messages as they arrived - */ - RECENT, - - /** - * order messages by relevance - */ - RANK; - } - /** * Search keys. */ diff --git a/vapi/c-api.vapi b/vapi/c-api.vapi index e95ccb7..bf3f72c 100644 --- a/vapi/c-api.vapi +++ b/vapi/c-api.vapi @@ -156,6 +156,12 @@ namespace Matrix { KNOCK; } + [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_SEARCH_ORDER_")] + public enum SearchOrder { + RECENT, + RANK; + } + /** * The major version number of the Matrix.org GLib SDK. */