[console/zbrown/quick-ci-check: 2/2] general: use generated marshals
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [console/zbrown/quick-ci-check: 2/2] general: use generated marshals
- Date: Wed, 24 Aug 2022 21:18:22 +0000 (UTC)
commit 690581bcb005eb31c3a54e362102f024bf2478b5
Author: Zander Brown <zbrown gnome org>
Date: Wed Aug 24 00:00:23 2022 +0100
general: use generated marshals
Use explict pre-generated marshallers rather than libffi
_In theory_ this may have a slight perf gain, which is nice, but mostly
it gives us simpler traces when debugging
src/kgx-marshals.list | 4 ++++
src/kgx-pages.c | 7 +++++--
src/kgx-tab-switcher.c | 17 +++++++++--------
src/kgx-terminal.c | 6 ++++--
src/meson.build | 6 ++++++
5 files changed, 28 insertions(+), 12 deletions(-)
---
diff --git a/src/kgx-marshals.list b/src/kgx-marshals.list
new file mode 100644
index 0000000..79c86d8
--- /dev/null
+++ b/src/kgx-marshals.list
@@ -0,0 +1,4 @@
+VOID: ENUM
+VOID: ENUM, STRING, BOOLEAN
+VOID: UINT, UINT
+VOID: VOID
\ No newline at end of file
diff --git a/src/kgx-pages.c b/src/kgx-pages.c
index 4f94aee..c97823b 100644
--- a/src/kgx-pages.c
+++ b/src/kgx-pages.c
@@ -24,14 +24,16 @@
* The container of open #KgxTab (uses #AdwTabView internally)
*/
+#include "kgx-config.h"
+
#include <glib/gi18n.h>
#include "kgx-close-dialog.h"
-#include "kgx-config.h"
#include "kgx-pages.h"
#include "kgx-tab.h"
#include "kgx-window.h"
#include "kgx-terminal.h"
+#include "kgx-marshals.h"
typedef struct _KgxPagesPrivate KgxPagesPrivate;
@@ -659,7 +661,8 @@ kgx_pages_class_init (KgxPagesClass *klass)
signals[ZOOM] = g_signal_new ("zoom",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
+ 0, NULL, NULL,
+ kgx_marshals_VOID__ENUM,
G_TYPE_NONE,
1,
KGX_TYPE_ZOOM);
diff --git a/src/kgx-tab-switcher.c b/src/kgx-tab-switcher.c
index e1b0031..609b49e 100644
--- a/src/kgx-tab-switcher.c
+++ b/src/kgx-tab-switcher.c
@@ -29,6 +29,7 @@
#include "kgx-config.h"
#include "kgx-tab-switcher.h"
#include "kgx-tab-switcher-row.h"
+#include "kgx-marshals.h"
struct _KgxTabSwitcher {
@@ -529,14 +530,14 @@ kgx_tab_switcher_class_init (KgxTabSwitcherClass *klass)
g_object_class_install_properties (object_class, LAST_PROP, pspecs);
- signals[NEW_TAB] =
- g_signal_new ("new-tab",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL, NULL,
- G_TYPE_NONE,
- 0);
+ signals[NEW_TAB] = g_signal_new ("new-tab",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ kgx_marshals_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
gtk_widget_class_set_template_from_resource (widget_class,
KGX_APPLICATION_PATH "kgx-tab-switcher.ui");
diff --git a/src/kgx-terminal.c b/src/kgx-terminal.c
index 49a2810..a50106d 100644
--- a/src/kgx-terminal.c
+++ b/src/kgx-terminal.c
@@ -36,6 +36,7 @@
#include "kgx-config.h"
#include "kgx-terminal.h"
+#include "kgx-marshals.h"
/* Regex adapted from TerminalWidget.vala in Pantheon Terminal */
@@ -571,7 +572,8 @@ kgx_terminal_class_init (KgxTerminalClass *klass)
signals[SIZE_CHANGED] = g_signal_new ("size-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
+ 0, NULL, NULL,
+ kgx_marshals_VOID__UINT_UINT,
G_TYPE_NONE,
2,
G_TYPE_UINT,
@@ -631,7 +633,7 @@ clear_paste_data (gpointer data)
g_clear_weak_pointer (&self->dest);
g_free (self->text);
g_free (self);
-}
+}
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PasteData, clear_paste_data)
diff --git a/src/meson.build b/src/meson.build
index e929310..bd635a8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -58,6 +58,12 @@ kgx_sources += gnome.compile_resources('kgx-resources',
c_name: 'kgx'
)
+kgx_sources += gnome.genmarshal('kgx-marshals',
+ sources: 'kgx-marshals.list',
+ internal: true,
+ prefix: 'kgx_marshals',
+)
+
kgx_sources += gnome.gdbus_codegen('xdg-fm1',
sources: 'org.freedesktop.FileManager1.xml',
interface_prefix: 'org.freedesktop.',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]