[gtksourceview/gtksourcecompletion] Updated documentation
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtksourceview/gtksourcecompletion] Updated documentation
- Date: Sun, 20 Sep 2009 14:26:59 +0000 (UTC)
commit 44d40476ba0e364e65eb7214f01c041231f6d04d
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Sep 20 16:26:50 2009 +0200
Updated documentation
docs/reference/Makefile.am | 14 ++++-
docs/reference/gtksourceview-2.0-sections.txt | 49 ++++++++++---
docs/reference/tmpl/view.sgml | 9 ---
gtksourceview/gtksourcecompletion-private.h | 2 +-
gtksourceview/gtksourcecompletion.c | 94 +++++++++++++++++++++++-
gtksourceview/gtksourcecompletion.h | 13 ++--
gtksourceview/gtksourcecompletioncontext.c | 91 ++++++++++++++++++++++++
gtksourceview/gtksourcecompletioncontext.h | 4 +-
gtksourceview/gtksourcecompletioninfo.h | 5 +-
gtksourceview/gtksourcecompletionitem.c | 2 +-
gtksourceview/gtksourcecompletionitem.h | 8 +-
gtksourceview/gtksourcecompletionmodel.h | 4 +-
gtksourceview/gtksourcecompletionproposal.c | 23 ++++++
gtksourceview/gtksourcecompletionproposal.h | 2 +-
gtksourceview/gtksourcecompletionprovider.c | 36 ++++++++++
gtksourceview/gtksourcecompletionprovider.h | 9 +--
gtksourceview/gtksourcecompletionutils.h | 5 +-
gtksourceview/gtksourceview.c | 14 ++++-
18 files changed, 330 insertions(+), 54 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 98fbbe8..97684c3 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -34,7 +34,19 @@ IGNORE_HFILES = \
gtktextregion.h \
gtksourceengine.h \
gtksourcecontextengine.h \
- gtksourceprintjob.h
+ gtksourceprintjob.h \
+ gtksourcecompletionmodel.h \
+ gtksourcecompletionutils.h \
+ ../tests/gsc-devhelp-provider.h \
+ ../tests/gsc-words-provider.h
+
+update-sections: $(HFILE_GLOB)
+ @echo 'gtk-doc: Scanning header files'
+ cp $(DOC_MODULE)-sections.txt $(DOC_MODULE)-sections.txt.old && \
+ (cd $(srcdir) && \
+ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" --rebuild-sections $(SCAN_OPTIONS) $(EXTRA_HFILES)) && \
+ cp $(DOC_MODULE)-sections.txt $(DOC_MODULE)-sections.txt.new && \
+ mv $(DOC_MODULE)-sections.txt.old $(DOC_MODULE)-sections.txt
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS = --sgml-mode --output-format=xml --ignore-files=trio
diff --git a/docs/reference/gtksourceview-2.0-sections.txt b/docs/reference/gtksourceview-2.0-sections.txt
index 432b82f..7c3780e 100644
--- a/docs/reference/gtksourceview-2.0-sections.txt
+++ b/docs/reference/gtksourceview-2.0-sections.txt
@@ -81,7 +81,6 @@ gtk_source_view_get_tab_width
gtk_source_view_set_draw_spaces
gtk_source_view_get_draw_spaces
gtk_source_view_get_completion
-gtk_source_view_show_completion
<SUBSECTION Standard>
GTK_IS_SOURCE_VIEW
GTK_IS_SOURCE_VIEW_CLASS
@@ -298,13 +297,15 @@ GtkSourcePrintCompositorClass
<TITLE>GtkSourceCompletion</TITLE>
<INCLUDE>gtksourceview/gtksourcecompletion.h</INCLUDE>
GtkSourceCompletion
-GtkSourceCompletionClass
-gtk_source_completion_get_view
gtk_source_completion_add_provider
gtk_source_completion_remove_provider
+gtk_source_completion_get_providers
gtk_source_completion_show
gtk_source_completion_hide
gtk_source_completion_get_info_window
+gtk_source_completion_get_view
+gtk_source_completion_create_context
+gtk_source_completion_move_window
<SUBSECTION Standard>
GTK_IS_SOURCE_COMPLETION
GTK_IS_SOURCE_COMPLETION_CLASS
@@ -314,6 +315,7 @@ GTK_SOURCE_COMPLETION_GET_CLASS
GTK_TYPE_SOURCE_COMPLETION
GtkSourceCompletionPrivate
gtk_source_completion_get_type
+GtkSourceCompletionClass
</SECTION>
<SECTION>
@@ -321,12 +323,12 @@ gtk_source_completion_get_type
<TITLE>GtkSourceCompletionInfo</TITLE>
<INCLUDE>gtksourceview/gtksourcecompletioninfo.h</INCLUDE>
GtkSourceCompletionInfo
-GtkSourceCompletionInfoClass
gtk_source_completion_info_new
gtk_source_completion_info_move_to_iter
gtk_source_completion_info_set_sizing
gtk_source_completion_info_set_widget
gtk_source_completion_info_get_widget
+gtk_source_completion_info_process_resize
<SUBSECTION Standard>
GTK_IS_SOURCE_COMPLETION_INFO
GTK_IS_SOURCE_COMPLETION_INFO_CLASS
@@ -336,6 +338,7 @@ GTK_SOURCE_COMPLETION_INFO_GET_CLASS
GTK_TYPE_SOURCE_COMPLETION_INFO
GtkSourceCompletionInfoPrivate
gtk_source_completion_info_get_type
+GtkSourceCompletionInfoClass
</SECTION>
<SECTION>
@@ -343,19 +346,21 @@ gtk_source_completion_info_get_type
<TITLE>GtkSourceCompletionProposal</TITLE>
<INCLUDE>gtksourceview/gtksourcecompletionproposal.h</INCLUDE>
GtkSourceCompletionProposal
-GtkSourceCompletionProposalIface
gtk_source_completion_proposal_get_label
gtk_source_completion_proposal_get_markup
gtk_source_completion_proposal_get_text
gtk_source_completion_proposal_get_icon
gtk_source_completion_proposal_get_info
gtk_source_completion_proposal_changed
+gtk_source_completion_proposal_hash
+gtk_source_completion_proposal_equal
<SUBSECTION Standard>
GTK_IS_SOURCE_COMPLETION_PROPOSAL
GTK_SOURCE_COMPLETION_PROPOSAL
GTK_SOURCE_COMPLETION_PROPOSAL_GET_INTERFACE
GTK_TYPE_SOURCE_COMPLETION_PROPOSAL
gtk_source_completion_proposal_get_type
+GtkSourceCompletionProposalIface
</SECTION>
<SECTION>
@@ -363,7 +368,6 @@ gtk_source_completion_proposal_get_type
<TITLE>GtkSourceCompletionItem</TITLE>
<INCLUDE>gtksourceview/gtksourcecompletionitem.h</INCLUDE>
GtkSourceCompletionItem
-GtkSourceCompletionItemClass
gtk_source_completion_item_new
gtk_source_completion_item_new_with_markup
gtk_source_completion_item_new_from_stock
@@ -375,6 +379,7 @@ GTK_SOURCE_COMPLETION_ITEM_CLASS
GTK_SOURCE_COMPLETION_ITEM_GET_CLASS
GTK_TYPE_SOURCE_COMPLETION_ITEM
gtk_source_completion_item_get_type
+GtkSourceCompletionItemClass
</SECTION>
<SECTION>
@@ -382,15 +387,15 @@ gtk_source_completion_item_get_type
<TITLE>GtkSourceCompletionProvider</TITLE>
<INCLUDE>gtksourceview/gtksourcecompletionprovider.h</INCLUDE>
GtkSourceCompletionProvider
-GtkSourceCompletionProviderIface
gtk_source_completion_provider_get_name
gtk_source_completion_provider_get_icon
-gtk_source_completion_provider_get_proposals
-gtk_source_completion_provider_filter_proposal
-gtk_source_completion_provider_get_automatic
+gtk_source_completion_provider_populate
gtk_source_completion_provider_get_interactive
+gtk_source_completion_provider_get_default
+gtk_source_completion_provider_match
gtk_source_completion_provider_get_info_widget
gtk_source_completion_provider_update_info
+gtk_source_completion_provider_get_start_iter
gtk_source_completion_provider_activate_proposal
<SUBSECTION Standard>
GTK_IS_SOURCE_COMPLETION_PROVIDER
@@ -398,4 +403,28 @@ GTK_SOURCE_COMPLETION_PROVIDER
GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE
GTK_TYPE_SOURCE_COMPLETION_PROVIDER
gtk_source_completion_provider_get_type
+GtkSourceCompletionProviderIface
+</SECTION>
+
+<SECTION>
+<FILE>gtksourcecompletioncontext</FILE>
+<TITLE>GtkSourceCompletionContext</TITLE>
+<INCLUDE>gtksourceview/gtksourcecompletioncontext.h</INCLUDE>
+GtkSourceCompletionContext
+gtk_source_completion_context_add_proposals
+gtk_source_completion_context_get_view
+gtk_source_completion_context_get_iter
+gtk_source_completion_context_get_interactive
+gtk_source_completion_context_get_default
+gtk_source_completion_context_move_window
+<SUBSECTION Standard>
+GTK_IS_SOURCE_COMPLETION_CONTEXT
+GTK_IS_SOURCE_COMPLETION_CONTEXT_CLASS
+GTK_SOURCE_COMPLETION_CONTEXT
+GTK_SOURCE_COMPLETION_CONTEXT_CLASS
+GTK_SOURCE_COMPLETION_CONTEXT_GET_CLASS
+GTK_TYPE_SOURCE_COMPLETION_CONTEXT
+GtkSourceCompletionContextPrivate
+gtk_source_completion_context_get_type
+GtkSourceCompletionContextClass
</SECTION>
diff --git a/docs/reference/tmpl/view.sgml b/docs/reference/tmpl/view.sgml
index f599bb8..c172bc9 100644
--- a/docs/reference/tmpl/view.sgml
+++ b/docs/reference/tmpl/view.sgml
@@ -448,12 +448,3 @@ a text view which syntax highlighting, undo/redo and text marks. Use a
@Returns:
-<!-- ##### FUNCTION gtk_source_view_show_completion ##### -->
-<para>
-
-</para>
-
- view:
- proposals:
-
-
diff --git a/gtksourceview/gtksourcecompletion-private.h b/gtksourceview/gtksourcecompletion-private.h
index 9f48705..e150397 100644
--- a/gtksourceview/gtksourcecompletion-private.h
+++ b/gtksourceview/gtksourcecompletion-private.h
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletion-private.h
* This file is part of gtksourcecompletion
*
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index d4bfa10..b3383cb 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -1733,6 +1733,12 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
250,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ /**
+ * GtkSourceCompletion:provider-page-size:
+ *
+ * The scroll page size of the provider pages in the completion window.
+ *
+ */
g_object_class_install_property (object_class,
PROP_PROVIDER_PAGE_SIZE,
g_param_spec_uint ("provider-page-size",
@@ -1743,6 +1749,12 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
5,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ /**
+ * GtkSourceCompletion:proposal-page-size:
+ *
+ * The scroll page size of the proposals in the completion window.
+ *
+ */
g_object_class_install_property (object_class,
PROP_PROPOSAL_PAGE_SIZE,
g_param_spec_uint ("proposal-page-size",
@@ -1792,6 +1804,15 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
G_TYPE_NONE,
0);
+ /**
+ * GtkSourceCompletion::populate-context:
+ * @completion: The #GtkSourceCompletion who emits the signal
+ * @context: The #GtkSourceCompletionContext for the current completion
+ *
+ * Emitted just before starting to populate the completion with providers.
+ * You can use this signal to add additional attributes in the context.
+ *
+ */
signals[POPULATE_CONTEXT] =
g_signal_new ("populate-context",
G_TYPE_FROM_CLASS (klass),
@@ -1805,6 +1826,21 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
GTK_TYPE_SOURCE_COMPLETION_CONTEXT);
/* Actions */
+
+ /**
+ * GtkSourceCompletion::move-cursor:
+ * @completion: The #GtkSourceCompletion who emits the signal
+ * @step: The #GtkScrollStep by which to move the cursor
+ * @num: The amount of steps to move the cursor
+ *
+ * The ::move-cursor signal is a keybinding signal which gets emitted when
+ * the user initiates a cursor movement.
+ *
+ * Applications should not connect to it, but may emit it with
+ * #g_signal_emit_by_name if they need to control the cursor
+ * programmatically.
+ *
+ */
signals [MOVE_CURSOR] =
g_signal_new ("move-cursor",
G_TYPE_FROM_CLASS (klass),
@@ -1818,6 +1854,21 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
GTK_TYPE_SCROLL_STEP,
G_TYPE_INT);
+ /**
+ * GtkSourceCompletion::move-page:
+ * @completion: The #GtkSourceCompletion who emits the signal
+ * @step: The #GtkScrollStep by which to move the page
+ * @num: The amount of steps to move the page
+ *
+ * The ::move-page signal is a keybinding signal which gets emitted when
+ * the user initiates a page movement (i.e. switches between provider
+ * pages).
+ *
+ * Applications should not connect to it, but may emit it with
+ * #g_signal_emit_by_name if they need to control the page selection
+ * programmatically.
+ *
+ */
signals [MOVE_PAGE] =
g_signal_new ("move-page",
G_TYPE_FROM_CLASS (klass),
@@ -1831,6 +1882,18 @@ gtk_source_completion_class_init (GtkSourceCompletionClass *klass)
GTK_TYPE_SCROLL_STEP,
G_TYPE_INT);
+ /**
+ * GtkSourceCompletion::activate-proposal:
+ * @completion: The #GtkSourceCompletion who emits the signal
+ *
+ * The ::activate-proposal signal is a keybinding signal which gets
+ * emitted when the user initiates a proposal activation.
+ *
+ * Applications should not connect to it, but may emit it with
+ * #g_signal_emit_by_name if they need to control the proposal activation
+ * programmatically.
+ *
+ */
signals [ACTIVATE_PROPOSAL] =
g_signal_new ("activate-proposal",
G_TYPE_FROM_CLASS (klass),
@@ -2499,10 +2562,10 @@ select_providers (GtkSourceCompletion *completion,
* gtk_source_completion_show:
* @completion: A #GtkSourceCompletion
* @providers: A list of #GtkSourceCompletionProvider or %NULL
- * @place: The place where you want to position the popup window, or %NULL
+ * @context: The #GtkSourceCompletionContext with which to start the completion
*
- * Shows the show completion window. If @place if %NULL the popup window will
- * be placed on the cursor position.
+ * Starts a new completion with the specified #GtkSourceCompletionContext and
+ * a list of potential candidate providers for completion.
*
* Returns: %TRUE if it was possible to the show completion window.
*/
@@ -2608,7 +2671,7 @@ gtk_source_completion_new (GtkSourceView *view)
*
* Returns: %TRUE if @provider was successfully added, otherwise if @error
* is provided, it will be set with the error and %FALSE is returned.
- **/
+ */
gboolean
gtk_source_completion_add_provider (GtkSourceCompletion *completion,
GtkSourceCompletionProvider *provider,
@@ -2747,6 +2810,21 @@ gtk_source_completion_get_view (GtkSourceCompletion *completion)
return completion->priv->view;
}
+/**
+ * gtk_source_completion_create_context:
+ * @completion: A #GtkSourceCompletion
+ * @position: A #GtkTextIter
+ *
+ * Create a new #GtkSourceCompletionContext for @completion. The position at
+ * which the completion using the new context will consider completion can
+ * be provider by @position. If @position is %NULL, the current cursor
+ * position will be used.
+ *
+ * Returns: a new #GtkSourceCompletionContext. The reference being returned
+ * is a 'floating' reference, so if you invoke #gtk_source_completion_show
+ * with this context you don't need to unref it.
+ *
+ */
GtkSourceCompletionContext *
gtk_source_completion_create_context (GtkSourceCompletion *completion,
GtkTextIter *position)
@@ -2774,6 +2852,14 @@ gtk_source_completion_create_context (GtkSourceCompletion *completion,
return context;
}
+/**
+ * gtk_source_completion_move_window:
+ * @completion: A #GtkSourceCompletion
+ * @iter: A #GtkTextIter
+ *
+ * Move the completion window to a specific iter.
+ *
+ */
void
gtk_source_completion_move_window (GtkSourceCompletion *completion,
GtkTextIter *iter)
diff --git a/gtksourceview/gtksourcecompletion.h b/gtksourceview/gtksourcecompletion.h
index a19899c..0859121 100644
--- a/gtksourceview/gtksourcecompletion.h
+++ b/gtksourceview/gtksourcecompletion.h
@@ -1,8 +1,9 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletion.h
* This file is part of gtksourcecompletion
*
- * Copyright (C) 2007 -2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2007 - 2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2009 Jesse van den Kieboom <jessevdk gnome org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,8 +21,8 @@
* Boston, MA 02111-1307, USA.
*/
-#ifndef GTK_SOURCE_COMPLETION_H
-#define GTK_SOURCE_COMPLETION_H
+#ifndef __GTK_SOURCE_COMPLETION_H__
+#define __GTK_SOURCE_COMPLETION_H__
#include <gtk/gtk.h>
#include <gtksourceview/gtksourcecompletioninfo.h>
@@ -124,6 +125,4 @@ void _gtk_source_completion_add_proposals (GtkSourceCompletion *com
gboolean finished);
G_END_DECLS
-#endif
-
-/* vi:ex:ts=8 */
+#endif /* __GTK_SOURCE_COMPLETION_H__ */
diff --git a/gtksourceview/gtksourcecompletioncontext.c b/gtksourceview/gtksourcecompletioncontext.c
index e5c2a14..ea6a0b1 100644
--- a/gtksourceview/gtksourcecompletioncontext.c
+++ b/gtksourceview/gtksourcecompletioncontext.c
@@ -141,6 +141,13 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
object_class->get_property = gtk_source_completion_context_get_property;
object_class->dispose = gtk_source_completion_context_dispose;
+ /**
+ * GtkSourceCompletionContext::cancelled:
+ *
+ * Emitted when the current population of proposals has been cancelled.
+ * Providers adding proposals asynchronously should connect to this signal
+ * to know when to cancel running proposal queries.
+ **/
context_signals[CANCELLED] =
g_signal_new ("cancelled",
G_TYPE_FROM_CLASS (klass),
@@ -152,6 +159,11 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
G_TYPE_NONE,
0);
+ /**
+ * GtkSourceCompletionContext:completion:
+ *
+ * The #GtkSourceCompletion associated with the context.
+ **/
g_object_class_install_property (object_class,
PROP_COMPLETION,
g_param_spec_object ("completion",
@@ -160,6 +172,11 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
GTK_TYPE_SOURCE_COMPLETION,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * GtkSourceCompletionContext:view:
+ *
+ * The #GtkSourceView associated with the context.
+ **/
g_object_class_install_property (object_class,
PROP_VIEW,
g_param_spec_object ("view",
@@ -168,6 +185,11 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
GTK_TYPE_SOURCE_VIEW,
G_PARAM_READABLE));
+ /**
+ * GtkSourceCompletionContext:iter:
+ *
+ * The #GtkTextIter at which the completion is invoked.
+ **/
g_object_class_install_property (object_class,
PROP_ITER,
g_param_spec_pointer ("iter",
@@ -175,6 +197,11 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
_("The GtkTextIter at which the completion was invoked"),
G_PARAM_READWRITE));
+ /**
+ * GtkSourceCompletionContext:interactive:
+ *
+ * Whether the completion is in 'interactive' mode.
+ **/
g_object_class_install_property (object_class,
PROP_INTERACTIVE,
g_param_spec_boolean ("interactive",
@@ -183,6 +210,11 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
FALSE,
G_PARAM_READWRITE));
+ /**
+ * GtkSourceCompletionContext:default:
+ *
+ * Whether the completion is in 'default' mode.
+ **/
g_object_class_install_property (object_class,
PROP_DEFAULT,
g_param_spec_boolean ("default",
@@ -200,6 +232,19 @@ gtk_source_completion_context_init (GtkSourceCompletionContext *self)
self->priv = GTK_SOURCE_COMPLETION_CONTEXT_GET_PRIVATE (self);
}
+/**
+ * gtk_source_completion_context_add_proposals:
+ * @context: A #GtkSourceCompletionContext
+ * @provider: A #GtkSourceCompletionProvider
+ * @proposals: The list of proposals to add
+ * @finished: Whether the provider is finished adding proposals
+ *
+ * Providers can use this function to add proposals to the completion. They
+ * can do so asynchronously by means of the @finished argument. Providers must
+ * ensure that they always call this function with @finished set to %TRUE
+ * once each population (even if no proposals need to be added).
+ *
+ **/
void
gtk_source_completion_context_add_proposals (GtkSourceCompletionContext *context,
GtkSourceCompletionProvider *provider,
@@ -216,6 +261,15 @@ gtk_source_completion_context_add_proposals (GtkSourceCompletionContext *contex
finished);
}
+/**
+ * gtk_source_completion_context_get_view:
+ * @context: A #GtkSourceCompletionContext
+ *
+ * Get the #GtkSourceView to which the context applies
+ *
+ * Returns: A #GtkSourceView
+ *
+ **/
GtkSourceView *
gtk_source_completion_context_get_view (GtkSourceCompletionContext *context)
{
@@ -223,6 +277,15 @@ gtk_source_completion_context_get_view (GtkSourceCompletionContext *context)
return gtk_source_completion_get_view (context->priv->completion);
}
+/**
+ * gtk_source_completion_context_get_iter:
+ * @context: A #GtkSourceCompletionContext
+ * @iter: A #GtkTextIter
+ *
+ * Get the iter at which the completion was invoked. Providers can use this
+ * to determine how and if to match proposals.
+ *
+ **/
void
gtk_source_completion_context_get_iter (GtkSourceCompletionContext *context,
GtkTextIter *iter)
@@ -231,6 +294,16 @@ gtk_source_completion_context_get_iter (GtkSourceCompletionContext *context,
*iter = context->priv->iter;
}
+/**
+ * gtk_source_completion_context_get_interactive:
+ * @context: A #GtkSourceCompletionContext
+ *
+ * Get whether the context is targeting 'interactive' mode providers. The
+ * interactive mode is used by #GtkSourceCompletion to indicate a completion
+ * that was started interactively (i.e. when typing).
+ *
+ * Returns: %TRUE if the context is in 'interactive' mode, %FALSE otherwise
+ */
gboolean
gtk_source_completion_context_get_interactive (GtkSourceCompletionContext *context)
{
@@ -239,6 +312,16 @@ gtk_source_completion_context_get_interactive (GtkSourceCompletionContext *conte
}
+/**
+ * gtk_source_completion_context_get_default:
+ * @context: A #GtkSourceCompletionContext
+ *
+ * Get whether the context is targeting 'default' mode providers. The default
+ * mode is used by the #GtkSourceView completion binding to invoke the
+ * completion with providers that support default mode.
+ *
+ * Returns: %TRUE if the context is in 'default' mode, %FALSE otherwise
+ */
gboolean
gtk_source_completion_context_get_default (GtkSourceCompletionContext *context)
{
@@ -247,6 +330,14 @@ gtk_source_completion_context_get_default (GtkSourceCompletionContext *context)
}
+/**
+ * gtk_source_completion_context_move_window:
+ * @context: A #GtkSourceCompletionContext
+ * @iter: A #GtkTextIter
+ *
+ * Move the completion window to the specified @iter
+ *
+ **/
void
gtk_source_completion_context_move_window (GtkSourceCompletionContext *context,
GtkTextIter *iter)
diff --git a/gtksourceview/gtksourcecompletioncontext.h b/gtksourceview/gtksourcecompletioncontext.h
index 29a02f6..cdf2ae6 100644
--- a/gtksourceview/gtksourcecompletioncontext.h
+++ b/gtksourceview/gtksourcecompletioncontext.h
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletioncontext.h
* This file is part of gtksourceview
*
@@ -80,5 +80,3 @@ void _gtk_source_completion_context_cancel (GtkSourceCompletionContext
G_END_DECLS
#endif /* __GTK_SOURCE_COMPLETION_CONTEXT_H__ */
-
-/* vi:ex:ts=8 */
diff --git a/gtksourceview/gtksourcecompletioninfo.h b/gtksourceview/gtksourcecompletioninfo.h
index 09ddd6d..90dd9ec 100644
--- a/gtksourceview/gtksourcecompletioninfo.h
+++ b/gtksourceview/gtksourcecompletioninfo.h
@@ -1,8 +1,9 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletioninfo.h
* This file is part of gtksourcecompletion
*
- * Copyright (C) 2007 -2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2007 - 2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2009 Jesse van den Kieboom <jessevdk gnome org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/gtksourceview/gtksourcecompletionitem.c b/gtksourceview/gtksourcecompletionitem.c
index 407f587..454e1e3 100644
--- a/gtksourceview/gtksourcecompletionitem.c
+++ b/gtksourceview/gtksourcecompletionitem.c
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletionitem.c
* This file is part of gtksourcecompletion
*
diff --git a/gtksourceview/gtksourcecompletionitem.h b/gtksourceview/gtksourcecompletionitem.h
index 01c51d6..f396620 100644
--- a/gtksourceview/gtksourcecompletionitem.h
+++ b/gtksourceview/gtksourcecompletionitem.h
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletionitem.h
* This file is part of gtksourcecompletion
*
@@ -53,17 +53,17 @@ struct _GtkSourceCompletionItemClass {
GType gtk_source_completion_item_get_type (void) G_GNUC_CONST;
GtkSourceCompletionItem *gtk_source_completion_item_new (const gchar *label,
- const gchar *action,
+ const gchar *text,
GdkPixbuf *icon,
const gchar *info);
GtkSourceCompletionItem *gtk_source_completion_item_new_with_markup (const gchar *markup,
- const gchar *action,
+ const gchar *text,
GdkPixbuf *icon,
const gchar *info);
GtkSourceCompletionItem *gtk_source_completion_item_new_from_stock (const gchar *label,
- const gchar *action,
+ const gchar *text,
const gchar *stock,
const gchar *info);
diff --git a/gtksourceview/gtksourcecompletionmodel.h b/gtksourceview/gtksourcecompletionmodel.h
index 23d499b..447f0d4 100644
--- a/gtksourceview/gtksourcecompletionmodel.h
+++ b/gtksourceview/gtksourcecompletionmodel.h
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletionmodel.h
* This file is part of gtksourcecompletion
*
@@ -108,5 +108,3 @@ gboolean gtk_source_completion_model_iter_last (GtkSourceCompletionModel
G_END_DECLS
#endif /* __GTK_SOURCE_COMPLETION_MODEL_H__ */
-
-/* vi:ex:ts=8 */
diff --git a/gtksourceview/gtksourcecompletionproposal.c b/gtksourceview/gtksourcecompletionproposal.c
index 5cdb12f..6f2afe9 100644
--- a/gtksourceview/gtksourcecompletionproposal.c
+++ b/gtksourceview/gtksourcecompletionproposal.c
@@ -244,6 +244,17 @@ gtk_source_completion_proposal_get_info (GtkSourceCompletionProposal *proposal)
return GTK_SOURCE_COMPLETION_PROPOSAL_GET_INTERFACE (proposal)->get_info (proposal);
}
+/**
+ * gtk_source_completion_proposal_hash:
+ * @proposal: A #GtkSourceCompletionProposal
+ *
+ * Get the hash value of @proposal. This is used to (together with
+ * #gtk_source_completion_proposal_equal) to match proposals in the completion
+ * model. By default, it uses a direct hash (#g_direct_hash).
+ *
+ * Returns: The hash value of @proposal
+ *
+ **/
guint
gtk_source_completion_proposal_hash (GtkSourceCompletionProposal *proposal)
{
@@ -251,6 +262,18 @@ gtk_source_completion_proposal_hash (GtkSourceCompletionProposal *proposal)
return GTK_SOURCE_COMPLETION_PROPOSAL_GET_INTERFACE (proposal)->hash (proposal);
}
+/**
+ * gtk_source_completion_proposal_equal:
+ * @proposal: A #GtkSourceCompletionProposal
+ * @other: A #GtkSourceCompletionProposal
+ *
+ * Get whether two proposal objects are the same. This is used to (together
+ * with #gtk_source_completion_proposal_hash) to match proposals in the
+ * completion model. By default, it uses direct equality (#g_direct_equal).
+ *
+ * Returns: %TRUE if @proposal and @object are the same proposal
+ *
+ **/
gboolean
gtk_source_completion_proposal_equal (GtkSourceCompletionProposal *proposal,
GtkSourceCompletionProposal *other)
diff --git a/gtksourceview/gtksourcecompletionproposal.h b/gtksourceview/gtksourcecompletionproposal.h
index 89a123a..c4ba721 100644
--- a/gtksourceview/gtksourcecompletionproposal.h
+++ b/gtksourceview/gtksourcecompletionproposal.h
@@ -1,4 +1,4 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletionproposal.h
* This file is part of gtksourcecompletion
*
diff --git a/gtksourceview/gtksourcecompletionprovider.c b/gtksourceview/gtksourcecompletionprovider.c
index 158636d..b911dc3 100644
--- a/gtksourceview/gtksourcecompletionprovider.c
+++ b/gtksourceview/gtksourcecompletionprovider.c
@@ -214,6 +214,17 @@ gtk_source_completion_provider_populate (GtkSourceCompletionProvider *provider,
GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->populate (provider, context);
}
+/**
+ * gtk_source_completion_provider_get_default:
+ * @provider: A #GtkSourceCompletionProvider
+ *
+ * Get whether the provider can be activated in default mode. Default mode
+ * is a special mode which corresponds to the keybinding on #GtkSourceView
+ * with which a completion can be invoked.
+ *
+ * Returns: %TRUE if the provider should be activated in default mode.
+ *
+ **/
gboolean
gtk_source_completion_provider_get_default (GtkSourceCompletionProvider *provider)
{
@@ -221,6 +232,17 @@ gtk_source_completion_provider_get_default (GtkSourceCompletionProvider *provide
return GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->get_default (provider);
}
+/**
+ * gtk_source_completion_provider_get_interactive:
+ * @provider: A #GtkSourceCompletionProvider
+ *
+ * Get whether the provider can be activated in interactive mode. Interactive
+ * mode is a special completion mode which is invoked automatically when
+ * typing.
+ *
+ * Returns: %TRUE if the provider should be activated in interactive mode.
+ *
+ **/
gboolean
gtk_source_completion_provider_get_interactive (GtkSourceCompletionProvider *provider)
{
@@ -296,6 +318,20 @@ gtk_source_completion_provider_update_info (GtkSourceCompletionProvider *provide
GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->update_info (provider, proposal, info);
}
+/**
+ * gtk_source_completion_provider_get_start_iter:
+ * @provider: A #GtkSourceCompletionProvider
+ * @proposal: A #GtkSourceCompletionProposal
+ * @iter: A #GtkTextIter
+ *
+ * Get the #GtkTextIter at which the completion for @proposal starts. When
+ * implemented, the completion can use this information to position the
+ * completion window accordingly when a proposal is selected in the completion
+ * window.
+ *
+ * Returns: %TRUE if @iter was set for @proposal, %FALSE otherwise
+ *
+ **/
gboolean
gtk_source_completion_provider_get_start_iter (GtkSourceCompletionProvider *provider,
GtkSourceCompletionProposal *proposal,
diff --git a/gtksourceview/gtksourcecompletionprovider.h b/gtksourceview/gtksourcecompletionprovider.h
index 730062e..c08bd5d 100644
--- a/gtksourceview/gtksourcecompletionprovider.h
+++ b/gtksourceview/gtksourcecompletionprovider.h
@@ -1,8 +1,9 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletionprovider.h
* This file is part of gtksourcecompletion
*
- * Copyright (C) 2007 -2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2007 - 2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2009 Jesse van den Kieboom <jessevdk gnome org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -107,6 +108,4 @@ gboolean gtk_source_completion_provider_activate_proposal (GtkSourceCompletionP
G_END_DECLS
-#endif
-
-/* vi:ex:ts=8 */
+#endif /* __GTK_SOURCE_COMPLETION_PROVIDER_H__ */
diff --git a/gtksourceview/gtksourcecompletionutils.h b/gtksourceview/gtksourcecompletionutils.h
index 8de70e1..4be065a 100644
--- a/gtksourceview/gtksourcecompletionutils.h
+++ b/gtksourceview/gtksourcecompletionutils.h
@@ -1,8 +1,9 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcecompletion-utils.h
* This file is part of gtksourcecompletion
*
- * Copyright (C) 2007 -2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2007 - 2009 Jesús Barbero RodrÃguez <chuchiperriman gmail com>
+ * Copyright (C) 2009 Jesse van den Kieboom <jessevdk gnome org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 51a96ce..276e389 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -449,7 +449,19 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
_gtksourceview_marshal_VOID__VOID,
G_TYPE_NONE,
0);
-
+
+ /**
+ * GtkSourceView::show-completion:
+ * @view: The #GtkSourceView who emits the signal
+ *
+ * The ::show-completion signal is a keybinding signal which gets
+ * emitted when the user initiates a completion in default mode.
+ *
+ * Applications should not connect to it, but may emit it with
+ * #g_signal_emit_by_name if they need to control the default mode
+ * completion activation.
+ *
+ */
signals [SHOW_COMPLETION] =
g_signal_new ("show-completion",
G_TYPE_FROM_CLASS (klass),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]