static gboolean filter_string_ascii_case (const TpCMParamSpec *param_spec, GValue *value, GError **error) { const gchar *s = g_value_get_string (value); guint i; for (i = 0; s[i] != '\0'; i++) { int c = s[i]; /* just to avoid -Wtype-limits */ if (c < 0 || c > 127) /* char might be signed or unsigned */ { g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "%s must be ASCII", param_spec->name); return FALSE; } } if (GINT_TO_POINTER (param_spec->filter_data)) g_value_take_string (value, g_ascii_strup (s, -1)); else g_value_take_string (value, g_ascii_strdown (s, -1)); return TRUE; }
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); } } }
static void gst_a2dp_sink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstA2dpSink *self = GST_A2DP_SINK (object); gchar *device, *transport; switch (prop_id) { case PROP_DEVICE: if (self->sink != NULL) { device = gst_avdtp_sink_get_device (self->sink); if (device != NULL) g_value_take_string (value, device); } break; case PROP_AUTOCONNECT: if (self->sink != NULL) g_object_get (G_OBJECT (self->sink), "auto-connect", &self->autoconnect, NULL); g_value_set_boolean (value, self->autoconnect); break; case PROP_TRANSPORT: if (self->sink != NULL) { transport = gst_avdtp_sink_get_transport (self->sink); if (transport != NULL) g_value_take_string (value, transport); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void dspy_introspection_model_get_value (GtkTreeModel *model, GtkTreeIter *iter, gint column, GValue *value) { LOG_DEBUG (G_STRFUNC); if (column == 0) { DspyNode *node = iter->user_data; g_autofree gchar *str = NULL; g_assert (node != NULL); g_assert (DSPY_IS_NODE (node)); g_value_init (value, G_TYPE_STRING); str = _dspy_node_get_text (node); if (_dspy_node_is_group (node)) { if (gtk_tree_model_iter_has_child (model, iter)) g_value_take_string (value, g_strdup_printf ("<b>%s</b>", str)); else g_value_take_string (value, g_strdup_printf ("<span fgalpha='25000' weight='bold'>%s</span>", str)); } else g_value_take_string (value, g_steal_pointer (&str)); } }
/** * gcr_certificate_mixin_get_property: (skip) * @obj: The object * @prop_id: The property id * @value: The value to fill in. * @pspec: The param specification. * * Implementation to get various required certificate properties. This should * be called from your derived class get_property function, or used as a * get_property virtual function. * * Example of use as called from derived class get_property function: * * <informalexample><programlisting> * static void * my_get_property (GObject *obj, guint prop_id, GValue *value, GParamSpec *pspec) * { * switch (prop_id) { * * ... * * default: * gcr_certificate_mixin_get_property (obj, prop_id, value, pspec); * break; * } *} * </programlisting></informalexample> * * Example of use as get_property function: * * <informalexample><programlisting> * static void * my_class_init (MyClass *klass) * { * GObjectClass *gobject_class = G_OBJECT_CLASS (klass); * gobject_class->get_property = gcr_certificate_mixin_get_property; * * ... * } * </programlisting></informalexample> */ void gcr_certificate_mixin_get_property (GObject *obj, guint prop_id, GValue *value, GParamSpec *pspec) { GcrCertificate *cert = GCR_CERTIFICATE (obj); switch (prop_id) { case PROP_LABEL: g_value_take_string (value, gcr_certificate_get_subject_name (cert)); break; case PROP_SUBJECT: g_value_take_string (value, gcr_certificate_get_subject_name (cert)); break; case PROP_ICON: g_value_set_object (value, gcr_certificate_get_icon (cert)); break; case PROP_DESCRIPTION: g_value_set_string (value, _("Certificate")); break; case PROP_MARKUP: g_value_take_string (value, calculate_markup (cert)); break; case PROP_ISSUER: g_value_take_string (value, gcr_certificate_get_issuer_name (cert)); break; case PROP_EXPIRY: g_value_take_boxed (value, gcr_certificate_get_expiry_date (cert)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } }
static void webkit_dom_test_interface_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { WebCore::JSMainThreadNullState state; WebKitDOMTestInterface* self = WEBKIT_DOM_TEST_INTERFACE(object); WebCore::TestInterface* coreSelf = WebKit::core(self); switch (prop_id) { #if ENABLE(Condition11) || ENABLE(Condition12) case PROP_SUPPLEMENTAL_STR1: { g_value_take_string(value, convertToUTF8String(WebCore::TestSupplemental::supplementalStr1(coreSelf))); break; } #endif /* ENABLE(Condition11) || ENABLE(Condition12) */ #if ENABLE(Condition11) || ENABLE(Condition12) case PROP_SUPPLEMENTAL_STR2: { g_value_take_string(value, convertToUTF8String(WebCore::TestSupplemental::supplementalStr2(coreSelf))); break; } #endif /* ENABLE(Condition11) || ENABLE(Condition12) */ #if ENABLE(Condition11) || ENABLE(Condition12) case PROP_SUPPLEMENTAL_NODE: { RefPtr<WebCore::Node> ptr = WebCore::TestSupplemental::supplementalNode(coreSelf); g_value_set_object(value, WebKit::kit(ptr.get())); break; } #endif /* ENABLE(Condition11) || ENABLE(Condition12) */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } }
static void webkit_dom_style_sheet_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) { WebKitDOMStyleSheet* self = WEBKIT_DOM_STYLE_SHEET(object); switch (propertyId) { case PROP_TYPE: g_value_take_string(value, webkit_dom_style_sheet_get_content_type(self)); break; case PROP_DISABLED: g_value_set_boolean(value, webkit_dom_style_sheet_get_disabled(self)); break; case PROP_OWNER_NODE: g_value_set_object(value, webkit_dom_style_sheet_get_owner_node(self)); break; case PROP_PARENT_STYLE_SHEET: g_value_set_object(value, webkit_dom_style_sheet_get_parent_style_sheet(self)); break; case PROP_HREF: g_value_take_string(value, webkit_dom_style_sheet_get_href(self)); break; case PROP_TITLE: g_value_take_string(value, webkit_dom_style_sheet_get_title(self)); break; case PROP_MEDIA: g_value_set_object(value, webkit_dom_style_sheet_get_media(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); break; } }
static void gst_rtsp_media_factory_get_property (GObject * object, guint propid, GValue * value, GParamSpec * pspec) { GstRTSPMediaFactory *factory = GST_RTSP_MEDIA_FACTORY (object); switch (propid) { case PROP_LAUNCH: g_value_take_string (value, gst_rtsp_media_factory_get_launch (factory)); break; case PROP_SHARED: g_value_set_boolean (value, gst_rtsp_media_factory_is_shared (factory)); break; case PROP_EOS_SHUTDOWN: g_value_set_boolean (value, gst_rtsp_media_factory_is_eos_shutdown (factory)); break; case PROP_PROTOCOLS: g_value_set_flags (value, gst_rtsp_media_factory_get_protocols (factory)); break; case PROP_BUFFER_SIZE: g_value_set_uint (value, gst_rtsp_media_factory_get_buffer_size (factory)); break; case PROP_MULTICAST_GROUP: g_value_take_string (value, gst_rtsp_media_factory_get_multicast_group (factory)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec); } }
static void webkit_dom_html_embed_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) { WebKitDOMHTMLEmbedElement* self = WEBKIT_DOM_HTML_EMBED_ELEMENT(object); switch (propertyId) { case PROP_ALIGN: g_value_take_string(value, webkit_dom_html_embed_element_get_align(self)); break; case PROP_HEIGHT: g_value_set_long(value, webkit_dom_html_embed_element_get_height(self)); break; case PROP_NAME: g_value_take_string(value, webkit_dom_html_embed_element_get_name(self)); break; case PROP_SRC: g_value_take_string(value, webkit_dom_html_embed_element_get_src(self)); break; case PROP_TYPE: g_value_take_string(value, webkit_dom_html_embed_element_get_type_attr(self)); break; case PROP_WIDTH: g_value_set_long(value, webkit_dom_html_embed_element_get_width(self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); break; } }
static void gst_alsasink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstAlsaSink *sink; sink = GST_ALSA_SINK (object); switch (prop_id) { case PROP_DEVICE: g_value_set_string (value, sink->device); break; case PROP_DEVICE_NAME: g_value_take_string (value, gst_alsa_find_device_name (GST_OBJECT_CAST (sink), sink->device, sink->handle, SND_PCM_STREAM_PLAYBACK)); break; case PROP_CARD_NAME: g_value_take_string (value, gst_alsa_find_card_name (GST_OBJECT_CAST (sink), sink->device, SND_PCM_STREAM_PLAYBACK)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void gedit_document_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GeditDocument *doc = GEDIT_DOCUMENT (object); switch (prop_id) { case PROP_SHORTNAME: g_value_take_string (value, gedit_document_get_short_name_for_display (doc)); break; case PROP_CONTENT_TYPE: g_value_take_string (value, gedit_document_get_content_type (doc)); break; case PROP_MIME_TYPE: g_value_take_string (value, gedit_document_get_mime_type (doc)); break; case PROP_READ_ONLY: g_value_set_boolean (value, doc->priv->readonly); break; case PROP_EMPTY_SEARCH: g_value_set_boolean (value, doc->priv->empty_search); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
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); } }
static void ide_layout_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { IdeLayoutView *self = IDE_LAYOUT_VIEW (object); switch (prop_id) { case PROP_CAN_SPLIT: g_value_set_boolean (value, ide_layout_view_get_can_split (self)); break; case PROP_MODIFIED: g_value_set_boolean (value, ide_layout_view_get_modified (self)); break; case PROP_SPECIAL_TITLE: g_value_take_string (value, ide_layout_view_get_special_title (self)); break; case PROP_TITLE: g_value_take_string (value, ide_layout_view_get_title (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }
void _midgard_sql_query_constraint_add_conditions_to_statement (MidgardQueryExecutor *executor, MidgardQueryConstraintSimple *constraint_simple, GdaSqlStatement *stmt, GdaSqlExpr *where_expr_node, GError **error) { MidgardSqlQueryConstraint *self = MIDGARD_SQL_QUERY_CONSTRAINT (constraint_simple); MidgardConnection *mgd = executor->priv->mgd; GdaConnection *cnc = mgd->priv->connection; GdaSqlStatementSelect *select = stmt->contents; GdaSqlExpr *top_where, *where, *expr; GdaSqlOperation *top_operation, *cond; GValue *value; /* Create table_alias.field name */ MidgardSqlQueryColumn *column = midgard_sql_query_constraint_get_column (self); gchar *table_alias_field = get_real_table_field (executor, column); g_object_unref (column); if (!table_alias_field) { /* TODO */ /* Handle error */ } if (where_expr_node) { top_where = where_expr_node; top_operation = top_where->cond; } else { top_where = select->where_cond; top_operation = top_where->cond; } where = gda_sql_expr_new (GDA_SQL_ANY_PART (top_operation)); top_operation->operands = g_slist_append (top_operation->operands, where); cond = gda_sql_operation_new (GDA_SQL_ANY_PART (where)); where->cond = cond; cond->operator_type = self->priv->op_type; expr = gda_sql_expr_new (GDA_SQL_ANY_PART (cond)); g_value_take_string ((value = gda_value_new (G_TYPE_STRING)), table_alias_field); expr->value = value; cond->operands = g_slist_append (cond->operands, expr); expr = gda_sql_expr_new (GDA_SQL_ANY_PART (cond)); /* Create value */ GValue val = {0, }; midgard_query_holder_get_value (MIDGARD_QUERY_HOLDER (self->priv->holder), &val); //FIXME, create parameter name::type */ expr->value = gda_value_new (G_TYPE_STRING); GString *str = g_string_new (""); __get_expression_value (cnc, &val, str); g_value_take_string (expr->value, g_string_free (str, FALSE)); g_value_unset (&val); cond->operands = g_slist_append (cond->operands, expr); /* increase executor's constraints number */ executor->priv->n_constraints++; }
static void snra_client_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { SnraClient *client = (SnraClient *) (object); switch (prop_id) { case PROP_SERVER_HOST:{ char *tmp = NULL; if (client->server_host) tmp = g_strdup_printf ("%s:%u", client->server_host, client->server_port); g_value_take_string (value, tmp); break; } case PROP_FLAGS:{ g_value_set_uint (value, client->flags); break; } case PROP_PAUSED:{ g_value_set_boolean (value, client->paused); break; } case PROP_BASE_TIME:{ g_value_set_uint64 (value, client->base_time); break; } case PROP_POSITION:{ g_value_set_uint64 (value, client->position); break; } case PROP_MEDIA_URI:{ g_value_set_string (value, client->uri); break; } case PROP_VOLUME:{ g_value_set_double (value, client->volume); break; } case PROP_CONNECTED_SERVER:{ char *tmp = NULL; if (client->connected_server) tmp = g_strdup_printf ("%s:%u", client->connected_server, client->connected_port); g_value_take_string (value, tmp); break; } case PROP_LANGUAGE:{ g_value_set_string (value, client->language); break; } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static GimpValueArray * procedural_db_proc_info_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; const gchar *procedure_name; gchar *blurb = NULL; gchar *help = NULL; gchar *author = NULL; gchar *copyright = NULL; gchar *date = NULL; gint32 proc_type = 0; gint32 num_args = 0; gint32 num_values = 0; procedure_name = g_value_get_string (gimp_value_array_index (args, 0)); if (success) { GimpPDBProcType ptype; gchar *canonical; canonical = gimp_canonicalize_identifier (procedure_name); success = gimp_pdb_proc_info (gimp->pdb, canonical, &blurb, &help, &author, ©right, &date, &ptype, &num_args, &num_values, error); proc_type = ptype; g_free (canonical); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) { g_value_take_string (gimp_value_array_index (return_vals, 1), blurb); g_value_take_string (gimp_value_array_index (return_vals, 2), help); g_value_take_string (gimp_value_array_index (return_vals, 3), author); g_value_take_string (gimp_value_array_index (return_vals, 4), copyright); g_value_take_string (gimp_value_array_index (return_vals, 5), date); g_value_set_enum (gimp_value_array_index (return_vals, 6), proc_type); g_value_set_int (gimp_value_array_index (return_vals, 7), num_args); g_value_set_int (gimp_value_array_index (return_vals, 8), num_values); } return return_vals; }
static void update_type_list (AnjutaShell *shell, IAnjutaIterable *iter, const gchar *name) { gchar *list = NULL; GValue value = {0,}; if (iter) { ianjuta_iterable_first (iter, NULL); if (ianjuta_iterable_get_length (iter, NULL) > 0) { GString *s = g_string_sized_new(ianjuta_iterable_get_length (iter, NULL) * 10); do { IAnjutaSymbol *symbol = IANJUTA_SYMBOL (iter); const gchar *sname = ianjuta_symbol_get_string (symbol, IANJUTA_SYMBOL_FIELD_NAME, NULL); g_string_append(s, sname); g_string_append_c(s, ' '); } while (ianjuta_iterable_next (iter, NULL)); list = g_string_free(s, FALSE); } } anjuta_shell_get_value (shell, name, &value, NULL); if (G_VALUE_HOLDS_STRING(&value)) { const gchar *value_list = g_value_get_string (&value); if (list == NULL) { anjuta_shell_remove_value (shell, name, NULL); } else if (strcmp (list, value_list) == 0) { g_free (list); } else { g_value_take_string (&value, list); anjuta_shell_add_value (shell, name, &value, NULL); } } else { if (list != NULL) { g_value_init (&value, G_TYPE_STRING); g_value_take_string (&value, list); anjuta_shell_add_value (shell, name, &value, NULL); } } if (G_IS_VALUE (&value)) g_value_unset (&value); }
static void add_element_used (InsanityGstPipelineTest * ptest, GstElement * element) { GstElementFactory *factory; const char *factory_name; char label[32], *element_name; GValue string_value = { 0 }; GstElement *parent; /* Only add once */ element_name = gst_element_get_name (element); if (g_hash_table_lookup_extended (ptest->priv->elements_used, element_name, NULL, NULL)) { g_free (element_name); return; } g_hash_table_insert (ptest->priv->elements_used, g_strdup (element_name), NULL); ptest->priv->element_count++; g_value_init (&string_value, G_TYPE_STRING); factory = gst_element_get_factory (element); factory_name = factory ? gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_LONGNAME) : "(no factory)"; g_value_take_string (&string_value, element_name); snprintf (label, sizeof (label), "elements-used.%u.name", ptest->priv->element_count); insanity_test_set_extra_info (INSANITY_TEST (ptest), label, &string_value); g_value_reset (&string_value); g_value_set_string (&string_value, factory_name); snprintf (label, sizeof (label), "elements-used.%u.factory", ptest->priv->element_count); insanity_test_set_extra_info (INSANITY_TEST (ptest), label, &string_value); g_value_reset (&string_value); parent = GST_ELEMENT (gst_element_get_parent (element)); if (parent) { g_value_take_string (&string_value, gst_element_get_name (parent)); snprintf (label, sizeof (label), "elements-used.%u.parent", ptest->priv->element_count); insanity_test_set_extra_info (INSANITY_TEST (ptest), label, &string_value); g_value_reset (&string_value); gst_object_unref (parent); } }
static void gst_pulsesrc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (object); switch (prop_id) { case PROP_SERVER: g_value_set_string (value, pulsesrc->server); break; case PROP_DEVICE: g_value_set_string (value, pulsesrc->device); break; case PROP_DEVICE_NAME: g_value_take_string (value, gst_pulsesrc_device_description (pulsesrc)); break; case PROP_STREAM_PROPERTIES: gst_value_set_structure (value, pulsesrc->properties); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void search_bar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case PROP_ACTIVE_SEARCH: g_value_set_boolean ( value, e_search_bar_get_active_search ( E_SEARCH_BAR (object))); return; case PROP_CASE_SENSITIVE: g_value_set_boolean ( value, e_search_bar_get_case_sensitive ( E_SEARCH_BAR (object))); return; case PROP_TEXT: g_value_take_string ( value, e_search_bar_get_text ( E_SEARCH_BAR (object))); return; case PROP_WEB_VIEW: g_value_set_object ( value, e_search_bar_get_web_view ( E_SEARCH_BAR (object))); return; } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); }
static void proto_hier_tree_get_value(GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value) { ProtoHierTreeModel *model; header_field_info *hfinfo; g_return_if_fail(PROTOHIER_IS_TREE(tree_model)); model = (ProtoHierTreeModel *) tree_model; g_return_if_fail(iter != NULL); g_return_if_fail(iter->stamp == model->stamp); g_return_if_fail(column == 0 || column == 1); hfinfo = (header_field_info *)iter->user_data3; switch (column) { case 0: /* hfinfo */ g_value_init(value, G_TYPE_POINTER); g_value_set_pointer(value, hfinfo); break; case 1: /* field name */ g_value_init(value, G_TYPE_STRING); g_value_take_string(value, hfinfo_to_name(hfinfo)); break; } }
gboolean __query_select_add_orders (MidgardQueryExecutor *self, GError **error) { if (!self->priv->orders) return TRUE; GSList *l = NULL; MidgardQueryExecutor *executor = MIDGARD_QUERY_EXECUTOR (self); GdaSqlStatement *sql_stm = executor->priv->stmt; GdaSqlStatementSelect *select = (GdaSqlStatementSelect *) sql_stm->contents; GdaSqlSelectOrder *order; for (l = MIDGARD_QUERY_EXECUTOR (self)->priv->orders; l != NULL; l = l->next) { /* Proper asc type is set during validation phase */ qso *_so = (qso*) l->data; /* Create new order */ order = gda_sql_select_order_new (GDA_SQL_ANY_PART (select)); order->asc = _so->asc; MidgardQueryProperty *property = _so->property; MidgardQueryStorage *storage = NULL; if (property->priv && property->priv->storage) storage = property->priv->storage; /* Compute table.colname for given property name */ GValue rval = {0, }; midgard_query_holder_get_value (MIDGARD_QUERY_HOLDER (property), &rval); GError *err = NULL; gchar *table_field = midgard_core_query_compute_constraint_property (executor, storage, g_value_get_string (&rval), &err); if (err) { g_propagate_error (error, err); g_free (table_field); gda_sql_select_order_free (order); return FALSE; } if (!table_field) { g_set_error (error, MIDGARD_VALIDATION_ERROR, MIDGARD_VALIDATION_ERROR_LOCATION_INVALID, "Can not find table and column name for given '%s' property name", g_value_get_string (&rval)); g_value_unset (&rval); return FALSE; } g_value_unset (&rval); GValue *value = g_new0 (GValue, 1); g_value_init (value, G_TYPE_STRING); g_value_take_string (value, table_field); /* Set order's expression and add new one to statement orders list */ GdaSqlExpr *expr = gda_sql_expr_new (GDA_SQL_ANY_PART (order)); expr->value = value; order->expr = expr; select->order_by = g_slist_append (select->order_by, order); } return TRUE; }
static void nmc_convert_bytes_to_string (const GValue *src_value, GValue *dest_value) { GBytes *bytes; const guint8 *array; gsize length; GString *printable; guint i = 0; bytes = g_value_get_boxed (src_value); printable = g_string_new ("["); if (bytes) { array = g_bytes_get_data (bytes, &length); while (i < MIN (length, 35)) { if (i > 0) g_string_append_c (printable, ' '); g_string_append_printf (printable, "0x%02X", array[i++]); } if (i < length) g_string_append (printable, " ... "); } g_string_append_c (printable, ']'); g_value_take_string (dest_value, g_string_free (printable, FALSE)); }
static void msd_smartcard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { MsdSmartcard *card = MSD_SMARTCARD (object); switch (prop_id) { case PROP_NAME: g_value_take_string (value, msd_smartcard_get_name (card)); break; case PROP_SLOT_ID: g_value_set_ulong (value, (gulong) msd_smartcard_get_slot_id (card)); break; case PROP_SLOT_SERIES: g_value_set_int (value, msd_smartcard_get_slot_series (card)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }
static void time_converter(GBinding* bind, const GValue* from, GValue* to, gpointer udata) { gchar* label = NULL; GDateTime* now_time; GDateTime* stream_started_time; GTimeSpan dif; if (g_value_get_pointer(from) != NULL) { now_time = g_date_time_new_now_utc(); stream_started_time = (GDateTime*) g_value_get_pointer(from); dif = g_date_time_difference(now_time, stream_started_time); if (dif > G_TIME_SPAN_HOUR) label = g_strdup_printf("%2.1fh", (gdouble) dif / G_TIME_SPAN_HOUR); else label = g_strdup_printf("%ldm", dif / G_TIME_SPAN_MINUTE); g_date_time_unref(now_time); } g_value_take_string(to, label); }
static void __add_join (Psh *holder) { MidgardCRCoreQueryExecutor *executor = MIDGARD_CR_CORE_QUERY_EXECUTOR (holder->executor); GdaSqlStatement *sql_stm = executor->priv->stmt; GdaSqlStatementSelect *select = (GdaSqlStatementSelect *) sql_stm->contents; GdaSqlSelectFrom *from = select->from; GdaSqlSelectJoin *join = gda_sql_select_join_new (GDA_SQL_ANY_PART (from)); join->type = GDA_SQL_SELECT_JOIN_LEFT; GdaSqlExpr *expr = gda_sql_expr_new (GDA_SQL_ANY_PART (join)); expr->value = gda_value_new (G_TYPE_STRING); g_value_take_string (expr->value, g_strdup_printf ("%s.%s = %s.%s", holder->table_alias, holder->colname, holder->target_table_alias, holder->target_colname)); join->expr = expr; join->position = ++executor->priv->joinid; gda_sql_select_from_take_new_join (from , join); GdaSqlSelectTarget *s_target = gda_sql_select_target_new (GDA_SQL_ANY_PART (from)); s_target->table_name = g_strdup (holder->target_table); s_target->as = g_strdup (holder->target_table_alias); gda_sql_select_from_take_new_target (from, s_target); /* Set target expression */ GdaSqlExpr *texpr = gda_sql_expr_new (GDA_SQL_ANY_PART (s_target)); GValue *tval = g_new0 (GValue, 1); g_value_init (tval, G_TYPE_STRING); g_value_set_string (tval, s_target->table_name); texpr->value = tval; s_target->expr = texpr; }
static void gb_shortcuts_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GbShortcutsDialog *self = (GbShortcutsDialog *)object; GbShortcutsDialogPrivate *priv = gb_shortcuts_dialog_get_instance_private (self); switch (prop_id) { case PROP_VIEW_NAME: { GtkWidget *child = gtk_stack_get_visible_child (priv->stack); if (child != NULL) { gchar *name = NULL; gtk_container_child_get (GTK_CONTAINER (priv->stack), child, "name", &name, NULL); g_value_take_string (value, name); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }
static void gst_dtls_dec_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstDtlsDec *self = GST_DTLS_DEC (object); switch (prop_id) { case PROP_CONNECTION_ID: g_value_set_string (value, self->connection_id); break; case PROP_PEM: g_value_take_string (value, gst_dtls_agent_get_certificate_pem (self->agent)); break; case PROP_PEER_PEM: g_value_set_string (value, self->peer_pem); break; case PROP_DECODER_KEY: g_value_set_boxed (value, self->decoder_key); break; case PROP_SRTP_CIPHER: g_value_set_uint (value, self->srtp_cipher); break; case PROP_SRTP_AUTH: g_value_set_uint (value, self->srtp_auth); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); } }
static GimpValueArray * temp_name_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; const gchar *extension; gchar *name = NULL; extension = g_value_get_string (gimp_value_array_index (args, 0)); if (success) { GFile *file = gimp_get_temp_file (gimp, extension); name = g_file_get_path (file); g_object_unref (file); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) g_value_take_string (gimp_value_array_index (return_vals, 1), name); return return_vals; }
static void gda_xa_transaction_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec) { GdaXaTransaction *xa_trans; xa_trans = GDA_XA_TRANSACTION (object); if (xa_trans->priv) { switch (param_id) { case PROP_FORMAT_ID: g_value_set_uint (value, xa_trans->priv->xid.format); break; case PROP_TRANSACT_ID: { gchar *tmp; tmp = g_new (gchar, xa_trans->priv->xid.gtrid_length + 1); memcpy (tmp, xa_trans->priv->xid.data, xa_trans->priv->xid.gtrid_length); /* Flawfinder: ignore */ tmp [xa_trans->priv->xid.gtrid_length] = 0; g_value_take_string (value, tmp); break; } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; } } }