Merge branch 'wip/jtojnar/inspector-immodule-backport' into 'gtk-3-24'
inspector: Add pango backend and im module See merge request GNOME/gtk!5706
This commit is contained in:
commit
2ebdce8633
@ -26,10 +26,12 @@
|
|||||||
#include "gtkswitch.h"
|
#include "gtkswitch.h"
|
||||||
#include "gtklistbox.h"
|
#include "gtklistbox.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
|
#include "gtksettings.h"
|
||||||
#include "gtksizegroup.h"
|
#include "gtksizegroup.h"
|
||||||
#include "gtkimage.h"
|
#include "gtkimage.h"
|
||||||
#include "gtkadjustment.h"
|
#include "gtkadjustment.h"
|
||||||
#include "gtkbox.h"
|
#include "gtkbox.h"
|
||||||
|
#include "gtkimmoduleprivate.h"
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_X11
|
#ifdef GDK_WINDOWING_X11
|
||||||
#include "x11/gdkx.h"
|
#include "x11/gdkx.h"
|
||||||
@ -62,9 +64,11 @@ struct _GtkInspectorGeneralPrivate
|
|||||||
GtkWidget *device_box;
|
GtkWidget *device_box;
|
||||||
GtkWidget *gtk_version;
|
GtkWidget *gtk_version;
|
||||||
GtkWidget *gdk_backend;
|
GtkWidget *gdk_backend;
|
||||||
|
GtkWidget *pango_fontmap;
|
||||||
GtkWidget *app_id_frame;
|
GtkWidget *app_id_frame;
|
||||||
GtkWidget *app_id;
|
GtkWidget *app_id;
|
||||||
GtkWidget *resource_path;
|
GtkWidget *resource_path;
|
||||||
|
GtkWidget *im_module;
|
||||||
GtkWidget *gl_version;
|
GtkWidget *gl_version;
|
||||||
GtkWidget *gl_vendor;
|
GtkWidget *gl_vendor;
|
||||||
GtkWidget *prefix;
|
GtkWidget *prefix;
|
||||||
@ -500,6 +504,60 @@ init_display (GtkInspectorGeneral *gen)
|
|||||||
populate_display (screen, gen);
|
populate_display (screen, gen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
init_pango (GtkInspectorGeneral *gen)
|
||||||
|
{
|
||||||
|
PangoFontMap *fontmap;
|
||||||
|
const char *type;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
|
fontmap = pango_cairo_font_map_get_default ();
|
||||||
|
type = G_OBJECT_TYPE_NAME (fontmap);
|
||||||
|
if (strcmp (type, "PangoCairoFcFontMap") == 0)
|
||||||
|
name = "fontconfig";
|
||||||
|
else if (strcmp (type, "PangoCairoCoreTextFontMap") == 0)
|
||||||
|
name = "coretext";
|
||||||
|
else if (strcmp (type, "PangoCairoWin32FontMap") == 0)
|
||||||
|
name = "win32";
|
||||||
|
else
|
||||||
|
name = type;
|
||||||
|
|
||||||
|
gtk_label_set_label (GTK_LABEL (gen->priv->pango_fontmap), name);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
im_module_changed (GtkSettings *settings,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
GtkInspectorGeneral *gen)
|
||||||
|
{
|
||||||
|
gtk_label_set_label (GTK_LABEL (gen->priv->im_module),
|
||||||
|
_gtk_im_module_get_default_context_id ());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
init_im_module (GtkInspectorGeneral *gen)
|
||||||
|
{
|
||||||
|
GdkScreen *screen = gdk_screen_get_default ();
|
||||||
|
GtkSettings *settings = gtk_settings_get_for_screen (screen);
|
||||||
|
const char *default_context_id = _gtk_im_module_get_default_context_id ();
|
||||||
|
|
||||||
|
gtk_label_set_label (GTK_LABEL (gen->priv->im_module), default_context_id);
|
||||||
|
|
||||||
|
if (g_getenv ("GTK_IM_MODULE") != NULL)
|
||||||
|
{
|
||||||
|
/* This can't update if GTK_IM_MODULE envvar is set */
|
||||||
|
gtk_widget_set_tooltip_text (gen->priv->im_module,
|
||||||
|
_("IM Context is hardcoded by GTK_IM_MODULE"));
|
||||||
|
gtk_widget_set_sensitive (gen->priv->im_module, FALSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_signal_connect_object (settings,
|
||||||
|
"notify::gtk-im-module",
|
||||||
|
G_CALLBACK (im_module_changed),
|
||||||
|
gen, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void populate_seats (GtkInspectorGeneral *gen);
|
static void populate_seats (GtkInspectorGeneral *gen);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -670,6 +728,8 @@ gtk_inspector_general_init (GtkInspectorGeneral *gen)
|
|||||||
init_app_id (gen);
|
init_app_id (gen);
|
||||||
init_env (gen);
|
init_env (gen);
|
||||||
init_display (gen);
|
init_display (gen);
|
||||||
|
init_pango (gen);
|
||||||
|
init_im_module (gen);
|
||||||
init_gl (gen);
|
init_gl (gen);
|
||||||
init_device (gen);
|
init_device (gen);
|
||||||
}
|
}
|
||||||
@ -757,6 +817,8 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass)
|
|||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_box);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gl_box);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_version);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_version);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, pango_fontmap);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, im_module);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id_frame);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id_frame);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, app_id);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, resource_path);
|
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, resource_path);
|
||||||
|
@ -86,6 +86,74 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBoxRow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="activatable">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">horizontal</property>
|
||||||
|
<property name="margin">10</property>
|
||||||
|
<property name="spacing">40</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="pango_fontmap_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Pango Fontmap</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="valign">baseline</property>
|
||||||
|
<property name="xalign">0.0</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="pango_fontmap">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="selectable">True</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="valign">baseline</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBoxRow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="activatable">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="orientation">horizontal</property>
|
||||||
|
<property name="margin">10</property>
|
||||||
|
<property name="spacing">40</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="input_method_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Input Method</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="valign">baseline</property>
|
||||||
|
<property name="xalign">0.0</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="im_module">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="selectable">True</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="valign">baseline</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@ -650,6 +718,8 @@
|
|||||||
<widgets>
|
<widgets>
|
||||||
<widget name="gtk_version_label"/>
|
<widget name="gtk_version_label"/>
|
||||||
<widget name="gdk_backend_label"/>
|
<widget name="gdk_backend_label"/>
|
||||||
|
<widget name="pango_fontmap_label"/>
|
||||||
|
<widget name="input_method_label"/>
|
||||||
<widget name="app_id_label"/>
|
<widget name="app_id_label"/>
|
||||||
<widget name="resource_path_label"/>
|
<widget name="resource_path_label"/>
|
||||||
<widget name="gl_version_label"/>
|
<widget name="gl_version_label"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user