Merge branch 'inspector-media' into 'master'

Inspector media

See merge request GNOME/gtk!1781
This commit is contained in:
Matthias Clasen 2020-04-28 05:25:50 +00:00
commit f66950f48c
4 changed files with 63 additions and 7 deletions

View File

@ -183,19 +183,15 @@ gtk_media_file_init (GtkMediaFile *self)
{
}
static GType
gtk_media_file_get_impl_type (void)
GIOExtension *
gtk_media_file_get_extension (void)
{
static GType impl_type = G_TYPE_NONE;
const char *extension_name;
GIOExtension *e;
GIOExtensionPoint *ep;
if (G_LIKELY (impl_type != G_TYPE_NONE))
return impl_type;
GTK_NOTE (MODULES, g_print ("Looking up MediaFile extension\n"));
ep = g_io_extension_point_lookup (GTK_MEDIA_FILE_EXTENSION_POINT_NAME);
e = NULL;
@ -239,6 +235,19 @@ gtk_media_file_get_impl_type (void)
e = l->data;
}
return e;
}
static GType
gtk_media_file_get_impl_type (void)
{
static GType impl_type = G_TYPE_NONE;
GIOExtension *e;
if (G_LIKELY (impl_type != G_TYPE_NONE))
return impl_type;
e = gtk_media_file_get_extension ();
impl_type = g_io_extension_get_type (e);
GTK_NOTE (MODULES, g_print ("Using %s from \"%s\" extension\n", g_type_name (impl_type), g_io_extension_get_name (e)));

View File

@ -24,6 +24,7 @@
void gtk_media_file_extension_init (void);
GIOExtension * gtk_media_file_get_extension (void);
#endif /* __GTK_MEDIA_FILE_PRIVATE_H__ */

View File

@ -32,6 +32,7 @@
#include "gtkadjustment.h"
#include "gtkbox.h"
#include "gtkbinlayout.h"
#include "gtkmediafileprivate.h"
#ifdef GDK_WINDOWING_X11
@ -74,6 +75,7 @@ struct _GtkInspectorGeneralPrivate
GtkWidget *gdk_backend;
GtkWidget *gsk_renderer;
GtkWidget *pango_fontmap;
GtkWidget *media_backend;
GtkWidget *gl_version;
GtkWidget *gl_vendor;
GtkWidget *vk_device;
@ -646,6 +648,17 @@ init_pango (GtkInspectorGeneral *gen)
gtk_label_set_label (GTK_LABEL (gen->priv->pango_fontmap), name);
}
static void
init_media (GtkInspectorGeneral *gen)
{
GIOExtension *e;
const char *name;
e = gtk_media_file_get_extension ();
name = g_io_extension_get_name (e);
gtk_label_set_label (GTK_LABEL (gen->priv->media_backend), name);
}
static void populate_seats (GtkInspectorGeneral *gen);
static void
@ -894,6 +907,7 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gsk_renderer);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, pango_fontmap);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, media_backend);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_version);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_vendor);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, vk_device);
@ -925,6 +939,7 @@ gtk_inspector_general_set_display (GtkInspectorGeneral *gen,
init_env (gen);
init_display (gen);
init_pango (gen);
init_media (gen);
init_gl (gen);
init_vulkan (gen);
init_device (gen);

View File

@ -138,6 +138,36 @@
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="spacing">40</property>
<child>
<object class="GtkLabel" id="media_backend_label">
<property name="label" translatable="yes">Media Backend</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkLabel" id="media_backend">
<property name="selectable">1</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<property name="hexpand">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
@ -666,6 +696,7 @@
<widget name="gdk_backend_label"/>
<widget name="gsk_renderer_label"/>
<widget name="pango_fontmap_label"/>
<widget name="media_backend_label"/>
<widget name="gl_version_label"/>
<widget name="gl_vendor_label"/>
<widget name="vk_device_label"/>