[vte/wip/sixels: 111/111] widget: Rename SIXEL API to vte_terminal_[sg]et_enable_sixel
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/sixels: 111/111] widget: Rename SIXEL API to vte_terminal_[sg]et_enable_sixel
- Date: Sat, 8 Aug 2020 18:43:03 +0000 (UTC)
commit 2d846a27ed722d6fa0838235ace56c4a33d7073c
Author: Christian Persch <chpe src gnome org>
Date: Sat Aug 8 20:42:49 2020 +0200
widget: Rename SIXEL API to vte_terminal_[sg]et_enable_sixel
... and complete the gobject property implementation for it.
src/app/app.cc | 2 +-
src/vte/vteterminal.h | 4 ++--
src/vtegtk.cc | 52 +++++++++++++++++++++++++++++----------------------
src/vtegtk.hh | 2 +-
4 files changed, 34 insertions(+), 26 deletions(-)
---
diff --git a/src/app/app.cc b/src/app/app.cc
index 12580f65..a615fd5b 100644
--- a/src/app/app.cc
+++ b/src/app/app.cc
@@ -2118,12 +2118,12 @@ vteapp_window_constructed(GObject *object)
vte_terminal_set_cursor_shape(window->terminal, options.cursor_shape);
vte_terminal_set_enable_bidi(window->terminal, !options.no_bidi);
vte_terminal_set_enable_shaping(window->terminal, !options.no_shaping);
+ vte_terminal_set_enable_sixel(window->terminal, !options.no_sixel);
vte_terminal_set_mouse_autohide(window->terminal, true);
vte_terminal_set_rewrap_on_resize(window->terminal, !options.no_rewrap);
vte_terminal_set_scroll_on_output(window->terminal, false);
vte_terminal_set_scroll_on_keystroke(window->terminal, true);
vte_terminal_set_scrollback_lines(window->terminal, options.scrollback_lines);
- vte_terminal_set_sixel_enabled(window->terminal, !options.no_sixel);
vte_terminal_set_text_blink_mode(window->terminal, options.text_blink_mode);
/* Style */
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index c7387d3d..d5e96535 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -507,11 +507,11 @@ gboolean vte_terminal_write_contents_sync (VteTerminal *terminal,
/* Set or get whether SIXEL image support is enabled */
_VTE_PUBLIC
-void vte_terminal_set_sixel_enabled(VteTerminal *terminal,
+void vte_terminal_set_enable_sixel(VteTerminal *terminal,
gboolean enabled) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
-gboolean vte_terminal_get_sixel_enabled(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
+gboolean vte_terminal_get_enable_sixel(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(VteTerminal, g_object_unref)
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 31d12854..5fcae132 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -676,6 +676,9 @@ try
case PROP_ENABLE_SHAPING:
g_value_set_boolean (value, vte_terminal_get_enable_shaping (terminal));
break;
+ case PROP_ENABLE_SIXEL:
+ g_value_set_boolean (value, vte_terminal_get_enable_sixel (terminal));
+ break;
case PROP_ENCODING:
g_value_set_string (value, vte_terminal_get_encoding (terminal));
break;
@@ -794,6 +797,9 @@ try
case PROP_ENABLE_SHAPING:
vte_terminal_set_enable_shaping (terminal, g_value_get_boolean (value));
break;
+ case PROP_ENABLE_SIXEL:
+ vte_terminal_set_enable_sixel (terminal, g_value_get_boolean (value));
+ break;
case PROP_ENCODING:
vte_terminal_set_encoding (terminal, g_value_get_string (value), NULL);
break;
@@ -1772,6 +1778,23 @@ vte_terminal_class_init(VteTerminalClass *klass)
TRUE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+ /**
+ * VteTerminal:enable-sixel:
+ *
+ * Controls whether SIXEL image support is enabled.
+ *
+ * Since: 0.62
+ */
+ pspecs[PROP_ENABLE_SIXEL] =
+ g_param_spec_boolean ("enable-sixel", nullptr, nullptr,
+#ifdef WITH_SIXEL
+ VTE_SIXEL_ENABLED_DEFAULT,
+#else
+ false,
+#endif
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
+
+
/**
* VteTerminal:font-scale:
*
@@ -1910,21 +1933,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
TRUE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
- /**
- * VteTerminal:sixel-enabled:
- *
- * Controls whether SIXEL image support is enabled.
- */
- pspecs[PROP_SIXEL_ENABLED] =
- g_param_spec_boolean ("sixel-enabled", NULL, NULL,
-#ifdef WITH_SIXEL
- VTE_SIXEL_ENABLED_DEFAULT,
-#else
- false,
-#endif
- (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY));
-
-
/**
* VteTerminal:text-blink-mode:
*
@@ -5611,7 +5619,7 @@ catch (...)
}
/**
- * vte_terminal_set_sixel_enabled:
+ * vte_terminal_set_enable_sixel:
* @terminal: a #VteTerminal
* @enabled: whether to enable SIXEL images
*
@@ -5620,15 +5628,15 @@ catch (...)
* Since: 0.62
*/
void
-vte_terminal_set_sixel_enabled(VteTerminal *terminal,
- gboolean enabled) noexcept
+vte_terminal_set_enable_sixel(VteTerminal *terminal,
+ gboolean enabled) noexcept
try
{
#ifdef WITH_SIXEL
g_return_if_fail(VTE_IS_TERMINAL(terminal));
- if (WIDGET(terminal)->set_sixel_enabled(enabled))
- g_object_notify_by_pspec(G_OBJECT(terminal), pspecs[PROP_SIXEL_ENABLED]);
+ if (WIDGET(terminal)->set_sixel_enabled(enabled != FALSE))
+ g_object_notify_by_pspec(G_OBJECT(terminal), pspecs[PROP_ENABLE_SIXEL]);
#endif
}
catch (...)
@@ -5637,7 +5645,7 @@ catch (...)
}
/**
- * vte_terminal_get_sixel_enabled:
+ * vte_terminal_get_enable_sixel:
* @terminal: a #VteTerminal
*
* Returns: %TRUE if SIXEL image support is enabled, %FALSE otherwise
@@ -5645,7 +5653,7 @@ catch (...)
* Since: 0.62
*/
gboolean
-vte_terminal_get_sixel_enabled(VteTerminal *terminal) noexcept
+vte_terminal_get_enable_sixel(VteTerminal *terminal) noexcept
try
{
#ifdef WITH_SIXEL
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index 82aad3e0..cb207e57 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -78,6 +78,7 @@ enum {
PROP_DELETE_BINDING,
PROP_ENABLE_BIDI,
PROP_ENABLE_SHAPING,
+ PROP_ENABLE_SIXEL,
PROP_ENCODING,
PROP_FONT_DESC,
PROP_FONT_SCALE,
@@ -90,7 +91,6 @@ enum {
PROP_SCROLLBACK_LINES,
PROP_SCROLL_ON_KEYSTROKE,
PROP_SCROLL_ON_OUTPUT,
- PROP_SIXEL_ENABLED,
PROP_TEXT_BLINK_MODE,
PROP_WINDOW_TITLE,
PROP_WORD_CHAR_EXCEPTIONS,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]