[gnome-flashback] input-sources: add GfCandidatePopup, unimplemented



commit 4e81ffb0c28a48425e9c5db0bf89a8598ef9f010
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Sep 15 02:31:52 2015 +0300

    input-sources: add GfCandidatePopup, unimplemented

 configure.ac                                       |    3 +-
 gnome-flashback/libinput-sources/Makefile.am       |    2 +
 .../libinput-sources/gf-candidate-popup.c          |  175 ++++++++++++++++++++
 .../libinput-sources/gf-candidate-popup.h          |   37 ++++
 4 files changed, 216 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 10b96ec..5ecdf7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@ GLIB_REQUIRED=2.44.0
 GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=3.12.0
 POLKIT_AGENT_REQUIRED=0.97
 POLKIT_GOBJECT_REQUIRED=0.97
+IBUS_REQUIRED=1.5.10
 
 PKG_CHECK_MODULES(GNOME_FLASHBACK, gtk+-3.0 >= $GTK_REQUIRED dbus-glib-1)
 AC_SUBST(GNOME_FLASHBACK_CFLAGS)
@@ -70,7 +71,7 @@ PKG_CHECK_MODULES(IDLE_MONITOR, gtk+-3.0 >= $GTK_REQUIRED x11 xext)
 AC_SUBST(IDLE_MONITOR_CFLAGS)
 AC_SUBST(IDLE_MONITOR_LIBS)
 
-PKG_CHECK_MODULES([INPUT_SOURCES], [gtk+-3.0 >= $GTK_REQUIRED])
+PKG_CHECK_MODULES([INPUT_SOURCES], [gtk+-3.0 >= $GTK_REQUIRED ibus-1.0 >= $IBUS_REQUIRED])
 AC_SUBST([INPUT_SOURCES_CFLAGS])
 AC_SUBST([INPUT_SOURCES_LIBS])
 
diff --git a/gnome-flashback/libinput-sources/Makefile.am b/gnome-flashback/libinput-sources/Makefile.am
index 3622bb9..509eb69 100644
--- a/gnome-flashback/libinput-sources/Makefile.am
+++ b/gnome-flashback/libinput-sources/Makefile.am
@@ -12,6 +12,8 @@ libinput_sources_la_CFLAGS = \
        $(NULL)
 
 libinput_sources_la_SOURCES = \
+       gf-candidate-popup.c \
+       gf-candidate-popup.h \
        gf-input-sources.c \
        gf-input-sources.h \
        $(NULL)
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.c 
b/gnome-flashback/libinput-sources/gf-candidate-popup.c
new file mode 100644
index 0000000..32d6a63
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (C) 2015 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gf-candidate-popup.h"
+
+struct _GfCandidatePopup
+{
+  GObject           parent;
+
+  IBusPanelService *service;
+};
+
+G_DEFINE_TYPE (GfCandidatePopup, gf_candidate_popup, G_TYPE_OBJECT)
+
+static void
+set_cursor_location_cb (IBusPanelService *service,
+                        gint              x,
+                        gint              y,
+                        gint              w,
+                        gint              h,
+                        gpointer          user_data)
+{
+}
+
+static void
+update_preedit_text_cb (IBusPanelService *service,
+                        IBusText         *text,
+                        guint             cursor_pos,
+                        gboolean          visible,
+                        gpointer          user_data)
+{
+}
+
+static void
+show_preedit_text_cb (IBusPanelService *service,
+                      gpointer          user_data)
+{
+}
+
+static void
+hide_preedit_text_cb (IBusPanelService *service,
+                      gpointer          user_data)
+{
+}
+
+static void
+update_auxiliary_text_cb (IBusPanelService *service,
+                          IBusText         *text,
+                          gboolean          visible,
+                          gpointer          user_data)
+{
+}
+
+static void
+show_auxiliary_text_cb (IBusPanelService *service,
+                        gpointer          user_data)
+{
+}
+
+static void
+hide_auxiliary_text_cb (IBusPanelService *service,
+                        gpointer          user_data)
+{
+}
+
+static void
+update_lookup_table_cb (IBusPanelService *service,
+                        IBusLookupTable  *lookup_table,
+                        gboolean          visible,
+                        gpointer          user_data)
+{
+}
+
+static void
+show_lookup_table_cb (IBusPanelService *service,
+                      gpointer          user_data)
+{
+}
+
+static void
+hide_lookup_table_cb (IBusPanelService *service,
+                      gpointer          user_data)
+{
+}
+
+static void
+focus_out_cb (IBusPanelService *service,
+              const gchar      *input_context_path,
+              gpointer          user_data)
+{
+}
+
+static void
+gf_candidate_popup_dispose (GObject *object)
+{
+  GfCandidatePopup *popup;
+
+  popup = GF_CANDIDATE_POPUP (object);
+
+  g_clear_object (&popup->service);
+
+  G_OBJECT_CLASS (gf_candidate_popup_parent_class)->dispose (object);
+}
+
+static void
+gf_candidate_popup_class_init (GfCandidatePopupClass *popup_class)
+{
+  GObjectClass *object_class;
+
+  object_class = G_OBJECT_CLASS (popup_class);
+
+  object_class->dispose = gf_candidate_popup_dispose;
+}
+
+static void
+gf_candidate_popup_init (GfCandidatePopup *popup)
+{
+}
+
+GfCandidatePopup *
+gf_candidate_popup_new (void)
+{
+  return g_object_new (GF_TYPE_CANDIDATE_POPUP, NULL);
+}
+
+void
+gf_candidate_popup_set_panel_service (GfCandidatePopup *popup,
+                                      IBusPanelService *service)
+{
+  g_clear_object (&popup->service);
+
+  if (service == NULL)
+    return;
+
+  popup->service = g_object_ref (service);
+
+  g_signal_connect (service, "set-cursor-location",
+                    G_CALLBACK (set_cursor_location_cb), popup);
+  g_signal_connect (service, "update-preedit-text",
+                    G_CALLBACK (update_preedit_text_cb), popup);
+  g_signal_connect (service, "show-preedit-text",
+                    G_CALLBACK (show_preedit_text_cb), popup);
+  g_signal_connect (service, "hide-preedit-text",
+                    G_CALLBACK (hide_preedit_text_cb), popup);
+  g_signal_connect (service, "update-auxiliary-text",
+                    G_CALLBACK (update_auxiliary_text_cb), popup);
+  g_signal_connect (service, "show-auxiliary-text",
+                    G_CALLBACK (show_auxiliary_text_cb), popup);
+  g_signal_connect (service, "hide-auxiliary-text",
+                    G_CALLBACK (hide_auxiliary_text_cb), popup);
+  g_signal_connect (service, "update-lookup-table",
+                    G_CALLBACK (update_lookup_table_cb), popup);
+  g_signal_connect (service, "show-lookup-table",
+                    G_CALLBACK (show_lookup_table_cb), popup);
+  g_signal_connect (service, "hide-lookup-table",
+                    G_CALLBACK (hide_lookup_table_cb), popup);
+  g_signal_connect (service, "focus-out",
+                    G_CALLBACK (focus_out_cb), popup);
+}
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.h 
b/gnome-flashback/libinput-sources/gf-candidate-popup.h
new file mode 100644
index 0000000..8a79979
--- /dev/null
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GF_CANDIDATE_POPUP_H
+#define GF_CANDIDATE_POPUP_H
+
+#include <glib-object.h>
+#include <ibus-1.0/ibus.h>
+
+G_BEGIN_DECLS
+
+#define GF_TYPE_CANDIDATE_POPUP gf_candidate_popup_get_type ()
+G_DECLARE_FINAL_TYPE (GfCandidatePopup, gf_candidate_popup,
+                      GF, CANDIDATE_POPUP, GObject)
+
+GfCandidatePopup *gf_candidate_popup_new               (void);
+
+void              gf_candidate_popup_set_panel_service (GfCandidatePopup *popup,
+                                                        IBusPanelService *service);
+
+G_END_DECLS
+
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]