glom r1946 - in trunk: . glom glom/layout_item_dialogs glom/libglom/document glom/mode_design glom/relationships_overview glom/translation glom/utility_widgets



Author: murrayc
Date: Tue Mar  3 13:59:58 2009
New Revision: 1946
URL: http://svn.gnome.org/viewvc/glom?rev=1946&view=rev

Log:
2009-03-03  Murray Cumming  <murrayc murrayc com>

* glom/libglom/document/Makefile.am:
* glom/libglom/document/document_glom.[h|cc]: Renamed the *_HOSTED enum values to 
use a prefix. Moved the View tyepdefs into a view.h file.

* glom/application.cc:
* glom/base_db.h:
* glom/dialog_connection.cc:
* glom/frame_glom.cc:
* glom/layout_item_dialogs/dialog_field_layout.h:
* glom/mode_design/dialog_design.h:
* glom/relationships_overview/dialog_relationships_overview.h:
* glom/translation/dialog_identify_original.h:
* glom/translation/window_translations.[h|cc]:
* glom/utility_widgets/datawidget.h:
* glom/utility_widgets/filechooserdialog_saveextras.cc: Adapted.

Added:
   trunk/glom/libglom/document/view.h
Modified:
   trunk/ChangeLog
   trunk/glom/application.cc
   trunk/glom/base_db.h
   trunk/glom/dialog_connection.cc
   trunk/glom/frame_glom.cc
   trunk/glom/layout_item_dialogs/dialog_field_layout.h
   trunk/glom/libglom/document/Makefile.am
   trunk/glom/libglom/document/document_glom.cc
   trunk/glom/libglom/document/document_glom.h
   trunk/glom/mode_design/dialog_design.h
   trunk/glom/relationships_overview/dialog_relationships_overview.h
   trunk/glom/translation/dialog_identify_original.h
   trunk/glom/translation/window_translations.cc
   trunk/glom/translation/window_translations.h
   trunk/glom/utility_widgets/datawidget.h
   trunk/glom/utility_widgets/filechooserdialog_saveextras.cc

Modified: trunk/glom/application.cc
==============================================================================
--- trunk/glom/application.cc	(original)
+++ trunk/glom/application.cc	Tue Mar  3 13:59:58 2009
@@ -115,9 +115,9 @@
   m_ui_save_extra_showextras(false),
 
 #ifdef GLOM_ENABLE_POSTGRESQL
-  m_ui_save_extra_newdb_hosting_mode(Document_Glom::POSTGRES_CENTRAL_HOSTED),
+  m_ui_save_extra_newdb_hosting_mode(Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL),
 #else
-  m_ui_save_extra_newdb_hosting_mode(Document_Glom::SQLITE_HOSTED),
+  m_ui_save_extra_newdb_hosting_mode(Document_Glom::HOSTING_MODE_SQLITE),
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #endif // !GLOM_ENABLE_CLIENT_ONLY
@@ -715,8 +715,8 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 #ifdef GLOM_ENABLE_POSTGRESQL
       //Stop the document from being self-hosted (it's already hosted by the other networked Glom instance):
-      if(document_temp.get_hosting_mode() == Document_Glom::POSTGRES_SELF_HOSTED)
-        document_temp.set_hosting_mode(Document_Glom::POSTGRES_CENTRAL_HOSTED);
+      if(document_temp.get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_SELF)
+        document_temp.set_hosting_mode(Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL);
 #endif //GLOM_ENABLE_POSTGRESQL
 #endif // !GLOM_ENABLE_CLIENT_ONLY
       // TODO: Error out in case this is a sqlite database, since we probably
@@ -2232,12 +2232,12 @@
       bool is_self_hosted = false;
 
 #ifdef GLOM_ENABLE_POSTGRESQL
-      if(m_ui_save_extra_newdb_hosting_mode == Document_Glom::POSTGRES_SELF_HOSTED)
+      if(m_ui_save_extra_newdb_hosting_mode == Document_Glom::HOSTING_MODE_POSTGRES_SELF)
         is_self_hosted = true;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
-      if(m_ui_save_extra_newdb_hosting_mode == Document_Glom::SQLITE_HOSTED)
+      if(m_ui_save_extra_newdb_hosting_mode == Document_Glom::HOSTING_MODE_SQLITE)
         is_self_hosted = true;
 #endif // GLOM_ENABLE_SQLITE
 

Modified: trunk/glom/base_db.h
==============================================================================
--- trunk/glom/base_db.h	(original)
+++ trunk/glom/base_db.h	Tue Mar  3 13:59:58 2009
@@ -25,7 +25,7 @@
 
 #include <gtkmm.h>
 
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 #include <glom/libglom/connectionpool.h>
 #include <glom/libglom/appstate.h>
 #include <glom/libglom/data_structure/foundset.h>

Modified: trunk/glom/dialog_connection.cc
==============================================================================
--- trunk/glom/dialog_connection.cc	(original)
+++ trunk/glom/dialog_connection.cc	Tue Mar  3 13:59:58 2009
@@ -94,7 +94,7 @@
       connection_pool->set_database(m_database_name);
 
 #ifdef GLOM_ENABLE_POSTGRESQL
-      if(document->get_hosting_mode() == Document_Glom::POSTGRES_CENTRAL_HOSTED)
+      if(document->get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL)
       {
         ConnectionPool::Backend* backend = connection_pool->get_backend();
         ConnectionPoolBackends::PostgresCentralHosted* central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
@@ -128,7 +128,7 @@
       //and so we can tell connecting clients (using browse network) what port to use:
       Document_Glom* unconst = const_cast<Document_Glom*>(document);
 
-      if(document->get_hosting_mode() == Document_Glom::POSTGRES_CENTRAL_HOSTED)
+      if(document->get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL)
       {
         ConnectionPool::Backend* backend = connection_pool->get_backend();
         ConnectionPoolBackends::PostgresCentralHosted* central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
@@ -138,7 +138,7 @@
       }
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-      else if(document->get_hosting_mode() == Document_Glom::POSTGRES_SELF_HOSTED)
+      else if(document->get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_SELF)
       {
         ConnectionPool::Backend* backend = connection_pool->get_backend();
         ConnectionPoolBackends::PostgresSelfHosted* self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
@@ -172,7 +172,7 @@
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 #ifdef GLOM_ENABLE_POSTGRESQL
     //Load server and user:
-    if(document->get_hosting_mode() != Document_Glom::POSTGRES_CENTRAL_HOSTED)
+    if(document->get_hosting_mode() != Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL)
     {
        m_entry_host->set_text("(self hosted)");
        m_entry_host->set_sensitive(false);

Modified: trunk/glom/frame_glom.cc
==============================================================================
--- trunk/glom/frame_glom.cc	(original)
+++ trunk/glom/frame_glom.cc	Tue Mar  3 13:59:58 2009
@@ -1649,7 +1649,7 @@
 #ifdef GLOM_ENABLE_POSTGRESQL
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-    case Document_Glom::POSTGRES_SELF_HOSTED:
+    case Document_Glom::HOSTING_MODE_POSTGRES_SELF:
       {
         ConnectionPoolBackends::PostgresSelfHosted* backend = new ConnectionPoolBackends::PostgresSelfHosted;
         backend->set_self_hosting_data_uri(document->get_connection_self_hosted_directory_uri());
@@ -1658,7 +1658,7 @@
       break;
 #endif //GLOM_ENABLE_CLIENT_ONLY
 
-    case Document_Glom::POSTGRES_CENTRAL_HOSTED:
+    case Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL:
       {
         ConnectionPoolBackends::PostgresCentralHosted* backend = new ConnectionPoolBackends::PostgresCentralHosted;
         backend->set_host(document->get_connection_server());
@@ -1670,7 +1670,7 @@
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
-    case Document_Glom::SQLITE_HOSTED:
+    case Document_Glom::HOSTING_MODE_SQLITE:
       {
         ConnectionPoolBackends::Sqlite* backend = new ConnectionPoolBackends::Sqlite;
         backend->set_database_directory_uri(document->get_connection_self_hosted_directory_uri());
@@ -1712,7 +1712,7 @@
   switch(document->get_hosting_mode())
   {
 #ifdef GLOM_ENABLE_POSTGRESQL
-  case Document_Glom::POSTGRES_SELF_HOSTED:
+  case Document_Glom::HOSTING_MODE_POSTGRES_SELF:
     {
 #ifndef GLOM_ENABLE_CLIENT_ONLY
       Dialog_NewSelfHostedConnection* dialog = 0;
@@ -1792,7 +1792,7 @@
     }
 
     break;
-  case Document_Glom::POSTGRES_CENTRAL_HOSTED:
+  case Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL:
     {
       //Ask for connection details:
       m_pDialogConnection->load_from_document(); //Get good defaults.
@@ -1817,7 +1817,7 @@
     break;
 #endif //GLOM_ENABLE_POSTGRESQL
 #ifdef GLOM_ENABLE_SQLITE
-  case Document_Glom::SQLITE_HOSTED:
+  case Document_Glom::HOSTING_MODE_SQLITE:
     {
       // sqlite
       if(!connection_pool->initialize(get_app_window()))
@@ -1896,7 +1896,7 @@
 
         // Remember host if the document is not self hosted
         #ifdef GLOM_ENABLE_POSTGRESQL
-        if(document->get_hosting_mode() == Document_Glom::POSTGRES_CENTRAL_HOSTED)
+        if(document->get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL)
         {
           ConnectionPool::Backend* backend = connection_pool->get_backend();
           ConnectionPoolBackends::PostgresCentralHosted* central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
@@ -1910,7 +1910,7 @@
         // connect_to_server_with_connection_settings, which is just not
         // executed because it failed with no database present. We should
         // somehow avoid this code duplication.
-        else if(document->get_hosting_mode() == Document_Glom::POSTGRES_SELF_HOSTED)
+        else if(document->get_hosting_mode() == Document_Glom::HOSTING_MODE_POSTGRES_SELF)
         {
           ConnectionPool::Backend* backend = connection_pool->get_backend();
           ConnectionPoolBackends::PostgresSelfHosted* self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
@@ -1970,7 +1970,7 @@
     // libgda, but gda_connection_supports_feature() requires a GdaConnection
     // which we don't have at this point.
 #ifdef GLOM_ENABLE_SQLITE
-    if(document->get_hosting_mode() != Document_Glom::SQLITE_HOSTED)
+    if(document->get_hosting_mode() != Document_Glom::HOSTING_MODE_SQLITE)
 #endif
     {
       if(known_username.empty() && known_password.empty())

Modified: trunk/glom/layout_item_dialogs/dialog_field_layout.h
==============================================================================
--- trunk/glom/layout_item_dialogs/dialog_field_layout.h	(original)
+++ trunk/glom/layout_item_dialogs/dialog_field_layout.h	Tue Mar  3 13:59:58 2009
@@ -23,7 +23,7 @@
 
 #include <gtkmm.h>
 #include "../utility_widgets/dialog_properties.h"
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 #include "../box_withbuttons.h"
 #include "../utility_widgets/combo_textglade.h"
 #include "../utility_widgets/comboentry_currency.h"

Modified: trunk/glom/libglom/document/Makefile.am
==============================================================================
--- trunk/glom/libglom/document/Makefile.am	(original)
+++ trunk/glom/libglom/document/Makefile.am	Tue Mar  3 13:59:58 2009
@@ -1,4 +1,4 @@
 AM_CPPFLAGS = -I top_srcdir@/ $(GLOM_CFLAGS)
 
 noinst_LTLIBRARIES = libdocument.la
-libdocument_la_SOURCES = document_glom.h document_glom.cc
+libdocument_la_SOURCES = document_glom.h document_glom.cc view.h

Modified: trunk/glom/libglom/document/document_glom.cc
==============================================================================
--- trunk/glom/libglom/document/document_glom.cc	(original)
+++ trunk/glom/libglom/document/document_glom.cc	Tue Mar  3 13:59:58 2009
@@ -206,6 +206,31 @@
 //A built-in relationship that is available for every table:
 #define GLOM_RELATIONSHIP_NAME_SYSTEM_PROPERTIES "system_properties"
 
+
+/// Can be used with std::find_if() to find a layout with the same parent_table and layout_name.
+template<class T_Element>
+class predicate_Layout
+{
+public:
+  predicate_Layout(const Glib::ustring& parent_table, const Glib::ustring& layout_name, const Glib::ustring& layout_platform)
+  : m_parent_table(parent_table),
+    m_layout_name(layout_name),
+    m_layout_platform(layout_platform)
+  {
+  }
+
+  bool operator() (const T_Element& element)
+  {
+    return (element.m_parent_table == m_parent_table) &&
+           (element.m_layout_name == m_layout_name) &&
+           (element.m_layout_platform == m_layout_platform);
+  }
+
+private:
+  Glib::ustring m_parent_table, m_layout_name, m_layout_platform;
+};
+
+
 Document_Glom::Document_Glom()
 :
   m_hosting_mode(DEFAULT_HOSTED),
@@ -283,16 +308,16 @@
       switch(m_hosting_mode)
       {
 #ifdef GLOM_ENABLE_POSTGRESQL
-      case POSTGRES_SELF_HOSTED:
+      case HOSTING_MODE_POSTGRES_SELF:
         datadir = parent->get_child("glom_postgres_data");
         break;
-      case POSTGRES_CENTRAL_HOSTED:
+      case HOSTING_MODE_POSTGRES_CENTRAL:
         datadir = parent;
         break;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
-      case SQLITE_HOSTED:
+      case HOSTING_MODE_SQLITE:
         datadir = parent;
         break;
 #endif //GLOM_ENABLE_SQLITE
@@ -1283,8 +1308,7 @@
   }
 }
 
-bool Document_Glom::get_table_overview_position ( const Glib::ustring &table_name,
-                                                  float &x, float &y ) const
+bool Document_Glom::get_table_overview_position(const Glib::ustring& table_name, float& x, float& y) const
 {
   type_tables::const_iterator it = m_tables.find(table_name);
   if(it != m_tables.end())
@@ -1294,6 +1318,7 @@
     {
       return false;
     }
+
     x = it->second.m_overviewx;
     y = it->second.m_overviewy;
     return true;
@@ -1304,8 +1329,7 @@
   }
 }
     
-void Document_Glom::set_table_overview_position ( const Glib::ustring &table_name,
-                                                  float x, float y )
+void Document_Glom::set_table_overview_position(const Glib::ustring &table_name, float x, float y)
 {
   type_tables::iterator it = m_tables.find(table_name);
   if(it != m_tables.end())
@@ -2326,21 +2350,21 @@
           // If no hosting mode is set, then try the self_hosted flag which
           // was used before sqlite support was implemented.
           const bool self_hosted = get_node_attribute_value_as_bool(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_SELF_HOSTED);
-          mode = self_hosted ? POSTGRES_SELF_HOSTED : POSTGRES_CENTRAL_HOSTED;
+          mode = self_hosted ? HOSTING_MODE_POSTGRES_SELF : HOSTING_MODE_POSTGRES_CENTRAL;
 #endif //GLOM_ENABLE_POSTGRESQL
         }
         else
         {
 #ifdef GLOM_ENABLE_POSTGRESQL
           if(attr_mode == GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_CENTRAL)
-            mode = POSTGRES_CENTRAL_HOSTED;
+            mode = HOSTING_MODE_POSTGRES_CENTRAL;
           else if(attr_mode == GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_SELF)
-            mode = POSTGRES_SELF_HOSTED;
+            mode = HOSTING_MODE_POSTGRES_SELF;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
           if(attr_mode == GLOM_ATTRIBUTE_CONNECTION_HOSTING_SQLITE)
-            mode = SQLITE_HOSTED;
+            mode = HOSTING_MODE_SQLITE;
 #endif //GLOM_ENABLE_SQLITE
           else
 	  {
@@ -2350,7 +2374,7 @@
         }
 
 #ifdef GLOM_ENABLE_CLIENT_ONLY
-        if(mode == POSTGRES_SELF_HOSTED)
+        if(mode == HOSTING_MODE_POSTGRES_SELF)
         {
           std::cerr << "Document_Glom::load_after(): Loading failed because the document needs to be self-hosted, but self-hosting is not supported in client only mode" << std::endl;
           return false; //TODO: Provide more information so the application (or Bakery) can say exactly why loading failed.
@@ -3192,16 +3216,16 @@
     switch(m_hosting_mode)
     {
 #ifdef GLOM_ENABLE_POSTGRESQL
-    case POSTGRES_CENTRAL_HOSTED:
+    case HOSTING_MODE_POSTGRES_CENTRAL:
       set_node_attribute_value(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_HOSTING_MODE, GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_CENTRAL);
       break;
-    case POSTGRES_SELF_HOSTED:
+    case HOSTING_MODE_POSTGRES_SELF:
       set_node_attribute_value(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_HOSTING_MODE, GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_SELF);
       break;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
-    case SQLITE_HOSTED:
+    case HOSTING_MODE_SQLITE:
       set_node_attribute_value(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_HOSTING_MODE, GLOM_ATTRIBUTE_CONNECTION_HOSTING_SQLITE);
       break;
 #endif

Modified: trunk/glom/libglom/document/document_glom.h
==============================================================================
--- trunk/glom/libglom/document/document_glom.h	(original)
+++ trunk/glom/libglom/document/document_glom.h	Tue Mar  3 13:59:58 2009
@@ -1,6 +1,6 @@
 /* Glom
  *
- * Copyright (C) 2001-2004 Murray Cumming
+ * Copyright (C) 2001-2009 Murray Cumming
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -39,36 +39,18 @@
 #include <glom/libglom/data_structure/print_layout.h>
 #include <glom/libglom/data_structure/foundset.h>
 #include "../appstate.h"
-#include <gtkmm/window.h>
+//#include <gtkmm/window.h>
 #include <vector>
 #include <map>
 #include <limits> // for numeric_limits
 
-namespace Glom
+namespace Gtk
 {
+class Window;
+}
 
-/// Can be used with std::find_if() to find a layout with the same parent_table and layout_name.
-template<class T_Element>
-class predicate_Layout
+namespace Glom
 {
-public:
-  predicate_Layout(const Glib::ustring& parent_table, const Glib::ustring& layout_name, const Glib::ustring& layout_platform)
-  : m_parent_table(parent_table),
-    m_layout_name(layout_name),
-    m_layout_platform(layout_platform)
-  {
-  }
-
-  bool operator() (const T_Element& element)
-  {
-    return (element.m_parent_table == m_parent_table) &&
-           (element.m_layout_name == m_layout_name) &&
-           (element.m_layout_platform == m_layout_platform);
-  }
-
-private:
-  Glib::ustring m_parent_table, m_layout_name, m_layout_platform;
-};
 
 class Document_Glom : public Bakery::Document_XML
 {
@@ -110,26 +92,26 @@
 
   static guint get_latest_known_document_format_version();
 
-  //TODO: Use a prefix instead of a suffix for these enum names:
+  /// How the database is hosted.
   enum HostingMode
   {
 #ifdef GLOM_ENABLE_POSTGRESQL
-    POSTGRES_CENTRAL_HOSTED, /*!< The database is hosted on an external postgresql server. */
-    POSTGRES_SELF_HOSTED, /*!< A new postgres database process is spawned that hosts the data. */
+    HOSTING_MODE_POSTGRES_CENTRAL, /*!< The database is hosted on an external postgresql server. */
+    HOSTING_MODE_POSTGRES_SELF, /*!< A new postgres database process is spawned that hosts the data. */
 #endif //GLOM_ENABLE_POSTGRESQL
 #ifdef GLOM_ENABLE_SQLITE
-    SQLITE_HOSTED, /*!< A sqlite database file is used. */
+    HOSTING_MODE_SQLITE, /*!< A sqlite database file is used. */
 #endif // GLOM_ENABLE_SQLITE
 
     //This reduces the ifdefs elsewhere:
 #ifdef GLOM_ENABLE_POSTGRESQL
-    DEFAULT_HOSTED = POSTGRES_CENTRAL_HOSTED
+    DEFAULT_HOSTED = HOSTING_MODE_POSTGRES_CENTRAL
 #else
-    DEFAULT_HOSTED = SQLITE_HOSTED
+    DEFAULT_HOSTED = HOSTING_MODE_SQLITE
 #endif
   };
 
-  /** Set the hosting mode of the database.
+  /** Set the hosting mode of the database. 
    */
   void set_hosting_mode(HostingMode mode);
 
@@ -139,7 +121,7 @@
   void set_connection_port(int port_number);
   void set_connection_try_other_ports(bool val);
 
-  /** This returns how the hosting mode of the database.
+  /** This returns how the database is hosted.
    */
   HostingMode get_hosting_mode() const;
 
@@ -353,14 +335,14 @@
 
   // Used by Relationship Overview dialog to preserve table locations accross instantiations:
     
-  /** Retrieve the x and y coordinates for the given table position.
+  /** Retrieve the x and y coordinates for the given table position in the relationship overview dialog.
    * 
    * @param table_name The name of the table to query.
    * @param x The x coordinate of the table position.
    * @param y The y coordinate of the table position.
-   * @return false if the table does not have any 
+   * @return false if the table does not have any position for this table.
    */
-  bool get_table_overview_position ( const Glib::ustring &table_name, float &x, float &y ) const;
+  bool get_table_overview_position( const Glib::ustring& table_name, float &x, float &y ) const;
     
   /** Set the position of a table in the relationship overview dialog.
    * 
@@ -368,7 +350,7 @@
    * @param x The x coordinate of the table position.
    * @param y The y coordinate of the table position.
    */
-  void set_table_overview_position ( const Glib::ustring &table_name, float x, float y );
+  void set_table_overview_position( const Glib::ustring& utable_name, float x, float y );
     
   enum userLevelReason
   {
@@ -599,10 +581,6 @@
   Gtk::Window* m_parent_window; //Needed by BusyCursor.
 };
 
-//The base View for this document;
-typedef Bakery::View<Document_Glom> View_Glom;
-typedef Bakery::View_Composite<Document_Glom> View_Composite_Glom;
-
 } //namespace Glom
 
 #endif //DOCUMENT_GLOM_H

Added: trunk/glom/libglom/document/view.h
==============================================================================
--- (empty file)
+++ trunk/glom/libglom/document/view.h	Tue Mar  3 13:59:58 2009
@@ -0,0 +1,36 @@
+/* Glom
+ *
+ * Copyright (C) 2001-2009 Murray Cumming
+ *
+ * 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 2 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef DOCUMENT_GLOM_VIEW_H
+#define DOCUMENT_GLOM_VIEW_H
+
+#include <glom/libglom/document/document_glom.h>
+
+namespace Glom
+{
+
+///The base View for the document.
+typedef Bakery::View<Document_Glom> View_Glom;
+
+typedef Bakery::View_Composite<Document_Glom> View_Composite_Glom;
+
+} //namespace Glom
+
+#endif //DOCUMENT_GLOM_VIEW_H

Modified: trunk/glom/mode_design/dialog_design.h
==============================================================================
--- trunk/glom/mode_design/dialog_design.h	(original)
+++ trunk/glom/mode_design/dialog_design.h	Tue Mar  3 13:59:58 2009
@@ -23,7 +23,7 @@
 
 #include <gtkmm.h>
 #include <libglademm.h>
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 
 namespace Glom
 {

Modified: trunk/glom/relationships_overview/dialog_relationships_overview.h
==============================================================================
--- trunk/glom/relationships_overview/dialog_relationships_overview.h	(original)
+++ trunk/glom/relationships_overview/dialog_relationships_overview.h	Tue Mar  3 13:59:58 2009
@@ -21,7 +21,7 @@
 #ifndef GLOM_DIALOG_RELATIONSHIPS_OVERVIEW
 #define GLOM_DIALOG_RELATIONSHIPS_OVERVIEW
 
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 #include "glom/utility_widgets/canvas/canvas_editable.h"
 #include "canvas_group_dbtable.h"
 #include <gtkmm/dialog.h>

Modified: trunk/glom/translation/dialog_identify_original.h
==============================================================================
--- trunk/glom/translation/dialog_identify_original.h	(original)
+++ trunk/glom/translation/dialog_identify_original.h	Tue Mar  3 13:59:58 2009
@@ -22,7 +22,7 @@
 #define GLOM_TRANSLATIONS_DIALOG_IDENTIFY_ORIGINAL_H
 
 #include "combobox_locale.h"
-#include <glom/libglom/document/document_glom.h> // For View_Glom
+#include <glom/libglom/document/view.h> // For View_Glom
 #include <libglademm.h>
 #include <gtkmm/dialog.h>
 

Modified: trunk/glom/translation/window_translations.cc
==============================================================================
--- trunk/glom/translation/window_translations.cc	(original)
+++ trunk/glom/translation/window_translations.cc	Tue Mar  3 13:59:58 2009
@@ -35,6 +35,10 @@
 
 #include <sstream>
 
+/* For really ugly hacks! */
+#include <setjmp.h>
+
+
 namespace Glom
 {
 

Modified: trunk/glom/translation/window_translations.h
==============================================================================
--- trunk/glom/translation/window_translations.h	(original)
+++ trunk/glom/translation/window_translations.h	Tue Mar  3 13:59:58 2009
@@ -21,15 +21,12 @@
 #ifndef GLOM_TRANSLATIONS_DIALOG_TRANSLATIONS_H
 #define GLOM_TRANSLATIONS_DIALOG_TRANSLATIONS_H
 
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 #include <gtkmm.h>
 #include <libglademm.h>
 
 #include <gettext-po.h>
 
-/* For really ugly hacks! */
-#include <setjmp.h>
-
 namespace Glom
 {
 

Modified: trunk/glom/utility_widgets/datawidget.h
==============================================================================
--- trunk/glom/utility_widgets/datawidget.h	(original)
+++ trunk/glom/utility_widgets/datawidget.h	Tue Mar  3 13:59:58 2009
@@ -27,7 +27,7 @@
 #include "layoutwidgetmenu.h"
 #include <gtkmm/label.h>
 #include <glom/libglom/data_structure/field.h>
-#include <glom/libglom/document/document_glom.h>
+#include <glom/libglom/document/view.h>
 #include <glom/libglom/data_structure/layout/layoutitem_field.h>
 #include "../mode_data/treestore_layout.h" //Forthe enum.
 

Modified: trunk/glom/utility_widgets/filechooserdialog_saveextras.cc
==============================================================================
--- trunk/glom/utility_widgets/filechooserdialog_saveextras.cc	(original)
+++ trunk/glom/utility_widgets/filechooserdialog_saveextras.cc	Tue Mar  3 13:59:58 2009
@@ -171,16 +171,16 @@
   switch(mode)
   {
 #ifdef GLOM_ENABLE_POSTGRESQL
-  case Document_Glom::POSTGRES_CENTRAL_HOSTED:
+  case Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL:
     m_radiobutton_server_postgres_central.set_active();
     break;
-  case Document_Glom::POSTGRES_SELF_HOSTED:
+  case Document_Glom::HOSTING_MODE_POSTGRES_SELF:
     m_radiobutton_server_postgres_selfhosted.set_active();
     break;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
-  case Document_Glom::SQLITE_HOSTED:
+  case Document_Glom::HOSTING_MODE_SQLITE:
     m_radiobutton_server_sqlite.set_active();
     break;
 #endif //GLOM_ENABLE_SQLITE
@@ -199,22 +199,22 @@
 {
 #ifdef GLOM_ENABLE_POSTGRESQL
   if(m_radiobutton_server_postgres_central.get_active())
-    return Document_Glom::POSTGRES_CENTRAL_HOSTED;
+    return Document_Glom::HOSTING_MODE_POSTGRES_CENTRAL;
   else if(m_radiobutton_server_postgres_selfhosted.get_active())
-    return Document_Glom::POSTGRES_SELF_HOSTED;
+    return Document_Glom::HOSTING_MODE_POSTGRES_SELF;
 #endif //GLOM_ENABLE_POSTGRESQL
 
 #ifdef GLOM_ENABLE_SQLITE
   if(m_radiobutton_server_sqlite.get_active())
-    return Document_Glom::SQLITE_HOSTED;
+    return Document_Glom::HOSTING_MODE_SQLITE;
 #endif //GLOM_ENABLE_SQLITE
 
   g_assert_not_reached();
 
 #ifdef GLOM_ENABLE_SQLITE
-  return Document_Glom::SQLITE_HOSTED; //Arbitrary
+  return Document_Glom::HOSTING_MODE_SQLITE; //Arbitrary
 #else
-  return Document_Glom::POSTGRES_SELF_HOSTED; //Arbitrary.
+  return Document_Glom::HOSTING_MODE_POSTGRES_SELF; //Arbitrary.
 #endif //GLOM_ENABLE_SQLITE
 }
 



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