mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-05 02:09:37 +00:00
app: add stubs for gimp_prop_language_entry_new()
This commit is contained in:
parent
1b806e5fb6
commit
e2dbd56c5a
2 changed files with 118 additions and 12 deletions
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include "gimpcolorpanel.h"
|
#include "gimpcolorpanel.h"
|
||||||
#include "gimpdnd.h"
|
#include "gimpdnd.h"
|
||||||
|
#include "gimplanguageentry.h"
|
||||||
#include "gimpscalebutton.h"
|
#include "gimpscalebutton.h"
|
||||||
#include "gimpview.h"
|
#include "gimpview.h"
|
||||||
#include "gimppropwidgets.h"
|
#include "gimppropwidgets.h"
|
||||||
|
@ -615,18 +616,19 @@ static void gimp_prop_number_pair_entry_number_pair_user_override_notify
|
||||||
*
|
*
|
||||||
* Return value: A #GimpNumberPairEntry widget.
|
* Return value: A #GimpNumberPairEntry widget.
|
||||||
*/
|
*/
|
||||||
GtkWidget * gimp_prop_number_pair_entry_new (GObject *config,
|
GtkWidget *
|
||||||
const gchar *left_number_property,
|
gimp_prop_number_pair_entry_new (GObject *config,
|
||||||
const gchar *right_number_property,
|
const gchar *left_number_property,
|
||||||
const gchar *default_left_number_property,
|
const gchar *right_number_property,
|
||||||
const gchar *default_right_number_property,
|
const gchar *default_left_number_property,
|
||||||
const gchar *user_override_property,
|
const gchar *default_right_number_property,
|
||||||
gboolean connect_numbers_changed,
|
const gchar *user_override_property,
|
||||||
gboolean connect_ratio_changed,
|
gboolean connect_numbers_changed,
|
||||||
const gchar *separators,
|
gboolean connect_ratio_changed,
|
||||||
gboolean allow_simplification,
|
const gchar *separators,
|
||||||
gdouble min_valid_value,
|
gboolean allow_simplification,
|
||||||
gdouble max_valid_value)
|
gdouble min_valid_value,
|
||||||
|
gdouble max_valid_value)
|
||||||
{
|
{
|
||||||
GimpPropNumberPairEntryData *data;
|
GimpPropNumberPairEntryData *data;
|
||||||
GtkWidget *number_pair_entry;
|
GtkWidget *number_pair_entry;
|
||||||
|
@ -819,6 +821,105 @@ gimp_prop_number_pair_entry_number_pair_user_override_notify (GtkWidget
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************/
|
||||||
|
/* language entry */
|
||||||
|
/********************/
|
||||||
|
|
||||||
|
static void gimp_prop_language_entry_callback (GtkWidget *entry,
|
||||||
|
GObject *config);
|
||||||
|
static void gimp_prop_language_entry_notify (GObject *config,
|
||||||
|
GParamSpec *param_spec,
|
||||||
|
GtkWidget *entry);
|
||||||
|
|
||||||
|
GtkWidget *
|
||||||
|
gimp_prop_language_entry_new (GObject *config,
|
||||||
|
const gchar *property_name)
|
||||||
|
{
|
||||||
|
GParamSpec *param_spec;
|
||||||
|
GtkWidget *entry;
|
||||||
|
gchar *value;
|
||||||
|
|
||||||
|
param_spec = check_param_spec_w (config, property_name,
|
||||||
|
G_TYPE_PARAM_STRING, G_STRFUNC);
|
||||||
|
if (! param_spec)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
entry = gimp_language_entry_new ();
|
||||||
|
|
||||||
|
g_object_get (config,
|
||||||
|
property_name, &value,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
gtk_entry_set_text (GTK_ENTRY (entry), value);
|
||||||
|
g_free (value);
|
||||||
|
|
||||||
|
set_param_spec (G_OBJECT (entry), entry, param_spec);
|
||||||
|
|
||||||
|
g_signal_connect (entry, "changed",
|
||||||
|
G_CALLBACK (gimp_prop_language_entry_callback),
|
||||||
|
config);
|
||||||
|
|
||||||
|
connect_notify (config, property_name,
|
||||||
|
G_CALLBACK (gimp_prop_language_entry_notify),
|
||||||
|
entry);
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_prop_language_entry_callback (GtkWidget *entry,
|
||||||
|
GObject *config)
|
||||||
|
{
|
||||||
|
GParamSpec *param_spec;
|
||||||
|
const gchar *text;
|
||||||
|
|
||||||
|
param_spec = get_param_spec (G_OBJECT (entry));
|
||||||
|
if (! param_spec)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||||
|
|
||||||
|
g_signal_handlers_block_by_func (config,
|
||||||
|
gimp_prop_language_entry_notify,
|
||||||
|
entry);
|
||||||
|
|
||||||
|
g_object_set (config,
|
||||||
|
param_spec->name, text,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
g_signal_handlers_unblock_by_func (config,
|
||||||
|
gimp_prop_language_entry_notify,
|
||||||
|
entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_prop_language_entry_notify (GObject *config,
|
||||||
|
GParamSpec *param_spec,
|
||||||
|
GtkWidget *entry)
|
||||||
|
{
|
||||||
|
gchar *value;
|
||||||
|
|
||||||
|
g_object_get (config,
|
||||||
|
param_spec->name, &value,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
g_signal_handlers_block_by_func (entry,
|
||||||
|
gimp_prop_language_entry_callback,
|
||||||
|
config);
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
gtk_entry_set_text (GTK_ENTRY (entry), value ? value : "");
|
||||||
|
|
||||||
|
g_signal_handlers_unblock_by_func (entry,
|
||||||
|
gimp_prop_language_entry_callback,
|
||||||
|
config);
|
||||||
|
|
||||||
|
g_free (value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********/
|
/***********/
|
||||||
/* table */
|
/* table */
|
||||||
/***********/
|
/***********/
|
||||||
|
|
|
@ -78,6 +78,11 @@ GtkWidget * gimp_prop_number_pair_entry_new
|
||||||
gdouble min_valid_value,
|
gdouble min_valid_value,
|
||||||
gdouble max_valid_value);
|
gdouble max_valid_value);
|
||||||
|
|
||||||
|
/* GParamString */
|
||||||
|
|
||||||
|
GtkWidget * gimp_prop_language_entry_new (GObject *config,
|
||||||
|
const gchar *property_name);
|
||||||
|
|
||||||
|
|
||||||
/* A view on all of an object's properties */
|
/* A view on all of an object's properties */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue