Commit 4c8bd8e7 authored by William Jon McCann's avatar William Jon McCann
Browse files

docs: Identify examples that are C code

https://bugzilla.gnome.org/show_bug.cgi?id=723119
parent 768bc440
......@@ -502,7 +502,7 @@ gdk_init (int *argc, char ***argv)
*
* A minimal main program for a threaded GTK+ application
* looks like:
* |[
* |[<!-- language="C" -->
* int
* main (int argc, char *argv[])
* {
......@@ -532,7 +532,7 @@ gdk_init (int *argc, char ***argv)
*
* Erik Mouw contributed the following code example to
* illustrate how to use threads within GTK+ programs.
* |[
* |[<!-- language="C" -->
* /<!---->*-------------------------------------------------------------------------
* * Filename: gtk-thread.c
* * Version: 0.99.1
......@@ -843,7 +843,7 @@ gdk_threads_dispatch_free (gpointer data)
* running in thread A and accessing @self after it has been finalized
* in thread B:
*
* |[
* |[<!-- language="C" -->
* static gboolean
* idle_callback (gpointer data)
* {
......@@ -949,7 +949,7 @@ gdk_threads_add_idle (GSourceFunc function,
* This variant of g_timeout_add_full() can be thought of a MT-safe version
* for GTK+ widgets for the following use case:
*
* |[
* |[<!-- language="C" -->
* static gboolean timeout_callback (gpointer data)
* {
* SomeWidget *self = data;
......
......@@ -36,7 +36,7 @@
* screen or workspace.
* <example>
* <title>Launching an application</title>
* |[
* |[<!-- language="C" -->
* GdkAppLaunchContext *context;
*
* context = gdk_display_get_app_launch_context (display);
......
......@@ -2115,7 +2115,7 @@ static GQueue gdk_error_traps = G_QUEUE_INIT;
*
* <example>
* <title>Trapping an X error</title>
* |[
* |[<!-- language="C" -->
* gdk_error_trap_push (<!-- -->);
*
* // ... Call the X function which may cause an error here ...
......
......@@ -87,7 +87,7 @@
*
* <example id="backend-specific">
* <title>Backend-specific code</title>
* |[
* |[<!-- language="C" -->
* #ifdef GDK_WINDOWING_X11
* if (GDK_IS_X11_DISPLAY (display))
* {
......@@ -225,7 +225,7 @@ static const gchar *allowed_backends;
* By default, GDK tries all included backends.
*
* For example,
* |[
* |[<!-- language="C" -->
* gdk_set_allowed_backends ("wayland,quartz,*");
* ]|
* instructs GDK to try the Wayland backend first,
......
......@@ -1676,7 +1676,7 @@ gdk_event_get_source_device (const GdkEvent *event)
* core pointer. Coordinate extraction, processing and requesting more
* motion events from a %GDK_MOTION_NOTIFY event usually works like this:
*
* |[
* |[<!-- language="C" -->
* {
* /&ast; motion_event handler &ast;/
* x = motion_event->x;
......
......@@ -1142,7 +1142,7 @@ struct _GdkEventDND {
* The event type is always the first field in all of the event types, and
* can always be accessed with the following code, no matter what type of
* event it is:
* |[
* |[<!-- language="C" -->
* GdkEvent *event;
* GdkEventType type;
*
......@@ -1153,14 +1153,14 @@ struct _GdkEventDND {
* can be cast to the appropriate event type, or the union member
* name can be used. For example if the event type is %GDK_BUTTON_PRESS
* then the x coordinate of the button press can be accessed with:
* |[
* |[<!-- language="C" -->
* GdkEvent *event;
* gdouble x;
*
* x = ((GdkEventButton*)event)->x;
* ]|
* or:
* |[
* |[<!-- language="C" -->
* GdkEvent *event;
* gdouble x;
*
......
......@@ -503,7 +503,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
* <literal>&lt;Control&gt;plus</literal> accelerator &lt;Shift&gt; should
* be masked out.
* </para>
* |[
* |[<!-- language="C" -->
* &sol;* We want to ignore irrelevant modifiers like ScrollLock *&sol;
* &num;define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)
* gdk_keymap_translate_keyboard_state (keymap, event->hardware_keycode,
......@@ -518,7 +518,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
* all modifiers that might affect the translation of the key;
* this allowed accelerators to be stored with irrelevant consumed
* modifiers, by doing:</para>
* |[
* |[<!-- language="C" -->
* &sol;* XXX Don't do this XXX *&sol;
* if (keyval == accel_keyval &&
* (event->state &amp; ~consumed &amp; ALL_ACCELS_MASK) == (accel_mods &amp; ~consumed))
......
......@@ -53,7 +53,7 @@
* <title>Draw transformed text with Pango and cairo</title>
* <!-- Note that this example is basically the same as
* demos/gtk-demo/rotated_text.c -->
* |[
* |[<!-- language="C" -->
* #define RADIUS 100
* #define N_WORDS 10
* #define FONT "Sans Bold 18"
......
......@@ -421,7 +421,7 @@ struct _GdkWindowAttr
* Here's an example of how the terminal example would be implemented, assuming
* a terminal area widget called "terminal" and a toplevel window "toplevel":
*
* |[
* |[<!-- language="C" -->
* GdkGeometry hints;
*
* hints.base_width = terminal->char_width;
......
......@@ -49,7 +49,7 @@
* calls by an ifdef as follows. Since GDK may be built with multiple
* backends, you should also check for the backend that is in use (e.g. by
* using the GDK_IS_WAYLAND_DISPLAY() macro).
* |[
* |[<!-- language="C" -->
* #ifdef GDK_WINDOWING_WAYLAND
* if (GDK_IS_WAYLAND_DISPLAY (display))
* {
......
......@@ -2275,7 +2275,7 @@ gdk_wayland_window_get_wl_surface (GdkWindow *window)
* This function should be called before a #GdkWindow is shown. This is
* best done by connecting to the #GtkWidget::realize signal:
*
* |[
* |[<!-- language="C" -->
* static void
* widget_realize_cb (GtkWidget *widget)
* {
......
......@@ -41,7 +41,7 @@
* </para>
* <example>
* <title>A class fragment implementing #GtkActivatable</title>
* |[
* |[<!-- language="C" -->
*
* enum {
* ...
......
......@@ -402,7 +402,7 @@ create_menu_item (GtkAction *action)
* to the group.
*
* A common way to set up a group of radio group is the following:
* |[
* |[<!-- language="C" -->
* GSList *group = NULL;
* GtkRadioAction *action;
*
......@@ -492,7 +492,7 @@ gtk_radio_action_set_group (GtkRadioAction *action,
* and gtk_radio_action_set_group() methods
*
* A common way to set up a group of radio actions is the following:
* |[
* |[<!-- language="C" -->
* GtkRadioAction *action;
* GtkRadioAction *last_action;
*
......
......@@ -607,7 +607,7 @@
* <literal>*</literal>. So for example, the following specifies different icons to
* use for left-to-right and right-to-left languages:
*
* |[
* |[<!-- language="C" -->
* stock["my-stock-item"] =
* {
* { "itemltr.png", LTR, *, * },
......@@ -617,7 +617,7 @@
*
* This could be abbreviated as follows:
*
* |[
* |[<!-- language="C" -->
* stock["my-stock-item"] =
* {
* { "itemltr.png", LTR },
......@@ -627,7 +627,7 @@
*
* You can specify custom icons for specific sizes, as follows:
*
* |[
* |[<!-- language="C" -->
* stock["my-stock-item"] =
* {
* { "itemmenusize.png", *, *, "gtk-menu" },
......@@ -643,7 +643,7 @@
*
* It's also possible to use custom icons for a given state, for example:
*
* |[
* |[<!-- language="C" -->
* stock["my-stock-item"] =
* {
* { "itemprelight.png", *, PRELIGHT },
......@@ -1499,7 +1499,7 @@ gtk_rc_get_style (GtkWidget *widget)
* would be items inside a GNOME canvas widget.
*
* The action of gtk_rc_get_style() is similar to:
* |[
* |[<!-- language="C" -->
* gtk_widget_path (widget, NULL, &path, NULL);
* gtk_widget_class_path (widget, NULL, &class_path, NULL);
* gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
......
......@@ -483,7 +483,7 @@ static const GtkStockItem builtin_items [] =
* the correct domain when calling dgettext(). This can be useful, e.g.
* when dealing with message contexts:
*
* |[
* |[<!-- language="C" -->
* GtkStockItem items[] = {
* { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" },
* { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" },
......
......@@ -3190,7 +3190,7 @@ queue_update (GtkUIManager *manager)
* UI in an idle function. A typical example where this function is
* useful is to enforce that the menubar and toolbar have been added to
* the main window before showing it:
* |[
* |[<!-- language="C" -->
* gtk_container_add (GTK_CONTAINER (window), vbox);
* g_signal_connect (merge, "add-widget",
* G_CALLBACK (add_widget), vbox);
......
......@@ -51,7 +51,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* from #GtkBox, and set the #GtkOrientable:orientation property to
* %GTK_ORIENTATION_VERTICAL in your instance init function, with a
* call like:
* |[
* |[<!-- language="C" -->
* gtk_orientable_set_orientation (GTK_ORIENTABLE (object),
* GTK_ORIENTATION_VERTICAL);
* ]|
......
......@@ -84,7 +84,7 @@
* application, but in order to ensure proper translation of the title,
* applications should set the title property explicitly when constructing
* a GtkAboutDialog, as shown in the following example:
* |[
* |[<!-- language="C" -->
* gtk_show_about_dialog (NULL,
* "program-name", "ExampleCode",
* "logo", example_logo,
......@@ -1653,7 +1653,7 @@ gtk_about_dialog_get_translator_credits (GtkAboutDialog *about)
* of the language which is currently used in the user interface.
* Using gettext(), a simple way to achieve that is to mark the
* string for translation:
* |[
* |[<!-- language="C" -->
* gtk_about_dialog_set_translator_credits (about, _("translator-credits"));
* ]|
* It is a good idea to use the customary msgid "translator-credits" for this
......
......@@ -67,7 +67,7 @@
* though it is almost always used to display just one accelerator key.
* <example>
* <title>Creating a simple menu item with an accelerator key.</title>
* |[
* |[<!-- language="C" -->
* GtkWidget *save_item;
* GtkAccelGroup *accel_group;
*
......
......@@ -94,7 +94,7 @@
* </figure>
*
* <example id="gtkapplication"><title>A simple application</title>
* |[
* |[<!-- language="C" -->
* <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/bloatpad.c">
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
* </xi:include>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment