aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-06-15 16:39:46 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-06-15 17:25:32 +0000
commitd852178540bbe98c0b88ecc627b0fcfa208d4b24 (patch)
treefa01726dd6e4337c40c317e299c2f93f27fda23e
parentvt: tag collision-count check with ‘unlikely’ (diff)
ime: ime_reset_pending_{preedit,commit} is not used outside ime.c
-rw-r--r--ime.c68
-rw-r--r--ime.h2
2 files changed, 34 insertions, 36 deletions
diff --git a/ime.c b/ime.c
index e7e5937a..a3ca19b2 100644
--- a/ime.c
+++ b/ime.c
@@ -18,6 +18,40 @@
#include "xmalloc.h"
static void
+ime_reset_pending_preedit(struct seat *seat)
+{
+ free(seat->ime.preedit.pending.text);
+ seat->ime.preedit.pending.text = NULL;
+}
+
+static void
+ime_reset_pending_commit(struct seat *seat)
+{
+ free(seat->ime.commit.pending.text);
+ seat->ime.commit.pending.text = NULL;
+}
+
+void
+ime_reset_pending(struct seat *seat)
+{
+ ime_reset_pending_preedit(seat);
+ ime_reset_pending_commit(seat);
+}
+
+void
+ime_reset_preedit(struct seat *seat)
+{
+ if (seat->ime.preedit.cells == NULL)
+ return;
+
+ free(seat->ime.preedit.text);
+ free(seat->ime.preedit.cells);
+ seat->ime.preedit.text = NULL;
+ seat->ime.preedit.cells = NULL;
+ seat->ime.preedit.count = 0;
+}
+
+static void
enter(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
struct wl_surface *surface)
{
@@ -324,40 +358,6 @@ done(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
}
}
-void
-ime_reset_pending_preedit(struct seat *seat)
-{
- free(seat->ime.preedit.pending.text);
- seat->ime.preedit.pending.text = NULL;
-}
-
-void
-ime_reset_pending_commit(struct seat *seat)
-{
- free(seat->ime.commit.pending.text);
- seat->ime.commit.pending.text = NULL;
-}
-
-void
-ime_reset_pending(struct seat *seat)
-{
- ime_reset_pending_preedit(seat);
- ime_reset_pending_commit(seat);
-}
-
-void
-ime_reset_preedit(struct seat *seat)
-{
- if (seat->ime.preedit.cells == NULL)
- return;
-
- free(seat->ime.preedit.text);
- free(seat->ime.preedit.cells);
- seat->ime.preedit.text = NULL;
- seat->ime.preedit.cells = NULL;
- seat->ime.preedit.count = 0;
-}
-
static void
ime_send_cursor_rect(struct seat *seat)
{
diff --git a/ime.h b/ime.h
index 2aa4efe4..3127f4d7 100644
--- a/ime.h
+++ b/ime.h
@@ -15,7 +15,5 @@ void ime_enable(struct seat *seat);
void ime_disable(struct seat *seat);
void ime_update_cursor_rect(struct seat *seat);
-void ime_reset_pending_preedit(struct seat *seat);
-void ime_reset_pending_commit(struct seat *seat);
void ime_reset_pending(struct seat *seat);
void ime_reset_preedit(struct seat *seat);