[gtksourceview/wip/chergert/vim: 213/293] add new helper




commit 2b138f38137652bc89cc3056adc9f6c94910f2e6
Author: Christian Hergert <chergert redhat com>
Date:   Tue Nov 2 13:19:09 2021 -0700

    add new helper

 gtksourceview/vim/gtk-source-vim-command.c | 10 ++++++++++
 gtksourceview/vim/gtk-source-vim-command.h | 11 ++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-command.c b/gtksourceview/vim/gtk-source-vim-command.c
index 34522b52..1abaa222 100644
--- a/gtksourceview/vim/gtk-source-vim-command.c
+++ b/gtksourceview/vim/gtk-source-vim-command.c
@@ -572,3 +572,13 @@ gtk_source_vim_command_get_command (GtkSourceVimCommand *self)
 
        return self->command;
 }
+
+GtkSourceVimState *
+gtk_source_vim_command_new (const char *command)
+{
+       g_return_val_if_fail (command != NULL, NULL);
+
+       return g_object_new (GTK_SOURCE_TYPE_VIM_COMMAND,
+                            "command", command,
+                            NULL);
+}
diff --git a/gtksourceview/vim/gtk-source-vim-command.h b/gtksourceview/vim/gtk-source-vim-command.h
index 7a6dcbc5..7bfb2e98 100644
--- a/gtksourceview/vim/gtk-source-vim-command.h
+++ b/gtksourceview/vim/gtk-source-vim-command.h
@@ -30,10 +30,11 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (GtkSourceVimCommand, gtk_source_vim_command, GTK_SOURCE, VIM_COMMAND, 
GtkSourceVimState)
 
-const char *gtk_source_vim_command_get_command          (GtkSourceVimCommand *self);
-void        gtk_source_vim_command_set_motion           (GtkSourceVimCommand *self,
-                                                         GtkSourceVimMotion  *motion);
-void        gtk_source_vim_command_set_selection_motion (GtkSourceVimCommand *self,
-                                                         GtkSourceVimMotion  *selection_motion);
+GtkSourceVimState *gtk_source_vim_command_new                  (const char          *command);
+const char        *gtk_source_vim_command_get_command          (GtkSourceVimCommand *self);
+void               gtk_source_vim_command_set_motion           (GtkSourceVimCommand *self,
+                                                                GtkSourceVimMotion  *motion);
+void               gtk_source_vim_command_set_selection_motion (GtkSourceVimCommand *self,
+                                                                GtkSourceVimMotion  *selection_motion);
 
 G_END_DECLS


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