From b211ee2fc2aa3645ffb14a445f18acab4e3e72a8 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 2 Nov 2017 09:54:22 +0100 Subject: [PATCH] Port MatrixResizeMethod to C --- src/matrix-c-types.c | 9 +++++++++ src/matrix-c-types.h | 6 ++++++ src/matrix-types.vala | 20 -------------------- vapi/c-api.vapi | 7 +++++++ 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/matrix-c-types.c b/src/matrix-c-types.c index 0a2b6f9..bef62fb 100644 --- a/src/matrix-c-types.c +++ b/src/matrix-c-types.c @@ -162,3 +162,12 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * * Receipt types of acknowledgment. */ + +/** + * MatrixResizeMethod: + * @MATRIX_RESIZE_METHOD_DEFAULT: use the server default value + * @MATRIX_RESIZE_METHOD_CROP: crop thumbnail to the requested size + * @MATRIX_RESIZE_METHOD_SCALE: scale thumbnail to the requested size + * + * Resizing methods for matrix_api_media_thumbnail(). + */ diff --git a/src/matrix-c-types.h b/src/matrix-c-types.h index d0fec31..8f837a0 100644 --- a/src/matrix-c-types.h +++ b/src/matrix-c-types.h @@ -118,4 +118,10 @@ typedef enum { MATRIX_RECEIPT_TYPE_READ } MatrixReceiptType; +typedef enum { + MATRIX_RESIZE_METHOD_DEFAULT, + MATRIX_RESIZE_METHOD_CROP, + MATRIX_RESIZE_METHOD_SCALE +} MatrixResizeMethod; + #endif /* __MATRIX_TYPE_H__ */ diff --git a/src/matrix-types.vala b/src/matrix-types.vala index c5c8fe2..ba2d39d 100644 --- a/src/matrix-types.vala +++ b/src/matrix-types.vala @@ -17,26 +17,6 @@ */ namespace Matrix { - /** - * Resizing methods for matrix_api_media_thumbnail(). - */ - public enum ResizeMethod { - /** - * use the server default value - */ - DEFAULT, - - /** - * crop thumbnail to the requested size - */ - CROP, - - /** - * scale thumbnail to the requested size - */ - SCALE; - } - /** * Room membership types. */ diff --git a/vapi/c-api.vapi b/vapi/c-api.vapi index 2e45c81..2911543 100644 --- a/vapi/c-api.vapi +++ b/vapi/c-api.vapi @@ -115,6 +115,13 @@ namespace Matrix { READ; } + [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_RESIZE_METHOD_")] + public enum ResizeMethod { + DEFAULT, + CROP, + SCALE; + } + /** * The major version number of the Matrix.org GLib SDK. */