[glom/gtkmm4v4] gtkmm4: Remove use of gtksourceview, regrettably.



commit a6f98b7b2524f9e6b09afc2c0b6ae755741a5ff1
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Apr 16 14:50:13 2017 +0200

    gtkmm4: Remove use of gtksourceview, regrettably.
    
    Revert this when there is a version of gtksourceview that targets
    GTK+-4.0.

 configure.ac                                       |    5 +++--
 .../ui/developer/dialog_database_preferences.glade |    3 +--
 data/ui/developer/dialog_script_library.glade      |    3 +--
 data/ui/developer/window_button_script.glade       |    3 +--
 data/ui/developer/window_field_calculation.glade   |    3 +--
 .../developer/window_field_definition_edit.glade   |    3 +--
 glom/main.cc                                       |    2 --
 glom/mode_design/dialog_database_preferences.cc    |   17 +++--------------
 glom/mode_design/dialog_database_preferences.h     |    4 ++--
 glom/mode_design/fields/dialog_fieldcalculation.cc |   16 +++-------------
 glom/mode_design/fields/dialog_fieldcalculation.h  |    4 ++--
 glom/mode_design/fields/dialog_fielddefinition.h   |    4 ++--
 .../layout_item_dialogs/dialog_buttonscript.cc     |   17 +++--------------
 .../layout_item_dialogs/dialog_buttonscript.h      |    5 ++---
 .../script_library/dialog_script_library.cc        |   15 +++------------
 .../script_library/dialog_script_library.h         |    4 ++--
 tests/ui/glade_toplevels_instantiation.cc          |    2 --
 tests/ui/test_glade_derived_instantiation.cc       |    2 --
 18 files changed, 30 insertions(+), 82 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 02d51a9..ebc2e8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,8 +177,9 @@ AS_IF([test "x$glom_enable_client_only" != xyes && test "x$glom_host_win32" != x
       [REQUIRED_GLOM_LIBS="$REQUIRED_GLOM_LIBS iso-codes"])
 
 # Do not require gtksourceviewmm in client only mode
-AS_IF([test "x$glom_enable_client_only" != xyes],
-      [REQUIRED_GLOM_LIBS="$REQUIRED_GLOM_LIBS gtksourceviewmm-4.0 >= 3.18.0"])
+# TODO: Re-enable this when there is a version of gtksourceview that builds with GTK+-4.0:
+#AS_IF([test "x$glom_enable_client_only" != xyes],
+#      [REQUIRED_GLOM_LIBS="$REQUIRED_GLOM_LIBS gtksourceviewmm-4.0 >= 3.18.0"])
 
 AS_IF([test "x$glom_enable_sqlite" = xyes],
       [REQUIRED_GLOM_LIBS="$REQUIRED_GLOM_LIBS libgda-sqlite-6.0"])
diff --git a/data/ui/developer/dialog_database_preferences.glade 
b/data/ui/developer/dialog_database_preferences.glade
index d868531..30409ee 100644
--- a/data/ui/developer/dialog_database_preferences.glade
+++ b/data/ui/developer/dialog_database_preferences.glade
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.18.1 -->
 <interface>
   <requires lib="gtk+" version="3.6"/>
-  <requires lib="gtksourceview" version="0.0"/>
   <object class="GtkDialog" id="dialog_database_preferences">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -499,7 +498,7 @@
                             <property name="can_focus">False</property>
                             <property name="shadow_type">none</property>
                             <child>
-                              <object class="GtkSourceView" id="textview_calculation">
+                              <object class="GtkTextView" id="textview_calculation">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="left_margin">2</property>
diff --git a/data/ui/developer/dialog_script_library.glade b/data/ui/developer/dialog_script_library.glade
index d128f20..c274b69 100644
--- a/data/ui/developer/dialog_script_library.glade
+++ b/data/ui/developer/dialog_script_library.glade
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.16.0 on Fri Oct 25 10:59:22 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.6 -->
-  <!-- interface-requires gtksourceview 0.0 -->
   <object class="GtkDialog" id="dialog_script_library">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -153,7 +152,7 @@
                 <property name="can_focus">True</property>
                 <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkSourceView" id="textview_script">
+                  <object class="GtkTextView" id="textview_script">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="left_margin">2</property>
diff --git a/data/ui/developer/window_button_script.glade b/data/ui/developer/window_button_script.glade
index 86a592e..891f12c 100644
--- a/data/ui/developer/window_button_script.glade
+++ b/data/ui/developer/window_button_script.glade
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.16.0 on Fri Oct 25 10:57:19 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.6 -->
-  <!-- interface-requires gtksourceview 0.0 -->
   <object class="GtkDialog" id="window_button_script">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -157,7 +156,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkSourceView" id="textview_calculation">
+                      <object class="GtkTextView" id="textview_calculation">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="left_margin">2</property>
diff --git a/data/ui/developer/window_field_calculation.glade 
b/data/ui/developer/window_field_calculation.glade
index da8dee8..6521e57 100644
--- a/data/ui/developer/window_field_calculation.glade
+++ b/data/ui/developer/window_field_calculation.glade
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.15.4 on Wed Oct 23 11:19:51 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.6 -->
-  <!-- interface-requires gtksourceview 0.0 -->
   <object class="GtkDialog" id="window_field_calculation">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -123,7 +122,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkSourceView" id="textview_calculation">
+                      <object class="GtkTextView" id="textview_calculation">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="left_margin">2</property>
diff --git a/data/ui/developer/window_field_definition_edit.glade 
b/data/ui/developer/window_field_definition_edit.glade
index d718fd4..6e395d2 100644
--- a/data/ui/developer/window_field_definition_edit.glade
+++ b/data/ui/developer/window_field_definition_edit.glade
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.18.1 -->
 <interface>
   <requires lib="gtk+" version="3.6"/>
-  <requires lib="gtksourceview" version="0.0"/>
   <object class="GtkWindow" id="window_field_definition_edit">
     <property name="can_focus">False</property>
     <property name="border_width">12</property>
@@ -362,7 +361,7 @@
                             <property name="can_focus">True</property>
                             <property name="shadow_type">in</property>
                             <child>
-                              <object class="GtkSourceView" id="textview_calculate">
+                              <object class="GtkTextView" id="textview_calculate">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                </object>
diff --git a/glom/main.cc b/glom/main.cc
index 1309ad4..e5ea7c9 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -55,7 +55,6 @@
 #include <glom/python_embed/glom_python.h>
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-#include <gtksourceviewmm/init.h>
 #include <goocanvasmm/init.h>
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
@@ -495,7 +494,6 @@ main(int argc, char* argv[])
       Glom::Application::create();
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-    Gsv::init();
     Goocanvas::init();
 #endif //!GLOM_ENABLE_CLIENT_ONLY
 
diff --git a/glom/mode_design/dialog_database_preferences.cc b/glom/mode_design/dialog_database_preferences.cc
index f3c156f..1914fe4 100644
--- a/glom/mode_design/dialog_database_preferences.cc
+++ b/glom/mode_design/dialog_database_preferences.cc
@@ -25,7 +25,6 @@
 #include <libglom/db_utils.h>
 #include <glom/bakery/busy_cursor.h>
 #include <glom/utils_ui.h>
-#include <gtksourceviewmm/languagemanager.h>
 #include <glibmm/i18n.h>
 
 #include <iostream>
@@ -87,19 +86,9 @@ Dialog_Database_Preferences::Dialog_Database_Preferences(BaseObjectType* cobject
 
   //Dialog_Properties::set_modified(false);
 
-  //Tell the SourceView to do syntax highlighting for Python:
-  auto languages_manager =
-    Gsv::LanguageManager::get_default();
-
-  auto language =
-    languages_manager->get_language("python"); //This is the GtkSourceView language ID.
-  if(language)
-  {
-     //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to 
set it, using the wrong buffer type:
-     auto buffer = Gsv::Buffer::create(language);
-     buffer->set_highlight_syntax();
-     m_text_view_script->set_buffer(buffer);
-  }
+  //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to set 
it, using the wrong buffer type:
+  auto buffer = Gtk::TextBuffer::create();
+  m_text_view_script->set_buffer(buffer);
 }
 
 void Dialog_Database_Preferences::on_treeview_cell_edited_next_value(const Glib::ustring& path_string, const 
Glib::ustring& new_text)
diff --git a/glom/mode_design/dialog_database_preferences.h b/glom/mode_design/dialog_database_preferences.h
index 7390ac9..af7055c 100644
--- a/glom/mode_design/dialog_database_preferences.h
+++ b/glom/mode_design/dialog_database_preferences.h
@@ -28,7 +28,7 @@
 #include <gtkmm/label.h>
 #include <gtkmm/treeview.h>
 #include <gtkmm/liststore.h>
-#include <gtksourceviewmm/view.h>
+#include <gtkmm/textview.h>
 #include <glom/base_db.h>
 #include <libglom/data_structure/system_prefs.h>
 #include <libglom/connectionpool.h>
@@ -82,7 +82,7 @@ private:
   ImageGlom* m_image;
   Gtk::Button* m_button_choose_image;
 
-  Gsv::View* m_text_view_script;
+  Gtk::TextView* m_text_view_script;
   Gtk::Button* m_button_test_script;
 
   SystemPrefs m_system_prefs;
diff --git a/glom/mode_design/fields/dialog_fieldcalculation.cc 
b/glom/mode_design/fields/dialog_fieldcalculation.cc
index 5ba087e..5137130 100644
--- a/glom/mode_design/fields/dialog_fieldcalculation.cc
+++ b/glom/mode_design/fields/dialog_fieldcalculation.cc
@@ -26,7 +26,6 @@
 #include <glom/utils_ui.h>
 #include <glom/appwindow.h>
 #include <libglom/data_structure/glomconversions.h>
-#include <gtksourceviewmm/languagemanager.h>
 
 //#include <libgnome/gnome-i18n.h>
 #include <glibmm/i18n.h>
@@ -49,18 +48,9 @@ Dialog_FieldCalculation::Dialog_FieldCalculation(BaseObjectType* cobject, const
 
   if(m_text_view)
   {
-    m_text_view->set_highlight_current_line(true);
-
-    auto languages_manager = Gsv::LanguageManager::get_default();
-
-    auto language = languages_manager->get_language("python"); //This is the GtkSourceView language ID.
-    if(language)
-    {
-       //Createa a new buffer and set it, instead of getting the default buffer, in case libglade has tried 
to set it, using the wrong buffer type:
-       auto buffer = Gsv::Buffer::create(language);
-       buffer->set_highlight_syntax();
-       m_text_view->set_buffer(buffer);
-    }
+    //Createa a new buffer and set it, instead of getting the default buffer, in case libglade has tried to 
set it, using the wrong buffer type:
+    auto buffer = Gtk::TextBuffer::create();
+    m_text_view->set_buffer(buffer);
   }
 
   //Dialog_Properties::set_modified(false);
diff --git a/glom/mode_design/fields/dialog_fieldcalculation.h 
b/glom/mode_design/fields/dialog_fieldcalculation.h
index e9da789..27f3f04 100644
--- a/glom/mode_design/fields/dialog_fieldcalculation.h
+++ b/glom/mode_design/fields/dialog_fieldcalculation.h
@@ -25,9 +25,9 @@
 #include <gtkmm/button.h>
 #include <gtkmm/label.h>
 #include <gtkmm/builder.h>
+#include <gtkmm/textview.h>
 #include <libglom/data_structure/field.h>
 #include <glom/base_db.h>
-#include <gtksourceviewmm/view.h>
 
 namespace Glom
 {
@@ -50,7 +50,7 @@ private:
   void on_button_test();
   bool check_for_return_statement(const Glib::ustring& calculation);
 
-  Gsv::View* m_text_view;
+  Gtk::TextView* m_text_view;
   Gtk::Button* m_button_test;
   Gtk::Label* m_label_triggered_by;
 
diff --git a/glom/mode_design/fields/dialog_fielddefinition.h 
b/glom/mode_design/fields/dialog_fielddefinition.h
index 311c993..b807689 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.h
+++ b/glom/mode_design/fields/dialog_fielddefinition.h
@@ -25,6 +25,7 @@
 #include <gtkmm/checkbutton.h>
 #include <gtkmm/comboboxtext.h>
 #include <gtkmm/entry.h>
+#include <gtkmm/textview.h>
 #include <glom/mode_design/layout/combobox_relationship.h>
 #include "combo_fieldtype.h"
 //#include "../../utility_widgets/entry_numerical.h"
@@ -33,7 +34,6 @@
 #include <libglom/data_structure/field.h>
 #include <glom/mode_design/layout/layout_item_dialogs/box_formatting.h>
 #include <glom/base_db.h>
-#include <gtksourceviewmm/view.h>
 
 namespace Glom
 {
@@ -84,7 +84,7 @@ private:
 
   Gtk::RadioButton* m_radio_calculate;
   Gtk::Box* m_alignment_calculate;
-  Gsv::View* m_textView_calculation;
+  Gtk::TextView* m_textView_calculation;
   Gtk::Button* m_button_edit_calculation;
 
   Gtk::Entry* m_entry_title;
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc 
b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
index fb550af..5c90f6d 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
@@ -25,7 +25,6 @@
 #include <glom/appwindow.h>
 #include <glom/utils_ui.h>
 #include <libglom/data_structure/glomconversions.h>
-#include <gtksourceviewmm/languagemanager.h>
 
 
 //#include <libgnome/gnome-i18n.h>
@@ -52,19 +51,9 @@ Dialog_ButtonScript::Dialog_ButtonScript(BaseObjectType* cobject, const Glib::Re
 
   //Dialog_Properties::set_modified(false);
 
-  //Tell the SourceView to do syntax highlighting for Python:
-  auto languages_manager =
-    Gsv::LanguageManager::get_default();
-
-  auto language =
-    languages_manager->get_language("python"); //This is the GtkSourceView language ID.
-  if(language)
-  {
-     //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to 
set it, using the wrong buffer type:
-     auto buffer = Gsv::Buffer::create(language);
-     buffer->set_highlight_syntax();
-     m_text_view_script->set_buffer(buffer);
-  }
+  //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to set 
it, using the wrong buffer type:
+  auto buffer = Gtk::TextBuffer::create();
+  m_text_view_script->set_buffer(buffer);
 }
 
 void Dialog_ButtonScript::set_script(const std::shared_ptr<const LayoutItem_Button>& script, const 
Glib::ustring& table_name)
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h 
b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h
index 78abea7..0fdcf9d 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h
@@ -24,11 +24,10 @@
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/builder.h>
+#include <gtkmm/textview.h>
 #include <libglom/data_structure/layout/layoutitem_button.h>
 #include <glom/base_db.h>
 
-#include <gtksourceviewmm/view.h>
-
 namespace Glom
 {
 
@@ -51,7 +50,7 @@ private:
   void on_button_test_script();
 
   Gtk::Entry* m_entry_title;
-  Gsv::View* m_text_view_script;
+  Gtk::TextView* m_text_view_script;
   Gtk::Button* m_button_test_script;
 
   std::shared_ptr<LayoutItem_Button> m_script;
diff --git a/glom/mode_design/script_library/dialog_script_library.cc 
b/glom/mode_design/script_library/dialog_script_library.cc
index c0ea0ec..3d31673 100644
--- a/glom/mode_design/script_library/dialog_script_library.cc
+++ b/glom/mode_design/script_library/dialog_script_library.cc
@@ -24,7 +24,6 @@
 #include <glom/glade_utils.h>
 #include <glom/utils_ui.h>
 #include <glom/mode_design/script_library/dialog_new_script.h>
-#include <gtksourceviewmm/languagemanager.h>
 #include <glom/appwindow.h>
 
 
@@ -56,17 +55,9 @@ Dialog_ScriptLibrary::Dialog_ScriptLibrary(BaseObjectType* cobject, const Glib::
 
   //Dialog_Properties::set_modified(false);
 
-  //Set the SourceView to do syntax highlighting for Python:
-  auto languages_manager = Gsv::LanguageManager::get_default();
-
-  auto language = languages_manager->get_language("python"); //This is the GtkSourceView language ID.
-  if(language)
-  {
-     //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to 
set it, using the wrong buffer type:
-     auto buffer = Gsv::Buffer::create(language);
-     buffer->set_highlight_syntax();
-     m_text_view->set_buffer(buffer);
-  }
+  //Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to set 
it, using the wrong buffer type:
+  auto buffer = Gtk::TextBuffer::create();
+  m_text_view->set_buffer(buffer);
 }
 
 void Dialog_ScriptLibrary::on_button_check()
diff --git a/glom/mode_design/script_library/dialog_script_library.h 
b/glom/mode_design/script_library/dialog_script_library.h
index 1232e69..138b527 100644
--- a/glom/mode_design/script_library/dialog_script_library.h
+++ b/glom/mode_design/script_library/dialog_script_library.h
@@ -23,9 +23,9 @@
 
 #include <gtkmm/dialog.h>
 #include <gtkmm/builder.h>
+#include <gtkmm/textview.h>
 #include <libglom/data_structure/layout/layoutitem_button.h>
 #include <glom/base_db.h>
-#include <gtksourceviewmm/view.h>
 #include <glom/utility_widgets/combo_textglade.h>
 
 namespace Glom
@@ -58,7 +58,7 @@ private:
 
   Combo_TextGlade* m_combobox_name;
 
-  Gsv::View* m_text_view;
+  Gtk::TextView* m_text_view;
   Gtk::Button* m_button_check;
   Gtk::Button* m_button_add;
   Gtk::Button* m_button_remove;
diff --git a/tests/ui/glade_toplevels_instantiation.cc b/tests/ui/glade_toplevels_instantiation.cc
index 671a209..d747822 100644
--- a/tests/ui/glade_toplevels_instantiation.cc
+++ b/tests/ui/glade_toplevels_instantiation.cc
@@ -20,7 +20,6 @@
 #include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
 #include <gtkmm/application.h>
-#include <gtksourceviewmm/init.h>
 #include <libxml++/libxml++.h>
 
 #include <iostream>
@@ -92,7 +91,6 @@ int main(int argc, char* argv[])
 {
   auto app =
     Gtk::Application::create("org.glom.test_glade_toplevels_instantiation");
-  Gsv::init(); //Our .glade files contain gtksourceview widgets too.
 
   std::string filepath;
   if(argc > 1 )
diff --git a/tests/ui/test_glade_derived_instantiation.cc b/tests/ui/test_glade_derived_instantiation.cc
index 228bb48..11693bd 100644
--- a/tests/ui/test_glade_derived_instantiation.cc
+++ b/tests/ui/test_glade_derived_instantiation.cc
@@ -73,7 +73,6 @@
 #include <glom/dialog_invalid_data.h>
 #include <gtkmm/builder.h>
 #include <gtkmm/application.h>
-#include <gtksourceviewmm/init.h>
 
 const int GLOM_MAX_WINDOW_WIDTH = 800;
 const int GLOM_MAX_WINDOW_HEIGHT = 600;
@@ -131,7 +130,6 @@ int main()
 {
   auto app =
     Gtk::Application::create("org.glom.test_glade_derived_instantiation");
-  Gsv::init(); //Our .glade files contain gtksourceview widgets too.
 
   using namespace Glom;
 


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