Changeset 1d79f148669cfa7e22a001b0c897a60553bd3487

Show
Ignore:
Timestamp:
01/06/07 23:32:12 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
16c77f334ee68143eb93d92cd5b5fd39a9495ede
Children:
6460a27fda60372c9a6f37ce5f654de90a0eebaf
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:32:12Z+0000
Message:

[project @ Some GtkSourceView? wrapper fixes and extensions]

Original author: Armin Burgmeier <armin@…>
Date: 2005-04-22 20:50:25+00:00

Files:
7 modified

Legend:

Unmodified
Added
Removed
  • inc/sourceview/private/sourcebuffer_p.hpp

    r3edaafe r1d79f14  
    5050        // by overriding the *_impl method. 
    5151        // TODO: . 
     52        static void can_undo_callback(GtkSourceBuffer* self, gboolean can_undo); 
     53        static void can_redo_callback(GtkSourceBuffer* self, gboolean can_redo); 
     54        static void highlight_updated_callback(GtkSourceBuffer* self, 
     55                                               GtkTextIter* begin, 
     56                                               GtkTextIter* end); 
     57        static void marker_updated_callback(GtkSourceBuffer* self, 
     58                                            GtkTextIter* pos); 
    5259 
    5360        // Callbacks (virtual functions): 
  • inc/sourceview/sourcebuffer.hpp

    r3edaafe r1d79f14  
    2525#include <gtkmm/textbuffer.h> 
    2626#include <gtksourceview/gtksourcebuffer.h> 
     27#include "sourceview/sourcelanguage.hpp" 
    2728 
    2829typedef struct _GtkSourceBuffer GtkSourceBuffer; 
     
    5556 
    5657public: 
     58        typedef TextBuffer::iterator iterator; 
     59 
    5760        virtual ~SourceBuffer(); 
    5861 
     
    6871protected: 
    6972        // Default Signal handlers 
    70         // ... 
     73        virtual void on_can_undo(bool can_undo); 
     74        virtual void on_can_redo(bool can_redo); 
     75        virtual void on_highlight_updated(const iterator& begin, 
     76                                          const iterator& end); 
     77        virtual void on_marker_updated(const iterator& pos); 
     78 
    7179protected: 
    7280        SourceBuffer(); 
     81        explicit SourceBuffer(const Glib::RefPtr<SourceLanguage>& language); 
    7382        // explicit SourceBuffer(const Glib::RefPtr<TagTable>& tag_table); 
    7483 
    7584public: 
    7685        static Glib::RefPtr<SourceBuffer> create(); 
     86        static Glib::RefPtr<SourceBuffer> create( 
     87                const Glib::RefPtr<SourceLanguage>& language 
     88        ); 
     89 
    7790        // static Glib::RefPtr<SourceBuffer> create(const Glib::RefPtr<TagTable>& tag_table); 
     91 
     92        bool get_check_brackets() const; 
     93        void set_check_brackets(bool check_brackets); 
     94//      void set_bracket_match_style(const Glib::RefPtr<SourceTagStyle>& style); 
    7895         
     96        bool get_highlight() const; 
     97        void set_highlight(bool highlight); 
     98 
     99        gint get_max_undo_levels() const; 
     100        void set_max_undo_levels(gint max_undo_levels); 
     101 
     102        Glib::RefPtr<SourceLanguage> get_language() const; 
     103        void set_language(const Glib::RefPtr<SourceLanguage> language); 
     104 
     105        gunichar get_escape_char() const; 
     106        void set_escape_char(gunichar escape_char); 
     107 
     108        bool can_undo() const; 
     109        bool can_redo() const; 
     110 
     111        void undo(); 
     112        void redo(); 
     113 
     114        void begin_not_undoable_action(); 
     115        void end_not_undoable_action(); 
     116 
     117        // TODO: Marker stuff 
     118 
     119        Glib::SignalProxy1<void, bool> signal_can_undo(); 
     120        Glib::SignalProxy1<void, bool> signal_can_redo(); 
     121        Glib::SignalProxy2<void, const iterator&, const iterator&> 
     122                signal_highlight_updated(); 
     123        Glib::SignalProxy1<void, const iterator&> signal_marker_updated(); 
    79124}; 
    80125 
  • inc/sourceview/sourcelanguage.hpp

    rb813f09 r1d79f14  
    5353        SourceLanguage& operator=(const SourceLanguage& other); 
    5454 
    55 protected: 
     55//protected: 
     56// TODO: SourceLanguage() is needed by Glib::wrap(), but should be protected, 
     57// though... 
     58public: 
     59        SourceLanguage(); 
    5660        explicit SourceLanguage(const Glib::ConstructParams& construct_params); 
    5761        explicit SourceLanguage(GtkSourceLanguage* castitem); 
  • inc/sourceview/sourcelanguagesmanager.hpp

    r16c77f3 r1d79f14  
    7676 
    7777public: 
     78        static Glib::RefPtr<SourceLanguagesManager> create(); 
     79 
    7880        Glib::SListHandle<Glib::RefPtr<SourceLanguage> >  
    7981                get_available_languages() const; 
  • src/sourceview/sourcebuffer.cpp

    r3edaafe r1d79f14  
    4040        CppClassParent::class_init_function(klass, class_data); 
    4141 
    42         // Hier irgendwelche Signale. 
     42        klass->can_undo = &can_undo_callback; 
     43        klass->can_redo = &can_redo_callback; 
     44        klass->highlight_updated = &highlight_updated_callback; 
     45        klass->marker_updated = &marker_updated_callback; 
     46} 
     47 
     48void Gtk::SourceBuffer_Class::can_undo_callback(GtkSourceBuffer* self, 
     49                                                gboolean can_undo) 
     50{ 
     51        CppObjectType* const obj = dynamic_cast<CppObjectType*>( 
     52                Glib::ObjectBase::_get_current_wrapper((GObject*)self)); 
     53 
     54        if(obj && obj->is_derived_() ) 
     55        { 
     56                try 
     57                { 
     58                        obj->on_can_undo(can_undo == TRUE); 
     59                } 
     60                catch(...) 
     61                { 
     62                        Glib::exception_handlers_invoke(); 
     63                } 
     64        } 
     65        else 
     66        { 
     67                BaseClassType* const base = static_cast<BaseClassType*>( 
     68                        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) 
     69                ); 
     70 
     71                if(base && base->can_undo) 
     72                        (*base->can_undo)(self, can_undo); 
     73        } 
     74} 
     75 
     76void Gtk::SourceBuffer_Class::can_redo_callback(GtkSourceBuffer* self, 
     77                                                gboolean can_redo) 
     78{ 
     79        CppObjectType* const obj = dynamic_cast<CppObjectType*>( 
     80                Glib::ObjectBase::_get_current_wrapper((GObject*)self)); 
     81 
     82        if(obj && obj->is_derived_() ) 
     83        { 
     84                try 
     85                { 
     86                        obj->on_can_redo(can_redo == TRUE); 
     87                } 
     88                catch(...) 
     89                { 
     90                        Glib::exception_handlers_invoke(); 
     91                } 
     92        } 
     93        else 
     94        { 
     95                BaseClassType* const base = static_cast<BaseClassType*>( 
     96                        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) 
     97                ); 
     98 
     99                if(base && base->can_redo) 
     100                        (*base->can_redo)(self, can_redo); 
     101        } 
     102} 
     103 
     104void Gtk::SourceBuffer_Class::highlight_updated_callback(GtkSourceBuffer* self, 
     105                                                         GtkTextIter* begin, 
     106                                                         GtkTextIter* end) 
     107{ 
     108        CppObjectType* const obj = dynamic_cast<CppObjectType*>( 
     109                Glib::ObjectBase::_get_current_wrapper((GObject*)self)); 
     110 
     111        if(obj && obj->is_derived_() ) 
     112        { 
     113                try 
     114                { 
     115                        obj->on_highlight_updated( 
     116                                Glib::wrap(begin), 
     117                                Glib::wrap(end) 
     118                        ); 
     119                } 
     120                catch(...) 
     121                { 
     122                        Glib::exception_handlers_invoke(); 
     123                } 
     124        } 
     125        else 
     126        { 
     127                BaseClassType* const base = static_cast<BaseClassType*>( 
     128                        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) 
     129                ); 
     130 
     131                if(base && base->highlight_updated) 
     132                        (*base->highlight_updated)(self, begin, end); 
     133        } 
     134} 
     135 
     136void Gtk::SourceBuffer_Class::marker_updated_callback(GtkSourceBuffer* self, 
     137                                                      GtkTextIter* pos) 
     138{ 
     139        CppObjectType* const obj = dynamic_cast<CppObjectType*>( 
     140                Glib::ObjectBase::_get_current_wrapper((GObject*)self)); 
     141 
     142        if(obj && obj->is_derived_() ) 
     143        { 
     144                try 
     145                { 
     146                        obj->on_marker_updated(Glib::wrap(pos) ); 
     147                } 
     148                catch(...) 
     149                { 
     150                        Glib::exception_handlers_invoke(); 
     151                } 
     152        } 
     153        else 
     154        { 
     155                BaseClassType* const base = static_cast<BaseClassType*>( 
     156                        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) 
     157                ); 
     158 
     159                if(base && base->marker_updated) 
     160                        (*base->marker_updated)(self, pos); 
     161        } 
    43162} 
    44163 
     
    46165{ 
    47166        return new SourceBuffer( (GtkSourceBuffer*)o); 
     167} 
     168 
     169namespace 
     170{ 
     171 
     172void SourceBuffer_signal_can_undo_callback(GtkSourceBuffer* self, 
     173                                           gboolean can_undo, 
     174                                           void* data) 
     175{ 
     176        using namespace Gtk; 
     177        typedef sigc::slot<void, bool> SlotType; 
     178 
     179        if(Glib::ObjectBase::_get_current_wrapper((GObject*)self) ) 
     180        { 
     181                try 
     182                { 
     183                        sigc::slot_base* const slot =  
     184                                Glib::SignalProxyNormal::data_to_slot(data); 
     185 
     186                        if(slot) 
     187                                (*static_cast<SlotType*>(slot))( 
     188                                        can_undo == TRUE 
     189                                ); 
     190                } 
     191                catch(...) 
     192                { 
     193                        Glib::exception_handlers_invoke(); 
     194                } 
     195        } 
     196} 
     197 
     198const Glib::SignalProxyInfo SourceBuffer_signal_can_undo_info =  
     199{ 
     200        "can_undo", 
     201        (GCallback) &SourceBuffer_signal_can_undo_callback, 
     202        (GCallback) &SourceBuffer_signal_can_undo_callback 
     203}; 
     204 
     205void SourceBuffer_signal_can_redo_callback(GtkSourceBuffer* self, 
     206                                           gboolean can_redo, 
     207                                           void* data) 
     208{ 
     209        using namespace Gtk; 
     210        typedef sigc::slot<void, bool> SlotType; 
     211 
     212        if(Glib::ObjectBase::_get_current_wrapper((GObject*)self) ) 
     213        { 
     214                try 
     215                { 
     216                        sigc::slot_base* const slot =  
     217                                Glib::SignalProxyNormal::data_to_slot(data); 
     218 
     219                        if(slot) 
     220                                (*static_cast<SlotType*>(slot))( 
     221                                        can_redo == TRUE 
     222                                ); 
     223                } 
     224                catch(...) 
     225                { 
     226                        Glib::exception_handlers_invoke(); 
     227                } 
     228        } 
     229} 
     230 
     231const Glib::SignalProxyInfo SourceBuffer_signal_can_redo_info =  
     232{ 
     233        "can_redo", 
     234        (GCallback) &SourceBuffer_signal_can_redo_callback, 
     235        (GCallback) &SourceBuffer_signal_can_redo_callback 
     236}; 
     237 
     238void SourceBuffer_signal_highlight_updated_callback(GtkSourceBuffer* self, 
     239                                                    GtkTextIter* begin, 
     240                                                    GtkTextIter* end, 
     241                                                    void* data) 
     242{ 
     243        using namespace Gtk; 
     244        typedef sigc::slot< 
     245                void, 
     246                const SourceBuffer::iterator&, 
     247                const SourceBuffer::iterator& 
     248        > SlotType; 
     249 
     250        if(Glib::ObjectBase::_get_current_wrapper((GObject*)self) ) 
     251        { 
     252                try 
     253                { 
     254                        sigc::slot_base* const slot =  
     255                                Glib::SignalProxyNormal::data_to_slot(data); 
     256 
     257                        if(slot) 
     258                                (*static_cast<SlotType*>(slot))( 
     259                                        Glib::wrap(begin), 
     260                                        Glib::wrap(end) 
     261                                ); 
     262                } 
     263                catch(...) 
     264                { 
     265                        Glib::exception_handlers_invoke(); 
     266                } 
     267        } 
     268} 
     269 
     270const Glib::SignalProxyInfo SourceBuffer_signal_highlight_updated_info =  
     271{ 
     272        "highlight_updated", 
     273        (GCallback) &SourceBuffer_signal_highlight_updated_callback, 
     274        (GCallback) &SourceBuffer_signal_highlight_updated_callback 
     275}; 
     276 
     277void SourceBuffer_signal_marker_updated_callback(GtkSourceBuffer* self, 
     278                                                 GtkTextIter* pos, 
     279                                                 void* data) 
     280{ 
     281        using namespace Gtk; 
     282        typedef sigc::slot< 
     283                void, 
     284                const SourceBuffer::iterator& 
     285        > SlotType; 
     286 
     287        if(Glib::ObjectBase::_get_current_wrapper((GObject*)self) ) 
     288        { 
     289                try 
     290                { 
     291                        sigc::slot_base* const slot =  
     292                                Glib::SignalProxyNormal::data_to_slot(data); 
     293 
     294                        if(slot) 
     295                                (*static_cast<SlotType*>(slot))( 
     296                                        Glib::wrap(pos) 
     297                                ); 
     298                } 
     299                catch(...) 
     300                { 
     301                        Glib::exception_handlers_invoke(); 
     302                } 
     303        } 
     304} 
     305 
     306const Glib::SignalProxyInfo SourceBuffer_signal_marker_updated_info =  
     307{ 
     308        "marker_updated", 
     309        (GCallback) &SourceBuffer_signal_marker_updated_callback, 
     310        (GCallback) &SourceBuffer_signal_marker_updated_callback 
     311}; 
     312 
    48313} 
    49314 
     
    51316 : Gtk::TextBuffer(Glib::ConstructParams(sourcebuffer_class_.init()) ) 
    52317{ 
     318} 
     319 
     320Gtk::SourceBuffer::SourceBuffer(const Glib::RefPtr<SourceLanguage>& language) 
     321 : Gtk::TextBuffer(Glib::ConstructParams(sourcebuffer_class_.init()) ) 
     322{ 
     323        set_language(language); 
    53324} 
    54325 
     
    98369} 
    99370 
     371Glib::RefPtr<Gtk::SourceBuffer> 
     372Gtk::SourceBuffer::create(const Glib::RefPtr<SourceLanguage>& language) 
     373{ 
     374        return Glib::RefPtr<SourceBuffer>(new SourceBuffer(language) ); 
     375} 
     376 
    100377/*Glib::RefPtr<Gtk::SourceBuffer> 
    101378Gtk::SourceBuffer::create(const Glib::RefPtr<TagTable>& tag_table) 
     
    103380        return Glib::RefPtr<SourceBuffer>(new SourceBuffer(tag_table) ); 
    104381}*/ 
     382 
     383void Gtk::SourceBuffer::on_can_undo(bool can_undo) 
     384{ 
     385        BaseClassType* const base = static_cast<BaseClassType*>( 
     386                g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) 
     387        ); 
     388 
     389        if(base && base->can_undo) 
     390                (*base->can_undo)(gobj(), can_undo ? TRUE : FALSE); 
     391} 
     392 
     393void Gtk::SourceBuffer::on_can_redo(bool can_redo) 
     394{ 
     395        BaseClassType* const base = static_cast<BaseClassType*>( 
     396                g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) 
     397        ); 
     398 
     399        if(base && base->can_redo) 
     400                (*base->can_redo)(gobj(), can_redo ? TRUE : FALSE); 
     401} 
     402 
     403void Gtk::SourceBuffer::on_highlight_updated(const iterator& begin, 
     404                                             const iterator& end) 
     405{ 
     406        BaseClassType* const base = static_cast<BaseClassType*>( 
     407                g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) 
     408        ); 
     409 
     410        if(base && base->highlight_updated) 
     411                (*base->highlight_updated)( 
     412                        gobj(), 
     413                        const_cast<GtkTextIter*>(begin.gobj()), 
     414                        const_cast<GtkTextIter*>(end.gobj()) 
     415                ); 
     416} 
     417 
     418void Gtk::SourceBuffer::on_marker_updated(const iterator& pos) 
     419{ 
     420        BaseClassType* const base = static_cast<BaseClassType*>( 
     421                g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) 
     422        ); 
     423 
     424        if(base && base->marker_updated) 
     425                (*base->marker_updated)( 
     426                        gobj(), 
     427                        const_cast<GtkTextIter*>(pos.gobj()) 
     428                ); 
     429} 
     430 
     431Glib::SignalProxy1<void, bool> Gtk::SourceBuffer::signal_can_undo() 
     432{ 
     433        return Glib::SignalProxy1<void, bool>( 
     434                this, 
     435                &SourceBuffer_signal_can_undo_info 
     436        ); 
     437} 
     438 
     439Glib::SignalProxy1<void, bool> Gtk::SourceBuffer::signal_can_redo() 
     440{ 
     441        return Glib::SignalProxy1<void, bool>( 
     442                this, 
     443                &SourceBuffer_signal_can_redo_info 
     444        ); 
     445} 
     446 
     447Glib::SignalProxy2< 
     448        void, 
     449        const Gtk::SourceBuffer::iterator&, 
     450        const Gtk::SourceBuffer::iterator& 
     451> Gtk::SourceBuffer::signal_highlight_updated() 
     452{ 
     453        return Glib::SignalProxy2<void, const iterator&, const iterator&>( 
     454                this, 
     455                &SourceBuffer_signal_highlight_updated_info 
     456        ); 
     457} 
     458 
     459Glib::SignalProxy1< 
     460        void, 
     461        const Gtk::SourceBuffer::iterator& 
     462> Gtk::SourceBuffer::signal_marker_updated() 
     463{ 
     464        return Glib::SignalProxy1<void, const iterator&>( 
     465                this, 
     466                &SourceBuffer_signal_marker_updated_info 
     467        ); 
     468} 
     469 
     470bool Gtk::SourceBuffer::get_check_brackets() const 
     471{ 
     472        return gtk_source_buffer_get_check_brackets( 
     473                const_cast<GtkSourceBuffer*>(gobj()) 
     474        ) == TRUE; 
     475} 
     476 
     477void Gtk::SourceBuffer::set_check_brackets(bool check_brackets) 
     478{ 
     479        return gtk_source_buffer_set_check_brackets( 
     480                gobj(), 
     481                check_brackets ? TRUE : FALSE 
     482        ); 
     483} 
     484 
     485/*void Gtk::SourceBuffer::set_bracket_match_style( 
     486        const Glib::RefPtr<Gtk::SourceTagStyle>& style 
     487) 
     488{ 
     489        gtk_source_buffer_set_bracket_match_style( 
     490                const_cast<GtkSourceBuffer*>(gobj() ), 
     491                style->gobj() 
     492        ); 
     493}*/ 
     494 
     495bool Gtk::SourceBuffer::get_highlight() const 
     496{ 
     497        return gtk_source_buffer_get_highlight( 
     498                const_cast<GtkSourceBuffer*>(gobj()) 
     499        ) == TRUE; 
     500} 
     501 
     502void Gtk::SourceBuffer::set_highlight(bool highlight) 
     503{ 
     504        gtk_source_buffer_set_highlight( 
     505                gobj(), 
     506                highlight ? TRUE : FALSE 
     507        ); 
     508} 
     509 
     510gint Gtk::SourceBuffer::get_max_undo_levels() const 
     511{ 
     512        return gtk_source_buffer_get_max_undo_levels( 
     513                const_cast<GtkSourceBuffer*>(gobj()) 
     514        ); 
     515} 
     516 
     517void Gtk::SourceBuffer::set_max_undo_levels(gint max_undo_levels) 
     518{ 
     519        gtk_source_buffer_set_max_undo_levels( 
     520                gobj(), 
     521                max_undo_levels 
     522        );       
     523} 
     524 
     525Glib::RefPtr<Gtk::SourceLanguage> Gtk::SourceBuffer::get_language() const 
     526{ 
     527        return Glib::wrap(gtk_source_buffer_get_language( 
     528                const_cast<GtkSourceBuffer*>(gobj()) 
     529        ) ); 
     530} 
     531 
     532void 
     533Gtk::SourceBuffer::set_language(const Glib::RefPtr<SourceLanguage> language) 
     534{ 
     535        // Add new reference to the language because the C instance holds a 
     536        // new reference now. 
     537        g_object_ref(G_OBJECT(language->gobj()) ); 
     538 
     539        gtk_source_buffer_set_language( 
     540                gobj(), 
     541                language->gobj() 
     542        ); 
     543} 
     544 
     545gunichar Gtk::SourceBuffer::get_escape_char() const 
     546{ 
     547        return gtk_source_buffer_get_escape_char( 
     548                const_cast<GtkSourceBuffer*>(gobj()) 
     549        ); 
     550} 
     551 
     552void Gtk::SourceBuffer::set_escape_char(gunichar escape_char) 
     553{ 
     554        gtk_source_buffer_set_escape_char( 
     555                gobj(), 
     556                escape_char 
     557        ); 
     558} 
     559 
     560bool Gtk::SourceBuffer::can_undo() const 
     561{ 
     562        return gtk_source_buffer_can_undo( 
     563                const_cast<GtkSourceBuffer*>(gobj()) 
     564        ); 
     565} 
     566 
     567bool Gtk::SourceBuffer::can_redo() const 
     568{ 
     569        return gtk_source_buffer_can_redo( 
     570                const_cast<GtkSourceBuffer*>(gobj()) 
     571        ); 
     572} 
     573 
     574void Gtk::SourceBuffer::undo() 
     575{ 
     576        gtk_source_buffer_undo(gobj() ); 
     577} 
     578 
     579void Gtk::SourceBuffer::redo() 
     580{ 
     581        gtk_source_buffer_redo(gobj() ); 
     582} 
     583 
     584void Gtk::SourceBuffer::begin_not_undoable_action() 
     585{ 
     586        gtk_source_buffer_begin_not_undoable_action(gobj() ); 
     587} 
     588 
     589void Gtk::SourceBuffer::end_not_undoable_action() 
     590{ 
     591        gtk_source_buffer_end_not_undoable_action(gobj() ); 
     592} 
    105593 
    106594Glib::RefPtr<Gtk::SourceBuffer> 
  • src/sourceview/sourcelanguage.cpp

    rb813f09 r1d79f14  
    4646{ 
    4747        return new SourceLanguage(reinterpret_cast<GtkSourceLanguage*>(o) ); 
     48} 
     49 
     50Gtk::SourceLanguage::SourceLanguage() 
     51 : Glib::Object(Glib::ConstructParams(sourcelanguage_class_.init())) 
     52{ 
    4853} 
    4954 
     
    141146Glib::wrap(GtkSourceLanguage* object, bool take_copy) 
    142147{ 
    143         return Glib::RefPtr<Gtk::SourceLanguage>( 
     148        // The Code below does not work - don't know why 
     149        return Glib::RefPtr<Gtk::SourceLanguage>(new Gtk::SourceLanguage(GTK_SOURCE_LANGUAGE( (GObject*)(object)))); 
     150/*      return Glib::RefPtr<Gtk::SourceLanguage>( 
    144151                dynamic_cast<Gtk::SourceLanguage*>(Glib::wrap_auto( 
    145152                        reinterpret_cast<GObject*>(object), 
    146153                        take_copy 
    147154                ) ) 
    148         ); 
     155        );*/ 
    149156} 
  • src/sourceview/sourcelanguagesmanager.cpp

    r16c77f3 r1d79f14  
    8989} 
    9090 
     91Glib::RefPtr<Gtk::SourceLanguagesManager> 
     92Gtk::SourceLanguagesManager::create() 
     93{ 
     94        return Glib::RefPtr<SourceLanguagesManager>(new SourceLanguagesManager); 
     95} 
     96 
    9197Glib::SListHandle<Glib::RefPtr<Gtk::SourceLanguage> > 
    9298Gtk::SourceLanguagesManager::get_available_languages() const 
     
    111117                        const_cast<GtkSourceLanguagesManager*>(gobj()), 
    112118                        mime_type.c_str() 
    113                 ) // TODO: Take new copy? 
     119                ), 
     120                true  
    114121        ); 
    115122