[gtk/modern-doc-shooter: 3/8] docs: Add gallery images for some more widgets




commit 0ae46040a4cd2363c9296ae861215f5f28708e8a
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 3 23:42:27 2020 -0400

    docs: Add gallery images for some more widgets
    
    This adds GtkPicture, GtkVideo, GtkMediaControls.

 docs/reference/gtk/images/media-controls.png | Bin 0 -> 4295 bytes
 docs/reference/gtk/images/picture.png        | Bin 0 -> 7086 bytes
 docs/reference/gtk/images/video.png          | Bin 0 -> 3606 bytes
 docs/reference/gtk/meson.build               |   3 ++
 docs/reference/gtk/visual_index.xml          |   9 ++++
 docs/tools/widgets.c                         |  70 +++++++++++++++++++++++++++
 6 files changed, 82 insertions(+)
---
diff --git a/docs/reference/gtk/images/media-controls.png b/docs/reference/gtk/images/media-controls.png
new file mode 100644
index 0000000000..829b131569
Binary files /dev/null and b/docs/reference/gtk/images/media-controls.png differ
diff --git a/docs/reference/gtk/images/picture.png b/docs/reference/gtk/images/picture.png
new file mode 100644
index 0000000000..fb80873181
Binary files /dev/null and b/docs/reference/gtk/images/picture.png differ
diff --git a/docs/reference/gtk/images/video.png b/docs/reference/gtk/images/video.png
new file mode 100644
index 0000000000..2ed034fcbc
Binary files /dev/null and b/docs/reference/gtk/images/video.png differ
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index 4334af35f0..9eb60f581e 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -322,6 +322,7 @@ images = [
   'images/lockbutton.png',
   'images/lockbutton-sorry.png',
   'images/lockbutton-unlocked.png',
+  'images/media-controls.png',
   'images/menubar.png',
   'images/menu-button.png',
   'images/messagedialog.png',
@@ -330,6 +331,7 @@ images = [
   'images/options.png',
   'images/pagesetupdialog.png',
   'images/panes.png',
+  'images/picture.png',
   'images/placessidebar.png',
   'images/popup-anchors.png',
   'images/popup-at.svg',
@@ -362,6 +364,7 @@ images = [
   'images/up-center.png',
   'images/up-end.png',
   'images/up-start.png',
+  'images/video.png',
   'images/volumebutton.png',
   'images/widget-hvalign.png',
   'images/window-default.png',
diff --git a/docs/reference/gtk/visual_index.xml b/docs/reference/gtk/visual_index.xml
index 44cc4e6433..a1814e3093 100644
--- a/docs/reference/gtk/visual_index.xml
+++ b/docs/reference/gtk/visual_index.xml
@@ -45,6 +45,15 @@
     <link linkend="GtkGLArea">
       <inlinegraphic fileref="glarea.png" format="PNG"></inlinegraphic>
     </link>
+    <link linkend="GtkPicture">
+      <inlinegraphic fileref="picture.png" format="PNG"></inlinegraphic>
+    </link>
+    <link linkend="GtkVideo">
+      <inlinegraphic fileref="video.png" format="PNG"></inlinegraphic>
+    </link>
+    <link linkend="GtkMediaControls">
+      <inlinegraphic fileref="media-controls.png" format="PNG"></inlinegraphic>
+    </link>
   </para>
 </section>
 
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 078b90954b..f519c16c3f 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1027,6 +1027,73 @@ create_image (void)
   return new_widget_info ("image", vbox, SMALL);
 }
 
+static WidgetInfo *
+create_picture (void)
+{
+  GtkWidget *widget;
+  GtkWidget *vbox;
+  GtkIconTheme *theme;
+  GdkPaintable *paintable;
+
+  theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
+  paintable = GDK_PAINTABLE (gtk_icon_theme_lookup_icon (theme,
+                                                         "applications-graphics",
+                                                         NULL,
+                                                         48, 1, GTK_TEXT_DIR_LTR,
+                                                         0));
+
+  widget = gtk_picture_new_for_paintable (paintable);
+  gtk_picture_set_can_shrink (GTK_PICTURE (widget), TRUE);
+  gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Picture"));
+
+  add_margin (vbox);
+
+  return new_widget_info ("picture", vbox, SMALL);
+}
+
+static WidgetInfo *
+create_video (void)
+{
+  GtkWidget *widget;
+  GtkWidget *vbox;
+
+  widget = gtk_video_new_for_filename ("../../demos/gtk-demo/gtk-logo.webm");
+  gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Video"));
+
+  add_margin (vbox);
+
+  return new_widget_info ("video", vbox, SMALL);
+}
+
+static WidgetInfo *
+create_media_controls (void)
+{
+  GtkWidget *widget;
+  GtkWidget *vbox;
+
+  widget = gtk_media_controls_new (NULL);
+  gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Media Controls"));
+
+  add_margin (vbox);
+
+  return new_widget_info ("media-controls", vbox, SMALL);
+}
+
 static WidgetInfo *
 create_spinner (void)
 {
@@ -1458,6 +1525,9 @@ get_all_widgets (void)
   retval = g_list_prepend (retval, create_info_bar ());
   retval = g_list_prepend (retval, create_gl_area ());
   retval = g_list_prepend (retval, create_sidebar ());
+  retval = g_list_prepend (retval, create_video ());
+  retval = g_list_prepend (retval, create_media_controls ());
+  retval = g_list_prepend (retval, create_picture ());
 
   return retval;
 }


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