[gtksourceviewmm] Adapt tests (or rather - examples).



commit b45bdd214845a1b6e46b4696af4061a4ae6aa883
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sun Mar 27 15:56:31 2011 +0200

    Adapt tests (or rather - examples).
    
    * tests/basic/main.cc:
    * tests/completion/main.cc:
    * tests/get_buffer/main.cc:
    * tests/langs/main.cc:
    * tests/mime_types/main.cc:
    * tests/search/main.cc: source_truncate.pl did the job.

 tests/basic/main.cc      |    6 +++---
 tests/completion/main.cc |   44 ++++++++++++++++++++++----------------------
 tests/get_buffer/main.cc |    4 ++--
 tests/langs/main.cc      |   10 +++++-----
 tests/mime_types/main.cc |    6 +++---
 tests/search/main.cc     |    8 ++++----
 6 files changed, 39 insertions(+), 39 deletions(-)
---
diff --git a/tests/basic/main.cc b/tests/basic/main.cc
index fe50bfb..62fad18 100644
--- a/tests/basic/main.cc
+++ b/tests/basic/main.cc
@@ -12,10 +12,10 @@ main (int a_argc, char *a_argv[])
     Gtk::Main main_loop (a_argc, a_argv) ;
     Gsv::init () ;
 
-    SourceView source_view ;
-    RefPtr<SourceBuffer> buffer = source_view.get_source_buffer () ;
+    View source_view ;
+    RefPtr<Buffer> buffer = source_view.get_source_buffer () ;
     if (!buffer) {
-        cerr << "Gsv::SourceView::get_source_buffer () failed" << std::endl ;
+        cerr << "Gsv::View::get_source_buffer () failed" << std::endl ;
         return -1;
     }
     buffer->set_text ("coin") ;
diff --git a/tests/completion/main.cc b/tests/completion/main.cc
index 3192da6..f458895 100644
--- a/tests/completion/main.cc
+++ b/tests/completion/main.cc
@@ -9,7 +9,7 @@
 // gtksourceviewmm
 #include <gtksourceviewmm.h>
 
-class TestProvider : public Glib::Object, public Gsv::SourceCompletionProvider
+class TestProvider : public Glib::Object, public Gsv::CompletionProvider
 {
 public:
   static Glib::RefPtr<TestProvider> create();
@@ -29,18 +29,18 @@ private:
   virtual Glib::ustring get_name_vfunc() const;
   virtual Glib::RefPtr<Gdk::Pixbuf> get_icon_vfunc();
   virtual Glib::RefPtr<const Gdk::Pixbuf> get_icon_vfunc() const;
-  virtual void populate_vfunc(const Glib::RefPtr<Gsv::SourceCompletionContext>& context);
-  virtual bool match_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionContext>& context) const;
-  //virtual Gtk::Widget* get_info_widget_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionProposal>& proposal);
-  //virtual const Gtk::Widget* get_info_widget_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionProposal>& proposal) const;
-  //virtual void update_info_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionProposal>& proposal, const Gsv::SourceCompletionInfo& info);
-  //virtual bool get_start_iter_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionContext>& context, const Glib::RefPtr<const Gsv::SourceCompletionProposal>& proposal, Gtk::TextIter& iter);
-  //virtual bool activate_proposal_vfunc(const Glib::RefPtr<Gsv::SourceCompletionProposal>& proposal, const Gtk::TextIter& iter);
-  virtual Gsv::SourceCompletionActivation get_activation_vfunc() const;
+  virtual void populate_vfunc(const Glib::RefPtr<Gsv::CompletionContext>& context);
+  virtual bool match_vfunc(const Glib::RefPtr<const Gsv::CompletionContext>& context) const;
+  //virtual Gtk::Widget* get_info_widget_vfunc(const Glib::RefPtr<const Gsv::CompletionProposal>& proposal);
+  //virtual const Gtk::Widget* get_info_widget_vfunc(const Glib::RefPtr<const Gsv::CompletionProposal>& proposal) const;
+  //virtual void update_info_vfunc(const Glib::RefPtr<const Gsv::CompletionProposal>& proposal, const Gsv::CompletionInfo& info);
+  //virtual bool get_start_iter_vfunc(const Glib::RefPtr<const Gsv::CompletionContext>& context, const Glib::RefPtr<const Gsv::CompletionProposal>& proposal, Gtk::TextIter& iter);
+  //virtual bool activate_proposal_vfunc(const Glib::RefPtr<Gsv::CompletionProposal>& proposal, const Gtk::TextIter& iter);
+  virtual Gsv::CompletionActivation get_activation_vfunc() const;
   //virtual int get_interactive_delay_vfunc() const;
   virtual int get_priority_vfunc() const;
 
-  std::vector<Glib::RefPtr<Gsv::SourceCompletionProposal> > m_proposals;
+  std::vector<Glib::RefPtr<Gsv::CompletionProposal> > m_proposals;
   int m_priority;
   Glib::ustring m_name;
   Glib::RefPtr<Gdk::Pixbuf> m_pixbuf;
@@ -67,12 +67,12 @@ void TestProvider::set_name(const Glib::ustring& name)
 TestProvider::TestProvider()
 : Glib::ObjectBase(typeid(TestProvider)),
   Glib::Object(),
-  Gsv::SourceCompletionProvider()
+  Gsv::CompletionProvider()
 {
   m_proposals.reserve(3);
-  m_proposals.push_back( Gsv::SourceCompletionItem::create( "Proposal 1", "Proposal 1", get_icon_vfunc(), "" ) );
-  m_proposals.push_back( Gsv::SourceCompletionItem::create( "Proposal 2", "Proposal 2", get_icon_vfunc(), "" ) );
-  m_proposals.push_back( Gsv::SourceCompletionItem::create( "Proposal 3", "Proposal 3", get_icon_vfunc(), "" ) );
+  m_proposals.push_back( Gsv::CompletionItem::create( "Proposal 1", "Proposal 1", get_icon_vfunc(), "" ) );
+  m_proposals.push_back( Gsv::CompletionItem::create( "Proposal 2", "Proposal 2", get_icon_vfunc(), "" ) );
+  m_proposals.push_back( Gsv::CompletionItem::create( "Proposal 3", "Proposal 3", get_icon_vfunc(), "" ) );
 }
 
 Glib::ustring TestProvider::get_name_vfunc() const
@@ -90,21 +90,21 @@ Glib::RefPtr<const Gdk::Pixbuf> TestProvider::get_icon_vfunc() const
   return const_cast<TestProvider*>(this)->get_icon_vfunc();
 }
 
-void TestProvider::populate_vfunc(const Glib::RefPtr<Gsv::SourceCompletionContext>& context)
+void TestProvider::populate_vfunc(const Glib::RefPtr<Gsv::CompletionContext>& context)
 {
   Glib::RefPtr<TestProvider> reffed_this(this);
   reffed_this->reference();
   context->add_proposals(reffed_this, m_proposals, true);
 }
 
-bool TestProvider::match_vfunc(const Glib::RefPtr<const Gsv::SourceCompletionContext>& /* context */) const
+bool TestProvider::match_vfunc(const Glib::RefPtr<const Gsv::CompletionContext>& /* context */) const
 {
   return true;
 }
 
-Gsv::SourceCompletionActivation TestProvider::get_activation_vfunc() const
+Gsv::CompletionActivation TestProvider::get_activation_vfunc() const
 {
-  return Gsv::SOURCE_COMPLETION_ACTIVATION_INTERACTIVE | Gsv::SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED;
+  return Gsv::COMPLETION_ACTIVATION_INTERACTIVE | Gsv::COMPLETION_ACTIVATION_USER_REQUESTED;
 }
 
 int TestProvider::get_priority_vfunc() const
@@ -125,8 +125,8 @@ protected:
   void show_icons_toggled();
 
 private:
-  Glib::RefPtr<Gsv::SourceCompletion> m_completion;
-  Gsv::SourceView* m_view;
+  Glib::RefPtr<Gsv::Completion> m_completion;
+  Gsv::View* m_view;
   Gtk::CheckButton* m_remember;
   Gtk::CheckButton* m_select_on_show;
   Gtk::CheckButton* m_show_headers;
@@ -153,7 +153,7 @@ TestWindow::TestWindow()
   resize(600, 400);
 
   Gtk::ScrolledWindow* scrolledwindow (Gtk::manage(new Gtk::ScrolledWindow()));
-  m_view = Gtk::manage(new Gsv::SourceView());
+  m_view = Gtk::manage(new Gsv::View());
 
   scrolledwindow->add(*m_view);
 
@@ -179,7 +179,7 @@ TestWindow::TestWindow()
 
   add(*vbox);
 //completion
-  Glib::RefPtr<Gsv::SourceCompletionWords> prov_words ( Gsv::SourceCompletionWords::create("", Glib::RefPtr<Gdk::Pixbuf>()) );
+  Glib::RefPtr<Gsv::CompletionWords> prov_words ( Gsv::CompletionWords::create("", Glib::RefPtr<Gdk::Pixbuf>()) );
 
   prov_words->register_provider(m_view->get_buffer());
   m_completion->add_provider(prov_words);
diff --git a/tests/get_buffer/main.cc b/tests/get_buffer/main.cc
index 1ac6dc8..1ad8707 100644
--- a/tests/get_buffer/main.cc
+++ b/tests/get_buffer/main.cc
@@ -8,8 +8,8 @@ main (int argc, char* argv[])
     Gtk::Main kit (argc, argv) ;
     Gsv::init () ;
 
-    Gsv::SourceView view ;
-    Glib::RefPtr<Gsv::SourceBuffer> buf = view.get_source_buffer () ;
+    Gsv::View view ;
+    Glib::RefPtr<Gsv::Buffer> buf = view.get_source_buffer () ;
     if (buf) {
         std::cout << "PASSED" << std::endl;
     } else {
diff --git a/tests/langs/main.cc b/tests/langs/main.cc
index be5ea11..450c59b 100644
--- a/tests/langs/main.cc
+++ b/tests/langs/main.cc
@@ -1,7 +1,7 @@
 #include <iostream>
 #include <gtkmm.h>
-#include <gtksourceviewmm/sourceview.h>
-#include<gtksourceviewmm/sourcelanguagemanager.h>
+#include <gtksourceviewmm/view.h>
+#include<gtksourceviewmm/languagemanager.h>
 #include<gtksourceviewmm/init.h>
 
 using namespace std ;
@@ -13,14 +13,14 @@ main (int argc, char **argv)
     Gtk::Main loop (argc, argv) ;
     Gsv::init () ;
 
-    Glib::RefPtr<SourceLanguageManager> language_manager =
-                                                SourceLanguageManager::create();
+    Glib::RefPtr<LanguageManager> language_manager =
+                                                LanguageManager::create();
     vector<string> langs = language_manager->get_language_ids ();
     cout << "number of languages found: " << langs.size () << std::endl;;
 
     for (vector<string>::const_iterator iter = langs.begin(); iter != langs.end (); ++iter) {
         if (!(iter->empty())) {
-            Glib::RefPtr<SourceLanguage> lang = language_manager->get_language (*iter);
+            Glib::RefPtr<Language> lang = language_manager->get_language (*iter);
             cout << "language: " << lang->get_name () << std::endl;
         } else {
             cout << "language: null" << std::endl;;
diff --git a/tests/mime_types/main.cc b/tests/mime_types/main.cc
index 1a2e04b..60db13c 100644
--- a/tests/mime_types/main.cc
+++ b/tests/mime_types/main.cc
@@ -5,7 +5,7 @@
 // gtkmm
 #include <gtkmm.h>
 // gtksourceviewmm
-#include <gtksourceviewmm/sourcelanguagemanager.h>
+#include <gtksourceviewmm/languagemanager.h>
 #include <gtksourceviewmm/init.h>
 
 int
@@ -13,7 +13,7 @@ main (int /* argc */, char** /* argv */)
 {
   Gsv::init () ;
 
-  Glib::RefPtr<Gsv::SourceLanguageManager> lang_mgr = Gsv::SourceLanguageManager::create ();
+  Glib::RefPtr<Gsv::LanguageManager> lang_mgr = Gsv::LanguageManager::create ();
   if (!lang_mgr)
   {
     std::cerr << "Could not create the language manager.\n";
@@ -26,7 +26,7 @@ main (int /* argc */, char** /* argv */)
   mime_types.push_back ("text/x-c");
   mime_types.push_back ("text/x-c++");
 
-  Glib::RefPtr<Gsv::SourceLanguage> lang;
+  Glib::RefPtr<Gsv::Language> lang;
 
   unsigned int size (mime_types.size ());
   for (unsigned int idx (0); idx < size ; ++idx)
diff --git a/tests/search/main.cc b/tests/search/main.cc
index c4c481c..0ef9694 100644
--- a/tests/search/main.cc
+++ b/tests/search/main.cc
@@ -126,7 +126,7 @@ class App {
     MenuItem *m_edit_menu_item ;
     MenuItem *m_search_menu_item ;
     VBox *m_main_vbox ;
-    SourceView *m_source_view;
+    View *m_source_view;
 
 public:
 
@@ -219,7 +219,7 @@ public:
                     bool a_forward)
     {
         THROW_IF_FAIL (m_source_view) ;
-        RefPtr<SourceBuffer> source_buffer = m_source_view->get_source_buffer () ;
+        RefPtr<Buffer> source_buffer = m_source_view->get_source_buffer () ;
 
         TextIter search_iter (source_buffer->begin ());
         TextIter start, end, limit ;
@@ -320,7 +320,7 @@ public:
         m_main_vbox = manage (new VBox) ;
         g_return_if_fail (m_menu_bar) ;
         m_main_vbox->pack_start (*m_menu_bar, PACK_SHRINK) ;
-        m_source_view = manage (new SourceView) ;
+        m_source_view = manage (new View) ;
         m_main_vbox->pack_start (*m_source_view) ;
         get_widget ().add (*m_main_vbox) ;
     }
@@ -345,7 +345,7 @@ public:
 
         static char buffer[BUFFER_SIZE + 1] ;
         memset (buffer, 0, BUFFER_SIZE + 1) ;
-        RefPtr<SourceBuffer> source_buffer = m_source_view->get_source_buffer () ;
+        RefPtr<Buffer> source_buffer = m_source_view->get_source_buffer () ;
         for (;;) {
             file.read (buffer, BUFFER_SIZE) ;
             THROW_IF_FAIL (file.good () || file.eof ()) ;



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