Intern property proxy hint strings statically
This commit is contained in:
parent
31dabca224
commit
4d2968a0cc
1 changed files with 11 additions and 9 deletions
|
@ -38,6 +38,8 @@
|
||||||
#define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation
|
#define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define I_ g_intern_static_string
|
||||||
|
|
||||||
static void
|
static void
|
||||||
proxy_toggle_button_toggled_cb (GtkToggleButton* button,
|
proxy_toggle_button_toggled_cb (GtkToggleButton* button,
|
||||||
GObject* object)
|
GObject* object)
|
||||||
|
@ -510,7 +512,7 @@ katze_property_proxy (gpointer object,
|
||||||
type = G_PARAM_SPEC_TYPE (pspec);
|
type = G_PARAM_SPEC_TYPE (pspec);
|
||||||
nick = g_param_spec_get_nick (pspec);
|
nick = g_param_spec_get_nick (pspec);
|
||||||
_hint = g_intern_string (hint);
|
_hint = g_intern_string (hint);
|
||||||
if (_hint == g_intern_string ("blurb"))
|
if (_hint == I_("blurb"))
|
||||||
nick = g_param_spec_get_blurb (pspec);
|
nick = g_param_spec_get_blurb (pspec);
|
||||||
string = NULL;
|
string = NULL;
|
||||||
if (type == G_TYPE_PARAM_BOOLEAN)
|
if (type == G_TYPE_PARAM_BOOLEAN)
|
||||||
|
@ -519,7 +521,7 @@ katze_property_proxy (gpointer object,
|
||||||
gboolean toggled = katze_object_get_boolean (object, property);
|
gboolean toggled = katze_object_get_boolean (object, property);
|
||||||
|
|
||||||
#ifdef HAVE_HILDON_2_2
|
#ifdef HAVE_HILDON_2_2
|
||||||
if (_hint != g_intern_string ("toggle"))
|
if (_hint != I_("toggle"))
|
||||||
{
|
{
|
||||||
widget = hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
|
widget = hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
|
||||||
gtk_button_set_label (GTK_BUTTON (widget), gettext (nick));
|
gtk_button_set_label (GTK_BUTTON (widget), gettext (nick));
|
||||||
|
@ -529,7 +531,7 @@ katze_property_proxy (gpointer object,
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
widget = gtk_check_button_new ();
|
widget = gtk_check_button_new ();
|
||||||
if (_hint == g_intern_string ("toggle"))
|
if (_hint == I_("toggle"))
|
||||||
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (widget), FALSE);
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (widget), FALSE);
|
||||||
else
|
else
|
||||||
gtk_button_set_label (GTK_BUTTON (widget), gettext (nick));
|
gtk_button_set_label (GTK_BUTTON (widget), gettext (nick));
|
||||||
|
@ -544,7 +546,7 @@ katze_property_proxy (gpointer object,
|
||||||
G_CALLBACK (proxy_widget_boolean_destroy_cb), object);
|
G_CALLBACK (proxy_widget_boolean_destroy_cb), object);
|
||||||
g_free (notify_property);
|
g_free (notify_property);
|
||||||
}
|
}
|
||||||
else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("file"))
|
else if (type == G_TYPE_PARAM_STRING && _hint == I_("file"))
|
||||||
{
|
{
|
||||||
string = katze_object_get_string (object, property);
|
string = katze_object_get_string (object, property);
|
||||||
|
|
||||||
|
@ -559,7 +561,7 @@ katze_property_proxy (gpointer object,
|
||||||
g_signal_connect (widget, "selection-changed",
|
g_signal_connect (widget, "selection-changed",
|
||||||
G_CALLBACK (proxy_file_file_set_cb), object);
|
G_CALLBACK (proxy_file_file_set_cb), object);
|
||||||
}
|
}
|
||||||
else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("folder"))
|
else if (type == G_TYPE_PARAM_STRING && _hint == I_("folder"))
|
||||||
{
|
{
|
||||||
string = katze_object_get_string (object, property);
|
string = katze_object_get_string (object, property);
|
||||||
|
|
||||||
|
@ -573,7 +575,7 @@ katze_property_proxy (gpointer object,
|
||||||
g_signal_connect (widget, "selection-changed",
|
g_signal_connect (widget, "selection-changed",
|
||||||
G_CALLBACK (proxy_folder_file_set_cb), object);
|
G_CALLBACK (proxy_folder_file_set_cb), object);
|
||||||
}
|
}
|
||||||
else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("uri"))
|
else if (type == G_TYPE_PARAM_STRING && _hint == I_("uri"))
|
||||||
{
|
{
|
||||||
string = katze_object_get_string (object, property);
|
string = katze_object_get_string (object, property);
|
||||||
|
|
||||||
|
@ -592,14 +594,14 @@ katze_property_proxy (gpointer object,
|
||||||
G_CALLBACK (proxy_uri_file_set_cb), object);
|
G_CALLBACK (proxy_uri_file_set_cb), object);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (type == G_TYPE_PARAM_STRING && (_hint == g_intern_string ("font")
|
else if (type == G_TYPE_PARAM_STRING && (_hint == I_("font")
|
||||||
|| _hint == g_intern_string ("font-monospace")))
|
|| _hint == I_("font-monospace")))
|
||||||
{
|
{
|
||||||
GtkComboBox* combo;
|
GtkComboBox* combo;
|
||||||
gint n_families, i;
|
gint n_families, i;
|
||||||
PangoContext* context;
|
PangoContext* context;
|
||||||
PangoFontFamily** families;
|
PangoFontFamily** families;
|
||||||
gboolean monospace = _hint == g_intern_string ("font-monospace");
|
gboolean monospace = _hint == I_("font-monospace");
|
||||||
string = katze_object_get_string (object, property);
|
string = katze_object_get_string (object, property);
|
||||||
|
|
||||||
widget = gtk_combo_box_new_text ();
|
widget = gtk_combo_box_new_text ();
|
||||||
|
|
Loading…
Reference in a new issue