Questions tagged [gvariant]

variant datatype that stores type and value, it can be concurrently accessed in any way from any number of threads

variant datatype that stores type and value, it can be concurrently accessed in any way from any number of threads

13 questions
2
votes
2 answers

Define a GLib.Variant in Python

I am trying to define a GLib.Variant data type in Python to use it with the pydbus library. This is my attempt to do so: #!/usr/bin/python from gi.repository import GLib from pydbus import SessionBus var1 = GLib.Variant.new_variant('draw-cursor',…
Madno
  • 910
  • 2
  • 12
  • 27
1
vote
0 answers

How can I create a GVariant* to feed to g_variant_iter_new?

The following simple code is sufficient to reproduce the error I am having. #include int main() { GVariantIter *Iter; const gchar* s = "[('appname', uint64 size, uint64 field, false)]"; GVariant* up =…
Tony Tannous
  • 14,154
  • 10
  • 50
  • 86
1
vote
1 answer

Can you avoid GLib variant references and memory leaks when using g_variant_get?

Background I'm using GLib and variants. I have this scenario where I want to get the value deep inside a variant. The initial variant, changed_properties has the format a{sv}. // Example 1 /* GVariant *variant = g_variant_get_variant( …
bem22
  • 276
  • 1
  • 14
1
vote
1 answer

GVariantBuilder build a(ii) or a(vv)

I have this array of 2 int's I want to sent over dbus. It always complains that value is not of type tuple or null depending on the attempt. Hwow does it need to look like? GVariantBuilder builder; g_variant_builder_init(&builder,…
user215853
  • 33
  • 3
1
vote
1 answer

What GLib type should a{ss} map to when using GSettings?

I have a gsettings schema with a key of type a{ss}. I would like to bind said key to a property on an object. I have successfully used g_settings_bind and g_settings_bind_with_mapping with other keys but I don't know what type to map this key to.…
Ava
  • 2,038
  • 3
  • 23
  • 45
1
vote
2 answers

How can I read a value from an array of dictionaries stored in GSettings with Vala?

The GSettings Vala docs are not very detailed and I can't find a way to read an item from an array of dictionaries stored in GSettings. Right now I have this in my schema: [{"id": "postgresql",…
Talysson
  • 1,363
  • 1
  • 9
  • 13
1
vote
2 answers

How to send a two dimensional array over gdbus?

I'm trying to send a two dimendional array of strings over dbus.( I'm using the gdbus api, with gdbus-codegen). I have defined the dbus interface as follows.
nilanjanaLodh
  • 303
  • 4
  • 11
1
vote
1 answer

Sending pointers to another process using GVariant

I am currently developing a simple browser using webkit2gtk. In webkit2gtk, all DOM related operations are done in separate process called WebProcess. I have created a GTKWidget in UI Process. I need to pass GTKWidget structure to WebProcess. Can we…
Krishna M
  • 1,135
  • 2
  • 16
  • 32
0
votes
1 answer

GLib - getting the number of strings in array returned over D-Bus

I am getting an array of strings via a function call over D-Bus as follows. I am using GLib then to parse the returned values. The code below is greatly simplified. I can read each string returned using g_variant_iter_loop and the iterator. How can…
Engineer999
  • 3,683
  • 6
  • 33
  • 71
0
votes
2 answers

Template class static string member not initialized correctly

I am trying to create a simple wrapper around glib2.0's GVariant. I imagined to have a templated class that would be used to derive a format string of GVariant's type: template struct Object { static const std::string…
0
votes
0 answers

Passing parameter to RequestScan method of Network Manager service

I want to create a tuple of array of dictionary to pass argument to method RequestScan (IN a{sv} options). I write code as below. /* Create empty dictionary */ GVariantBuilder *b; GVariant *option; b =…
0
votes
1 answer

C++ STL containters to Glib conversion

I am trying to convert C++ code with STL containers to C and Glib. Is that correct? //vector > coordinates; GArray coordinates((int, int)); //vector > adj_Matrix; GArray adj_Matrix(GArray(int)); //vector >…
-1
votes
1 answer

Is it possible to store, set or update a value inside an existing GVariant

I have a simple floating-point glib variant object whose value I need to update, but there doesn't seem to be any functions to actually do that. The only way seems to be to create a new variant object and update all places that have references to…
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621