[gnome-builder/wip/libide-merge] add IdeSourceView:count gproperty
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide-merge] add IdeSourceView:count gproperty
- Date: Sun, 22 Mar 2015 00:20:53 +0000 (UTC)
commit f208a319f4b172db400ffedd3f5b4a44e265a91f
Author: Christian Hergert <christian hergert me>
Date: Sat Mar 21 16:59:11 2015 -0700
add IdeSourceView:count gproperty
libide/ide-source-view.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
libide/ide-source-view.h | 3 +++
2 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 9a50043..96aec9a 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -164,6 +164,7 @@ enum {
PROP_0,
PROP_AUTO_INDENT,
PROP_BACK_FORWARD_LIST,
+ PROP_COUNT,
PROP_ENABLE_WORD_COMPLETION,
PROP_FILE_SETTINGS,
PROP_FONT_NAME,
@@ -4465,6 +4466,10 @@ ide_source_view_get_property (GObject *object,
g_value_set_object (value, ide_source_view_get_back_forward_list (self));
break;
+ case PROP_COUNT:
+ g_value_set_uint (value, ide_source_view_get_count (self));
+ break;
+
case PROP_ENABLE_WORD_COMPLETION:
g_value_set_boolean (value, ide_source_view_get_enable_word_completion (self));
break;
@@ -4550,6 +4555,10 @@ ide_source_view_set_property (GObject *object,
ide_source_view_set_back_forward_list (self, g_value_get_object (value));
break;
+ case PROP_COUNT:
+ ide_source_view_set_count (self, g_value_get_uint (value));
+ break;
+
case PROP_ENABLE_WORD_COMPLETION:
ide_source_view_set_enable_word_completion (self, g_value_get_boolean (value));
break;
@@ -4684,6 +4693,16 @@ ide_source_view_class_init (IdeSourceViewClass *klass)
g_object_class_install_property (object_class, PROP_BACK_FORWARD_LIST,
gParamSpecs [PROP_BACK_FORWARD_LIST]);
+ gParamSpecs [PROP_COUNT] =
+ g_param_spec_uint ("count",
+ _("Count"),
+ _("The count for movements."),
+ 0,
+ G_MAXINT,
+ 0,
+ (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class, PROP_COUNT, gParamSpecs [PROP_COUNT]);
+
gParamSpecs [PROP_FILE_SETTINGS] =
g_param_spec_object ("file-settings",
_("File Settings"),
@@ -6320,3 +6339,30 @@ ide_source_view_clear_search (IdeSourceView *self)
gtk_source_search_settings_set_search_text (search_settings, NULL);
}
+
+guint
+ide_source_view_get_count (IdeSourceView *self)
+{
+ IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
+
+ g_return_val_if_fail (IDE_IS_SOURCE_VIEW (self), 0);
+
+ return priv->count;
+}
+
+void
+ide_source_view_set_count (IdeSourceView *self,
+ guint count)
+{
+ IdeSourceViewPrivate *priv = ide_source_view_get_instance_private (self);
+
+ g_return_if_fail (IDE_IS_SOURCE_VIEW (self));
+ g_return_if_fail (count >= 0);
+ g_return_if_fail (count <= G_MAXINT);
+
+ if (count != priv->count)
+ {
+ priv->count = count;
+ g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_COUNT]);
+ }
+}
diff --git a/libide/ide-source-view.h b/libide/ide-source-view.h
index 9fa78b4..b622d1d 100644
--- a/libide/ide-source-view.h
+++ b/libide/ide-source-view.h
@@ -279,6 +279,7 @@ IdeBackForwardList *ide_source_view_get_back_forward_list (IdeSource
void ide_source_view_get_visual_position (IdeSourceView *self,
guint *line,
guint
*line_offset);
+guint ide_source_view_get_count (IdeSourceView *self);
gboolean ide_source_view_get_enable_word_completion(IdeSourceView *self);
IdeFileSettings *ide_source_view_get_file_settings (IdeSourceView *self);
const PangoFontDescription *ide_source_view_get_font_desc (IdeSourceView *self);
@@ -301,6 +302,8 @@ void ide_source_view_jump (IdeSource
void ide_source_view_pop_snippet (IdeSourceView *self);
void ide_source_view_push_snippet (IdeSourceView *self,
IdeSourceSnippet *snippet);
+void ide_source_view_set_count (IdeSourceView *self,
+ guint count);
void ide_source_view_set_enable_word_completion(IdeSourceView *self,
gboolean
enable_word_copletion);
void ide_source_view_set_font_desc (IdeSourceView *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]