[dasher] Remove DasherEditorExternal



commit ab400f18eed6e5c196e188e0b1089b73ba4b8a30
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Sun Aug 21 11:01:04 2011 +0100

    Remove DasherEditorExternal
    
    This patch finally makes it possible to change alphabet (and other
    preferences) in direct mode.
    
    This is a first (hacky - not proud of #include dasher_editor_external.cpp
    at bottom of dasher_editor_internal.cpp) pass at trying to make it
    possible to toggle direct mode without needing to quit dasher. (Not
    there yet.)

 Data/GUI/Makefile.am                |    4 -
 Data/GUI/dasher.compose.ui          | 1062 -----------------------------------
 Data/GUI/dasher.direct.ui           |  278 ---------
 Data/GUI/dasher.fullscreen.ui       |  676 ----------------------
 Data/GUI/dasher.gameWIP.ui          | 1002 ---------------------------------
 Src/Gtk2/Makefile.am                |    1 -
 Src/Gtk2/dasher_editor_external.cpp |  180 +------
 Src/Gtk2/dasher_editor_external.h   |   41 +--
 Src/Gtk2/dasher_editor_internal.cpp |   45 ++-
 Src/Gtk2/dasher_main.cpp            |   18 +-
 Src/main.cc                         |    4 +-
 11 files changed, 70 insertions(+), 3241 deletions(-)
---
diff --git a/Data/GUI/Makefile.am b/Data/GUI/Makefile.am
index d7b6a67..3ec34db 100644
--- a/Data/GUI/Makefile.am
+++ b/Data/GUI/Makefile.am
@@ -1,8 +1,4 @@
 dist_pkgdata_DATA = \
-	dasher.compose.ui \
-	dasher.direct.ui \
-	dasher.fullscreen.ui \
-	dasher.gameWIP.ui \
 	dasher.preferences.ui \
 	dasher.traditional.ui \
 	dashermaemo.preferences.ui \
diff --git a/Src/Gtk2/Makefile.am b/Src/Gtk2/Makefile.am
index f80c0b1..6cbeb36 100644
--- a/Src/Gtk2/Makefile.am
+++ b/Src/Gtk2/Makefile.am
@@ -75,7 +75,6 @@ libdashergtk_la_SOURCES = \
 		DasherSpi.cpp \
 		dasher_editor.cpp \
 		dasher_editor.h \
-		dasher_editor_external.cpp \
 		dasher_editor_external.h \
 		dasher_editor_internal.cpp \
 		dasher_editor_internal.h \
diff --git a/Src/Gtk2/dasher_editor_external.cpp b/Src/Gtk2/dasher_editor_external.cpp
index 208edcb..9e8f5e5 100644
--- a/Src/Gtk2/dasher_editor_external.cpp
+++ b/Src/Gtk2/dasher_editor_external.cpp
@@ -23,148 +23,17 @@
 #include "../DasherCore/ControlManager.h"
 #include "DasherSpi.h"
 
-// TODO: Figure out if we need this stuff and re-implement
-
-// X_HAVE_UTF8_STRING -> attempt to do keyboard mapping? (This won't work without extended keysyms being defined) - no or otherwise?
-
-// Before...
-
-//   int min, max;
-//   Display *dpy = gdk_x11_get_default_xdisplay();
-
-// #ifdef X_HAVE_UTF8_STRING
-//   XDisplayKeycodes(dpy, &min, &max);
-//   origkeymap = XGetKeyboardMapping(dpy, min, max - min + 1, &numcodes);
-// #endif
-
-// And after...
-
-// #ifdef X_HAVE_UTF8_STRING
-//   // We want to set the keymap back to whatever it was before,
-//   // if that's possible
-//   int min, max;
-//   Display *dpy = gdk_x11_get_default_xdisplay();
-//   XDisplayKeycodes(dpy, &min, &max);
-//   XChangeKeyboardMapping(dpy, min, numcodes, origkeymap, (max - min));
-// #endif
-
-// ---
-
-typedef struct _DasherEditorExternalPrivate DasherEditorExternalPrivate;
-
-struct _DasherEditorExternalPrivate {
-  DasherMain *pDasherMain;
-  DasherAppSettings *pAppSettings;
-#ifdef GNOME_A11Y
-  AccessibleEventListener *pFocusListener;
-  AccessibleEventListener *pCaretListener;
-  AccessibleText *pAccessibleText;
-#endif
-};
-
-#define DASHER_EDITOR_EXTERNAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), DASHER_TYPE_EDITOR_EXTERNAL, DasherEditorExternalPrivate))
-
-G_DEFINE_TYPE(DasherEditorExternal, dasher_editor_external, DASHER_TYPE_EDITOR);
-
-
-static void dasher_editor_external_finalize(GObject *pObject);
-
-/* Private Method Declarations */
-
-static gboolean dasher_editor_external_command(DasherEditor *pSelf, const gchar *szCommand);
-static void dasher_editor_external_initialise(DasherEditor *pSelf, DasherAppSettings *pAppSettings, 
-					      DasherMain *pDasherMain, GtkBuilder *pXML, 
-					      const gchar *szFullPath);
-static void dasher_editor_external_create_buffer(DasherEditor *pSelf);
-static void dasher_editor_external_output(DasherEditor *pSelf, const gchar *szText, int iOffset);
-static void dasher_editor_external_delete(DasherEditor *pSelf, int iLength, int iOffset);
-static const gchar *dasher_editor_external_get_context(DasherEditor *pSelf, int iOffset, int iLength);
-static gint dasher_editor_external_get_offset(DasherEditor *pSelf);
-static void dasher_editor_external_grab_focus(DasherEditor *pSelf);
-static const gchar *dasher_editor_external_get_all_text(DasherEditor *pSelf);
-static const gchar *dasher_editor_external_get_new_text(DasherEditor *pSelf);
-//from dasher_external_buffer:
-//These were no-ops, so removing.
-//static void dasher_editor_external_edit_convert(DasherEditor *pSelf);
-//static void dasher_editor_external_edit_protect(DasherEditor *pSelf);
-//TODO: Implement ctrl_move/ctrl_delete (ATM uses dasher_editor default i.e. returns get_offset)
 #ifdef GNOME_A11Y
-void dasher_editor_external_handle_focus(DasherEditorExternal *pSelf, const AccessibleEvent *pEvent);
-void dasher_editor_external_handle_caret(DasherEditorExternal *pSelf, const AccessibleEvent *pEvent);
+void dasher_editor_external_handle_focus(DasherEditorInternal *pSelf, const AccessibleEvent *pEvent);
+void dasher_editor_external_handle_caret(DasherEditorInternal *pSelf, const AccessibleEvent *pEvent);
 
 void focus_listener(const AccessibleEvent *pEvent, void *pUserData);
 void caret_listener(const AccessibleEvent *pEvent, void *pUserData);
 #endif
 
-/* Callback Declarations */
-
-extern "C" void external_context_changed_handler(GObject *pSource, gpointer pUserData);
-
-/* Method Definitions */
-
-static void 
-dasher_editor_external_class_init(DasherEditorExternalClass *pClass) {
-
-  g_type_class_add_private(pClass, sizeof(DasherEditorExternalPrivate));
-
-  GObjectClass *pObjectClass = (GObjectClass *) pClass;
-  pObjectClass->finalize = dasher_editor_external_finalize;
-
-  DasherEditorClass *pParentClass = (DasherEditorClass *)pClass;
-
-  pParentClass->initialise = dasher_editor_external_initialise;
-  pParentClass->command = dasher_editor_external_command;
-  pParentClass->output = dasher_editor_external_output;
-  pParentClass->delete_text = dasher_editor_external_delete;
-  pParentClass->get_context = dasher_editor_external_get_context;
-  pParentClass->get_offset = dasher_editor_external_get_offset;
-  pParentClass->grab_focus = dasher_editor_external_grab_focus;
-  pParentClass->get_all_text = dasher_editor_external_get_all_text;
-  pParentClass->get_new_text = dasher_editor_external_get_new_text;
-}
-
-static void 
-dasher_editor_external_init(DasherEditorExternal *pDasherControl) {
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pDasherControl);
-
-  pPrivate->pDasherMain = NULL;
-  pPrivate->pAppSettings = NULL;
-}
-
-static void 
-dasher_editor_external_finalize(GObject *pObject) {
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(DASHER_EDITOR_EXTERNAL(pObject));
-#ifdef GNOME_A11Y
-  SPI_deregisterGlobalEventListener(pPrivate->pFocusListener, "focus:");
-  SPI_deregisterGlobalEventListener(pPrivate->pCaretListener, "object:text-caret-moved");
-#endif
-}
-
-/* Public methods */
-DasherEditorExternal *
-dasher_editor_external_new() {
-  return
-    DASHER_EDITOR_EXTERNAL(g_object_new(DASHER_TYPE_EDITOR_EXTERNAL, NULL));
-}
-
-static void
-dasher_editor_external_initialise(DasherEditor *pSelf, DasherAppSettings *pAppSettings, DasherMain *pDasherMain, GtkBuilder *pXML, const gchar *szFullPath) {
-
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
-
-  pPrivate->pAppSettings = pAppSettings;
-  pPrivate->pDasherMain = pDasherMain;
-
-  dasher_editor_external_create_buffer(pSelf);
-}
-
-static void 
-dasher_editor_external_grab_focus(DasherEditor *pSelf) {
-}
-
-static void 
+void
 dasher_editor_external_create_buffer(DasherEditor *pSelf) {
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
+  DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
 #ifdef GNOME_A11Y
 
@@ -188,12 +57,12 @@ dasher_editor_external_create_buffer(DasherEditor *pSelf) {
 #endif
 }
 
-static void 
+void
 dasher_editor_external_output(DasherEditor *pSelf, const gchar *szText, int iOffset) {
   sendText(szText);
 }
 
-static void 
+void
 dasher_editor_external_delete(DasherEditor *pSelf, int iLength, int iOffset) {
 #ifdef GNOME_A11Y
   if(!initSPI()) return;
@@ -212,10 +81,10 @@ dasher_editor_external_delete(DasherEditor *pSelf, int iLength, int iOffset) {
 #endif
 }
 
-static const gchar *
+const gchar *
 dasher_editor_external_get_context(DasherEditor *pSelf, int iOffset, int iLength) {
 #ifdef GNOME_A11Y
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
+  DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
   if(pPrivate->pAccessibleText)
     return AccessibleText_getText(pPrivate->pAccessibleText, iOffset, iOffset + iLength);
   else
@@ -225,10 +94,10 @@ dasher_editor_external_get_context(DasherEditor *pSelf, int iOffset, int iLength
 #endif
 }
 
-static gint 
+gint
 dasher_editor_external_get_offset(DasherEditor *pSelf) {
 #ifdef GNOME_A11Y
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
+  DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
   
   if(!pPrivate->pAccessibleText)
     return 0;
@@ -242,26 +111,9 @@ dasher_editor_external_get_offset(DasherEditor *pSelf) {
 #endif
 }
 
-static gboolean 
-dasher_editor_external_command(DasherEditor *pSelf, const gchar *szCommand) {
-  return FALSE;
-}
-
-static const gchar *
-dasher_editor_external_get_all_text(DasherEditor *pSelf) { 
-  return "";
-}
-
-static const gchar *
-dasher_editor_external_get_new_text(DasherEditor *pSelf) { 
-  return NULL;
-}
-
-/* Callback Functions */
-
 #ifdef GNOME_A11Y
-void dasher_editor_external_handle_focus(DasherEditorExternal *pSelf, const AccessibleEvent *pEvent) {
-  DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
+void dasher_editor_external_handle_focus(DasherEditorInternal *pSelf, const AccessibleEvent *pEvent) {
+  DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
   //  g_message("Focus");
   
@@ -298,9 +150,9 @@ void dasher_editor_external_handle_focus(DasherEditorExternal *pSelf, const Acce
   Accessible_unref(accessible);
 }
 
-void dasher_editor_external_handle_caret(DasherEditorExternal *pSelf, const AccessibleEvent *pEvent) {
+void dasher_editor_external_handle_caret(DasherEditorInternal *pSelf, const AccessibleEvent *pEvent) {
   //  g_message("Caret");
- DasherEditorExternalPrivate *pPrivate = DASHER_EDITOR_EXTERNAL_GET_PRIVATE(pSelf);
+ DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
  //  g_message("Focus");
   
@@ -358,11 +210,11 @@ void dasher_editor_external_handle_caret(DasherEditorExternal *pSelf, const Acce
 }
 
 void focus_listener(const AccessibleEvent *pEvent, void *pUserData) {
-  dasher_editor_external_handle_focus((DasherEditorExternal *)pUserData, pEvent);
+  dasher_editor_external_handle_focus((DasherEditorInternal *)pUserData, pEvent);
 }
 
 void caret_listener(const AccessibleEvent *pEvent, void *pUserData) {
-  dasher_editor_external_handle_caret((DasherEditorExternal *)pUserData, pEvent);
+  dasher_editor_external_handle_caret((DasherEditorInternal *)pUserData, pEvent);
 }
 
 #endif
diff --git a/Src/Gtk2/dasher_editor_external.h b/Src/Gtk2/dasher_editor_external.h
index 849717f..0b3c588 100644
--- a/Src/Gtk2/dasher_editor_external.h
+++ b/Src/Gtk2/dasher_editor_external.h
@@ -1,39 +1,14 @@
 #ifndef __dasher_editor_external_h__
 #define __dasher_editor_external_h__
 
-#include "dasher_editor.h"
+typedef struct _DasherEditor DasherEditor;
+struct _DasherEditor;
 
-#include <glib.h>
-#include <glib-object.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-#define DASHER_TYPE_EDITOR_EXTERNAL            (dasher_editor_external_get_type())
-#define DASHER_EDITOR_EXTERNAL(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), DASHER_TYPE_EDITOR_EXTERNAL, DasherEditorExternal ))
-#define DASHER_EDITOR_EXTERNAL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), DASHER_TYPE_EDITOR_EXTERNAL, DasherEditorExternalClass ))
-#define IS_DASHER_EDITOR_EXTERNAL(obj)	       (G_TYPE_CHECK_INSTANCE_TYPE((obj), DASHER_TYPE_EDITOR_EXTERNAL))
-#define IS_DASHER_EDITOR_EXTERNAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DASHER_TYPE_EDITOR_EXTERNAL))
-#define DASHER_EDITOR_EXTERNAL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), DASHER_TYPE_EDITOR_EXTERNAL, DasherEditorExternalClass))
-
-typedef struct _DasherEditorExternal DasherEditorExternal;
-typedef struct _DasherEditorExternalClass DasherEditorExternalClass;
-
-struct _DasherEditorExternal {
-  DasherEditor parent;
-};
-
-struct _DasherEditorExternalClass {
-  DasherEditorClass parent_class;
-
-  void (*filename_changed)(DasherEditorExternal *pDasherEditorExternal);
-  void (*buffer_changed)(DasherEditorExternal *pDasherEditorExternal);
-  void (*context_changed)(DasherEditorExternal *pDasherEditorExternal);
-};
-
-DasherEditorExternal *dasher_editor_external_new();
-
-GType dasher_editor_external_get_type();
-G_END_DECLS
+void dasher_editor_external_create_buffer(DasherEditor*); //  for dasher_editor_external_initialise, and calls focus bits
+/* dasher_editor_external_output just calls SPI sendText */
+void dasher_editor_external_output(DasherEditor *pSelf, const gchar *szText, int iOffset);
+void dasher_editor_external_delete(DasherEditor *pSelf, int iLength, int iOffset);
+const gchar * dasher_editor_external_get_context(DasherEditor *pSelf, int iOffset, int iLength);
+gint dasher_editor_external_get_offset(DasherEditor *pSelf);
 
 #endif
-
diff --git a/Src/Gtk2/dasher_editor_internal.cpp b/Src/Gtk2/dasher_editor_internal.cpp
index 1313ab4..8d81c6c 100644
--- a/Src/Gtk2/dasher_editor_internal.cpp
+++ b/Src/Gtk2/dasher_editor_internal.cpp
@@ -9,7 +9,12 @@
 #endif
 #include <gtk/gtk.h>
 
+#ifdef GNOME_A11Y
+#include <cspi/spi.h>
+#endif
+
 #include "dasher_editor_internal.h"
+#include "dasher_editor_external.h"
 #include "dasher_lock_dialogue.h"
 #include "dasher_main.h"
 #include "../DasherCore/ControlManager.h"
@@ -35,6 +40,13 @@ struct _DasherEditorInternalPrivate {
   gint iLastOffset;
   gint iCurrentState; // 0 = unconverted, 1 = converted
 
+  // for direct mode:
+#ifdef GNOME_A11Y
+  AccessibleEventListener *pFocusListener;
+  AccessibleEventListener *pCaretListener;
+  AccessibleText *pAccessibleText;
+#endif
+
   //Paralleling the previous approach in dasher_main, we _don't_ send context_changed
   // events if we're in the middle of executing a control action (as this would rebuild
   // the canvas)
@@ -120,6 +132,11 @@ extern "C" void handle_request_settings(GtkDasherControl * pDasherControl, gpoin
 extern "C" void gtk2_edit_delete_callback(GtkDasherControl *pDasherControl, const gchar *szText, int iOffset, gpointer user_data);
 extern "C" void gtk2_edit_output_callback(GtkDasherControl *pDasherControl, const gchar *szText, int iOffset, gpointer user_data);
 
+static gboolean
+isdirect(DasherAppSettings *pAppSettings) {
+  return (dasher_app_settings_get_long(pAppSettings, APP_LP_STYLE) == APP_STYLE_DIRECT);
+}
+
 static void
 dasher_editor_internal_class_init(DasherEditorInternalClass *pClass) {
   g_type_class_add_private(pClass, sizeof(DasherEditorInternalPrivate));
@@ -128,6 +145,7 @@ dasher_editor_internal_class_init(DasherEditorInternalClass *pClass) {
   pObjectClass->finalize = dasher_editor_internal_finalize;
 
   DasherEditorClass *pParentClass = (DasherEditorClass *)pClass;
+
   pParentClass->initialise = dasher_editor_internal_initialise;
   pParentClass->game_text_buffer = dasher_editor_internal_game_text_buffer;
   pParentClass->command = dasher_editor_internal_command;
@@ -191,6 +209,11 @@ static void
 dasher_editor_internal_finalize(GObject *pObject) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pObject);
 
+#ifdef GNOME_A11Y
+  SPI_deregisterGlobalEventListener(pPrivate->pFocusListener, "focus:");
+  SPI_deregisterGlobalEventListener(pPrivate->pCaretListener, "object:text-caret-moved");
+#endif
+
   if(pPrivate->szFilename)
     g_free(pPrivate->szFilename);
 }
@@ -214,8 +237,11 @@ dasher_editor_internal_initialise(DasherEditor *pSelf, DasherAppSettings *pAppSe
 				     dasher_app_settings_get_string(pPrivate->pAppSettings,
 								    APP_SP_EDIT_FONT));
 
-  // TODO: is this still needed?
-  dasher_editor_internal_create_buffer(pSelf);
+  if (isdirect(pAppSettings))
+    dasher_editor_external_create_buffer(pSelf);
+  else
+    // TODO: is this still needed?
+    dasher_editor_internal_create_buffer(pSelf);
 
   // TODO: see note in command_new method
   if(szFullPath)
@@ -337,6 +363,9 @@ void
 dasher_editor_internal_output(DasherEditor *pSelf, const gchar *szText, int iOffset) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
+  if (isdirect(pPrivate->pAppSettings))
+    return dasher_editor_external_output(pSelf, szText, iOffset);
+
   gtk_text_buffer_delete_selection(pPrivate->pBuffer, false, true );
 
   GtkTextIter sIter;
@@ -371,6 +400,9 @@ void
 dasher_editor_internal_delete(DasherEditor *pSelf, int iLength, int iOffset) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
+  if (isdirect(pPrivate->pAppSettings))
+    return dasher_editor_external_delete(pSelf, iLength, iOffset);
+
   GtkTextIter end;
 
   //Dasher offset 0 = "the first character"; Gtk Text Buffer offset 0
@@ -393,6 +425,9 @@ const gchar *
 dasher_editor_internal_get_context(DasherEditor *pSelf, int iOffset, int iLength) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
 
+  if (isdirect(pPrivate->pAppSettings))
+    return dasher_editor_external_get_context(pSelf, iOffset, iLength);
+
   //  g_message("Buffer lenght: %d", gtk_text_buffer_get_char_count(pPrivate->pBuffer));
 
   GtkTextIter start;
@@ -407,6 +442,10 @@ dasher_editor_internal_get_context(DasherEditor *pSelf, int iOffset, int iLength
 gint
 dasher_editor_internal_get_offset(DasherEditor *pSelf) {
   DasherEditorInternalPrivate *pPrivate = DASHER_EDITOR_INTERNAL_GET_PRIVATE(pSelf);
+
+  if (isdirect(pPrivate->pAppSettings))
+    return dasher_editor_external_get_offset(pSelf);
+
   GtkTextIter iter1,iter2;
   gtk_text_buffer_get_iter_at_mark(pPrivate->pBuffer, &iter1, gtk_text_buffer_get_insert(pPrivate->pBuffer));
   gtk_text_buffer_get_iter_at_mark(pPrivate->pBuffer, &iter2, gtk_text_buffer_get_selection_bound(pPrivate->pBuffer));
@@ -1209,3 +1248,5 @@ main_window_realized(DasherMain *pMain, gpointer pUserData) {
 extern "C" void mark_set_handler(GtkWidget *widget, GtkTextIter *pIter, GtkTextMark *pMark, gpointer pUserData) {
   dasher_editor_internal_mark_changed(DASHER_EDITOR_INTERNAL(pUserData), pIter, pMark);
 }
+
+#include "dasher_editor_external.cpp"
diff --git a/Src/Gtk2/dasher_main.cpp b/Src/Gtk2/dasher_main.cpp
index 0d06651..1c2c094 100644
--- a/Src/Gtk2/dasher_main.cpp
+++ b/Src/Gtk2/dasher_main.cpp
@@ -388,22 +388,7 @@ dasher_main_load_interface(DasherMain *pSelf) {
 #endif
   szPrefGUIFilename = PROGDATA "/dashermaemo.preferences.ui";
 #else
-  switch(dasher_app_settings_get_long(pPrivate->pAppSettings, APP_LP_STYLE)) {
-  case APP_STYLE_TRAD:
-    szGUIFilename = PROGDATA "/dasher.traditional.ui";
-    break;
-  case APP_STYLE_COMPOSE:
-    szGUIFilename = PROGDATA "/dasher.compose.ui";
-    break;
-  case APP_STYLE_DIRECT:
-    szGUIFilename = PROGDATA "/dasher.direct.ui";
-    break;
-  case APP_STYLE_FULLSCREEN:
-    szGUIFilename = PROGDATA "/dasher.fullscreen.ui";
-    break;
-  default:
-    g_error("Inconsistent application style specified.");
-  }
+  szGUIFilename = PROGDATA "/dasher.traditional.ui";
   szPrefGUIFilename = PROGDATA "/dasher.preferences.ui";
 #endif
 
@@ -562,6 +547,7 @@ dasher_main_load_interface(DasherMain *pSelf) {
     gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(pPrivate->pXML, "tb_command_copy")));
     gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(pPrivate->pXML, "tb_command_paste")));
     gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(pPrivate->pXML, "separatortoolitem2")));
+    gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(pPrivate->pXML, "DasherEditor")));
   }
     
   // TODO: szFullPath
diff --git a/Src/main.cc b/Src/main.cc
index 596f858..1f81354 100644
--- a/Src/main.cc
+++ b/Src/main.cc
@@ -10,9 +10,8 @@
 #include <gdk/gdkx.h>
 #include <signal.h>
 #include <Gtk2/DasherAppSettings.h>
-/* Just to make sure the symbols for the editors are visible. */
+/* Just to make sure the symbols for the editor are visible. */
 #include <Gtk2/dasher_editor_internal.h>
-#include <Gtk2/dasher_editor_external.h>
 
 #ifdef WITH_MAEMO
 #include <libosso.h>
@@ -230,7 +229,6 @@ int main(int argc, char *argv[]) {
 
   // This call is just to force the linker to export the following symbols.
   dasher_editor_internal_get_type();
-  dasher_editor_external_get_type();
 
   // 10.
   gtk_main();



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