static void
set_property(GObject*      obj,
             guint         prop,
             const GValue* val,
             GParamSpec*   pspec)
{
    GtChannelsViewChild* self = GT_CHANNELS_VIEW_CHILD(obj);
    GtChannelsViewChildPrivate* priv = gt_channels_view_child_get_instance_private(self);

    switch (prop)
    {
        case PROP_CHANNEL:
            priv->channel = g_value_ref_sink_object(val);
            break;
        default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop, pspec);
    }
}
Пример #2
0
static void
set_property(GObject*      obj,
             guint         prop,
             const GValue* val,
             GParamSpec*   pspec)
{
    GtGame* self = GT_GAME(obj);
    GtGamePrivate* priv = gt_game_get_instance_private(self);

    switch (prop)
    {
        case PROP_ID:
            priv->id = g_value_get_int64(val);
            break;
        case PROP_NAME:
            if (priv->name)
                g_free(priv->name);
            priv->name = g_value_dup_string(val);
            if (!priv->name)
                priv->name = "Untitled broadcast";
            break;
        case PROP_PREVIEW:
            if (priv->preview)
                g_object_unref(priv->preview);
            priv->preview = g_value_ref_sink_object(val);
            utils_pixbuf_scale_simple(&priv->preview,
                                      200, 270,
                                      GDK_INTERP_BILINEAR);
            break;
        case PROP_LOGO:
            if (priv->logo)
                g_object_unref(priv->logo);
            priv->logo = g_value_dup_object(val);
            break;
        case PROP_VIEWERS:
            priv->viewers = g_value_get_int64(val);
            break;
        case PROP_CHANNELS:
            priv->channels = g_value_get_int64(val);
            break;
        default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop, pspec);
    }
}
static void
set_property(GObject*      obj,
             guint         prop,
             const GValue* val,
             GParamSpec*   pspec)
{
    GtGamesViewChild* self = GT_GAMES_VIEW_CHILD(obj);
    GtGamesViewChildPrivate* priv = gt_games_view_child_get_instance_private(self);

    switch (prop)
    {
    case PROP_GAME:
        if (priv->game)
            g_object_unref(priv->game);
        priv->game = g_value_ref_sink_object(val);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop, pspec);
    }
}