[dasher] Tidy buffers; separate out ATSPI/X-Event keystroke sending code



commit 31dd9653c36c8b5aa7ee49630c67d2b0a0425b65
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Sun Mar 20 11:32:02 2011 +0000

    Tidy buffers; separate out ATSPI/X-Event keystroke sending code
    
    DasherSpi.h has
      *initSPI() wraps SPI_init w/ boolean, as external_buffer did
      *sendText(char*) used by external_buffer, also dasher_action_keyboard
    =>Removes dependencies on dasher_external_buffer.
    
    Also GC dasher_buffer_set pointers from dasher_editor
     and dasher_buffer_set::(set_)conversion_mode, never called (tho the impl
     in dasher_internal_buffer, now commented out, looks like it should be!)

 Src/Gtk2/DasherSpi.cpp              |  107 +++++++++++++++++++++++++++++++++++
 Src/Gtk2/DasherSpi.h                |   14 +++++
 Src/Gtk2/Makefile.am                |    2 +
 Src/Gtk2/dasher_action_keyboard.cpp |   20 ++----
 Src/Gtk2/dasher_action_keyboard.h   |    3 +-
 Src/Gtk2/dasher_buffer_set.cpp      |    4 -
 Src/Gtk2/dasher_buffer_set.h        |    2 -
 Src/Gtk2/dasher_editor.cpp          |    9 ---
 Src/Gtk2/dasher_editor_internal.cpp |   10 +---
 Src/Gtk2/dasher_external_buffer.cpp |   97 +------------------------------
 Src/Gtk2/dasher_internal_buffer.cpp |    6 +-
 11 files changed, 138 insertions(+), 136 deletions(-)
---
diff --git a/Src/Gtk2/DasherSpi.cpp b/Src/Gtk2/DasherSpi.cpp
new file mode 100644
index 0000000..8517038
--- /dev/null
+++ b/Src/Gtk2/DasherSpi.cpp
@@ -0,0 +1,107 @@
+#include "DasherSpi.h"
+
+#ifdef GNOME_A11Y
+
+#include <cspi/spi.h>
+#include <string.h>
+
+enum {
+  NOT_INIT,
+  INIT_SUCCESS,
+  INIT_FAIL
+}  status = NOT_INIT;
+
+bool initSPI() {
+  if (status == NOT_INIT) {
+    status = (SPI_init()==2) ? INIT_FAIL : INIT_SUCCESS;
+  }
+  return (status==INIT_SUCCESS);
+}
+
+#else
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/XTest.h>
+#include <gdk/gdkx.h>
+#endif
+
+void sendText(const char *szText) {
+#ifdef GNOME_A11Y
+  if(!initSPI())
+    return;
+
+  char *szNewText;
+  szNewText = new char[strlen(szText) + 1];
+  strcpy(szNewText, szText);
+  
+  SPI_generateKeyboardEvent(0, szNewText, SPI_KEY_STRING);
+  
+  delete[] szNewText;
+#else
+  glong numoutput;
+  int numcodes;
+  Display *dpy = gdk_x11_get_default_xdisplay();
+  int min, max;
+  KeySym *keysym;
+  KeyCode code;  
+  
+  if(szText[0] == '\n') {
+    // If it's a nreline, we want to mimic an enter press rather than a raw newline
+    code = XKeysymToKeycode(dpy, XK_Return);
+    if(code != 0) {
+      XTestFakeKeyEvent(dpy, code, True, CurrentTime);
+      XSync(dpy, true);
+      XTestFakeKeyEvent(dpy, code, False, CurrentTime);
+      XSync(dpy, true);
+    }
+  }
+  else {
+    // gunichar is a 32 bit data type for UTF32 (aka UCS4) encoded unicodeX
+    gunichar *wideoutput = g_utf8_to_ucs4(szText, -1, NULL, &numoutput, NULL);
+
+    for(int i = 0; i < numoutput; i++) {
+
+      // Erm - this makes no sense
+      int modifiedkey = (i + 1) % 10;
+
+      if(wideoutput[i] < 0x01000000) {
+
+	// See http://wiki.x.org/wiki/KeySyms for the logic behind this
+	// tranlation
+	wideoutput[i] = wideoutput[i] | 0x01000000;
+
+	// TODO: Please see
+	// http://tronche.com/gui/x/xlib/input/keyboard-encoding.html
+	// for an explanation as to why you sometimes get problems
+	// with upper/lower case on some X displays I'm tempted to say
+	// that the XTest stuff is just broken, and require some GNOME
+	// a11y support for direct entry...
+	
+	XDisplayKeycodes(dpy, &min, &max);
+	
+	// Returns the keyboard mapping for the current display - numcodes is the 
+	keysym = XGetKeyboardMapping(dpy, min, max - min + 1, &numcodes);
+	
+	// Reprogramme the keyboard map to use the new keysym
+	keysym[(max - min - modifiedkey - 1) * numcodes] = wideoutput[i];
+	XChangeKeyboardMapping(dpy, min, numcodes, keysym, (max - min));
+	XSync(dpy, true);
+	
+	// Delete the old keymap
+	XFree(keysym);
+	// There's no way whatsoever that this could ever possibly
+	// be guaranteed to work (ever), but it does.
+	code = (max - modifiedkey - 1);
+	if(code != 0) {
+	  XTestFakeKeyEvent(dpy, code, True, CurrentTime);
+	  XSync(dpy, true);
+	  XTestFakeKeyEvent(dpy, code, False, CurrentTime);
+	  XSync(dpy, true);
+	}
+      }
+    }
+    XSync(dpy, true);
+    g_free(wideoutput);
+  }
+#endif
+}
diff --git a/Src/Gtk2/DasherSpi.h b/Src/Gtk2/DasherSpi.h
new file mode 100644
index 0000000..7232c79
--- /dev/null
+++ b/Src/Gtk2/DasherSpi.h
@@ -0,0 +1,14 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef __dasher_spi_h__
+#define __dasher_spi_h__
+
+#ifdef GNOME_A11Y
+bool initSPI();
+#endif
+///tries to send text to another app (the currently focused one?)
+/// - using ATSPI if we've got GNOME_A11Y defined, else with X events
+void sendText(const char *szText);
+#endif
diff --git a/Src/Gtk2/Makefile.am b/Src/Gtk2/Makefile.am
index 08ebbab..c083573 100644
--- a/Src/Gtk2/Makefile.am
+++ b/Src/Gtk2/Makefile.am
@@ -56,6 +56,8 @@ libdashergtk_la_SOURCES = \
 		Preferences.cpp \
 		Preferences.h \
 		dasher.h \
+		DasherSpi.h \
+		DasherSpi.cpp \
 		dasher_action.cpp \
 		dasher_action.h \
 		dasher_action_keyboard.cpp \
diff --git a/Src/Gtk2/dasher_action_keyboard.cpp b/Src/Gtk2/dasher_action_keyboard.cpp
index e5ad3cd..16e6457 100644
--- a/Src/Gtk2/dasher_action_keyboard.cpp
+++ b/Src/Gtk2/dasher_action_keyboard.cpp
@@ -2,12 +2,14 @@
 #include <config.h>
 #endif
 #include "../Common/Common.h"
+
 #include "dasher_action_keyboard.h"
 #include "dasher_editor.h"
+#include "DasherSpi.h"
 #include <string.h>
 
 struct _DasherActionKeyboardPrivate {
-  IDasherBufferSet *pBufferSet;
+  /* No decls atm...TODO remove private struct? */
 };
 
 typedef struct _DasherActionKeyboardPrivate DasherActionKeyboardPrivate;
@@ -30,29 +32,21 @@ dasher_action_keyboard_class_init(DasherActionKeyboardClass *pClass) {
 
 static void 
 dasher_action_keyboard_init(DasherActionKeyboard *pDasherActionKeyboard) {
-  DasherActionKeyboardPrivate *pPrivate = DASHER_ACTION_KEYBOARD_GET_PRIVATE(pDasherActionKeyboard);
-
-  pPrivate->pBufferSet = NULL;
+  //TODO: Remove?
 }
 
 DasherActionKeyboard *
-dasher_action_keyboard_new(IDasherBufferSet *pBufferSet) {
+dasher_action_keyboard_new() {
   DasherActionKeyboard *pDasherActionKeyboard;
   pDasherActionKeyboard = (DasherActionKeyboard *)(g_object_new(dasher_action_keyboard_get_type(), NULL));
 
-  DasherActionKeyboardPrivate *pPrivate = DASHER_ACTION_KEYBOARD_GET_PRIVATE(pDasherActionKeyboard);
-  pPrivate->pBufferSet = pBufferSet;
-
   return pDasherActionKeyboard;
 }
 
 static gboolean 
 dasher_action_keyboard_execute(DasherAction *pSelf, DasherEditor *pEditor, int iIdx) {
-  DasherActionKeyboardPrivate *pPrivate = DASHER_ACTION_KEYBOARD_GET_PRIVATE(pSelf);
-   
-  if(pPrivate->pBufferSet)
-    /* TODO: Fix offset here */
-    idasher_buffer_set_insert(pPrivate->pBufferSet, dasher_editor_get_all_text(pEditor), 0);
+  
+  sendText(dasher_editor_get_all_text(pEditor));
 
   return true;
 }
diff --git a/Src/Gtk2/dasher_action_keyboard.h b/Src/Gtk2/dasher_action_keyboard.h
index d5613be..ecf5ebd 100644
--- a/Src/Gtk2/dasher_action_keyboard.h
+++ b/Src/Gtk2/dasher_action_keyboard.h
@@ -2,7 +2,6 @@
 #define __dasher_action_keyboard_h__
 
 #include "dasher_action.h"
-#include "dasher_buffer_set.h"
 
 G_BEGIN_DECLS
 #define TYPE_DASHER_ACTION_KEYBOARD           (dasher_action_keyboard_get_type())
@@ -24,7 +23,7 @@ struct _DasherActionKeyboardClass {
   DasherActionClass parent_class;
 };
 
-DasherActionKeyboard *dasher_action_keyboard_new(IDasherBufferSet *pBufferSet);
+DasherActionKeyboard *dasher_action_keyboard_new();
 GType dasher_action_keyboard_get_type();
 
 G_END_DECLS
diff --git a/Src/Gtk2/dasher_buffer_set.cpp b/Src/Gtk2/dasher_buffer_set.cpp
index 98b8df0..e6547a1 100644
--- a/Src/Gtk2/dasher_buffer_set.cpp
+++ b/Src/Gtk2/dasher_buffer_set.cpp
@@ -92,10 +92,6 @@ void idasher_buffer_set_edit_protect(IDasherBufferSet *pSelf) {
   IDASHER_BUFFER_SET_GET_INTERFACE(pSelf)->edit_protect(pSelf);
 }
 
-void idasher_buffer_set_conversion_mode(IDasherBufferSet *pSelf, gboolean bMode) {
-  IDASHER_BUFFER_SET_GET_INTERFACE(pSelf)->conversion_mode(pSelf, bMode);
-}
-
 gint idasher_buffer_set_get_offset(IDasherBufferSet *pSelf) {
   return IDASHER_BUFFER_SET_GET_INTERFACE(pSelf)->get_offset(pSelf);
 }
diff --git a/Src/Gtk2/dasher_buffer_set.h b/Src/Gtk2/dasher_buffer_set.h
index c936c9d..7f94ebd 100644
--- a/Src/Gtk2/dasher_buffer_set.h
+++ b/Src/Gtk2/dasher_buffer_set.h
@@ -37,7 +37,6 @@ struct _IDasherBufferSetInterface {
   void (*edit_delete)(IDasherBufferSet *pSelf, gint iDirection, gint iDist);
   void (*edit_convert)(IDasherBufferSet *pSelf);
   void (*edit_protect)(IDasherBufferSet *pSelf);
-  void (*conversion_mode)(IDasherBufferSet *pSelf, gboolean bMode);
   gint (*get_offset)(IDasherBufferSet *pSelf);
 };
 
@@ -50,7 +49,6 @@ void idasher_buffer_set_edit_move(IDasherBufferSet *pSelf, gint iDirection, gint
 void idasher_buffer_set_edit_delete(IDasherBufferSet *pSelf, gint iDirection, gint iDist);
 void idasher_buffer_set_edit_convert(IDasherBufferSet *pSelf);
 void idasher_buffer_set_edit_protect(IDasherBufferSet *pSelf);
-void idasher_buffer_set_conversion_mode(IDasherBufferSet *pSelf, gboolean bMode);
 gint idasher_buffer_set_get_offset(IDasherBufferSet *pSelf);
 
 #endif
diff --git a/Src/Gtk2/dasher_editor.cpp b/Src/Gtk2/dasher_editor.cpp
index 4a1422d..ef30fdb 100644
--- a/Src/Gtk2/dasher_editor.cpp
+++ b/Src/Gtk2/dasher_editor.cpp
@@ -69,9 +69,6 @@ struct _DasherEditorPrivate {
   EditorAction *pActionIter;
   gboolean bActionIterStarted;
   gint iNextActionID;
-  IDasherBufferSet *pBufferSet;
-  IDasherBufferSet *pExternalBuffer;
-  IDasherBufferSet *pInternalBuffer;
   //  GameModeHelper *pGameModeHelper;
   GtkTextMark *pNewMark;
   DasherAppSettings *pAppSettings;
@@ -160,9 +157,6 @@ static void
 dasher_editor_init(DasherEditor *pDasherControl) {
   DasherEditorPrivate *pPrivate = DASHER_EDITOR_GET_PRIVATE(pDasherControl);
 
-  pPrivate->pBufferSet = NULL;
-  pPrivate->pInternalBuffer = NULL;
-  pPrivate->pExternalBuffer = NULL;
   pPrivate->szFilename = NULL;
   pPrivate->pTextClipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
   pPrivate->pPrimarySelection = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
@@ -191,9 +185,6 @@ dasher_editor_finalize(GObject *pObject) {
     }
   }
 
-  if(pPrivate->pBufferSet)
-    g_object_unref(G_OBJECT(pPrivate->pBufferSet));
-
   if(pPrivate->szFilename)
     g_free(pPrivate->szFilename);
 }
diff --git a/Src/Gtk2/dasher_editor_internal.cpp b/Src/Gtk2/dasher_editor_internal.cpp
index b90f5a5..68de53a 100644
--- a/Src/Gtk2/dasher_editor_internal.cpp
+++ b/Src/Gtk2/dasher_editor_internal.cpp
@@ -21,7 +21,6 @@
 #endif
 
 #include "dasher_editor_internal.h"
-#include "dasher_external_buffer.h"
 #include "dasher_internal_buffer.h"
 #include "dasher_lock_dialogue.h"
 #include "dasher_main.h"
@@ -85,7 +84,6 @@ struct _DasherEditorInternalPrivate {
   gboolean bActionIterStarted;
   gint iNextActionID;
   IDasherBufferSet *pBufferSet;
-  IDasherBufferSet *pExternalBuffer;
   //  GameModeHelper *pGameModeHelper;
   GtkTextMark *pNewMark;
   DasherAppSettings *pAppSettings;
@@ -247,7 +245,6 @@ dasher_editor_internal_init(DasherEditorInternal *pSelf) {
     gtk_text_view_set_wrap_mode(pPrivate->pTextView, GTK_WRAP_WORD);
   pPrivate->pBuffer = gtk_text_view_get_buffer(pPrivate->pTextView);
   pPrivate->pBufferSet = NULL;
-  pPrivate->pExternalBuffer = NULL;
   pPrivate->szFilename = NULL;
   pPrivate->pTextClipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
   pPrivate->pPrimarySelection = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
@@ -589,11 +586,6 @@ dasher_editor_internal_grab_focus(DasherEditor *pSelf) {
 static void 
 dasher_editor_internal_create_buffer(DasherEditor *pSelf) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
-
-  /* Make an external buffer anyway, for keyboard command */
-  /* TODO: Review this */
-  if(!(pPrivate->pExternalBuffer))
-    pPrivate->pExternalBuffer = IDASHER_BUFFER_SET(dasher_external_buffer_new());
     
   if(!(pPrivate->pBufferSet))
     pPrivate->pBufferSet = IDASHER_BUFFER_SET(dasher_internal_buffer_new(pPrivate->pTextView));
@@ -1019,7 +1011,7 @@ dasher_editor_internal_setup_actions(DasherEditor *pSelf) {
   // any otherway! (Also the whole actions code stuff seems so unfinished etc.
   // anyway...that perhaps it's best removed?)
 
-  dasher_editor_internal_add_action(pSelf, DASHER_ACTION(dasher_action_keyboard_new(pPrivate->pExternalBuffer)));
+  dasher_editor_internal_add_action(pSelf, DASHER_ACTION(dasher_action_keyboard_new()));
 
 #ifdef WITH_MAEMO
   dasher_editor_internal_add_action(pSelf, DASHER_ACTION(dasher_action_keyboard_maemo_new()));
diff --git a/Src/Gtk2/dasher_external_buffer.cpp b/Src/Gtk2/dasher_external_buffer.cpp
index d5e1077..03dc4d4 100644
--- a/Src/Gtk2/dasher_external_buffer.cpp
+++ b/Src/Gtk2/dasher_external_buffer.cpp
@@ -19,6 +19,7 @@
 
 #include "dasher_buffer_set.h"
 #include "dasher_external_buffer.h"
+#include "DasherSpi.h"
 
 // TODO: Figure out if we need this stuff and re-implement
 
@@ -55,7 +56,6 @@ void dasher_external_buffer_insert(DasherExternalBuffer *pSelf, const gchar *szT
 void dasher_external_buffer_delete(DasherExternalBuffer *pSelf, int iLength, int iOffset);
 void dasher_external_buffer_edit_convert(DasherExternalBuffer *pSelf);
 void dasher_external_buffer_edit_protect(DasherExternalBuffer *pSelf);
-void dasher_external_buffer_conversion_mode(DasherExternalBuffer *pSelf, gboolean bMode);
 gchar *dasher_external_buffer_get_context(DasherExternalBuffer *pSelf, gint iOffset, gint iLength);
 void dasher_external_buffer_edit_move(DasherExternalBuffer *pSelf, int iDirection, int iDist);
 void dasher_external_buffer_edit_delete(DasherExternalBuffer *pSelf, int iDirection, int iDist);
@@ -77,7 +77,6 @@ struct _DasherExternalBufferPrivate {
   AccessibleEventListener *pCaretListener;
   AccessibleText *pAccessibleText;
 #endif
-  gboolean bSPIInit;
 };
 
 GType dasher_external_buffer_get_type() {
@@ -132,7 +131,6 @@ static void idasher_buffer_set_interface_init (gpointer g_iface, gpointer iface_
   iface->edit_delete = (void (*)(IDasherBufferSet *pSelf, gint iDirection, gint iDist))dasher_external_buffer_edit_delete;
   iface->edit_convert = (void (*)(IDasherBufferSet *pSelf))dasher_external_buffer_edit_convert;
   iface->edit_protect = (void (*)(IDasherBufferSet *pSelf))dasher_external_buffer_edit_protect;
-  iface->conversion_mode = (void (*)(IDasherBufferSet *pSelf, gboolean bMode))dasher_external_buffer_conversion_mode;
   iface->get_offset = (gint (*)(IDasherBufferSet *pSelf))dasher_external_buffer_get_offset;
 }
 
@@ -155,13 +153,10 @@ DasherExternalBuffer *dasher_external_buffer_new() {
 
   DasherExternalBufferPrivate *pPrivate = (DasherExternalBufferPrivate *)(pDasherControl->private_data);
 
-  if(SPI_init() == 2) {
+  if(!initSPI()) {
     g_message("Could not initialise SPI - accessibility options disabled");
-    pPrivate->bSPIInit = false;
   }
   else {
-    pPrivate->bSPIInit = true;
-
     pPrivate->pFocusListener = SPI_createAccessibleEventListener(focus_listener, pDasherControl);
     pPrivate->pCaretListener = SPI_createAccessibleEventListener(caret_listener, pDasherControl);
     
@@ -183,94 +178,13 @@ DasherExternalBuffer *dasher_external_buffer_new() {
 }
 
 void dasher_external_buffer_insert(DasherExternalBuffer *pSelf, const gchar *szText, int iOffset) { 
-  DasherExternalBufferPrivate *pPrivate = (DasherExternalBufferPrivate *)(pSelf->private_data);
-
-#ifdef GNOME_A11Y
-  if(!pPrivate->bSPIInit)
-    return;
-
-  char *szNewText;
-  szNewText = new char[strlen(szText) + 1];
-  strcpy(szNewText, szText);
-  
-  SPI_generateKeyboardEvent(0, szNewText, SPI_KEY_STRING);
-  
-  delete[] szNewText;
-#else
-  glong numoutput;
-  int numcodes;
-  Display *dpy = gdk_x11_get_default_xdisplay();
-  int min, max;
-  KeySym *keysym;
-  KeyCode code;  
-  
-  if(szText[0] == '\n') {
-    // If it's a nreline, we want to mimic an enter press rather than a raw newline
-    code = XKeysymToKeycode(dpy, XK_Return);
-    if(code != 0) {
-      XTestFakeKeyEvent(dpy, code, True, CurrentTime);
-      XSync(dpy, true);
-      XTestFakeKeyEvent(dpy, code, False, CurrentTime);
-      XSync(dpy, true);
-    }
-  }
-  else {
-    // gunichar is a 32 bit data type for UTF32 (aka UCS4) encoded unicodeX
-    gunichar *wideoutput = g_utf8_to_ucs4(szText, -1, NULL, &numoutput, NULL);
-
-    for(int i = 0; i < numoutput; i++) {
-
-      // Erm - this makes no sense
-      int modifiedkey = (i + 1) % 10;
-
-      if(wideoutput[i] < 0x01000000) {
-
-	// See http://wiki.x.org/wiki/KeySyms for the logic behind this
-	// tranlation
-	wideoutput[i] = wideoutput[i] | 0x01000000;
-
-	// TODO: Please see
-	// http://tronche.com/gui/x/xlib/input/keyboard-encoding.html
-	// for an explanation as to why you sometimes get problems
-	// with upper/lower case on some X displays I'm tempted to say
-	// that the XTest stuff is just broken, and require some GNOME
-	// a11y support for direct entry...
-	
-	XDisplayKeycodes(dpy, &min, &max);
-	
-	// Returns the keyboard mapping for the current display - numcodes is the 
-	keysym = XGetKeyboardMapping(dpy, min, max - min + 1, &numcodes);
-	
-	// Reprogramme the keyboard map to use the new keysym
-	keysym[(max - min - modifiedkey - 1) * numcodes] = wideoutput[i];
-	XChangeKeyboardMapping(dpy, min, numcodes, keysym, (max - min));
-	XSync(dpy, true);
-	
-	// Delete the old keymap
-	XFree(keysym);
-	// There's no way whatsoever that this could ever possibly
-	// be guaranteed to work (ever), but it does.
-	code = (max - modifiedkey - 1);
-	if(code != 0) {
-	  XTestFakeKeyEvent(dpy, code, True, CurrentTime);
-	  XSync(dpy, true);
-	  XTestFakeKeyEvent(dpy, code, False, CurrentTime);
-	  XSync(dpy, true);
-	}
-      }
-    }
-    XSync(dpy, true);
-    g_free(wideoutput);
-  }
-#endif
+  sendText(szText);
 }
 
 void dasher_external_buffer_delete(DasherExternalBuffer *pSelf, int iLength, int iOffset) {
-  DasherExternalBufferPrivate *pPrivate = (DasherExternalBufferPrivate *)(pSelf->private_data);
 
 #ifdef GNOME_A11Y
-  if(!pPrivate->bSPIInit)
-    return;
+  if(!initSPI()) return;
 
   SPI_generateKeyboardEvent(XK_BackSpace, NULL, SPI_KEY_SYM);
 #else
@@ -331,9 +245,6 @@ void dasher_external_buffer_edit_convert(DasherExternalBuffer *pSelf) {
 void dasher_external_buffer_edit_protect(DasherExternalBuffer *pSelf) {
 }
 
-void dasher_external_buffer_conversion_mode(DasherExternalBuffer *pSelf, gboolean bMode) {
-}
-
 #ifdef GNOME_A11Y
 void dasher_external_buffer_handle_focus(DasherExternalBuffer *pSelf, const AccessibleEvent *pEvent) {
   DasherExternalBufferPrivate *pPrivate = (DasherExternalBufferPrivate *)(pSelf->private_data);
diff --git a/Src/Gtk2/dasher_internal_buffer.cpp b/Src/Gtk2/dasher_internal_buffer.cpp
index e1d9070..de3f71c 100644
--- a/Src/Gtk2/dasher_internal_buffer.cpp
+++ b/Src/Gtk2/dasher_internal_buffer.cpp
@@ -17,7 +17,6 @@ void dasher_internal_buffer_edit_move(DasherInternalBuffer *pSelf, int iDirectio
 void dasher_internal_buffer_edit_delete(DasherInternalBuffer *pSelf, int iDirection, int iDist);
 void dasher_internal_buffer_edit_convert(DasherInternalBuffer *pSelf);
 void dasher_internal_buffer_edit_protect(DasherInternalBuffer *pSelf);
-void dasher_internal_buffer_conversion_mode(DasherInternalBuffer *pSelf, gboolean bMode);
 gint dasher_internal_buffer_get_offset(DasherInternalBuffer *pSelf);
 
 // Related signal handlers
@@ -88,7 +87,6 @@ static void idasher_buffer_set_interface_init (gpointer g_iface, gpointer iface_
   iface->edit_delete = (void (*)(IDasherBufferSet *pSelf, gint iDirection, gint iDist))dasher_internal_buffer_edit_delete;
   iface->edit_convert = (void (*)(IDasherBufferSet *pSelf))dasher_internal_buffer_edit_convert;
   iface->edit_protect = (void (*)(IDasherBufferSet *pSelf))dasher_internal_buffer_edit_protect;
-  iface->conversion_mode = (void (*)(IDasherBufferSet *pSelf, gboolean bMode))dasher_internal_buffer_conversion_mode;
   iface->get_offset = (gint (*)(IDasherBufferSet *pSelf))dasher_internal_buffer_get_offset;
 }
 
@@ -339,7 +337,7 @@ void dasher_internal_buffer_edit_protect(DasherInternalBuffer *pSelf) {
   pPrivate->iLastOffset = gtk_text_buffer_get_char_count(pPrivate->pBuffer);
 }
 
-void dasher_internal_buffer_conversion_mode(DasherInternalBuffer *pSelf, gboolean bMode) {
+/*void dasher_internal_buffer_conversion_mode(DasherInternalBuffer *pSelf, gboolean bMode) {
   DasherInternalBufferPrivate *pPrivate = (DasherInternalBufferPrivate *)(pSelf->private_data);
 
   if(bMode) {
@@ -351,7 +349,7 @@ void dasher_internal_buffer_conversion_mode(DasherInternalBuffer *pSelf, gboolea
     pPrivate->bConversionMode = FALSE;
     pPrivate->iCurrentState = 1;
   }
-}
+}*/
 
 void dasher_internal_buffer_clear(DasherInternalBuffer *pSelf) {
   DasherInternalBufferPrivate *pPrivate = (DasherInternalBufferPrivate *)(pSelf->private_data);



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