docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
This commit is contained in:
12
gdk/gdk.c
12
gdk/gdk.c
@ -502,8 +502,7 @@ gdk_init (int *argc, char ***argv)
|
||||
*
|
||||
* A minimal main program for a threaded GTK+ application
|
||||
* looks like:
|
||||
* <informalexample>
|
||||
* <programlisting role="C">
|
||||
* |[
|
||||
* int
|
||||
* main (int argc, char *argv[])
|
||||
* {
|
||||
@ -522,8 +521,7 @@ gdk_init (int *argc, char ***argv)
|
||||
*
|
||||
* return 0;
|
||||
* }
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*
|
||||
* Callbacks require a bit of attention. Callbacks from GTK+ signals
|
||||
* are made within the GTK+ lock. However callbacks from GLib (timeouts,
|
||||
@ -534,8 +532,7 @@ gdk_init (int *argc, char ***argv)
|
||||
*
|
||||
* Erik Mouw contributed the following code example to
|
||||
* illustrate how to use threads within GTK+ programs.
|
||||
* <informalexample>
|
||||
* <programlisting role="C">
|
||||
* |[
|
||||
* /<!---->*-------------------------------------------------------------------------
|
||||
* * Filename: gtk-thread.c
|
||||
* * Version: 0.99.1
|
||||
@ -672,8 +669,7 @@ gdk_init (int *argc, char ***argv)
|
||||
*
|
||||
* return 0;
|
||||
* }
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*
|
||||
* Unfortunately, all of the above documentation holds with the X11
|
||||
* backend only. With the Win32 or Quartz backends, GDK and GTK+ calls
|
||||
|
||||
@ -36,8 +36,7 @@
|
||||
* screen or workspace.
|
||||
* <example>
|
||||
* <title>Launching an application</title>
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* GdkAppLaunchContext *context;
|
||||
*
|
||||
* context = gdk_display_get_app_launch_context (display);
|
||||
@ -49,8 +48,7 @@
|
||||
* g_warning ("Launching failed: %s\n", error->message);
|
||||
*
|
||||
* g_object_unref (context);
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
* </example>
|
||||
*/
|
||||
|
||||
|
||||
@ -2115,7 +2115,7 @@ static GQueue gdk_error_traps = G_QUEUE_INIT;
|
||||
*
|
||||
* <example>
|
||||
* <title>Trapping an X error</title>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* gdk_error_trap_push (<!-- -->);
|
||||
*
|
||||
* // ... Call the X function which may cause an error here ...
|
||||
@ -2125,7 +2125,7 @@ static GQueue gdk_error_traps = G_QUEUE_INIT;
|
||||
* {
|
||||
* // ... Handle the error here ...
|
||||
* }
|
||||
* </programlisting>
|
||||
* ]|
|
||||
* </example>
|
||||
*/
|
||||
void
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
*
|
||||
* <example id="backend-specific">
|
||||
* <title>Backend-specific code</title>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* #ifdef GDK_WINDOWING_X11
|
||||
* if (GDK_IS_X11_DISPLAY (display))
|
||||
* {
|
||||
@ -103,7 +103,7 @@
|
||||
* else
|
||||
* #endif
|
||||
* g_error ("Unsupported GDK backend");
|
||||
* </programlisting>
|
||||
* ]|
|
||||
* </example>
|
||||
*/
|
||||
|
||||
@ -225,9 +225,9 @@ static const gchar *allowed_backends;
|
||||
* By default, GDK tries all included backends.
|
||||
*
|
||||
* For example,
|
||||
* <programlisting>
|
||||
* |[
|
||||
* gdk_set_allowed_backends ("wayland,quartz,*");
|
||||
* </programlisting>
|
||||
* ]|
|
||||
* instructs GDK to try the Wayland backend first,
|
||||
* followed by the Quartz backend, and then all
|
||||
* others.
|
||||
|
||||
@ -1142,36 +1142,30 @@ 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:
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* GdkEvent *event;
|
||||
* GdkEventType type;
|
||||
*
|
||||
* type = event->type;
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*
|
||||
* To access other fields of the event, the pointer to the event
|
||||
* 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:
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* GdkEvent *event;
|
||||
* gdouble x;
|
||||
*
|
||||
* x = ((GdkEventButton*)event)->x;
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
* or:
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* GdkEvent *event;
|
||||
* gdouble x;
|
||||
*
|
||||
* x = event->button.x;
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*/
|
||||
union _GdkEvent
|
||||
{
|
||||
|
||||
@ -503,7 +503,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
* <literal><Control>plus</literal> accelerator <Shift> should
|
||||
* be masked out.
|
||||
* </para>
|
||||
* <informalexample><programlisting>
|
||||
* |[
|
||||
* /* We want to ignore irrelevant modifiers like ScrollLock */
|
||||
* #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)
|
||||
* gdk_keymap_translate_keyboard_state (keymap, event->hardware_keycode,
|
||||
@ -512,18 +512,18 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
|
||||
* if (keyval == GDK_PLUS &&
|
||||
* (event->state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK)
|
||||
* /* Control was pressed */
|
||||
* </programlisting></informalexample>
|
||||
* ]|
|
||||
* <para>
|
||||
* An older interpretation @consumed_modifiers was that it contained
|
||||
* all modifiers that might affect the translation of the key;
|
||||
* this allowed accelerators to be stored with irrelevant consumed
|
||||
* modifiers, by doing:</para>
|
||||
* <informalexample><programlisting>
|
||||
* |[
|
||||
* /* XXX Don't do this XXX */
|
||||
* if (keyval == accel_keyval &&
|
||||
* (event->state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed))
|
||||
* /* Accelerator was pressed */
|
||||
* </programlisting></informalexample>
|
||||
* ]|
|
||||
* <para>
|
||||
* However, this did not work if multi-modifier combinations were
|
||||
* used in the keymap, since, for instance, <literal><Control></literal>
|
||||
|
||||
@ -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 -->
|
||||
* <programlisting>
|
||||
* |[
|
||||
* #define RADIUS 100
|
||||
* #define N_WORDS 10
|
||||
* #define FONT "Sans Bold 18"
|
||||
@ -116,7 +116,7 @@
|
||||
*
|
||||
* g_object_unref (layout);
|
||||
* g_object_unref (context);
|
||||
* </programlisting>
|
||||
* ]|
|
||||
* </example>
|
||||
* <figure>
|
||||
* <title>Output of <xref linkend="rotated-example"/></title>
|
||||
|
||||
@ -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":
|
||||
*
|
||||
* <informalexample><programlisting><![CDATA[
|
||||
* |[
|
||||
* GdkGeometry hints;
|
||||
*
|
||||
* hints.base_width = terminal->char_width;
|
||||
@ -437,7 +437,7 @@ struct _GdkWindowAttr
|
||||
* GDK_HINT_RESIZE_INC |
|
||||
* GDK_HINT_MIN_SIZE |
|
||||
* GDK_HINT_BASE_SIZE);
|
||||
* ]]></programlisting></informalexample>
|
||||
* ]|
|
||||
*
|
||||
* The other useful fields are the @min_aspect and @max_aspect fields; these
|
||||
* contain a width/height ratio as a floating point number. If a geometry widget
|
||||
|
||||
@ -2275,8 +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:
|
||||
*
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* static void
|
||||
* widget_realize_cb (GtkWidget *widget)
|
||||
* {
|
||||
@ -2297,8 +2296,7 @@ gdk_wayland_window_get_wl_surface (GdkWindow *window)
|
||||
* {
|
||||
* g_signal_connect (window, "realize", G_CALLBACK (widget_realize_cb), NULL);
|
||||
* }
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user