Annotate all examples with their language

The C ones, at least.
This commit is contained in:
Matthias Clasen
2014-02-01 15:11:49 -05:00
parent 701f00f125
commit adf892e96a
49 changed files with 151 additions and 151 deletions

View File

@@ -160,7 +160,7 @@ g_action_map_remove_action (GActionMap *action_map,
*
* Each action is constructed as per one #GActionEntry.
*
* |[
* |[<!-- language="C" -->
* static void
* activate_quit (GSimpleAction *simple,
* GVariant *parameter,

View File

@@ -47,7 +47,7 @@
*
* A typical implementation might look something like this:
*
* |[
* |[<!-- language="C" -->
* enum {
* NOT_INITIALIZED,
* INITIALIZING,

View File

@@ -57,7 +57,7 @@
* however, the "_finish()" function may be called at most once.
*
* Example of a typical asynchronous operation flow:
* |[
* |[<!-- language="C" -->
* void _theoretical_frobnitz_async (Theoretical *t,
* GCancellable *c,
* GAsyncReadyCallback cb,

View File

@@ -105,7 +105,7 @@ g_cancellable_class_init (GCancellableClass *klass)
* like this.
*
* An example of how to us this:
* |[
* |[<!-- language="C" -->
* /&ast; Make sure we don't do unnecessary work if already cancelled &ast;/
* if (g_cancellable_set_error_if_cancelled (cancellable, error))
* return;

View File

@@ -5794,7 +5794,7 @@ g_dbus_connection_call_sync_internal (GDBusConnection *connection,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_connection_call (connection,
* "org.freedesktop.StringThings",
* "/org/freedesktop/StringThings",
@@ -5895,7 +5895,7 @@ g_dbus_connection_call_finish (GDBusConnection *connection,
*
* If the @parameters #GVariant is floating, it is consumed.
* This allows convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_connection_call_sync (connection,
* "org.freedesktop.StringThings",
* "/org/freedesktop/StringThings",

View File

@@ -55,7 +55,7 @@
* automatically map from D-Bus errors to #GError and back. This
* is typically done in the function returning the #GQuark for the
* error domain:
* |[
* |[<!-- language="C" -->
* /&ast; foo-bar-error.h: &ast;/
*
* #define FOO_BAR_ERROR (foo_bar_error_quark ())

View File

@@ -786,7 +786,7 @@ g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
*
* If the @value #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_set_cached_property (proxy,
* "SomeProperty",
* g_variant_new ("(si)",
@@ -2966,7 +2966,7 @@ g_dbus_proxy_call_sync_internal (GDBusProxy *proxy,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_call (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",
@@ -3057,7 +3057,7 @@ g_dbus_proxy_call_finish (GDBusProxy *proxy,
*
* If the @parameters #GVariant is floating, it is consumed. This allows
* convenient 'inline' use of g_variant_new(), e.g.:
* |[
* |[<!-- language="C" -->
* g_dbus_proxy_call_sync (proxy,
* "TwoStrings",
* g_variant_new ("(ss)",

View File

@@ -603,7 +603,7 @@ g_file_enumerator_get_container (GFileEnumerator *enumerator)
* inside loops with g_file_enumerator_next_file().
*
* This is a convenience method that's equivalent to:
* |[
* |[<!-- language="C" -->
* gchar *name = g_file_info_get_name (info);
* GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
* name);

View File

@@ -77,7 +77,7 @@
* of an extension point has a name, and a priority. Use
* g_io_extension_point_implement() to implement an extension point.
*
* |[
* |[<!-- language="C" -->
* GIOExtensionPoint *ep;
*
* /&ast; Register an extension point &ast;/
@@ -85,7 +85,7 @@
* g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
* ]|
*
* |[
* |[<!-- language="C" -->
* /&ast; Implement an extension point &ast;/
* G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
* g_io_extension_point_implement ("my-extension-point",

View File

@@ -367,7 +367,7 @@ g_memory_output_stream_init (GMemoryOutputStream *stream)
* @size as 0 (allowing #GMemoryOutputStream to do the initial
* allocation for itself).
*
* |[
* |[<!-- language="C" -->
* /&ast; a stream that can grow &ast;/
* stream = g_memory_output_stream_new (NULL, 0, realloc, free);
*

View File

@@ -52,7 +52,7 @@
*
* Consider the following example:
*
* |[
* |[<!-- language="C" -->
* typedef struct
* {
* ...
@@ -109,7 +109,7 @@
* ships a gschemas.compiled file as part of itself, and then simply do
* the following:
*
* |[
* |[<!-- language="C" -->
* {
* GSettings *settings;
* gint some_value;

View File

@@ -399,7 +399,7 @@ g_simple_action_class_init (GSimpleActionClass *class)
* call g_simple_action_set_state() from the handler.
*
* An example of a 'change-state' handler:
* |[
* |[<!-- language="C" -->
* static void
* change_volume_state (GSimpleAction *action,
* GVariant *value,

View File

@@ -106,7 +106,7 @@
* #GAsyncResult. A typical implementation of an asynchronous operation
* using GSimpleAsyncResult looks something like this:
*
* |[
* |[<!-- language="C" -->
* static void
* baked_cb (Cake *cake,
* gpointer user_data)

View File

@@ -32,7 +32,7 @@
* to try out each socket address in turn until one succeeds, as shown
* in the sample code below.
*
* |[
* |[<!-- language="C" -->
* MyConnectionType *
* connect_to_host (const char *hostname,
* guint16 port,

View File

@@ -50,7 +50,7 @@
* the return value.
*
* Here is an example for using GTask as a GAsyncResult:
* |[
* |[<!-- language="C" -->
* typedef struct {
* CakeFrostingType frosting;
* char *message;
@@ -158,7 +158,7 @@
* and priority).
*
* Here is an example for chained asynchronous operations:
* |[
* |[<!-- language="C" -->
* typedef struct {
* Cake *cake;
* CakeFrostingType frosting;
@@ -293,7 +293,7 @@
* #GMainContext when it completes.
*
* Running a task in a thread:
* |[
* |[<!-- language="C" -->
* typedef struct {
* guint radius;
* CakeFlavor flavor;
@@ -377,7 +377,7 @@
* synchronous variants of blocking APIs.
*
* Cancelling a task:
* |[
* |[<!-- language="C" -->
* static void
* bake_cake_thread (GTask *task,
* gpointer source_object,

View File

@@ -257,7 +257,7 @@ g_themed_icon_class_init (GThemedIconClass *klass)
*
* For example, if the icon name was "gnome-dev-cdrom-audio", the array
* would become
* |[
* |[<!-- language="C" -->
* {
* "gnome-dev-cdrom-audio",
* "gnome-dev-cdrom",
@@ -345,7 +345,7 @@ g_themed_icon_new_from_names (char **iconnames,
* that can be created by shortening @iconname at '-' characters.
*
* In the following example, @icon1 and @icon2 are equivalent:
* |[
* |[<!-- language="C" -->
* const char *names[] = {
* "gnome-dev-cdrom-audio",
* "gnome-dev-cdrom",

View File

@@ -622,7 +622,7 @@ g_volume_enumerate_identifiers (GVolume *volume)
* either be equal or a prefix of what this function returns. In
* other words, in code
*
* |[
* |[<!-- language="C" -->
* GMount *mount;
* GFile *mount_root
* GFile *volume_activation_root;
@@ -632,7 +632,7 @@ g_volume_enumerate_identifiers (GVolume *volume)
* volume_activation_root = g_volume_get_activation_root (volume); /&ast; assume not NULL &ast;/
* ]|
* then the expression
* |[
* |[<!-- language="C" -->
* (g_file_has_prefix (volume_activation_root, mount_root) ||
g_file_equal (volume_activation_root, mount_root))
* ]|