Exemplo n.º 1
0
static void
string_modified (GtkEntry *entry, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;
  
  g_value_init (&val, G_TYPE_STRING);
  g_value_set_static_string (&val, gtk_entry_get_text (entry));
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 2
0
static void
rgba_modified (GtkColorButton *cb, GParamSpec *ignored, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;

  g_value_init (&val, p->spec->value_type);
  g_object_get_property (G_OBJECT (cb), "rgba", &val);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 3
0
static void
bool_modified (GtkToggleButton *tb, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;

  g_value_init (&val, G_TYPE_BOOLEAN);
  g_value_set_boolean (&val, gtk_toggle_button_get_active (tb));
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 4
0
static void
double_modified (GtkAdjustment *adj, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;
  
  g_value_init (&val, G_TYPE_DOUBLE);
  g_value_set_double (&val, gtk_adjustment_get_value (adj));
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 5
0
static void
float_modified (GtkAdjustment *adj, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;
  
  g_value_init (&val, G_TYPE_FLOAT);
  g_value_set_float (&val, (float) gtk_adjustment_get_value (adj));
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 6
0
bool RealmObjectClass<T>::set_property(ContextType ctx, ObjectType object, const String &property, ValueType value) {
    auto realm_object = get_internal<T, RealmObjectClass<T>>(object);
    try {
        realm_object->set_property_value(ctx, property, value, true);
    }
    catch (InvalidPropertyException &ex) {
        return false;
    }
    return true;
}
Exemplo n.º 7
0
static void
unichar_modified (GtkEntry *entry, ObjectProperty *p)
{
  gunichar u = unichar_get_value (entry);
  GValue val = G_VALUE_INIT;

  g_value_init (&val, p->spec->value_type);
  g_value_set_uint (&val, u);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 8
0
G_GNUC_END_IGNORE_DEPRECATIONS

static void
font_modified (GtkFontChooser *fb, GParamSpec *pspec, ObjectProperty *p)
{
  GValue val = G_VALUE_INIT;

  g_value_init (&val, PANGO_TYPE_FONT_DESCRIPTION);
  g_object_get_property (G_OBJECT (fb), "font-desc", &val);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 9
0
static void
color_modified (GtkColorButton *cb, GParamSpec *ignored, ObjectProperty *p)
{
  GdkRGBA rgba;
  GdkColor color;
  GValue val = G_VALUE_INIT;

  gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (cb), &rgba);
  color.red = 65535 * rgba.red;
  color.green = 65535 * rgba.green;
  color.blue = 65535 * rgba.blue;

  g_value_init (&val, p->spec->value_type);
  g_value_set_boxed (&val, &color);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 10
0
static void
enum_modified (GtkToggleButton *button, ObjectProperty *p)
{
  gint i;
  GEnumClass *eclass;
  GValue val = G_VALUE_INIT;

  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
    return;

  eclass = G_ENUM_CLASS (g_type_class_peek (p->spec->value_type));
  i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "index"));

  g_value_init (&val, p->spec->value_type);
  g_value_set_enum (&val, eclass->values[i].value);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 11
0
static void
flags_modified (GtkCheckButton *button, ObjectProperty *p)
{
  gboolean active;
  GFlagsClass *fclass;
  guint flags;
  gint i;
  GValue val = G_VALUE_INIT;

  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
  i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "index"));
  fclass = G_FLAGS_CLASS (g_type_class_peek (p->spec->value_type));

  g_value_init (&val, p->spec->value_type);
  get_property_value (p->obj, p->spec, &val);
  flags = g_value_get_flags (&val);
  if (active)
    flags |= fclass->values[i].value;
  else
    flags &= ~fclass->values[i].value;
  g_value_set_flags (&val, flags);
  set_property_value (p->obj, p->spec, &val);
  g_value_unset (&val);
}
Exemplo n.º 12
0
void set_brightness(fleaCamera* camera, float value)
{
    set_property_value(camera, FC2_BRIGHTNESS, value);

    return;
}
Exemplo n.º 13
0
void set_gamma(fleaCamera* camera, float value)
{
    set_property_value(camera, FC2_GAMMA, value);

    return;
}