[gedit] View: subclass TeplView



commit 82d8c507d64250c638719f89730456dcb16cb520
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Apr 12 16:26:28 2020 +0200

    View: subclass TeplView
    
    See:
    https://discourse.gnome.org/t/gobject-introspection-class-inheritance-and-symbol-conflict-clash/2114
    
    There are some methods with the same name between TeplView and
    GeditView. C code call the function with the full name, so there is no
    problem. Python code will call the GeditView functions.
    
    Subclassing TeplView will permit to use the TeplView features and
    deprecate/remove the corresponding functions from GeditView.
    
    Using TeplView without using TeplBuffer is fine. GeditDocument inherits
    from GtkSourceBuffer, not TeplBuffer (yet).

 gedit/gedit-view.c | 2 +-
 gedit/gedit-view.h | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 0f69e178e..d64efff32 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -50,7 +50,7 @@ struct _GeditViewPrivate
        PangoFontDescription *font_desc;
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GeditView, gedit_view, GTK_SOURCE_TYPE_VIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GeditView, gedit_view, TEPL_TYPE_VIEW)
 
 enum
 {
diff --git a/gedit/gedit-view.h b/gedit/gedit-view.h
index c9179b39d..42c367676 100644
--- a/gedit/gedit-view.h
+++ b/gedit/gedit-view.h
@@ -23,10 +23,8 @@
 #ifndef GEDIT_VIEW_H
 #define GEDIT_VIEW_H
 
-#include <gtk/gtk.h>
-
 #include <gedit/gedit-document.h>
-#include <gtksourceview/gtksource.h>
+#include <tepl/tepl.h>
 
 G_BEGIN_DECLS
 
@@ -43,7 +41,7 @@ typedef struct _GeditViewPrivate      GeditViewPrivate;
 
 struct _GeditView
 {
-       GtkSourceView view;
+       TeplView view;
 
        /*< private >*/
        GeditViewPrivate *priv;
@@ -51,7 +49,7 @@ struct _GeditView
 
 struct _GeditViewClass
 {
-       GtkSourceViewClass parent_class;
+       TeplViewClass parent_class;
 
        void    (*drop_uris)    (GeditView  *view,
                                 gchar     **uri_list);


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