[gtksourceview: 8/10] Doc: custom context classes can be used



commit 0d683ef5af476691c93c2ceb106863bbc9b32a32
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jan 30 18:16:59 2014 +0100

    Doc: custom context classes can be used
    
    Context classes are not restricted to the three default ones
    (no-spell-check etc).

 docs/reference/lang-reference.xml |    4 +++-
 gtksourceview/gtksourcebuffer.c   |   17 +++++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/docs/reference/lang-reference.xml b/docs/reference/lang-reference.xml
index 98beadc..4692957 100644
--- a/docs/reference/lang-reference.xml
+++ b/docs/reference/lang-reference.xml
@@ -421,7 +421,9 @@ contexts, sub-pattern contexts, reference contexts and keyword contexts.
 
 <para>
 Context classes can be enabled or disabled for some contexts, with the
-<code>class</code> and <code>class-disabled</code> attributes:
+<code>class</code> and <code>class-disabled</code> attributes. You can create
+your own context classes in custom language definition files. Here are the
+default context classes:
 </para>
 
 <itemizedlist>
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index a23c060..631dbdc 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -92,8 +92,8 @@
  *   <title>Context Classes</title>
  *   <para>
  *     It is possible to retrieve some information from the syntax highlighting
- *     engine. There are currently three context classes, that are applied to
- *     regions of a #GtkSourceBuffer:
+ *     engine. There are currently three default context classes that are
+ *     applied to regions of a #GtkSourceBuffer:
  *   </para>
  *   <itemizedlist>
  *     <listitem>
@@ -113,6 +113,11 @@
  *       </para>
  *     </listitem>
  *   </itemizedlist>
+ *   <para>
+ *     Custom language definition files can create their own context classes,
+ *     since the functions like gtk_source_buffer_iter_has_context_class() take
+ *     a string parameter as the context class.
+ *   </para>
  * </refsect2>
  */
 
@@ -2122,7 +2127,7 @@ gtk_source_buffer_remove_source_marks (GtkSourceBuffer   *buffer,
  *
  * Check if the class @context_class is set on @iter.
  *
- * See the #GtkSourceBuffer description for the list of context classes.
+ * See the #GtkSourceBuffer description for the list of default context classes.
  *
  * Returns: whether @iter has the context class.
  * Since: 2.10
@@ -2163,7 +2168,7 @@ gtk_source_buffer_iter_has_context_class (GtkSourceBuffer   *buffer,
  *
  * Get all defined context classes at @iter.
  *
- * See the #GtkSourceBuffer description for the list of context classes.
+ * See the #GtkSourceBuffer description for the list of default context classes.
  *
  * Returns: (array zero-terminated=1) (transfer full): a new %NULL
  * terminated array of context class names.
@@ -2214,7 +2219,7 @@ gtk_source_buffer_get_context_classes_at_iter (GtkSourceBuffer   *buffer,
  * @iter to the location of the toggle, or to the end of the buffer if no
  * toggle is found.
  *
- * See the #GtkSourceBuffer description for the list of context classes.
+ * See the #GtkSourceBuffer description for the list of default context classes.
  *
  * Returns: whether we found a context class toggle after @iter
  *
@@ -2261,7 +2266,7 @@ gtk_source_buffer_iter_forward_to_context_class_toggle (GtkSourceBuffer *buffer,
  * @iter to the location of the toggle, or to the end of the buffer if no
  * toggle is found.
  *
- * See the #GtkSourceBuffer description for the list of context classes.
+ * See the #GtkSourceBuffer description for the list of default context classes.
  *
  * Returns: whether we found a context class toggle before @iter
  *


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