static void gog_ring_plot_set_property (GObject *obj, guint param_id, GValue const *value, GParamSpec *pspec) { GogRingPlot *ring = GOG_RING_PLOT (obj); switch (param_id) { case RING_PLOT_PROP_CENTER_SIZE: ring->center_size = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec); return; /* NOTE : RETURN */ } /* none of the attributes triggers a size change yet. * When we add data labels we'll need it */ gog_object_emit_changed (GOG_OBJECT (obj), FALSE); }
static void mx_path_bar_button_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { MxPathBarButtonPrivate *priv = MX_PATH_BAR_BUTTON (object)->priv; switch (property_id) { case PROP_TRANSITION: priv->transition = g_value_get_double (value); clutter_actor_queue_relayout (CLUTTER_ACTOR (object)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } }
static void mail_task_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { MailTask *task = MAIL_TASK(object); switch (prop_id) { case PROP_CATEGORY: mail_task_set_category(task, g_value_get_enum(value)); break; case PROP_FRACTION: mail_task_set_fraction(task, g_value_get_double(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } }
static void uca_camera_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { UcaCameraPrivate *priv = UCA_CAMERA_GET_PRIVATE(object); if (priv->is_recording) { g_warning("You cannot change properties during data acquisition"); return; } switch (property_id) { case PROP_TRANSFER_ASYNCHRONOUSLY: priv->transfer_async = g_value_get_boolean(value); break; case PROP_FRAMES_PER_SECOND: { gdouble frames_per_second; frames_per_second = g_value_get_double (value); g_object_set (object, "exposure-time", 1. / frames_per_second, NULL); } break; case PROP_TRIGGER_SOURCE: priv->trigger_source = g_value_get_enum (value); break; case PROP_TRIGGER_TYPE: priv->trigger_type = g_value_get_enum (value); break; case PROP_BUFFERED: priv->buffered = g_value_get_boolean (value); break; case PROP_NUM_BUFFERS: priv->num_buffers = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); } }
static gboolean gail_scale_button_set_current_value (AtkValue *obj, const GValue *value) { GtkWidget *gtk_widget; g_return_val_if_fail (GAIL_IS_SCALE_BUTTON (obj), FALSE); gtk_widget = GTK_ACCESSIBLE (obj)->widget; if (gtk_widget == NULL) return FALSE; if (G_VALUE_HOLDS_DOUBLE (value)) { gtk_scale_button_set_value (GTK_SCALE_BUTTON (gtk_widget), g_value_get_double (value)); return TRUE; } return FALSE; }
static void playerctl_player_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { PlayerctlPlayer *self = PLAYERCTL_PLAYER(object); switch (property_id) { case PROP_PLAYER_NAME: g_free(self->priv->player_name); self->priv->player_name = g_strdup(g_value_get_string(value)); break; case PROP_VOLUME: org_mpris_media_player2_player_set_volume(self->priv->proxy, g_value_get_double(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } }
static void custom_cell_renderer_progress_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { CustomCellRendererProgress *cellprogress = CUSTOM_CELL_RENDERER_PROGRESS (object); switch (param_id) { case PROP_PERCENTAGE: cellprogress->progress = g_value_get_double(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec); break; } }
static void gst_aravis_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstAravis *gst_aravis = GST_ARAVIS (object); switch (prop_id) { case PROP_CAMERA_NAME: g_free (gst_aravis->camera_name); gst_aravis->camera_name = g_strdup (g_value_get_string (value)); GST_LOG_OBJECT (gst_aravis, "Set camera name to %s", gst_aravis->camera_name); break; case PROP_GAIN: gst_aravis->gain = g_value_get_int (value); break; case PROP_GAIN_AUTO: gst_aravis->gain_auto = g_value_get_boolean (value); break; case PROP_EXPOSURE: gst_aravis->exposure_time_us = g_value_get_double (value); break; case PROP_EXPOSURE_AUTO: gst_aravis->exposure_auto = g_value_get_boolean (value); break; case PROP_OFFSET_X: gst_aravis->offset_x = g_value_get_int (value); break; case PROP_OFFSET_Y: gst_aravis->offset_y = g_value_get_int (value); break; case PROP_H_BINNING: gst_aravis->h_binning = g_value_get_int (value); break; case PROP_V_BINNING: gst_aravis->v_binning = g_value_get_int (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
void ags_apply_tact_set_property(GObject *gobject, guint prop_id, const GValue *value, GParamSpec *param_spec) { AgsApplyTact *apply_tact; apply_tact = AGS_APPLY_TACT(gobject); switch(prop_id){ case PROP_SCOPE: { GObject *scope; scope = (GObject *) g_value_get_object(value); if(apply_tact->scope == (GObject *) scope){ return; } if(apply_tact->scope != NULL){ g_object_unref(apply_tact->scope); } if(scope != NULL){ g_object_ref(scope); } apply_tact->scope = (GObject *) scope; } break; case PROP_TACT: { apply_tact->tact = g_value_get_double(value); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, param_spec); break; } }
static GValueArray * channel_new_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GValueArray *args) { gboolean success = TRUE; GValueArray *return_vals; GimpImage *image; gint32 width; gint32 height; const gchar *name; gdouble opacity; GimpRGB color; GimpChannel *channel = NULL; image = gimp_value_get_image (&args->values[0], gimp); width = g_value_get_int (&args->values[1]); height = g_value_get_int (&args->values[2]); name = g_value_get_string (&args->values[3]); opacity = g_value_get_double (&args->values[4]); gimp_value_get_rgb (&args->values[5], &color); if (success) { GimpRGB rgb_color = color; rgb_color.a = opacity / 100.0; channel = gimp_channel_new (image, width, height, name, &rgb_color); if (! channel) success = FALSE; } return_vals = gimp_procedure_get_return_values (procedure, success); if (success) gimp_value_set_channel (&return_vals->values[1], channel); return return_vals; }
static void gtk_plot_bar_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GtkPlotBar *data; data = GTK_PLOT_BAR (object); switch (prop_id) { case ARG_WIDTH: data->width = g_value_get_double(value); break; case ARG_ORIENTATION: data->orientation = g_value_get_enum(value); break; } }
static void clutter_desaturate_effect_set_property (GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec) { ClutterDesaturateEffect *effect = CLUTTER_DESATURATE_EFFECT (gobject); switch (prop_id) { case PROP_FACTOR: clutter_desaturate_effect_set_factor (effect, g_value_get_double (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } }
/** * fo_length_set_property: * @object: #GObject whose property will be set. * @prop_id: Property ID assigned when property registered. * @value: New value for property. * @pspec: Parameter specification for this property type. * * Implements #GObjectSetPropertyFunc for #FoLength. **/ void fo_length_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { FoDatatype *length; length = FO_DATATYPE (object); switch (prop_id) { case PROP_VALUE: fo_length_set_value (length, g_value_get_double (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void trg_cell_renderer_ratio_set_property(GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { TrgCellRendererRatioPrivate *priv = TRG_CELL_RENDERER_RATIO_GET_PRIVATE(object); if (property_id == PROP_RATIO_VALUE) { priv->ratio_value = g_value_get_double(value); if (priv->ratio_value > 0) { char ratioString[32]; trg_strlratio(ratioString, priv->ratio_value); g_object_set(object, "text", ratioString, NULL); } else { g_object_set(object, "text", "", NULL); } } else { G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); } }
static void gst_gamma_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstGamma *gamma; g_return_if_fail (GST_IS_GAMMA (object)); gamma = GST_GAMMA (object); GST_DEBUG ("gst_gamma_set_property"); switch (prop_id) { case PROP_GAMMA: gamma->gamma = g_value_get_double (value); gst_gamma_calculate_tables (gamma); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void mex_volume_control_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { MexVolumeControl *volume = MEX_VOLUME_CONTROL (object); MexVolumeControlPrivate *priv = volume->priv; switch (property_id) { case PROP_VOLUME: priv->vol_value = g_value_get_double (value); update_volume_and_style_class (volume); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } }
static void task_manager_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TaskManagerDialogPrivate * priv = GET_PRIVATE (object); switch (property_id) { case PROP_DIALOG_MODE: priv->dialog_mode = g_value_get_int (value); break; case PROP_APPLET: priv->applet = g_value_get_object (value); break; case PROP_DIALOG_SCALE: priv->dialog_scale = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } }
static void print_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data) { int i, num; num = gst_tag_list_get_tag_size (list, tag); for (i = 0; i < num; ++i) { const GValue *val; /* Note: when looking for specific tags, use the g_tag_list_get_xyz() API, * we only use the GValue approach here because it is more generic */ val = gst_tag_list_get_value_index (list, tag, i); if (G_VALUE_HOLDS_STRING (val)) { const char* unformatted = g_value_get_string (val); gchar* formatted = strescape(unformatted,"\"","\""); g_print ("(%s . \"%s\")\n", tag, formatted); g_free(formatted); } else if (G_VALUE_HOLDS_UINT (val)) { unsigned int uint = g_value_get_uint (val); if(uint > 0xf) g_print ("(%s . #x%x)\n", tag, uint); } else if (G_VALUE_HOLDS_DOUBLE (val)) { g_print ("(%s . %g)\n", tag, g_value_get_double (val)); } else if (G_VALUE_HOLDS_BOOLEAN (val)) { g_print ("(%s . %s)\n", tag, (g_value_get_boolean (val)) ? "#t" : "#f"); } else if (GST_VALUE_HOLDS_BUFFER (val)) { g_print ("(%s . (buffer %u))", tag, gst_buffer_get_size(gst_value_get_buffer (val))); } else if (GST_VALUE_HOLDS_DATE_TIME (val)) { GDate* date = (GDate*)g_value_get_boxed(val); g_print ("(%s . (date 0 0 0 %u %u %u))\n", tag, g_date_get_day(date), g_date_get_month(date), g_date_get_year (date)); } else { g_print ("(%20s . (type %s))", tag, G_VALUE_TYPE_NAME (val)); } } }
static GValueArray * unit_new_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GValueArray *args, GError **error) { gboolean success = TRUE; GValueArray *return_vals; const gchar *identifier; gdouble factor; gint32 digits; const gchar *symbol; const gchar *abbreviation; const gchar *singular; const gchar *plural; GimpUnit unit_id = 0; identifier = g_value_get_string (&args->values[0]); factor = g_value_get_double (&args->values[1]); digits = g_value_get_int (&args->values[2]); symbol = g_value_get_string (&args->values[3]); abbreviation = g_value_get_string (&args->values[4]); singular = g_value_get_string (&args->values[5]); plural = g_value_get_string (&args->values[6]); if (success) { unit_id = _gimp_unit_new (gimp, identifier, factor, digits, symbol, abbreviation, singular, plural); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) g_value_set_int (&return_vals->values[1], unit_id); return return_vals; }
static void gimp_convolve_options_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { GimpConvolveOptions *options = GIMP_CONVOLVE_OPTIONS (object); switch (property_id) { case PROP_TYPE: options->type = g_value_get_enum (value); break; case PROP_RATE: options->rate = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static void gst_video_rate_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstVideoRate *videorate = GST_VIDEO_RATE (object); switch (prop_id) { case ARG_SILENT: videorate->silent = g_value_get_boolean (value); break; case ARG_NEW_PREF: videorate->new_pref = g_value_get_double (value); break; case ARG_SKIP_TO_FIRST: videorate->skip_to_first = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
/*! * \brief Convert a GValue to a QVariant * \param other GValue to convert * \return a QVariant with the GValue if it could be converted, an invalid * QVariant otherwise. */ QVariant gValueToQVariant(const GValue *other) { switch (G_VALUE_TYPE(other)) { case G_TYPE_BOOLEAN: return QVariant::fromValue(g_value_get_boolean(other) == TRUE); case G_TYPE_UINT: return QVariant::fromValue(g_value_get_uint(other)); case G_TYPE_UINT64: return QVariant::fromValue(g_value_get_uint64(other)); case G_TYPE_INT: return QVariant::fromValue(g_value_get_int(other)); case G_TYPE_INT64: return QVariant::fromValue(g_value_get_int64(other)); case G_TYPE_DOUBLE: return QVariant::fromValue(g_value_get_double(other)); case G_TYPE_STRING: return QVariant::fromValue(QString::fromUtf8(g_value_get_string(other))); default: return QVariant(); } }
static void gtk_gesture_long_press_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { GtkGestureLongPressPrivate *priv; priv = gtk_gesture_long_press_get_instance_private (GTK_GESTURE_LONG_PRESS (object)); switch (property_id) { case PROP_DELAY_FACTOR: priv->delay_factor = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static void gst_compositor_pad_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstCompositorPad *pad = GST_COMPOSITOR_PAD (object); switch (prop_id) { case PROP_PAD_XPOS: pad->xpos = g_value_get_int (value); break; case PROP_PAD_YPOS: pad->ypos = g_value_get_int (value); break; case PROP_PAD_ALPHA: pad->alpha = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void gst_osx_audio_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstOsxAudioSink *sink = GST_OSX_AUDIO_SINK (object); switch (prop_id) { #ifndef HAVE_IOS case ARG_DEVICE: sink->device_id = g_value_get_int (value); break; #endif case ARG_VOLUME: sink->volume = g_value_get_double (value); gst_osx_audio_sink_set_volume (sink); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static GValueArray * channel_set_opacity_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GValueArray *args) { gboolean success = TRUE; GimpChannel *channel; gdouble opacity; channel = gimp_value_get_channel (&args->values[0], gimp); opacity = g_value_get_double (&args->values[1]); if (success) { gimp_channel_set_opacity (channel, opacity / 100.0, TRUE); } return gimp_procedure_get_return_values (procedure, success); }
static void gdk_screen_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GdkScreen *screen = GDK_SCREEN (object); switch (prop_id) { case PROP_FONT_OPTIONS: gdk_screen_set_font_options (screen, g_value_get_pointer (value)); break; case PROP_RESOLUTION: gdk_screen_set_resolution (screen, g_value_get_double (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
/** * gst_event_parse_seek: * @event: a seek event * @rate: (out): result location for the rate * @format: (out): result location for the stream format * @flags: (out): result location for the #GstSeekFlags * @start_type: (out): result location for the #GstSeekType of the start position * @start: (out): result location for the start postion expressed in @format * @stop_type: (out): result location for the #GstSeekType of the stop position * @stop: (out): result location for the stop postion expressed in @format * * Parses a seek @event and stores the results in the given result locations. */ void gst_event_parse_seek (GstEvent * event, gdouble * rate, GstFormat * format, GstSeekFlags * flags, GstSeekType * start_type, gint64 * start, GstSeekType * stop_type, gint64 * stop) { const GstStructure *structure; g_return_if_fail (GST_IS_EVENT (event)); g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEEK); structure = GST_EVENT_STRUCTURE (event); if (rate) *rate = g_value_get_double (gst_structure_id_get_value (structure, GST_QUARK (RATE))); if (format) *format = (GstFormat) g_value_get_enum (gst_structure_id_get_value (structure, GST_QUARK (FORMAT))); if (flags) *flags = (GstSeekFlags) g_value_get_flags (gst_structure_id_get_value (structure, GST_QUARK (FLAGS))); if (start_type) *start_type = (GstSeekType) g_value_get_enum (gst_structure_id_get_value (structure, GST_QUARK (CUR_TYPE))); if (start) *start = g_value_get_int64 (gst_structure_id_get_value (structure, GST_QUARK (CUR))); if (stop_type) *stop_type = (GstSeekType) g_value_get_enum (gst_structure_id_get_value (structure, GST_QUARK (STOP_TYPE))); if (stop) *stop = g_value_get_int64 (gst_structure_id_get_value (structure, GST_QUARK (STOP))); }
static void etfci_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; ETableFieldChooserItem *etfci; item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); switch (property_id) { case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) etfci_add_full_header ( etfci, E_TABLE_HEADER ( g_value_get_object (value))); break; case PROP_HEADER: etfci_drop_table_header (etfci); if (g_value_get_object (value)) etfci_add_table_header ( etfci, E_TABLE_HEADER ( g_value_get_object (value))); break; case PROP_DND_CODE: g_free (etfci->dnd_code); etfci->dnd_code = g_strdup (g_value_get_string (value)); break; case PROP_WIDTH: etfci->width = g_value_get_double (value); gnome_canvas_item_request_update (item); break; } }
static void mx_adjustment_set_property (GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec) { MxAdjustment *adj = MX_ADJUSTMENT (gobject); switch (prop_id) { case PROP_LOWER: mx_adjustment_set_lower (adj, g_value_get_double (value)); break; case PROP_UPPER: mx_adjustment_set_upper (adj, g_value_get_double (value)); break; case PROP_VALUE: mx_adjustment_set_value (adj, g_value_get_double (value)); break; case PROP_STEP_INC: mx_adjustment_set_step_increment (adj, g_value_get_double (value)); break; case PROP_PAGE_INC: mx_adjustment_set_page_increment (adj, g_value_get_double (value)); break; case PROP_PAGE_SIZE: mx_adjustment_set_page_size (adj, g_value_get_double (value)); break; case PROP_ELASTIC: mx_adjustment_set_elastic (adj, g_value_get_boolean (value)); break; case PROP_CLAMP_VALUE: mx_adjustment_set_clamp_value (adj, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } }