Exemple #1
0
static void
gpview_device_ctrl_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
    GPViewDeviceCtrl *view = GPVIEW_DEVICE_CTRL(object);

    if (view != NULL)
    {
        switch (property_id)
        {
            case GPVIEW_DEVICE_CTRL_CURRENT_VIEW:
                g_value_take_object(value, gpview_device_ctrl_get_current_view(view));
                break;

            case GPVIEW_DEVICE_CTRL_DATABASE:
                g_value_take_object(value, gpview_device_ctrl_get_database(view));
                break;

            case GPVIEW_DEVICE_CTRL_FORM_FACTORY:
                g_value_take_object(value, gpview_device_ctrl_get_form_factory(view));
                break;

            case GPVIEW_DEVICE_CTRL_UI_MANAGER:
                g_value_take_object(value, gpview_device_ctrl_get_ui_manager(view));
                break;

            default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
        }
    }
}
static void
_get_property (GObject * object, guint property_id,
    GValue * value, GParamSpec * pspec)
{
  GESTimelineElement *self = GES_TIMELINE_ELEMENT (object);

  switch (property_id) {
    case PROP_PARENT:
      g_value_take_object (value, self->parent);
      break;
    case PROP_TIMELINE:
      g_value_take_object (value, self->timeline);
      break;
    case PROP_START:
      g_value_set_uint64 (value, self->start);
      break;
    case PROP_INPOINT:
      g_value_set_uint64 (value, self->inpoint);
      break;
    case PROP_DURATION:
      g_value_set_uint64 (value, self->duration);
      break;
    case PROP_MAX_DURATION:
      g_value_set_uint64 (value, self->maxduration);
      break;
    case PROP_PRIORITY:
      g_value_set_uint (value, self->priority);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec);
  }
}
Exemple #3
0
static void
gst_rtsp_server_get_property (GObject * object, guint propid,
    GValue * value, GParamSpec * pspec)
{
  GstRTSPServer *server = GST_RTSP_SERVER (object);

  switch (propid) {
    case PROP_ADDRESS:
      g_value_take_string (value, gst_rtsp_server_get_address (server));
      break;
    case PROP_SERVICE:
      g_value_take_string (value, gst_rtsp_server_get_service (server));
      break;
    case PROP_BACKLOG:
      g_value_set_int (value, gst_rtsp_server_get_backlog (server));
      break;
    case PROP_SESSION_POOL:
      g_value_take_object (value, gst_rtsp_server_get_session_pool (server));
      break;
    case PROP_MEDIA_MAPPING:
      g_value_take_object (value, gst_rtsp_server_get_media_mapping (server));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
  }
}
Exemple #4
0
static void _vala_soy_joints_hinge_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyjointsHinge * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_JOINTS_TYPE_HINGE, soyjointsHinge);
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	switch (property_id) {
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		case SOY_JOINTS_HINGE_ANCHOR:
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_value_take_object (value, soy_joints_hinge_get_anchor (self));
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		break;
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		case SOY_JOINTS_HINGE_AXIS:
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_value_take_object (value, soy_joints_hinge_get_axis (self));
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		break;
#line 1042 "Hinge.c"
		default:
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		break;
#line 1048 "Hinge.c"
	}
}
Exemple #5
0
static void
mud_character_get_property (GObject    *object,
                            guint       prop_id,
                            GValue     *value,
                            GParamSpec *pspec)
{
  MudCharacter *self = MUD_CHARACTER (object);

  switch (prop_id)
    {
    case PROP_ID:
      g_value_set_string (value, self->id);
      break;

    case PROP_PROFILE:
      g_value_take_object (value, self->profile);
      break;

    case PROP_MUD:
      g_value_take_object (value, G_OBJECT (mud_character_get_mud(self)));
      break;

    case PROP_NAME:
      g_value_set_string (value, mud_character_get_name (self));
      break;

    case PROP_CONNECT_STRING:
      g_value_set_string (value, mud_character_get_connect_string (self));
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
    }
}
Exemple #6
0
static void _vala_soy_bodies_light_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soybodiesLight * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_BODIES_TYPE_LIGHT, soybodiesLight);
	switch (property_id) {
		case SOY_BODIES_LIGHT_AMBIENT:
		g_value_take_object (value, soy_bodies_light_get_ambient (self));
		break;
		case SOY_BODIES_LIGHT_DIFFUSE:
		g_value_take_object (value, soy_bodies_light_get_diffuse (self));
		break;
		case SOY_BODIES_LIGHT_SPECULAR:
		g_value_take_object (value, soy_bodies_light_get_specular (self));
		break;
		case SOY_BODIES_LIGHT_RADIUS:
		g_value_set_float (value, soy_bodies_light_get_radius (self));
		break;
		case SOY_BODIES_LIGHT_SIZE:
		g_value_set_float (value, soy_bodies_light_get_size (self));
		break;
		case SOY_BODIES_LIGHT_TEXTURE:
		g_value_set_object (value, soy_bodies_light_get_texture (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
Exemple #7
0
static void _vala_soy_joints_hinge_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyjointsHinge * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_JOINTS_TYPE_HINGE, soyjointsHinge);
	switch (property_id) {
		case SOY_JOINTS_HINGE_ANCHOR:
		g_value_take_object (value, soy_joints_hinge_get_anchor (self));
		break;
		case SOY_JOINTS_HINGE_AXIS:
		g_value_take_object (value, soy_joints_hinge_get_axis (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
Exemple #8
0
static void
gpform_factory_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
    GPFormFactory *factory = GPFORM_FACTORY(object);

    if (factory != NULL)
    {
        switch (property_id)
        {
            case GPFORM_FACTORY_DIALOG_PARENT:
                g_value_take_object(value, gpform_factory_get_dialog_parent(factory));
                break;

            case GPFORM_FACTORY_FORM_ID:
                g_value_take_string(value, gpform_factory_get_form_id(factory));
                break;

            case GPFORM_FACTORY_IMAGE_PATH:
                g_value_take_string(value, gpform_factory_get_image_path(factory));
                break;

            case GPFORM_FACTORY_XML_PATH:
                g_value_take_string(value, gpform_factory_get_xml_path(factory));
                break;

            default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
        }
    }
}
Exemple #9
0
static void
gnm_soi_get_property (GObject     *object,
		      guint        property_id,
		      GValue      *value,
		      GParamSpec  *pspec)
{
	SheetObjectImage *soi = GNM_SO_IMAGE (object);
	GdkPixbuf *pixbuf;

	switch (property_id) {
	case PROP_IMAGE_TYPE:
		g_value_set_string (value, soi->type);
		break;
	case PROP_IMAGE:
		g_value_set_object (value, soi->image);
		break;
	case PROP_PIXBUF:
		pixbuf = go_image_get_pixbuf (soi->image);
		g_value_take_object (value, pixbuf);
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
void
gegl_operation_context_take_object (GeglOperationContext *context,
                                    const gchar          *padname,
                                    GObject              *data)
{
  GParamSpec *pspec;

  /* FIXME: check that there isn't already an existing
   *        output object/value set?
   */

  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (context->operation)), padname);

  if (pspec)
    {
      GValue value = {0, };
      g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));

      g_value_take_object (&value, data);
      gegl_operation_context_set_property (context, padname, &value);

      g_value_unset (&value);
    }
  else
    {
      g_warning ("%s: No paramspec found for pad '%s' on \"%s\"\n",
                 G_STRFUNC,
                 padname,
                 gegl_operation_get_name (context->operation));
    }
}
static void
mud_telnet_mssp_get_property(GObject *object,
                             guint prop_id,
                             GValue *value,
                             GParamSpec *pspec)
{
    MudTelnetMssp *self;

    self = MUD_TELNET_MSSP(object);

    switch(prop_id)
    {
        case PROP_ENABLED:
            g_value_set_boolean(value, self->priv->enabled);
            break;

        case PROP_HANDLES_OPTION:
            g_value_set_int(value, self->priv->option);
            break;

        case PROP_TELNET:
            g_value_take_object(value, self->priv->telnet);
            break;

        case PROP_MSSP:
            g_value_set_pointer(value, self->priv->mssp_data);
            break;

        default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
            break;
    }
}
Exemple #12
0
static gboolean
clutter_behaviour_path_parse_custom_node (ClutterScriptable *scriptable,
                                          ClutterScript     *script,
                                          GValue            *value,
                                          const gchar       *name,
                                          JsonNode          *node)
{
  if (strcmp ("path", name) == 0)
    {
      ClutterPath *path;
      GValue node_value = { 0 };

      path = g_object_ref_sink (clutter_path_new ());

      json_node_get_value (node, &node_value);

      if (!G_VALUE_HOLDS (&node_value, G_TYPE_STRING)
          || !clutter_path_set_description (path,
                                            g_value_get_string (&node_value)))
        g_warning ("Invalid path description");

      g_value_unset (&node_value);

      g_value_init (value, G_TYPE_OBJECT);
      g_value_take_object (value, path);

      return TRUE;
    }
  /* chain up */
  else if (parent_scriptable_iface->parse_custom_node)
    return parent_scriptable_iface->parse_custom_node (scriptable, script,
                                                       value, name, node);
  else
    return FALSE;
}
Exemple #13
0
/* Note that g_value_set_object() refs the object, as does
 * g_object_get(). But g_object_get() only unrefs once when it disgorges
 * the object, leaving an unbalanced ref, which leaks. So instead of
 * using g_value_set_object(), use g_value_take_object() which doesn't
 * ref the object when used in get_property().
 */
static void
gctt_get_property (GObject    *object,
                   guint       param_id,
                   GValue     *value,
                   GParamSpec *pspec)
{
    GncCombott *combott = GNC_COMBOTT (object);
    GncCombottPrivate *priv = GNC_COMBOTT_GET_PRIVATE (combott);

    switch (param_id)
    {
    case PROP_MODEL:
        g_value_take_object (value, priv->model);
        break;

    case PROP_ACTIVE:
        g_value_set_int (value, gnc_combott_get_active (combott));
        break;

    case PROP_TEXT_COL:
        g_value_set_int (value, priv->text_col);
        break;

    case PROP_TIP_COL:
        g_value_set_int (value, priv->tip_col);
        break;

    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
        break;
    }
}
static void
mud_window_prefs_get_property(GObject *object,
                              guint prop_id,
                              GValue *value,
                              GParamSpec *pspec)
{
    MudWindowPrefs *self;

    self = MUD_WINDOW_PREFS(object);

    switch(prop_id)
    {
        case PROP_PARENT:
            g_value_take_object(value, self->priv->parent);
            break;

        case PROP_NAME:
            g_value_set_string(value, self->priv->name);
            break;

        default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
            break;
    }
}
Exemple #15
0
static void _vala_soy_fields_wind_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyfieldsWind * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_FIELDS_TYPE_WIND, soyfieldsWind);
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	switch (property_id) {
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		case SOY_FIELDS_WIND_WIND:
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		g_value_take_object (value, soy_fields_wind_get_wind (self));
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		break;
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		case SOY_FIELDS_WIND_VISCOSITY:
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		g_value_set_float (value, soy_fields_wind_get_viscosity (self));
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		break;
#line 759 "Wind.c"
		default:
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 25 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		break;
#line 765 "Wind.c"
	}
}
void
gimp_gegl_config_proxy_sync (GimpObject  *proxy,
                             GeglNode    *node)
{
  GParamSpec **pspecs;
  gchar       *operation;
  guint        n_pspecs;
  gint         i;

  g_return_if_fail (GIMP_IS_OBJECT (proxy));
  g_return_if_fail (GEGL_IS_NODE (node));

  gegl_node_get (node,
                 "operation", &operation,
                 NULL);

  g_return_if_fail (operation != NULL);

  pspecs = gegl_operation_list_properties (operation, &n_pspecs);
  g_free (operation);

  for (i = 0; i < n_pspecs; i++)
    {
      GParamSpec *gegl_pspec = pspecs[i];
      GParamSpec *gimp_pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (proxy),
                                                             gegl_pspec->name);

      if (gimp_pspec)
        {
          GValue value = { 0, };

          g_value_init (&value, gimp_pspec->value_type);

          g_object_get_property (G_OBJECT (proxy), gimp_pspec->name,
                                 &value);

          if (GEGL_IS_PARAM_SPEC_COLOR (gegl_pspec))
            {
              GimpRGB    gimp_color;
              GeglColor *gegl_color;

              gimp_value_get_rgb (&value, &gimp_color);
              g_value_unset (&value);

              gegl_color = gimp_gegl_color_new (&gimp_color);

              g_value_init (&value, gegl_pspec->value_type);
              g_value_take_object (&value, gegl_color);
            }

          gegl_node_set_property (node, gegl_pspec->name,
                                  &value);

          g_value_unset (&value);
        }
    }

  g_free (pspecs);
}
static void
gtk_menu_tracker_item_get_property (GObject    *object,
                                    guint       prop_id,
                                    GValue     *value,
                                    GParamSpec *pspec)
{
    GtkMenuTrackerItem *self = GTK_MENU_TRACKER_ITEM (object);

    switch (prop_id)
    {
    case PROP_IS_SEPARATOR:
        g_value_set_boolean (value, gtk_menu_tracker_item_get_is_separator (self));
        break;
    case PROP_LABEL:
        g_value_set_string (value, gtk_menu_tracker_item_get_label (self));
        break;
    case PROP_ICON:
        g_value_take_object (value, gtk_menu_tracker_item_get_icon (self));
        break;
    case PROP_VERB_ICON:
        g_value_take_object (value, gtk_menu_tracker_item_get_verb_icon (self));
        break;
    case PROP_SENSITIVE:
        g_value_set_boolean (value, gtk_menu_tracker_item_get_sensitive (self));
        break;
    case PROP_ROLE:
        g_value_set_enum (value, gtk_menu_tracker_item_get_role (self));
        break;
    case PROP_TOGGLED:
        g_value_set_boolean (value, gtk_menu_tracker_item_get_toggled (self));
        break;
    case PROP_ACCEL:
        g_value_set_string (value, gtk_menu_tracker_item_get_accel (self));
        break;
    case PROP_SUBMENU_SHOWN:
        g_value_set_boolean (value, gtk_menu_tracker_item_get_submenu_shown (self));
        break;
    case PROP_IS_VISIBLE:
        g_value_set_boolean (value, gtk_menu_tracker_item_get_is_visible (self));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}
static GArray*
inf_adopted_session_get_xml_user_props(InfSession* session,
                                       InfXmlConnection* conn,
                                       const xmlNodePtr xml)
{
  GArray* array;
  GParameter* parameter;
  InfAdoptedStateVector* vector;
  xmlChar* time;

  array = INF_SESSION_CLASS(parent_class)->get_xml_user_props(
    session,
    conn,
    xml
  );

  /* Vector time */
  time = inf_xml_util_get_attribute(xml, "time");
  if(time != NULL)
  {
    vector = inf_adopted_state_vector_from_string((const gchar*)time, NULL);
    xmlFree(time);

    /* TODO: Error reporting for get_xml_user_props */
    if(vector != NULL)
    {
      parameter = inf_session_get_user_property(array, "vector");
      g_value_init(&parameter->value, INF_ADOPTED_TYPE_STATE_VECTOR);
      g_value_take_boxed(&parameter->value, vector);
    }
  }

  /* log-begin is not in the  spec */
#if 0
  /* Initial request log, only if ID is also given */
  id_param = inf_session_lookup_user_property(
    (const GParameter*)array->data,
    array->len,
    "id"
  );

  if(id_param != NULL &&
     inf_xml_util_get_attribute_uint(xml, "log-begin", &log_begin, NULL))
  {
    log = inf_adopted_request_log_new(
      g_value_get_uint(&id_param->value),
      log_begin
    );

    parameter = inf_session_get_user_property(array, "request-log");
    g_value_init(&parameter->value, INF_ADOPTED_TYPE_REQUEST_LOG);
    g_value_take_object(&parameter->value, log);
  }
#endif

  return array;
}
Exemple #19
0
static void _vala_soy_joints_universal_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soyjointsUniversal * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_JOINTS_TYPE_UNIVERSAL, soyjointsUniversal);
	switch (property_id) {
		case SOY_JOINTS_UNIVERSAL_ANCHOR:
		g_value_take_object (value, soy_joints_universal_get_anchor (self));
		break;
		case SOY_JOINTS_UNIVERSAL_AXIS1:
		g_value_take_object (value, soy_joints_universal_get_axis1 (self));
		break;
		case SOY_JOINTS_UNIVERSAL_AXIS2:
		g_value_take_object (value, soy_joints_universal_get_axis2 (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
Exemple #20
0
static void
dax_value_transform_string_knot_sequence (const GValue *src,
                                          GValue       *dest)
{
    DaxKnotSequence *seq;

    seq = dax_knot_sequence_new_from_string (g_value_get_string (src));

    g_value_take_object (dest, seq);
}
static void
gpartsui_result_controller_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
    GPartsUIResultController *controller = GPARTSUI_RESULT_CONTROLLER(object);

    switch (property_id)
    {
        case GPARTSUI_RESULT_CONTROLLER_MODEL:
            g_value_take_object(value, gpartsui_result_controller_get_model(controller));
            break;

        case GPARTSUI_RESULT_CONTROLLER_VIEW:
            g_value_take_object(value, gpartsui_result_controller_get_view(controller));
            break;

        default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
    }
}
static void
miscui_action_controller_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
    MiscUIActionController *controller = MISCUI_ACTION_CONTROLLER(object);

    switch (property_id)
    {
    case MISCUI_ACTION_CONTROLLER_ACTION:
        g_value_take_object(value, miscui_action_controller_get_action(controller));
        break;

    case MISCUI_ACTION_CONTROLLER_MODEL:
        g_value_take_object(value, miscui_action_controller_get_model(controller));
        break;

    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
    }
}
static void
gimp_gegl_tool_map (GimpImageMapTool *image_map_tool)
{
  GimpGeglTool  *tool = GIMP_GEGL_TOOL (image_map_tool);
  GParamSpec   **pspecs;
  guint          n_pspecs;
  gint           i;

  if (! tool->config)
    return;

  pspecs = gegl_list_properties (tool->operation, &n_pspecs);

  for (i = 0; i < n_pspecs; i++)
    {
      GParamSpec *gegl_pspec = pspecs[i];
      GParamSpec *gimp_pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool->config),
                                                             gegl_pspec->name);

      if (gimp_pspec)
        {
          GValue value = { 0, };

          g_value_init (&value, gimp_pspec->value_type);

          g_object_get_property (G_OBJECT (tool->config), gimp_pspec->name,
                                 &value);

          if (GIMP_IS_PARAM_SPEC_RGB (gimp_pspec))
            {
              GeglColor *gegl_color = gegl_color_new (NULL);
              GimpRGB    gimp_color;

              gimp_value_get_rgb (&value, &gimp_color);
              g_value_unset (&value);

              gegl_color_set_rgba (gegl_color,
                                   gimp_color.r,
                                   gimp_color.g,
                                   gimp_color.b,
                                   gimp_color.a);

              g_value_init (&value, gegl_pspec->value_type);
              g_value_take_object (&value, gegl_color);
            }

          gegl_node_set_property (image_map_tool->operation, gegl_pspec->name,
                                  &value);

          g_value_unset (&value);
        }
    }

  g_free (pspecs);
}
Exemple #24
0
/* Note that g_value_set_object() refs the object, as does
 * g_object_get(). But g_object_get() only unrefs once when it disgorges
 * the object, leaving an unbalanced ref, which leaks. So instead of
 * using g_value_set_object(), use g_value_take_object() which doesn't
 * ref the object when used in get_property().
 */
static void
gnucash_cursor_get_property (GObject         *object,
                             guint            prop_id,
                             GValue          *value,
                             GParamSpec      *pspec)
{
    GnucashCursor *cursor = GNUCASH_CURSOR (object);

    switch (prop_id)
    {
    case PROP_SHEET:
        g_value_take_object (value, cursor->sheet);
        break;
    case PROP_GRID:
        g_value_take_object (value, cursor->grid);
        break;
    default:
        break;
    }
}
/* Note that g_value_set_object() refs the object, as does
 * g_object_get(). But g_object_get() only unrefs once when it disgorges
 * the object, leaving an unbalanced ref, which leaks. So instead of
 * using g_value_set_object(), use g_value_take_object() which doesn't
 * ref the object when used in get_property().
 */
static void
qof_instance_get_property (GObject         *object,
                           guint            prop_id,
                           GValue          *value,
                           GParamSpec      *pspec)
{
    QofInstance *inst;
    QofInstancePrivate *priv;

    g_return_if_fail(QOF_IS_INSTANCE(object));

    inst = QOF_INSTANCE(object);
    priv = GET_PRIVATE(inst);

    switch (prop_id)
    {
    case PROP_GUID:
        g_value_set_boxed(value, &priv->guid);
        break;
    case PROP_COLLECTION:
        g_value_set_pointer(value, priv->collection);
        break;
    case PROP_BOOK:
        g_value_take_object(value, priv->book);
        break;
    case PROP_LAST_UPDATE:
        g_value_set_pointer(value, &priv->last_update);
        break;
    case PROP_EDITLEVEL:
        g_value_set_int(value, priv->editlevel);
        break;
    case PROP_DESTROYING:
        g_value_set_boolean(value, priv->do_free);
        break;
    case PROP_DIRTY:
        g_value_set_boolean(value, qof_instance_get_dirty(inst));
        break;
    case PROP_INFANT:
        g_value_set_boolean(value, priv->infant);
        break;
    case PROP_VERSION:
        g_value_set_int(value, priv->version);
        break;
    case PROP_VERSION_CHECK:
        g_value_set_uint(value, priv->version_check);
        break;
    case PROP_IDATA:
        g_value_set_uint(value, priv->idata);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}
static void _vala_sample_vala_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	SampleValaPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SAMPLE_VALA_PLUGIN, SampleValaPlugin);
	switch (property_id) {
		case SAMPLE_VALA_PLUGIN_OBJECT:
		g_value_take_object (value, sample_vala_plugin_real_get_object ((PeasActivatable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
static GTokenType
gimp_config_deserialize_object (GValue     *value,
                                GimpConfig *config,
                                GParamSpec *prop_spec,
                                GScanner   *scanner,
                                gint        nest_level)
{
  GimpConfigInterface *config_iface;
  GimpConfig          *prop_object;

  g_object_get_property (G_OBJECT (config), prop_spec->name, value);

  prop_object = g_value_get_object (value);

  if (! prop_object)
    {
      /*  if the object property is not GIMP_CONFIG_PARAM_AGGREGATE, read
       *  the type of the object and create it
       */
      if (! (prop_spec->flags & GIMP_CONFIG_PARAM_AGGREGATE))
        {
          gchar *type_name;
          GType  type;

          if (! gimp_scanner_parse_string (scanner, &type_name))
            return G_TOKEN_STRING;

          type = g_type_from_name (type_name);
          g_free (type_name);

          if (! g_type_is_a (type, prop_spec->value_type))
            return G_TOKEN_STRING;

          prop_object = g_object_new (type, NULL);

          g_value_take_object (value, prop_object);
        }
      else
        {
          return G_TOKEN_RIGHT_PAREN;
        }
    }

  config_iface = GIMP_CONFIG_GET_INTERFACE (prop_object);

  if (! config_iface)
    return gimp_config_deserialize_any (value, prop_spec, scanner);

  if (! config_iface->deserialize (prop_object, scanner, nest_level + 1, NULL))
    return G_TOKEN_NONE;

  return G_TOKEN_RIGHT_PAREN;
}
Exemple #28
0
static void _vala_soy_controllers_pointer_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	soycontrollersPointer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOY_CONTROLLERS_TYPE_POINTER, soycontrollersPointer);
	switch (property_id) {
		case SOY_CONTROLLERS_POINTER_POSITION:
		g_value_take_object (value, soy_controllers_pointer_get_position (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
static void _vala_rotation_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	RotationPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_ROTATION_PLUGIN, RotationPlugin);
	switch (property_id) {
		case ROTATION_PLUGIN_OBJECT:
		g_value_take_object (value, rotation_plugin_real_get_object ((PeasActivatable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
Exemple #30
0
void
gegl_operation_context_take_object (GeglOperationContext *context,
                                    const gchar          *padname,
                                    GObject              *data)
{
  GValue *storage;

  g_return_if_fail (context != NULL);
  g_return_if_fail (!data || GEGL_IS_BUFFER (data));

  storage = gegl_operation_context_add_value (context, padname);
  g_value_take_object (storage, data);
}