[gnome-builder] wip on sourceview



commit 250f84090faa4690eda2622147945aabb806dbea
Author: Christian Hergert <christian hergert me>
Date:   Tue Feb 24 13:13:07 2015 -0800

    wip on sourceview

 libide/ide-source-view.c |   38 ++++++++++++++++++++++++++++++++++++++
 libide/ide-source-view.h |   13 ++++++++-----
 2 files changed, 46 insertions(+), 5 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index e2f5ed5..0b34a82 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -36,6 +36,8 @@ typedef struct
   IdeBuffer            *buffer;
   GtkCssProvider       *css_provider;
   PangoFontDescription *font_desc;
+
+  guint                 show_line_changes : 1;
 } IdeSourceViewPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (IdeSourceView, ide_source_view, GTK_SOURCE_TYPE_VIEW)
@@ -44,6 +46,7 @@ enum {
   PROP_0,
   PROP_FONT_NAME,
   PROP_FONT_DESC,
+  PROP_SHOW_LINE_CHANGES,
   LAST_PROP
 };
 
@@ -210,6 +213,10 @@ ide_source_view_get_property (GObject    *object,
       g_value_set_boxed (value, ide_source_view_get_font_desc (self));
       break;
 
+    case PROP_SHOW_LINE_CHANGES:
+      g_value_set_boolean (value, ide_source_view_get_show_line_changes (self));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -233,6 +240,10 @@ ide_source_view_set_property (GObject      *object,
       ide_source_view_set_font_desc (self, g_value_get_boxed (value));
       break;
 
+    case PROP_SHOW_LINE_CHANGES:
+      ide_source_view_set_show_line_changes (self, g_value_get_boolean (value));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -317,3 +328,30 @@ ide_source_view_set_font_name (IdeSourceView *self,
   if (font_desc)
     pango_font_description_free (font_desc);
 }
+
+gboolean
+ide_source_view_get_show_line_changes (IdeSourceView *self)
+{
+  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
+
+  g_return_val_if_fail (IDE_IS_SOURCE_VIEW (self), FALSE);
+
+  return priv->show_line_changes;
+}
+
+void
+ide_source_view_set_show_line_changes (IdeSourceView *self,
+                                       gboolean       show_line_changes)
+{
+  IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
+
+  g_return_if_fail (IDE_IS_SOURCE_VIEW (self));
+
+  show_line_changes = !!show_line_changes;
+
+  if (show_line_changes != priv->show_line_changes)
+    {
+      priv->show_line_changes = show_line_changes;
+      g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_SHOW_LINE_CHANGES]);
+    }
+}
diff --git a/libide/ide-source-view.h b/libide/ide-source-view.h
index b726516..3e356a8 100644
--- a/libide/ide-source-view.h
+++ b/libide/ide-source-view.h
@@ -46,11 +46,14 @@ struct _IdeSourceViewClass
 
 GType ide_source_view_get_type (void);
 
-void                        ide_source_view_set_font_name (IdeSourceView              *self,
-                                                           const gchar                *font_name);
-const PangoFontDescription *ide_source_view_get_font_desc (IdeSourceView              *self);
-void                        ide_source_view_set_font_desc (IdeSourceView              *self,
-                                                           const PangoFontDescription *font_desc);
+const PangoFontDescription *ide_source_view_get_font_desc         (IdeSourceView              *self);
+gboolean                    ide_source_view_get_show_line_changes (IdeSourceView *self);
+void                        ide_source_view_set_font_desc         (IdeSourceView              *self,
+                                                                   const PangoFontDescription *font_desc);
+void                        ide_source_view_set_font_name         (IdeSourceView              *self,
+                                                                   const gchar                *font_name);
+void                        ide_source_view_set_show_line_changes (IdeSourceView              *self,
+                                                                   gboolean                    
show_line_changes);
 
 G_END_DECLS
 


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