1. Compilation Units

    1. Cairo
    2. Cairo.Font_Face
    3. Cairo.Font_Options
    4. Cairo.Image_Surface
    5. Cairo.PDF
    6. Cairo.Matrix
    7. Cairo.Pattern
    8. Cairo.Png
    9. Cairo.SVG
    10. Cairo.Region
    11. Cairo.Scaled_Font
    12. Cairo.Surface
    13. Fontconfig
    14. Gdk
    15. Gdk.App_Launch_Context
    16. Gdk.Cicp_Params
    17. Gdk.Clipboard
    18. Gdk.Color_State
    19. Gdk.Content_Formats
    20. Gdk.Content_Provider
    21. Gdk.Cursor
    22. Gdk.Device
    23. Gdk.Device_Tool
    24. Gdk.Display
    25. Gdk.Display_Manager
    26. Gdk.Dmabuf_Formats
    27. Gdk.Dmabuf_Texture
    28. Gdk.Dmabuf_Texture_Builder
    29. Gdk.Drag
    30. Gdk.Draw_Context
    31. Gdk.Drop
    32. Gdk.Enums
    33. Gdk.Event
    34. Gdk.Event.Button_Event
    35. Gdk.Event.DND_Event
    36. Gdk.Event.Crossing_Event
    37. Gdk.Event.Delete_Event
    38. Gdk.Event.Focus_Event
    39. Gdk.Event.Grab_Broken_Event
    40. Gdk.Event.Key_Event
    41. Gdk.Event.Motion_Event
    42. Gdk.Event.Pad_Event
    43. Gdk.Event.Proximity_Event
    44. Gdk.Event.Scroll_Event
    45. Gdk.Event.Touch_Event
    46. Gdk.Event.Touchpad_Event
    47. Gdk.Frame_Clock
    48. Gdk.Frame_Timings
    49. Gdk.GLContext
    50. Gdk.GLTexture
    51. Gdk.GLTexture_Builder
    52. Gdk.Key_Match
    53. Gdk.Memory_Texture
    54. Gdk.Memory_Texture_Builder
    55. Gdk.Monitor
    56. Gdk.Paintable
    57. Gdk.Pixbuf
    58. Gdk.Pixbuf_Format
    59. Gdk.RGBA
    60. Gdk.Popup_Layout
    61. Gdk.Rectangle
    62. Gdk.Seat
    63. Gdk.Snapshot
    64. Gdk.Surface
    65. Gdk.Texture
    66. Gdk.Toplevel_Layout
    67. Glib
    68. Glib.Action
    69. Glib.Action_Group
    70. Glib.Action_Map
    71. Glib.App_Info
      1. Glib.App_Info.Get_Default_For_Type_Async_User_Data
      2. Glib.App_Info.Get_Default_For_Uri_Scheme_Async_User_Data
      3. Glib.App_Info.Launch_Default_For_Uri_Async_User_Data
    72. Glib.App_Launch_Context
    73. Glib.Application
    74. Glib.Bytes
    75. Glib.Cancellable
      1. Glib.Cancellable.Connect_User_Data
    76. Glib.Convert
    77. Glib.Date_Time
    78. Glib.Enums
    79. Glib.Error
    80. Glib.File_IO_Stream
    81. Glib.Error_Enums
    82. Glib.File_Info
    83. Glib.File_Input_Stream
    84. Glib.GFile
    85. Glib.GSlist
      1. Glib.GSlist.Generic_SList
    86. Glib.File_Output_Stream
    87. Glib.G_Icon
    88. Glib.Generic_Properties
      1. Glib.Generic_Properties.Generic_Enumeration_Property
      2. Glib.Generic_Properties.Generic_Internal_Boxed_Property
      3. Glib.Generic_Properties.Generic_Internal_Discrete_Property
      4. Glib.Generic_Properties.Generic_Internal_Flags_Property
    89. Glib.Glist
      1. Glib.Glist.Generic_List
    90. Glib.Gnodes
      1. Glib.Gnodes.Gnode_Data
    91. Glib.IOChannel
    92. Glib.Graphs
    93. Glib.IO_Stream
    94. Glib.Graphs.Layouts
      1. Glib.Graphs.Layouts.Layered_Layouts
    95. Glib.Input_Stream
    96. Glib.Key_File
    97. Glib.List_Model
    98. Glib.List_Store
    99. Glib.Loadable_Icon
    100. Glib.Main
      1. Glib.Main.Generic_Sources
    101. Glib.Menu
    102. Glib.Menu_Model
    103. Glib.Messages
    104. Glib.Module
    105. Glib.Notification
    106. Glib.Object
      1. Glib.Object.User_Data
      2. Glib.Object.User_Data_Closure
    107. Glib.Option
      1. Glib.Option.Set_Translate_Func_User_Data
    108. Glib.Output_Stream
    109. Glib.Poll
    110. Glib.Properties
    111. Glib.Properties.Creation
    112. Glib.Resource
    113. Glib.Settings
    114. Glib.Settings_Backend
    115. Glib.Settings_Schema
    116. Glib.Settings_Schema_Key
    117. Glib.Settings_Schema_Source
    118. Glib.Simple_Action
    119. Glib.Simple_Action_Group
    120. Glib.Spawn
    121. Glib.String
    122. Glib.Test
    123. Glib.Time_Zone
    124. Glib.Type_Conversion_Hooks
      1. Glib.Type_Conversion_Hooks.Hook_Registrator
    125. Glib.Types
      1. Glib.Types.Implements
    126. Glib.Unicode
    127. Glib.Utils
    128. Glib.Values
    129. Glib.Variant
    130. Glib.XML
    131. Graphene
    132. Graphene.Box
    133. Graphene.Config
    134. Graphene.Euler
    135. Graphene.Frustum
    136. Graphene.Matrix
    137. Graphene.Plane
    138. Graphene.Point
    139. Graphene.Point3d
    140. Graphene.Quad
    141. Graphene.Quaternion
    142. Graphene.Ray
    143. Graphene.Rect
    144. Graphene.Size
    145. Graphene.Sphere
    146. Graphene.Triangle
    147. Graphene.Vec2
    148. Graphene.Vec3
    149. Graphene.Vec4
    150. Gsk
    151. Gsk.Enums
    152. Gsk.Path
    153. Gsk.Path_Builder
    154. Gsk.Path_Measure
    155. Gsk.Path_Point
    156. Gsk.Stroke
    157. Gsk.Transform
    158. Gtk
    159. Gtk.About_Dialog
    160. Gtk.Accessible
    161. Gtk.Accessible_Hyperlink
    162. Gtk.Accessible_Hypertext
    163. Gtk.Accessible_Range
    164. Gtk.Accessible_Text
    165. Gtk.Action_Bar
    166. Gtk.Actionable
    167. Gtk.Activate_Action
    168. Gtk.Adjustment
    169. Gtk.Alert_Dialog
    170. Gtk.Alternative_Trigger
    171. Gtk.Any_Filter
    172. Gtk.Application
    173. Gtk.Application_Window
    174. Gtk.Arguments
    175. Gtk.Aspect_Frame
    176. Gtk.Assistant
      1. Gtk.Assistant.Set_Forward_Page_Func_User_Data
    177. Gtk.Assistant_Page
    178. Gtk.Atcontext
    179. Gtk.Bin_Layout
    180. Gtk.Bitset
    181. Gtk.Bitset_Iter
    182. Gtk.Bookmark_List
    183. Gtk.Bool_Filter
    184. Gtk.Box
    185. Gtk.Box_Layout
    186. Gtk.Buildable
    187. Gtk.Builder
    188. Gtk.Builder_CScope
    189. Gtk.Builder_List_Item_Factory
    190. Gtk.Builder_Scope
    191. Gtk.Button
    192. Gtk.Callback_Action
      1. Gtk.Callback_Action.Callback_Action_With_Data
    193. Gtk.Cclosure_Expression
    194. Gtk.Cell_Area
      1. Gtk.Cell_Area.Foreach_Alloc_User_Data
      2. Gtk.Cell_Area.Foreach_User_Data
      3. Gtk.Cell_Area.Set_Cell_Data_Func_User_Data
    195. Gtk.Cell_Area_Box
      1. Gtk.Cell_Area_Box.Set_Cell_Data_Func_User_Data
    196. Gtk.Cell_Area_Context
    197. Gtk.Cell_Editable
    198. Gtk.Cell_Layout
      1. Gtk.Cell_Layout.Set_Cell_Data_Func_User_Data
    199. Gtk.Cell_Renderer
    200. Gtk.Cell_Renderer_Accel
    201. Gtk.Cell_Renderer_Combo
    202. Gtk.Cell_Renderer_Progress
    203. Gtk.Cell_Renderer_Spin
    204. Gtk.Cell_Renderer_Spinner
    205. Gtk.Cell_Renderer_Text
    206. Gtk.Cell_Renderer_Toggle
    207. Gtk.Cell_View
      1. Gtk.Cell_View.Set_Cell_Data_Func_User_Data
    208. Gtk.Center_Box
    209. Gtk.Center_Layout
    210. Gtk.Check_Button
    211. Gtk.Closure_Expression
    212. Gtk.Color_Dialog
    213. Gtk.Color_Dialog_Button
    214. Gtk.Column_View
    215. Gtk.Column_View_Cell
    216. Gtk.Column_View_Column
    217. Gtk.Column_View_Row
    218. Gtk.Column_View_Sorter
    219. Gtk.Constant_Expression
    220. Gtk.Constraint
    221. Gtk.Constraint_Guide
    222. Gtk.Constraint_Layout
    223. Gtk.Constraint_Target
    224. Gtk.Css_Provider
    225. Gtk.Css_Section
    226. Gtk.Custom_Filter
      1. Gtk.Custom_Filter.Custom_Filter_User_Data
    227. Gtk.Custom_Sorter
      1. Gtk.Custom_Sorter.Custom_Sorter_User_Data
    228. Gtk.Dialog
    229. Gtk.Directory_List
    230. Gtk.Drag_Source
    231. Gtk.Drawing_Area
      1. Gtk.Drawing_Area.Set_Draw_Func_User_Data
    232. Gtk.Drop_Down
    233. Gtk.Drop_Target
    234. Gtk.Editable
    235. Gtk.Editable_Label
    236. Gtk.Emoji_Chooser
    237. Gtk.Entry_Buffer
    238. Gtk.Entry_Completion
      1. Gtk.Entry_Completion.Set_Cell_Data_Func_User_Data
      2. Gtk.Entry_Completion.Set_Match_Func_User_Data
    239. Gtk.Enums
    240. Gtk.Event_Controller
    241. Gtk.Event_Controller_Focus
    242. Gtk.Event_Controller_Key
    243. Gtk.Event_Controller_Legacy
    244. Gtk.Event_Controller_Motion
    245. Gtk.Event_Controller_Scroll
    246. Gtk.Every_Filter
    247. Gtk.Expander
    248. Gtk.Expression
      1. Gtk.Expression.Watch_User_Data
    249. Gtk.Expression_Watch
    250. Gtk.File_Dialog
    251. Gtk.File_Filter
    252. Gtk.File_Launcher
    253. Gtk.Filter
    254. Gtk.Filter_List_Model
    255. Gtk.Fixed
    256. Gtk.Fixed_Layout
    257. Gtk.Flatten_List_Model
    258. Gtk.Flow_Box
      1. Gtk.Flow_Box.Bind_Model_User_Data
      2. Gtk.Flow_Box.Selected_Foreach_User_Data
      3. Gtk.Flow_Box.Set_Filter_Func_User_Data
      4. Gtk.Flow_Box.Set_Sort_Func_User_Data
    259. Gtk.Flow_Box_Child
    260. Gtk.Font_Dialog
    261. Gtk.Font_Dialog_Button
    262. Gtk.Frame
    263. Gtk.GLArea
    264. Gtk.GRange
    265. Gtk.GEntry
    266. Gtk.Gesture
    267. Gtk.Gesture_Click
    268. Gtk.Gesture_Drag
    269. Gtk.Gesture_Long_Press
    270. Gtk.Gesture_Pan
    271. Gtk.Gesture_Rotate
    272. Gtk.Gesture_Single
    273. Gtk.Gesture_Stylus
    274. Gtk.Gesture_Swipe
    275. Gtk.Gesture_Zoom
    276. Gtk.Graphics_Offload
    277. Gtk.Grid
    278. Gtk.Grid_Layout
    279. Gtk.Grid_View
    280. Gtk.IM_Context
    281. Gtk.IM_Context_Simple
    282. Gtk.IM_Multi_Context
    283. Gtk.Header_Bar
    284. Gtk.Icon_Paintable
    285. Gtk.Icon_Theme
    286. Gtk.Image
    287. Gtk.Info_Bar
    288. Gtk.Inscription
    289. Gtk.Keyval_Trigger
    290. Gtk.Label
    291. Gtk.Layout_Manager
    292. Gtk.Level_Bar
    293. Gtk.Link_Button
    294. Gtk.List_Base
    295. Gtk.List_Box
      1. Gtk.List_Box.Bind_Model_User_Data
      2. Gtk.List_Box.Selected_Foreach_User_Data
      3. Gtk.List_Box.Set_Filter_Func_User_Data
      4. Gtk.List_Box.Set_Header_Func_User_Data
      5. Gtk.List_Box.Set_Sort_Func_User_Data
    296. Gtk.List_Box_Row
    297. Gtk.List_Item
    298. Gtk.List_Item_Factory
    299. Gtk.List_Store
      1. Gtk.List_Store.Foreach_User_Data
      2. Gtk.List_Store.Set_Default_Sort_Func_User_Data
      3. Gtk.List_Store.Set_Sort_Func_User_Data
    300. Gtk.List_View
    301. Gtk.Main
    302. Gtk.Map_List_Model
      1. Gtk.Map_List_Model.Map_List_Model_User_Data
    303. Gtk.Menu_Button
      1. Gtk.Menu_Button.Set_Create_Popup_Func_User_Data
    304. Gtk.Message_Dialog
    305. Gtk.Mnemonic_Action
    306. Gtk.Mnemonic_Trigger
    307. Gtk.Multi_Filter
    308. Gtk.Multi_Selection
    309. Gtk.Multi_Sorter
    310. Gtk.Named_Action
    311. Gtk.Native
    312. Gtk.Native_Dialog
    313. Gtk.Never_Trigger
    314. Gtk.No_Selection
    315. Gtk.Notebook
    316. Gtk.Notebook_Page
    317. Gtk.Nothing_Action
    318. Gtk.Numeric_Sorter
    319. Gtk.Object_Expression
    320. Gtk.Orientable
    321. Gtk.Overlay
    322. Gtk.Overlay_Layout
    323. Gtk.Page_Setup
    324. Gtk.Page_Setup_Unix_Dialog
    325. Gtk.Paned
    326. Gtk.Paper_Size
    327. Gtk.Password_Entry
    328. Gtk.Password_Entry_Buffer
    329. Gtk.Picture
    330. Gtk.Popover
    331. Gtk.Popover_Menu
    332. Gtk.Popover_Menu_Bar
    333. Gtk.Print_Context
    334. Gtk.Print_Dialog
    335. Gtk.Print_Operation
    336. Gtk.Print_Operation_Preview
    337. Gtk.Print_Settings
      1. Gtk.Print_Settings.Foreach_User_Data
    338. Gtk.Print_Setup
    339. Gtk.Progress_Bar
    340. Gtk.Property_Expression
    341. Gtk.Recent_Info
    342. Gtk.Recent_Manager
    343. Gtk.Revealer
    344. Gtk.Root
    345. Gtk.Scale
      1. Gtk.Scale.Set_Format_Value_Func_User_Data
    346. Gtk.Scale_Button
    347. Gtk.Scroll_Info
    348. Gtk.Scrollable
    349. Gtk.Scrollbar
    350. Gtk.Scrolled_Window
    351. Gtk.Search_Bar
    352. Gtk.Search_Entry
    353. Gtk.Section_Model
    354. Gtk.Selection_Filter_Model
    355. Gtk.Selection_Model
    356. Gtk.Separator
    357. Gtk.Settings
    358. Gtk.Shortcut
    359. Gtk.Shortcut_Action
    360. Gtk.Shortcut_Controller
    361. Gtk.Shortcut_Manager
    362. Gtk.Shortcut_Trigger
    363. Gtk.Signal_Action
    364. Gtk.Signal_List_Item_Factory
    365. Gtk.Single_Selection
    366. Gtk.Size_Group
    367. Gtk.Slice_List_Model
    368. Gtk.Snapshot
    369. Gtk.Sort_List_Model
    370. Gtk.Sorter
    371. Gtk.Spin_Button
    372. Gtk.Spinner
    373. Gtk.Stack
    374. Gtk.Stack_Page
    375. Gtk.Stack_Sidebar
    376. Gtk.Stack_Switcher
    377. Gtk.String_Filter
    378. Gtk.String_List
    379. Gtk.String_Object
    380. Gtk.String_Sorter
    381. Gtk.Style_Context
    382. Gtk.Style_Provider
    383. Gtk.Switch
    384. Gtk.Symbolic_Paintable
    385. Gtk.Text_Buffer
    386. Gtk.Text_Child_Anchor
    387. Gtk.Text_Iter
      1. Gtk.Text_Iter.Forward_Find_Char_User_Data
    388. Gtk.Text_Mark
    389. Gtk.Text_Tag
    390. Gtk.Text_Tag_Table
      1. Gtk.Text_Tag_Table.Foreach_User_Data
    391. Gtk.Text_View
    392. Gtk.Toggle_Button
    393. Gtk.Tooltip
    394. Gtk.Tree_Drag_Dest
    395. Gtk.Tree_Drag_Source
    396. Gtk.Tree_Expander
    397. Gtk.Tree_List_Model
      1. Gtk.Tree_List_Model.Gtk_Tree_List_Model_User_Data
    398. Gtk.Tree_List_Row
    399. Gtk.Tree_List_Row_Sorter
    400. Gtk.Tree_Model
      1. Gtk.Tree_Model.Foreach_User_Data
    401. Gtk.Tree_Model_Filter
      1. Gtk.Tree_Model_Filter.Foreach_User_Data
      2. Gtk.Tree_Model_Filter.Set_Modify_Func_User_Data
      3. Gtk.Tree_Model_Filter.Set_Visible_Func_User_Data
    402. Gtk.Tree_Model_Sort
      1. Gtk.Tree_Model_Sort.Foreach_User_Data
      2. Gtk.Tree_Model_Sort.Set_Default_Sort_Func_User_Data
      3. Gtk.Tree_Model_Sort.Set_Sort_Func_User_Data
    403. Gtk.Tree_Row_Reference
    404. Gtk.Tree_Selection
      1. Gtk.Tree_Selection.Selected_Foreach_User_Data
      2. Gtk.Tree_Selection.Set_Select_Function_User_Data
    405. Gtk.Tree_Sortable
      1. Gtk.Tree_Sortable.Set_Default_Sort_Func_User_Data
      2. Gtk.Tree_Sortable.Set_Sort_Func_User_Data
    406. Gtk.Tree_Store
      1. Gtk.Tree_Store.Foreach_User_Data
      2. Gtk.Tree_Store.Generic_Set
      3. Gtk.Tree_Store.Set_Default_Sort_Func_User_Data
      4. Gtk.Tree_Store.Set_Sort_Func_User_Data
    407. Gtk.Tree_View
      1. Gtk.Tree_View.Insert_Column_With_Data_Func_User_Data
      2. Gtk.Tree_View.Map_Expanded_Rows_User_Data
      3. Gtk.Tree_View.Set_Column_Drag_Function_User_Data
      4. Gtk.Tree_View.Set_Row_Separator_Func_User_Data
      5. Gtk.Tree_View.Set_Search_Equal_Func_User_Data
    408. Gtk.Tree_View_Column
      1. Gtk.Tree_View_Column.Set_Cell_Data_Func_User_Data
    409. Gtk.Try_Expression
    410. Gtk.Uri_Launcher
    411. Gtk.Viewport
    412. Gtk.Volume_Button
    413. Gtk.Widget
      1. Gtk.Widget.Add_Tick_Callback_User_Data
    414. Gtk.Window
    415. Gtkada
    416. Gtkada.Bindings
    417. Gtkada.C
      1. Gtkada.C.Unbounded_Arrays
    418. Gtkada.Intl
    419. Gtkada.Types
    420. Pango
    421. Pango.Attributes
    422. Pango.Cairo
    423. Pango.Color
    424. Pango.Context
    425. Pango.Coverage
    426. Pango.Enums
    427. Pango.Font
    428. Pango.Font_Face
    429. Pango.Font_Family
    430. Pango.Font_Map
    431. Pango.Font_Metrics
    432. Pango.Fontset
      1. Pango.Fontset.Foreach_User_Data
    433. Pango.Language
    434. Pango.Layout
    435. Pango.Matrix
    436. Pango.Tabs
  2. Tagged Types

    1. Gdk.App_Launch_Context.Gdk_App_Launch_Context_Record
    2. Gdk.Cicp_Params.Gdk_Cicp_Params_Record
    3. Gdk.Clipboard.Gdk_Clipboard_Record
    4. Gdk.Color_State.Gdk_Color_State
    5. Gdk.Content_Formats.Gdk_Content_Formats
    6. Gdk.Content_Provider.Gdk_Content_Provider_Record
    7. Gdk.Cursor.Gdk_Cursor_Record
    8. Gdk.Device.Gdk_Device_Record
    9. Gdk.Device_Tool.Gdk_Device_Tool_Record
    10. Gdk.Display.Gdk_Display_Record
    11. Gdk.Display_Manager.Gdk_Display_Manager_Record
    12. Gdk.Dmabuf_Formats.Gdk_Dmabuf_Formats
    13. Gdk.Dmabuf_Texture.Gdk_Dmabuf_Texture_Record
    14. Gdk.Dmabuf_Texture_Builder.Gdk_Dmabuf_Texture_Builder_Record
    15. Gdk.Drag.Gdk_Drag_Record
    16. Gdk.Draw_Context.Gdk_Draw_Context_Record
    17. Gdk.Event.Button_Event.Gdk_Button_Event
    18. Gdk.Event.DND_Event.Gdk_DND_Event
    19. Gdk.Event.Crossing_Event.Gdk_Crossing_Event
    20. Gdk.Event.Delete_Event.Gdk_Delete_Event
    21. Gdk.Event.Focus_Event.Gdk_Focus_Event
    22. Gdk.Drop.Gdk_Drop_Record
    23. Gdk.Event.Gdk_Event
    24. Gdk.Event.Grab_Broken_Event.Gdk_Grab_Broken_Event
    25. Gdk.Event.Key_Event.Gdk_Key_Event
    26. Gdk.Event.Motion_Event.Gdk_Motion_Event
    27. Gdk.Event.Pad_Event.Gdk_Pad_Event
    28. Gdk.Event.Proximity_Event.Gdk_Proximity_Event
    29. Gdk.Event.Scroll_Event.Gdk_Scroll_Event
    30. Gdk.Event.Touch_Event.Gdk_Touch_Event
    31. Gdk.Event.Touchpad_Event.Gdk_Touchpad_Event
    32. Gdk.Frame_Clock.Gdk_Frame_Clock_Record
    33. Gdk.Frame_Timings.Gdk_Frame_Timings
    34. Gdk.GLContext.Gdk_GLContext_Record
    35. Gdk.GLTexture.Gdk_Gltexture_Record
    36. Gdk.GLTexture_Builder.Gdk_Gltexture_Builder_Record
    37. Gdk.Memory_Texture.Gdk_Memory_Texture_Record
    38. Gdk.Memory_Texture_Builder.Gdk_Memory_Texture_Builder_Record
    39. Gdk.Monitor.Gdk_Monitor_Record
    40. Gdk.Pixbuf.Gdk_Pixbuf_Record
    41. Gdk.Popup_Layout.Gdk_Popup_Layout
    42. Gdk.Seat.Gdk_Seat_Record
    43. Gdk.Snapshot.Gdk_Snapshot_Record
    44. Gdk.Surface.Gdk_Surface_Record
    45. Gdk.Texture.Gdk_Texture_Record
    46. Glib.App_Launch_Context.Gapp_Launch_Context_Record
    47. Glib.Application.Gapplication_Command_Line_Record
    48. Glib.Application.Gapplication_Record
    49. Glib.Bytes.Gbytes
    50. Gdk.Toplevel_Layout.Gdk_Toplevel_Layout
    51. Glib.C_Boxed
    52. Glib.Cancellable.Gcancellable_Record
    53. Glib.File_IO_Stream.Gfile_Iostream_Record
    54. Glib.Date_Time.Gdate_Time
    55. Glib.File_Info.Gfile_Info_Record
    56. Glib.File_Input_Stream.Gfile_Input_Stream_Record
    57. Glib.File_Output_Stream.Gfile_Output_Stream_Record
    58. Glib.Graphs.Layouts.Base_Dummy_Vertex
    59. Glib.Graphs.Edge
    60. Glib.IO_Stream.Giostream_Record
    61. Glib.Graphs.Vertex
    62. Glib.Input_Stream.Ginput_Stream_Record
    63. Glib.List_Store.Glist_Store_Record
    64. Glib.Menu.Gmenu_Item_Record
    65. Glib.Menu.Gmenu_Record
    66. Glib.Menu_Model.Gmenu_Attribute_Iter_Record
    67. Glib.Menu_Model.Gmenu_Link_Iter_Record
    68. Glib.Menu_Model.Gmenu_Model_Record
    69. Glib.Object.GObject_Record
    70. Glib.Notification.Gnotification_Record
    71. Glib.Object.G_Binding_Record
    72. Glib.Option.Goption_Context
    73. Glib.Output_Stream.Goutput_Stream_Record
    74. Glib.Resource.Gresource
    75. Glib.Settings.Gsettings_Record
    76. Glib.Settings_Backend.Gsettings_Backend_Record
    77. Glib.Settings_Schema.Gsettings_Schema
    78. Glib.Settings_Schema_Key.Gsettings_Schema_Key
    79. Glib.Settings_Schema_Source.Gsettings_Schema_Source
    80. Glib.Simple_Action.Gsimple_Action_Record
    81. Glib.Simple_Action_Group.Gsimple_Action_Group_Record
    82. Glib.Time_Zone.Gtime_Zone
    83. Glib.Variant.Gvariant
    84. Gsk.Path.Gsk_Path
    85. Gsk.Path_Builder.Gsk_Path_Builder
    86. Gsk.Path_Measure.Gsk_Path_Measure
    87. Gsk.Stroke.Gsk_Stroke
    88. Gsk.Transform.Gsk_Transform
    89. Gtk.About_Dialog.Gtk_About_Dialog_Record
    90. Gtk.Accessible_Hyperlink.Gtk_Accessible_Hyperlink_Record
    91. Gtk.Action_Bar.Gtk_Action_Bar_Record
    92. Gtk.Activate_Action.Gtk_Activate_Action_Record
    93. Gtk.Adjustment.Gtk_Adjustment_Record
    94. Gtk.Alert_Dialog.Gtk_Alert_Dialog_Record
    95. Gtk.Alternative_Trigger.Gtk_Alternative_Trigger_Record
    96. Gtk.Any_Filter.Gtk_Any_Filter_Record
    97. Gtk.Application.Gtk_Application_Record
    98. Gtk.Application_Window.Gtk_Application_Window_Record
    99. Gtk.Aspect_Frame.Gtk_Aspect_Frame_Record
    100. Gtk.Assistant.Gtk_Assistant_Record
    101. Gtk.Assistant_Page.Gtk_Assistant_Page_Record
    102. Gtk.Atcontext.Gtk_Atcontext_Record
    103. Gtk.Bin_Layout.Gtk_Bin_Layout_Record
    104. Gtk.Bitset.Gtk_Bitset
    105. Gtk.Bookmark_List.Gtk_Bookmark_List_Record
    106. Gtk.Bool_Filter.Gtk_Bool_Filter_Record
    107. Gtk.Box.Gtk_Box_Record
    108. Gtk.Box_Layout.Gtk_Box_Layout_Record
    109. Gtk.Builder.Gtk_Builder_Record
    110. Gtk.Builder_CScope.Gtk_Builder_C_Scope_Record
    111. Gtk.Builder_List_Item_Factory.Gtk_Builder_List_Item_Factory_Record
    112. Gtk.Button.Gtk_Button_Record
    113. Gtk.Callback_Action.Gtk_Callback_Action_Record
    114. Gtk.Cclosure_Expression.Gtk_Cclosure_Expression_Record
    115. Gtk.Cell_Area.Gtk_Cell_Area_Record
    116. Gtk.Cell_Area_Box.Gtk_Cell_Area_Box_Record
    117. Gtk.Cell_Area_Context.Gtk_Cell_Area_Context_Record
    118. Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record
    119. Gtk.Cell_Renderer_Accel.Gtk_Cell_Renderer_Accel_Record
    120. Gtk.Cell_Renderer_Combo.Gtk_Cell_Renderer_Combo_Record
    121. Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress_Record
    122. Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin_Record
    123. Gtk.Cell_Renderer_Spinner.Gtk_Cell_Renderer_Spinner_Record
    124. Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record
    125. Gtk.Cell_Renderer_Toggle.Gtk_Cell_Renderer_Toggle_Record
    126. Gtk.Cell_View.Gtk_Cell_View_Record
    127. Gtk.Center_Box.Gtk_Center_Box_Record
    128. Gtk.Center_Layout.Gtk_Center_Layout_Record
    129. Gtk.Check_Button.Gtk_Check_Button_Record
    130. Gtk.Closure_Expression.Gtk_Closure_Expression_Record
    131. Gtk.Color_Dialog.Gtk_Color_Dialog_Record
    132. Gtk.Color_Dialog_Button.Gtk_Color_Dialog_Button_Record
    133. Gtk.Column_View.Gtk_Column_View_Record
    134. Gtk.Column_View_Cell.Gtk_Column_View_Cell_Record
    135. Gtk.Column_View_Column.Gtk_Column_View_Column_Record
    136. Gtk.Column_View_Row.Gtk_Column_View_Row_Record
    137. Gtk.Column_View_Sorter.Gtk_Column_View_Sorter_Record
    138. Gtk.Constant_Expression.Gtk_Constant_Expression_Record
    139. Gtk.Constraint.Gtk_Constraint_Record
    140. Gtk.Constraint_Guide.Gtk_Constraint_Guide_Record
    141. Gtk.Constraint_Layout.Gtk_Constraint_Layout_Child_Record
    142. Gtk.Constraint_Layout.Gtk_Constraint_Layout_Record
    143. Gtk.Css_Provider.Gtk_Css_Provider_Record
    144. Gtk.Css_Section.Gtk_Css_Section
    145. Gtk.Custom_Filter.Gtk_Custom_Filter_Record
    146. Gtk.Custom_Sorter.Gtk_Custom_Sorter_Record
    147. Gtk.Dialog.Gtk_Dialog_Record
    148. Gtk.Directory_List.Gtk_Directory_List_Record
    149. Gtk.Drag_Source.Gtk_Drag_Source_Record
    150. Gtk.Drawing_Area.Gtk_Drawing_Area_Record
    151. Gtk.Drop_Down.Gtk_Drop_Down_Record
    152. Gtk.Drop_Target.Gtk_Drop_Target_Record
    153. Gtk.Editable_Label.Gtk_Editable_Label_Record
    154. Gtk.Emoji_Chooser.Gtk_Emoji_Chooser_Record
    155. Gtk.Entry_Buffer.Gtk_Entry_Buffer_Record
    156. Gtk.Entry_Completion.Gtk_Entry_Completion_Record
    157. Gtk.Event_Controller.Gtk_Event_Controller_Record
    158. Gtk.Event_Controller_Focus.Gtk_Event_Controller_Focus_Record
    159. Gtk.Event_Controller_Key.Gtk_Event_Controller_Key_Record
    160. Gtk.Event_Controller_Legacy.Gtk_Event_Controller_Legacy_Record
    161. Gtk.Event_Controller_Motion.Gtk_Event_Controller_Motion_Record
    162. Gtk.Event_Controller_Scroll.Gtk_Event_Controller_Scroll_Record
    163. Gtk.Every_Filter.Gtk_Every_Filter_Record
    164. Gtk.Expander.Gtk_Expander_Record
    165. Gtk.Expression.Dummy_Gtk_Expression_Record
    166. Gtk.Expression.Gtk_Expression_Record
    167. Gtk.Expression_Watch.Gtk_Expression_Watch
    168. Gtk.File_Dialog.Gtk_File_Dialog_Record
    169. Gtk.File_Filter.Gtk_File_Filter_Record
    170. Gtk.File_Launcher.Gtk_File_Launcher_Record
    171. Gtk.Filter.Gtk_Filter_Record
    172. Gtk.Filter_List_Model.Gtk_Filter_List_Model_Record
    173. Gtk.Fixed.Gtk_Fixed_Record
    174. Gtk.Fixed_Layout.Gtk_Fixed_Layout_Child_Record
    175. Gtk.Fixed_Layout.Gtk_Fixed_Layout_Record
    176. Gtk.Flatten_List_Model.Gtk_Flatten_List_Model_Record
    177. Gtk.Flow_Box.Gtk_Flow_Box_Record
    178. Gtk.Flow_Box_Child.Gtk_Flow_Box_Child_Record
    179. Gtk.Font_Dialog.Gtk_Font_Dialog_Record
    180. Gtk.Font_Dialog_Button.Gtk_Font_Dialog_Button_Record
    181. Gtk.Frame.Gtk_Frame_Record
    182. Gtk.GLArea.Gtk_GLArea_Record
    183. Gtk.GRange.Gtk_Range_Record
    184. Gtk.GEntry.Gtk_Entry_Record
    185. Gtk.Gesture.Gtk_Gesture_Record
    186. Gtk.Gesture_Click.Gtk_Gesture_Click_Record
    187. Gtk.Gesture_Drag.Gtk_Gesture_Drag_Record
    188. Gtk.Gesture_Long_Press.Gtk_Gesture_Long_Press_Record
    189. Gtk.Gesture_Pan.Gtk_Gesture_Pan_Record
    190. Gtk.Gesture_Rotate.Gtk_Gesture_Rotate_Record
    191. Gtk.Gesture_Single.Gtk_Gesture_Single_Record
    192. Gtk.Gesture_Stylus.Gtk_Gesture_Stylus_Record
    193. Gtk.Gesture_Swipe.Gtk_Gesture_Swipe_Record
    194. Gtk.Gesture_Zoom.Gtk_Gesture_Zoom_Record
    195. Gtk.Graphics_Offload.Gtk_Graphics_Offload_Record
    196. Gtk.Grid.Gtk_Grid_Record
    197. Gtk.Grid_Layout.Gtk_Grid_Layout_Child_Record
    198. Gtk.Grid_Layout.Gtk_Grid_Layout_Record
    199. Gtk.Grid_View.Gtk_Grid_View_Record
    200. Gtk.IM_Context.Gtk_IM_Context_Record
    201. Gtk.IM_Context_Simple.Gtk_IM_Context_Simple_Record
    202. Gtk.IM_Multi_Context.Gtk_IM_Multi_Context_Record
    203. Gtk.Header_Bar.Gtk_Header_Bar_Record
    204. Gtk.Icon_Paintable.Gtk_Icon_Paintable_Record
    205. Gtk.Icon_Theme.Gtk_Icon_Theme_Record
    206. Gtk.Image.Gtk_Image_Record
    207. Gtk.Info_Bar.Gtk_Info_Bar_Record
    208. Gtk.Inscription.Gtk_Inscription_Record
    209. Gtk.Keyval_Trigger.Gtk_Keyval_Trigger_Record
    210. Gtk.Label.Gtk_Label_Record
    211. Gtk.Layout_Manager.Gtk_Layout_Child_Record
    212. Gtk.Layout_Manager.Gtk_Layout_Manager_Record
    213. Gtk.Level_Bar.Gtk_Level_Bar_Record
    214. Gtk.Link_Button.Gtk_Link_Button_Record
    215. Gtk.List_Base.Gtk_List_Base_Record
    216. Gtk.List_Box.Gtk_List_Box_Record
    217. Gtk.List_Box_Row.Gtk_List_Box_Row_Record
    218. Gtk.List_Item.Gtk_List_Item_Record
    219. Gtk.List_Item_Factory.Gtk_List_Item_Factory_Record
    220. Gtk.List_Store.Gtk_List_Store_Record
    221. Gtk.List_View.Gtk_List_View_Record
    222. Gtk.Map_List_Model.Gtk_Map_List_Model_Record
    223. Gtk.Menu_Button.Gtk_Menu_Button_Record
    224. Gtk.Message_Dialog.Gtk_Message_Dialog_Record
    225. Gtk.Mnemonic_Action.Gtk_Mnemonic_Action_Record
    226. Gtk.Mnemonic_Trigger.Gtk_Mnemonic_Trigger_Record
    227. Gtk.Multi_Filter.Gtk_Multi_Filter_Record
    228. Gtk.Multi_Selection.Gtk_Multi_Selection_Record
    229. Gtk.Multi_Sorter.Gtk_Multi_Sorter_Record
    230. Gtk.Named_Action.Gtk_Named_Action_Record
    231. Gtk.Native_Dialog.Gtk_Native_Dialog_Record
    232. Gtk.Never_Trigger.Gtk_Never_Trigger_Record
    233. Gtk.No_Selection.Gtk_No_Selection_Record
    234. Gtk.Notebook.Gtk_Notebook_Record
    235. Gtk.Notebook_Page.Gtk_Notebook_Page_Record
    236. Gtk.Nothing_Action.Gtk_Nothing_Action_Record
    237. Gtk.Numeric_Sorter.Gtk_Numeric_Sorter_Record
    238. Gtk.Object_Expression.Gtk_Object_Expression_Record
    239. Gtk.Overlay.Gtk_Overlay_Record
    240. Gtk.Overlay_Layout.Gtk_Overlay_Layout_Child_Record
    241. Gtk.Overlay_Layout.Gtk_Overlay_Layout_Record
    242. Gtk.Page_Setup.Gtk_Page_Setup_Record
    243. Gtk.Page_Setup_Unix_Dialog.Gtk_Page_Setup_Unix_Dialog_Record
    244. Gtk.Paned.Gtk_Paned_Record
    245. Gtk.Paper_Size.Gtk_Paper_Size
    246. Gtk.Password_Entry.Gtk_Password_Entry_Record
    247. Gtk.Password_Entry_Buffer.Gtk_Password_Entry_Buffer_Record
    248. Gtk.Picture.Gtk_Picture_Record
    249. Gtk.Popover.Gtk_Popover_Record
    250. Gtk.Popover_Menu.Gtk_Popover_Menu_Record
    251. Gtk.Popover_Menu_Bar.Gtk_Popover_Menu_Bar_Record
    252. Gtk.Print_Context.Gtk_Print_Context_Record
    253. Gtk.Print_Dialog.Gtk_Print_Dialog_Record
    254. Gtk.Print_Operation.Gtk_Print_Operation_Record
    255. Gtk.Print_Settings.Gtk_Print_Settings_Record
    256. Gtk.Print_Setup.Gtk_Print_Setup
    257. Gtk.Progress_Bar.Gtk_Progress_Bar_Record
    258. Gtk.Property_Expression.Gtk_Property_Expression_Record
    259. Gtk.Recent_Info.Gtk_Recent_Info
    260. Gtk.Recent_Manager.Gtk_Recent_Manager_Record
    261. Gtk.Revealer.Gtk_Revealer_Record
    262. Gtk.Scale.Gtk_Scale_Record
    263. Gtk.Scale_Button.Gtk_Scale_Button_Record
    264. Gtk.Scroll_Info.Gtk_Scroll_Info
    265. Gtk.Scrollbar.Gtk_Scrollbar_Record
    266. Gtk.Scrolled_Window.Gtk_Scrolled_Window_Record
    267. Gtk.Search_Bar.Gtk_Search_Bar_Record
    268. Gtk.Search_Entry.Gtk_Search_Entry_Record
    269. Gtk.Selection_Filter_Model.Gtk_Selection_Filter_Model_Record
    270. Gtk.Separator.Gtk_Separator_Record
    271. Gtk.Settings.Gtk_Settings_Record
    272. Gtk.Shortcut.Gtk_Shortcut_Record
    273. Gtk.Shortcut_Action.Gtk_Shortcut_Action_Record
    274. Gtk.Shortcut_Controller.Gtk_Shortcut_Controller_Record
    275. Gtk.Shortcut_Trigger.Gtk_Shortcut_Trigger_Record
    276. Gtk.Signal_Action.Gtk_Signal_Action_Record
    277. Gtk.Signal_List_Item_Factory.Gtk_Signal_List_Item_Factory_Record
    278. Gtk.Single_Selection.Gtk_Single_Selection_Record
    279. Gtk.Size_Group.Gtk_Size_Group_Record
    280. Gtk.Slice_List_Model.Gtk_Slice_List_Model_Record
    281. Gtk.Snapshot.Gtk_Snapshot_Record
    282. Gtk.Sort_List_Model.Gtk_Sort_List_Model_Record
    283. Gtk.Sorter.Gtk_Sorter_Record
    284. Gtk.Spin_Button.Gtk_Spin_Button_Record
    285. Gtk.Spinner.Gtk_Spinner_Record
    286. Gtk.Stack.Gtk_Stack_Record
    287. Gtk.Stack_Page.Gtk_Stack_Page_Record
    288. Gtk.Stack_Sidebar.Gtk_Stack_Sidebar_Record
    289. Gtk.Stack_Switcher.Gtk_Stack_Switcher_Record
    290. Gtk.String_Filter.Gtk_String_Filter_Record
    291. Gtk.String_List.Gtk_String_List_Record
    292. Gtk.String_Object.Gtk_String_Object_Record
    293. Gtk.String_Sorter.Gtk_String_Sorter_Record
    294. Gtk.Style_Context.Gtk_Style_Context_Record
    295. Gtk.Switch.Gtk_Switch_Record
    296. Gtk.Text_Buffer.Gtk_Text_Buffer_Record
    297. Gtk.Text_Child_Anchor.Gtk_Text_Child_Anchor_Record
    298. Gtk.Text_Mark.Gtk_Text_Mark_Record
    299. Gtk.Text_Tag.Gtk_Text_Tag_Record
    300. Gtk.Text_Tag_Table.Gtk_Text_Tag_Table_Record
    301. Gtk.Text_View.Gtk_Text_View_Record
    302. Gtk.Toggle_Button.Gtk_Toggle_Button_Record
    303. Gtk.Tooltip.Gtk_Tooltip_Record
    304. Gtk.Tree_Expander.Gtk_Tree_Expander_Record
    305. Gtk.Tree_List_Model.Gtk_Tree_List_Model_Record
    306. Gtk.Tree_List_Row.Gtk_Tree_List_Row_Record
    307. Gtk.Tree_List_Row_Sorter.Gtk_Tree_List_Row_Sorter_Record
    308. Gtk.Tree_Model.Gtk_Root_Tree_Model_Record
    309. Gtk.Tree_Model.Gtk_Tree_Path
    310. Gtk.Tree_Model_Filter.Gtk_Tree_Model_Filter_Record
    311. Gtk.Tree_Model_Sort.Gtk_Tree_Model_Sort_Record
    312. Gtk.Tree_Row_Reference.Gtk_Tree_Row_Reference
    313. Gtk.Tree_Selection.Gtk_Tree_Selection_Record
    314. Gtk.Tree_Store.Gtk_Tree_Store_Record
    315. Gtk.Tree_View.Gtk_Tree_View_Record
    316. Gtk.Tree_View_Column.Gtk_Tree_View_Column_Record
    317. Gtk.Try_Expression.Gtk_Try_Expression_Record
    318. Gtk.Uri_Launcher.Gtk_Uri_Launcher_Record
    319. Gtk.Viewport.Gtk_Viewport_Record
    320. Gtk.Volume_Button.Gtk_Volume_Button_Record
    321. Gtk.Widget.Gtk_Widget_Record
    322. Gtk.Window.Gtk_Window_Group_Record
    323. Gtk.Window.Gtk_Window_Record
    324. Pango.Attributes.Pango_Attr_List
    325. Pango.Context.Pango_Context_Record
    326. Pango.Coverage.Pango_Coverage_Record
    327. Pango.Font.Pango_Font_Record
    328. Pango.Font_Face.Pango_Font_Face_Record
    329. Pango.Font_Family.Pango_Font_Family_Record
    330. Pango.Font_Map.Pango_Font_Map_Record
    331. Pango.Font_Metrics.Pango_Font_Metrics
    332. Pango.Fontset.Pango_Fontset_Record
    333. Pango.Language.Pango_Language
    334. Pango.Layout.Pango_Layout_Iter
    335. Pango.Layout.Pango_Layout_Record
    336. Pango.Tabs.Pango_Tab_Array

Glib.Variant

Description

Glib.Variant.Gvariant is a variant datatype; it can contain one or more values along with information about the type of the values.

A Glib.Variant.Gvariant may contain simple types, like an integer, or a boolean value; or complex types, like an array of two strings, or a dictionary of key value pairs. A Glib.Variant.Gvariant is also immutable: once it's been created neither its type nor its content can be modified further.

GVariant is useful whenever data needs to be serialized, for example when sending method parameters in D-Bus, or when saving settings using GSettings.

When creating a new Glib.Variant.Gvariant, you pass the data you want to store in it along with a string representing the type of data you wish to pass to it.

For instance, if you want to create a Glib.Variant.Gvariant holding an integer value you can use:

GVariant *v = g_variant_new ("u", 40);

The string "u" in the first argument tells Glib.Variant.Gvariant that the data passed to the constructor (40) is going to be an unsigned integer.

More advanced examples of Glib.Variant.Gvariant in use can be found in documentation for [GVariant format strings][gvariant-format-strings-pointers].

The range of possible values is determined by the type.

The type system used by Glib.Variant.Gvariant is Glib.Variant.Gvariant_Type.

Glib.Variant.Gvariant instances always have a type and a value (which are given at construction time). The type and value of a Glib.Variant.Gvariant instance can never change other than by the Glib.Variant.Gvariant itself being destroyed. A Glib.Variant.Gvariant cannot contain a pointer.

Glib.Variant.Gvariant is reference counted using Glib.Variant.Ref and Glib.Variant.Unref. Glib.Variant.Gvariant also has floating reference counts -- see Glib.Variant.Ref_Sink.

Glib.Variant.Gvariant is completely threadsafe. A Glib.Variant.Gvariant instance can be concurrently accessed in any way from any number of threads without problems.

Glib.Variant.Gvariant is heavily optimised for dealing with data in serialized form. It works particularly well with data located in memory-mapped files. It can perform nearly all deserialization operations in a small constant time, usually touching only a single memory page. Serialized Glib.Variant.Gvariant data can also be sent over the network.

Glib.Variant.Gvariant is largely compatible with D-Bus. Almost all types of Glib.Variant.Gvariant instances can be sent over D-Bus. See Glib.Variant.Gvariant_Type for exceptions. (However, Glib.Variant.Gvariant's serialization format is not the same as the serialization format of a D-Bus message body: use Gdbus.Message.Gdbus_Message, in the gio library, for those.)

For space-efficiency, the Glib.Variant.Gvariant serialization format does not automatically include the variant's length, type or endianness, which must either be implied from context (such as knowledge that a particular file format always contains a little-endian G_VARIANT_TYPE_VARIANT which occupies the whole length of the file) or supplied out-of-band (for instance, a length, type and/or endianness indicator could be placed at the beginning of a file, network message or network stream).

A Glib.Variant.Gvariant's size is limited mainly by any lower level operating system constraints, such as the number of bits in Gsize. For example, it is reasonable to have a 2GB file mapped into memory with Gmapped.File.Gmapped_File, and call g_variant_new_from_data on it.

For convenience to C programmers, Glib.Variant.Gvariant features powerful varargs-based value construction and destruction. This feature is designed to be embedded in other libraries.

There is a Python-inspired text language for describing Glib.Variant.Gvariant values. Glib.Variant.Gvariant includes a printer for this language and a parser with type inferencing.

## Memory Use

Glib.Variant.Gvariant tries to be quite efficient with respect to memory use. This section gives a rough idea of how much memory is used by the current implementation. The information here is subject to change in the future.

The memory allocated by Glib.Variant.Gvariant can be grouped into 4 broad purposes: memory for serialized data, memory for the type information cache, buffer management memory and memory for the Glib.Variant.Gvariant structure itself.

## Serialized Data Memory

This is the memory that is used for storing GVariant data in serialized form. This is what would be sent over the network or what would end up on disk, not counting any indicator of the endianness, or of the length or type of the top-level variant.

The amount of memory required to store a boolean is 1 byte. 16, 32 and 64 bit integers and double precision floating point numbers use their "natural" size. Strings (including object path and signature strings) are stored with a nul terminator, and as such use the length of the string plus 1 byte.

Maybe types use no space at all to represent the null value and use the same amount of space (sometimes plus one byte) as the equivalent non-maybe-typed value to represent the non-null case.

Arrays use the amount of space required to store each of their members, concatenated. Additionally, if the items stored in an array are not of a fixed-size (ie: strings, other arrays, etc) then an additional framing offset is stored for each item. The size of this offset is either 1, 2 or 4 bytes depending on the overall size of the container. Additionally, extra padding bytes are added as required for alignment of child values.

Tuples (including dictionary entries) use the amount of space required to store each of their members, concatenated, plus one framing offset (as per arrays) for each non-fixed-sized item in the tuple, except for the last one. Additionally, extra padding bytes are added as required for alignment of child values.

Variants use the same amount of space as the item inside of the variant, plus 1 byte, plus the length of the type string for the item inside the variant.

As an example, consider a dictionary mapping strings to variants. In the case that the dictionary is empty, 0 bytes are required for the serialization.

If we add an item "width" that maps to the int32 value of 500 then we will use 4 byte to store the int32 (so 6 for the variant containing it) and 6 bytes for the string. The variant must be aligned to 8 after the 6 bytes of the string, so that's 2 extra bytes. 6 (string) + 2 (padding) + 6 (variant) is 14 bytes used for the dictionary entry. An additional 1 byte is added to the array as a framing offset making a total of 15 bytes.

If we add another entry, "title" that maps to a nullable string that happens to have a value of null, then we use 0 bytes for the null value (and 3 bytes for the variant to contain it along with its type string) plus 6 bytes for the string. Again, we need 2 padding bytes. That makes a total of 6 + 2 + 3 = 11 bytes.

We now require extra padding between the two items in the array. After the 14 bytes of the first item, that's 2 bytes required. We now require 2 framing offsets for an extra two bytes. 14 + 2 + 11 + 2 = 29 bytes to encode the entire two-item dictionary.

## Type Information Cache

For each GVariant type that currently exists in the program a type information structure is kept in the type information cache. The type information structure is required for rapid deserialization.

Continuing with the above example, if a Glib.Variant.Gvariant exists with the type "a{sv}" then a type information struct will exist for "a{sv}", "{sv}", "s", and "v". Multiple uses of the same type will share the same type information. Additionally, all single-digit types are stored in read-only static memory and do not contribute to the writable memory footprint of a program using Glib.Variant.Gvariant.

Aside from the type information structures stored in read-only memory, there are two forms of type information. One is used for container types where there is a single element type: arrays and maybe types. The other is used for container types where there are multiple element types: tuples and dictionary entries.

Array type info structures are 6 * sizeof (void *), plus the memory required to store the type string itself. This means that on 32-bit systems, the cache entry for "a{sv}" would require 30 bytes of memory (plus malloc overhead).

Tuple type info structures are 6 * sizeof (void *), plus 4 * sizeof (void *) for each item in the tuple, plus the memory required to store the type string itself. A 2-item tuple, for example, would have a type information structure that consumed writable memory in the size of 14 * sizeof (void *) (plus type string) This means that on 32-bit systems, the cache entry for "{sv}" would require 61 bytes of memory (plus malloc overhead).

This means that in total, for our "a{sv}" example, 91 bytes of type information would be allocated.

The type information cache, additionally, uses a GHash_Table to store and look up the cached items and stores a pointer to this hash table in static storage. The hash table is freed when there are zero items in the type cache.

Although these sizes may seem large it is important to remember that a program will probably only have a very small number of different types of values in it and that only one type information structure is required for many different values of the same type.

## Buffer Management Memory

Glib.Variant.Gvariant uses an internal buffer management structure to deal with the various different possible sources of serialized data that it uses. The buffer is responsible for ensuring that the correct call is made when the data is no longer in use by Glib.Variant.Gvariant. This may involve a g_free or a g_slice_free or even g_mapped_file_unref.

One buffer management structure is used for each chunk of serialized data. The size of the buffer management structure is 4 * (void *). On 32-bit systems, that's 16 bytes.

## GVariant structure

The size of a Glib.Variant.Gvariant structure is 6 * (void *). On 32-bit systems, that's 24 bytes.

Glib.Variant.Gvariant structures only exist if they are explicitly created with API calls. For example, if a Glib.Variant.Gvariant is constructed out of serialized data for the example given above (with the dictionary) then although there are 9 individual values that comprise the entire dictionary (two keys, two values, two variants containing the values, two dictionary entries, plus the dictionary itself), only 1 Glib.Variant.Gvariant instance exists -- the one referring to the dictionary.

If calls are made to start accessing the other values then Glib.Variant.Gvariant instances will exist for those values only for as long as they are in use (ie: until you call Glib.Variant.Unref). The type information is shared. The serialized data and the buffer management structure for that serialized data is shared by the child.

## Summary

To put the entire example together, for our dictionary mapping strings to variants (with two entries, as given above), we are using 91 bytes of memory for type information, 29 bytes of memory for the serialized data, 16 bytes for buffer management and 24 bytes for the Glib.Variant.Gvariant instance, or a total of 160 bytes, plus malloc overhead. If we were to use Glib.Variant.Get_Child_Value to access the two dictionary entries, we would use an additional 48 bytes. If we were to have other dictionaries of the same type, we would use more memory for the serialized data and buffer management for those dictionaries, but the type information would be shared.

Byteswap

function Byteswap (Self : Gvariant) return Gvariant

Performs a byteswapping operation on the contents of Value. The result is that all multi-byte numeric data contained in Value is byteswapped. That includes 16, 32, and 64bit signed and unsigned integers as well as file handles and double precision floating point values. This function is an identity mapping on any value that does not contain multi-byte numeric data. That include strings, booleans, bytes and containers containing only these things (recursively). While this function can safely handle untrusted, non-normal data, it is recommended to check whether the input is in normal form beforehand, using Glib.Variant.Is_Normal_Form, and to reject non-normal inputs if your application can be strict about what inputs it rejects. The returned value is always in normal form and is marked as trusted. A full, not floating, reference is returned. Since: gtk+ 2.24

Parameters
Self
Return Value

the byteswapped form of Value. Has transfer-ownership='full'.

Check_Format_String

function Check_Format_String
   (Self          : Gvariant;
    Format_String : UTF8_String;
    Copy_Only     : Boolean) return Boolean

Checks if calling g_variant_get with Format_String on Value would be valid from a type-compatibility standpoint. Format_String is assumed to be a valid format string (from a syntactic standpoint). If Copy_Only is True then this function additionally checks that it would be safe to call Glib.Variant.Unref on Value immediately after the call to g_variant_get without invalidating the result. This is only possible if deep copies are made (ie: there are no pointers to the data inside of the soon-to-be-freed Glib.Variant.Gvariant instance). If this check fails then a g_critical is printed and False is returned. This function is meant to be used by functions that wish to provide varargs accessors to Glib.Variant.Gvariant values of uncertain values (eg: g_variant_lookup or g_menu_model_get_item_attribute). Since: gtk+ 2.34

Parameters
Self
Format_String

a valid Glib.Variant.Gvariant format string

Copy_Only

True to ensure the format string makes deep copies

Return Value

True if Format_String is safe to use

Classify

function Classify (Self : Gvariant) return GVariant_Class

Classifies Value according to its top-level type. Since: gtk+ 2.24

Parameters
Self
Return Value

the Glib.Variant.GVariant_Class of Value

Copy

function Copy (Self : Gvariant_Type) return Gvariant_Type

Makes a copy of a Glib.Variant.Gvariant_Type. It is appropriate to call Glib.Variant.Free on the return value. Type may not be null.

Parameters
Self
Return Value

a new Glib.Variant.Gvariant_Type Since 2.24

Dup_Bytestring_Array

function Dup_Bytestring_Array
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of array of bytes Glib.Variant.Gvariant. This call makes a deep copy; the return result should be released with g_strfreev. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.26

Parameters
Self
Length

the length of the result, or null

Return Value

an array of strings

Dup_Objv

function Dup_Objv
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of object paths Glib.Variant.Gvariant. This call makes a deep copy; the return result should be released with g_strfreev. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.30

Parameters
Self
Length

the length of the result, or null

Return Value

an array of strings

Dup_String

function Dup_String
   (Self   : Gvariant;
    Length : access Gsize := null) return UTF8_String

Similar to Glib.Variant.Get_String except that instead of returning a constant string, the string is duplicated. The string will always be UTF-8 encoded. The return value must be freed using g_free. Since: gtk+ 2.24

Parameters
Self
Length

a pointer to a Gsize, to store the length

Return Value

a newly allocated string, UTF-8 encoded

Dup_String

function Dup_String (Self : Gvariant_Type) return UTF8_String

Returns a newly-allocated copy of the type string corresponding to Type. The returned string is nul-terminated. It is appropriate to call g_free on the return value.

Parameters
Self
Return Value

the corresponding type string Since 2.24

Dup_Strv

function Dup_Strv
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of strings Glib.Variant.Gvariant. This call makes a deep copy; the return result should be released with g_strfreev. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.24

Parameters
Self
Length

the length of the result, or null

Return Value

an array of strings

Element

function Element (Self : Gvariant_Type) return Gvariant_Type

Determines the element type of an array or maybe type. This function may only be used with array or maybe types.

Parameters
Self
Return Value

the element type of Type Since 2.24

First

function First (Self : Gvariant_Type) return Gvariant_Type

Determines the first item type of a tuple or dictionary entry type. This function may only be used with tuple or dictionary entry types, but must not be used with the generic tuple type G_VARIANT_TYPE_TUPLE. In the case of a dictionary entry type, this returns the type of the key. null is returned in case of Type being G_VARIANT_TYPE_UNIT. This call, together with Glib.Variant.Next provides an iterator interface over tuple and dictionary entry types.

Parameters
Self
Return Value

the first item type of Type, or null Since 2.24

Free

procedure Free (Self : Gvariant_Type)

Frees a Glib.Variant.Gvariant_Type that was allocated with Glib.Variant.Copy, g_variant_type_new or one of the container type constructor functions. In the case that Type is null, this function does nothing. Since 2.24

Parameters
Self

From_Object

function From_Object (Object : System.Address) return Gvariant
Parameters
Object
Return Value

From_Object_Free

function From_Object_Free (B : access Gvariant'Class) return Gvariant
Parameters
B
Return Value

G_New

procedure G_New (Self : out Gvariant_Type; Type_String : UTF8_String)

Creates a new Glib.Variant.Gvariant_Type corresponding to the type string given by Type_String. It is appropriate to call Glib.Variant.Free on the return value. It is a programmer error to call this function with an invalid type string. Use Glib.Variant.String_Is_Valid if you are unsure. Since: gtk+ 2.24

Parameters
Self
Type_String

a valid GVariant type string

G_New_Boolean

procedure G_New_Boolean (Self : out Gvariant; Value : Boolean)

Creates a new boolean Glib.Variant.Gvariant instance -- either True or False. Since: gtk+ 2.24

Parameters
Self
Value

a Boolean value

G_New_Byte

procedure G_New_Byte (Self : out Gvariant; Value : Guint8)

Creates a new byte Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Guint8 value

G_New_Bytestring

procedure G_New_Bytestring (Self : out Gvariant; String : Guint8_Array)

Creates an array-of-bytes Glib.Variant.Gvariant with the contents of String. This function is just like g_variant_new_string except that the string need not be valid UTF-8. The nul terminator character at the end of the string is stored in the array. Since: gtk+ 2.26

Parameters
Self
String

a normal nul-terminated string in no particular encoding

G_New_Bytestring_Array

procedure G_New_Bytestring_Array
   (Self   : out Gvariant;
    Strv   : GNAT.Strings.String_List;
    Length : Gssize)

Constructs an array of bytestring Glib.Variant.Gvariant from the given array of strings. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.26

Parameters
Self
Strv

an array of strings

Length

the length of Strv, or -1

G_New_Dict_Entry

procedure G_New_Dict_Entry
   (Self  : out Gvariant;
    Key   : Gvariant;
    Value : Gvariant)

Creates a new dictionary entry Glib.Variant.Gvariant. Key and Value must be non-null. Key must be a value of a basic type (ie: not a container). If the Key or Value are floating references (see Glib.Variant.Ref_Sink), the new instance takes ownership of them as if via Glib.Variant.Ref_Sink. Since: gtk+ 2.24

Parameters
Self
Key

a basic Glib.Variant.Gvariant, the key

Value

a Glib.Variant.Gvariant, the value

G_New_Dict_Entry

procedure G_New_Dict_Entry
   (Self  : out Gvariant_Type;
    Key   : Gvariant_Type;
    Value : Gvariant_Type)

Constructs the type corresponding to a dictionary entry with a key of type Key and a value of type Value. It is appropriate to call Glib.Variant.Free on the return value.

Parameters
Self
Key

a basic Glib.Variant.Gvariant_Type

Value

a Glib.Variant.Gvariant_Type

G_New_Double

procedure G_New_Double (Self : out Gvariant; Value : Gdouble)

Creates a new double Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Gdouble floating point value

G_New_From_Bytes

procedure G_New_From_Bytes
   (Self     : out Gvariant;
    The_Type : Gvariant_Type;
    Bytes    : Glib.Bytes.Gbytes;
    Trusted  : Boolean)

Constructs a new serialized-mode Glib.Variant.Gvariant instance. This is the inner interface for creation of new serialized values that gets called from various functions in gvariant.c. A reference is taken on Bytes. The data in Bytes must be aligned appropriately for the Type being loaded. Otherwise this function will internally create a copy of the memory (since GLib 2.60) or (in older versions) fail and exit the process. Since: gtk+ 2.36

Parameters
Self
The_Type

a Glib.Variant.Gvariant_Type

Bytes

a Glib.Bytes.Gbytes

Trusted

if the contents of Bytes are trusted

G_New_Handle

procedure G_New_Handle (Self : out Gvariant; Value : Gint32)

Creates a new handle Glib.Variant.Gvariant instance. By convention, handles are indexes into an array of file descriptors that are sent alongside a D-Bus message. If you're not interacting with D-Bus, you probably don't need them. Since: gtk+ 2.24

Parameters
Self
Value

a Gint32 value

G_New_Int16

procedure G_New_Int16 (Self : out Gvariant; Value : Gint16)

Creates a new int16 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Gint16 value

G_New_Int32

procedure G_New_Int32 (Self : out Gvariant; Value : Gint32)

Creates a new int32 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Gint32 value

G_New_Int64

procedure G_New_Int64 (Self : out Gvariant; Value : Gint64)

Creates a new int64 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Gint64 value

G_New_Object_Path

procedure G_New_Object_Path
   (Self        : out Gvariant;
    Object_Path : UTF8_String)

Creates a D-Bus object path Glib.Variant.Gvariant with the contents of Object_Path. Object_Path must be a valid D-Bus object path. Use Glib.Variant.Is_Object_Path if you're not sure. Since: gtk+ 2.24

Parameters
Self
Object_Path

a normal C nul-terminated string

G_New_Objv

procedure G_New_Objv
   (Self   : out Gvariant;
    Strv   : GNAT.Strings.String_List;
    Length : Gssize)

Constructs an array of object paths Glib.Variant.Gvariant from the given array of strings. Each string must be a valid Glib.Variant.Gvariant object path; see Glib.Variant.Is_Object_Path. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.30

Parameters
Self
Strv

an array of strings

Length

the length of Strv, or -1

G_New_Signature

procedure G_New_Signature (Self : out Gvariant; Signature : UTF8_String)

Creates a D-Bus type signature Glib.Variant.Gvariant with the contents of String. String must be a valid D-Bus type signature. Use Glib.Variant.Is_Signature if you're not sure. Since: gtk+ 2.24

Parameters
Self
Signature

a normal C nul-terminated string

G_New_String

procedure G_New_String (Self : out Gvariant; String : UTF8_String)

Creates a string Glib.Variant.Gvariant with the contents of String. String must be valid UTF-8, and must not be null. To encode potentially-null strings, use g_variant_new with ms as the [format string][gvariant-format-strings-maybe-types]. Since: gtk+ 2.24

Parameters
Self
String

a normal UTF-8 nul-terminated string

G_New_Strv

procedure G_New_Strv
   (Self   : out Gvariant;
    Strv   : GNAT.Strings.String_List;
    Length : Gssize)

Constructs an array of strings Glib.Variant.Gvariant from the given array of strings. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.24

Parameters
Self
Strv

an array of strings

Length

the length of Strv, or -1

G_New_Take_String

procedure G_New_Take_String (Self : out Gvariant; String : UTF8_String)

Creates a string Glib.Variant.Gvariant with the contents of String. String must be valid UTF-8, and must not be null. To encode potentially-null strings, use this with g_variant_new_maybe. After this call, String belongs to the Glib.Variant.Gvariant and may no longer be modified by the caller. The memory of Data has to be dynamically allocated and will eventually be freed with g_free. You must not modify or access String in any other way after passing it to this function. It is even possible that String is immediately freed. Since: gtk+ 2.38

Parameters
Self
String

a normal UTF-8 nul-terminated string

G_New_Uint16

procedure G_New_Uint16 (Self : out Gvariant; Value : Guint16)

Creates a new uint16 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Guint16 value

G_New_Uint32

procedure G_New_Uint32 (Self : out Gvariant; Value : Guint32)

Creates a new uint32 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Guint32 value

G_New_Uint64

procedure G_New_Uint64 (Self : out Gvariant; Value : Guint64)

Creates a new uint64 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Self
Value

a Guint64 value

G_New_Variant

procedure G_New_Variant (Self : out Gvariant; Value : Gvariant)

Boxes Value. The result is a Glib.Variant.Gvariant instance representing a variant containing the original value. If Child is a floating reference (see Glib.Variant.Ref_Sink), the new instance takes ownership of Child. Since: gtk+ 2.24

Parameters
Self
Value

a Glib.Variant.Gvariant instance

Get_Boolean

function Get_Boolean (Self : Gvariant) return Boolean

Returns the boolean value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_BOOLEAN. Since: gtk+ 2.24

Parameters
Self
Return Value

True or False

Get_Byte

function Get_Byte (Self : Gvariant) return Guint8

Returns the byte value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_BYTE. Since: gtk+ 2.24

Parameters
Self
Return Value

a Guint8

Get_Bytestring_Array

function Get_Bytestring_Array
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of array of bytes Glib.Variant.Gvariant. This call makes a shallow copy; the return result should be released with g_free, but the individual strings must not be modified. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.26

Parameters
Self
Length

the length of the result, or null

Return Value

an array of constant strings

Get_Child_Value

function Get_Child_Value (Self : Gvariant; Index : Gsize) return Gvariant

Reads a child item out of a container Glib.Variant.Gvariant instance. This includes variants, maybes, arrays, tuples and dictionary entries. It is an error to call this function on any other type of Glib.Variant.Gvariant. It is an error if Index_ is greater than the number of child items in the container. See Glib.Variant.N_Children. The returned value is never floating. You should free it with Glib.Variant.Unref when you're done with it. Note that values borrowed from the returned child are not guaranteed to still be valid after the child is freed even if you still hold a reference to Value, if Value has not been serialized at the time this function is called. To avoid this, you can serialize Value by calling g_variant_get_data and optionally ignoring the return value. There may be implementation specific restrictions on deeply nested values, which would result in the unit tuple being returned as the child value, instead of further nested children. Glib.Variant.Gvariant is guaranteed to handle nesting up to at least 64 levels. This function is O(1). Since: gtk+ 2.24

Parameters
Self
Index

the index of the child to fetch

Return Value

the child at the specified index. Has transfer-ownership='full'.

Get_Data_As_Bytes

function Get_Data_As_Bytes (Self : Gvariant) return Glib.Bytes.Gbytes

Returns a pointer to the serialized form of a Glib.Variant.Gvariant instance. The semantics of this function are exactly the same as g_variant_get_data, except that the returned Glib.Bytes.Gbytes holds a reference to the variant data. Since: gtk+ 2.36

Parameters
Self
Return Value

A new Glib.Bytes.Gbytes representing the variant data. Has transfer-ownership='full'.

Get_Double

function Get_Double (Self : Gvariant) return Gdouble

Returns the double precision floating point value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_DOUBLE. Since: gtk+ 2.24

Parameters
Self
Return Value

a Gdouble

Get_Handle

function Get_Handle (Self : Gvariant) return Gint32

Returns the 32-bit signed integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_HANDLE. By convention, handles are indexes into an array of file descriptors that are sent alongside a D-Bus message. If you're not interacting with D-Bus, you probably don't need them. Since: gtk+ 2.24

Parameters
Self
Return Value

a Gint32

Get_Int16

function Get_Int16 (Self : Gvariant) return Gint16

Returns the 16-bit signed integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_INT16. Since: gtk+ 2.24

Parameters
Self
Return Value

a Gint16

Get_Int32

function Get_Int32 (Self : Gvariant) return Gint32

Returns the 32-bit signed integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_INT32. Since: gtk+ 2.24

Parameters
Self
Return Value

a Gint32

Get_Int64

function Get_Int64 (Self : Gvariant) return Gint64

Returns the 64-bit signed integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_INT64. Since: gtk+ 2.24

Parameters
Self
Return Value

a Gint64

Get_Maybe

function Get_Maybe (Self : Gvariant) return Gvariant

Given a maybe-typed Glib.Variant.Gvariant instance, extract its value. If the value is Nothing, then this function returns null. Since: gtk+ 2.24

Parameters
Self
Return Value

the contents of Value, or null. Has transfer-ownership='full'.

Get_Normal_Form

function Get_Normal_Form (Self : Gvariant) return Gvariant

Gets a Glib.Variant.Gvariant instance that has the same value as Value and is trusted to be in normal form. If Value is already trusted to be in normal form then a new reference to Value is returned. If Value is not already trusted, then it is scanned to check if it is in normal form. If it is found to be in normal form then it is marked as trusted and a new reference to it is returned. If Value is found not to be in normal form then a new trusted Glib.Variant.Gvariant is created with the same value as Value. The non-normal parts of Value will be replaced with default values which are guaranteed to be in normal form. It makes sense to call this function if you've received Glib.Variant.Gvariant data from untrusted sources and you want to ensure your serialized output is definitely in normal form. If Value is already in normal form, a new reference will be returned (which will be floating if Value is floating). If it is not in normal form, the newly created Glib.Variant.Gvariant will be returned with a single non-floating reference. Typically, Glib.Variant.Take_Ref should be called on the return value from this function to guarantee ownership of a single non-floating reference to it. Since: gtk+ 2.24

Parameters
Self
Return Value

a trusted Glib.Variant.Gvariant. Has transfer-ownership='full'.

Get_Objv

function Get_Objv
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of object paths Glib.Variant.Gvariant. This call makes a shallow copy; the return result should be released with g_free, but the individual strings must not be modified. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.30

Parameters
Self
Length

the length of the result, or null

Return Value

an array of constant strings

Get_Size

function Get_Size (Self : Gvariant) return Gsize

Determines the number of bytes that would be required to store Value with Glib.Variant.Store. If Value has a fixed-sized type then this function always returned that fixed size. In the case that Value is already in serialized form or the size has already been calculated (ie: this function has been called before) then this function is O(1). Otherwise, the size is calculated, an operation which is approximately O(n) in the number of values involved. Since: gtk+ 2.24

Parameters
Self
Return Value

the serialized size of Value

Get_String

function Get_String
   (Self   : Gvariant;
    Length : access Gsize := null) return UTF8_String

Returns the string value of a Glib.Variant.Gvariant instance with a string type. This includes the types G_VARIANT_TYPE_STRING, G_VARIANT_TYPE_OBJECT_PATH and G_VARIANT_TYPE_SIGNATURE. The string will always be UTF-8 encoded, will never be null, and will never contain nul bytes. If Length is non-null then the length of the string (in bytes) is returned there. For trusted values, this information is already known. Untrusted values will be validated and, if valid, a strlen will be performed. If invalid, a default value will be returned — for G_VARIANT_TYPE_OBJECT_PATH, this is "/", and for other types it is the empty string. It is an error to call this function with a Value of any type other than those three. The return value remains valid as long as Value exists. Since: gtk+ 2.24

Parameters
Self
Length

a pointer to a Gsize, to store the length

Return Value

the constant string, UTF-8 encoded

Get_String_Length

function Get_String_Length (Self : Gvariant_Type) return Gsize

Returns the length of the type string corresponding to the given Type. This function must be used to determine the valid extent of the memory region returned by Glib.Variant.Peek_String.

Parameters
Self
Return Value

the length of the corresponding type string Since 2.24

Get_Strv

function Get_Strv
   (Self   : Gvariant;
    Length : access Gsize := null) return GNAT.Strings.String_List

Gets the contents of an array of strings Glib.Variant.Gvariant. This call makes a shallow copy; the return result should be released with g_free, but the individual strings must not be modified. If Length is non-null then the number of elements in the result is stored there. In any case, the resulting array will be null-terminated. For an empty array, Length will be set to 0 and a pointer to a null pointer will be returned. Since: gtk+ 2.24

Parameters
Self
Length

the length of the result, or null

Return Value

an array of constant strings

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Type

function Get_Type (Self : Gvariant) return Gvariant_Type

Determines the type of Value. The return value is valid for the lifetime of Value and must not be freed. Since: gtk+ 2.24

Parameters
Self
Return Value

a Glib.Variant.Gvariant_Type

Get_Type_String

function Get_Type_String (Self : Gvariant) return UTF8_String

Returns the type string of Value. Unlike the result of calling Glib.Variant.Peek_String, this string is nul-terminated. This string belongs to Glib.Variant.Gvariant and must not be freed. Since: gtk+ 2.24

Parameters
Self
Return Value

the type string for the type of Value

Get_Uint16

function Get_Uint16 (Self : Gvariant) return Guint16

Returns the 16-bit unsigned integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_UINT16. Since: gtk+ 2.24

Parameters
Self
Return Value

a Guint16

Get_Uint32

function Get_Uint32 (Self : Gvariant) return Guint32

Returns the 32-bit unsigned integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_UINT32. Since: gtk+ 2.24

Parameters
Self
Return Value

a Guint32

Get_Uint64

function Get_Uint64 (Self : Gvariant) return Guint64

Returns the 64-bit unsigned integer value of Value. It is an error to call this function with a Value of any type other than G_VARIANT_TYPE_UINT64. Since: gtk+ 2.24

Parameters
Self
Return Value

a Guint64

Get_Variant

function Get_Variant (Self : Gvariant) return Gvariant

Unboxes Value. The result is the Glib.Variant.Gvariant instance that was contained in Value. Since: gtk+ 2.24

Parameters
Self
Return Value

the item contained in the variant. Has transfer-ownership='full'.

Gvariant

type Gvariant is new Glib.C_Boxed with null record;

GVariant_Class

type GVariant_Class is (
   Class_Tuple,
   Class_Array,
   Class_Boolean,
   Class_Double,
   Class_Signature,
   Class_Handle,
   Class_Int32,
   Class_Maybe,
   …,
   Class_Dict_Entry);

The range of possible top-level types of Glib.Variant.Gvariant instances.

Enumeration Literal
Class_Tuple
Class_Array
Class_Boolean
Class_Double
Class_Signature
Class_Handle
Class_Int32
Class_Maybe
Class_Int16
Class_Object_Path
Class_Uint16
Class_String
Class_Uint64
Class_Uint32
Class_Variant
Class_Int64
Class_Byte
Class_Dict_Entry

GVariant_Class_Properties

package GVariant_Class_Properties is
   new Generic_Internal_Discrete_Property (GVariant_Class);

Gvariant_Iter

type Gvariant_Iter is new Glib.C_Proxy;

Gvariant_New_Boolean

function Gvariant_New_Boolean (Value : Boolean) return Gvariant

Creates a new boolean Glib.Variant.Gvariant instance -- either True or False. Since: gtk+ 2.24

Parameters
Value

a Boolean value

Return Value

Gvariant_New_Byte

function Gvariant_New_Byte (Value : Guint8) return Gvariant

Creates a new byte Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Guint8 value

Return Value

Gvariant_New_Bytestring

function Gvariant_New_Bytestring (String : Guint8_Array) return Gvariant

Creates an array-of-bytes Glib.Variant.Gvariant with the contents of String. This function is just like g_variant_new_string except that the string need not be valid UTF-8. The nul terminator character at the end of the string is stored in the array. Since: gtk+ 2.26

Parameters
String

a normal nul-terminated string in no particular encoding

Return Value

Gvariant_New_Bytestring_Array

function Gvariant_New_Bytestring_Array
   (Strv   : GNAT.Strings.String_List;
    Length : Gssize) return Gvariant

Constructs an array of bytestring Glib.Variant.Gvariant from the given array of strings. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.26

Parameters
Strv

an array of strings

Length

the length of Strv, or -1

Return Value

Gvariant_New_Dict_Entry

function Gvariant_New_Dict_Entry
   (Key   : Gvariant;
    Value : Gvariant) return Gvariant

Creates a new dictionary entry Glib.Variant.Gvariant. Key and Value must be non-null. Key must be a value of a basic type (ie: not a container). If the Key or Value are floating references (see Glib.Variant.Ref_Sink), the new instance takes ownership of them as if via Glib.Variant.Ref_Sink. Since: gtk+ 2.24

Parameters
Key

a basic Glib.Variant.Gvariant, the key

Value

a Glib.Variant.Gvariant, the value

Return Value

Gvariant_New_Double

function Gvariant_New_Double (Value : Gdouble) return Gvariant

Creates a new double Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Gdouble floating point value

Return Value

Gvariant_New_From_Bytes

function Gvariant_New_From_Bytes
   (The_Type : Gvariant_Type;
    Bytes    : Glib.Bytes.Gbytes;
    Trusted  : Boolean) return Gvariant

Constructs a new serialized-mode Glib.Variant.Gvariant instance. This is the inner interface for creation of new serialized values that gets called from various functions in gvariant.c. A reference is taken on Bytes. The data in Bytes must be aligned appropriately for the Type being loaded. Otherwise this function will internally create a copy of the memory (since GLib 2.60) or (in older versions) fail and exit the process. Since: gtk+ 2.36

Parameters
The_Type

a Glib.Variant.Gvariant_Type

Bytes

a Glib.Bytes.Gbytes

Trusted

if the contents of Bytes are trusted

Return Value

Gvariant_New_Handle

function Gvariant_New_Handle (Value : Gint32) return Gvariant

Creates a new handle Glib.Variant.Gvariant instance. By convention, handles are indexes into an array of file descriptors that are sent alongside a D-Bus message. If you're not interacting with D-Bus, you probably don't need them. Since: gtk+ 2.24

Parameters
Value

a Gint32 value

Return Value

Gvariant_New_Int16

function Gvariant_New_Int16 (Value : Gint16) return Gvariant

Creates a new int16 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Gint16 value

Return Value

Gvariant_New_Int32

function Gvariant_New_Int32 (Value : Gint32) return Gvariant

Creates a new int32 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Gint32 value

Return Value

Gvariant_New_Int64

function Gvariant_New_Int64 (Value : Gint64) return Gvariant

Creates a new int64 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Gint64 value

Return Value

Gvariant_New_Object_Path

function Gvariant_New_Object_Path
   (Object_Path : UTF8_String) return Gvariant

Creates a D-Bus object path Glib.Variant.Gvariant with the contents of Object_Path. Object_Path must be a valid D-Bus object path. Use Glib.Variant.Is_Object_Path if you're not sure. Since: gtk+ 2.24

Parameters
Object_Path

a normal C nul-terminated string

Return Value

Gvariant_New_Objv

function Gvariant_New_Objv
   (Strv   : GNAT.Strings.String_List;
    Length : Gssize) return Gvariant

Constructs an array of object paths Glib.Variant.Gvariant from the given array of strings. Each string must be a valid Glib.Variant.Gvariant object path; see Glib.Variant.Is_Object_Path. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.30

Parameters
Strv

an array of strings

Length

the length of Strv, or -1

Return Value

Gvariant_New_Signature

function Gvariant_New_Signature (Signature : UTF8_String) return Gvariant

Creates a D-Bus type signature Glib.Variant.Gvariant with the contents of String. String must be a valid D-Bus type signature. Use Glib.Variant.Is_Signature if you're not sure. Since: gtk+ 2.24

Parameters
Signature

a normal C nul-terminated string

Return Value

Gvariant_New_String

function Gvariant_New_String (String : UTF8_String) return Gvariant

Creates a string Glib.Variant.Gvariant with the contents of String. String must be valid UTF-8, and must not be null. To encode potentially-null strings, use g_variant_new with ms as the [format string][gvariant-format-strings-maybe-types]. Since: gtk+ 2.24

Parameters
String

a normal UTF-8 nul-terminated string

Return Value

Gvariant_New_Strv

function Gvariant_New_Strv
   (Strv   : GNAT.Strings.String_List;
    Length : Gssize) return Gvariant

Constructs an array of strings Glib.Variant.Gvariant from the given array of strings. If Length is -1 then Strv is null-terminated. Since: gtk+ 2.24

Parameters
Strv

an array of strings

Length

the length of Strv, or -1

Return Value

Gvariant_New_Take_String

function Gvariant_New_Take_String (String : UTF8_String) return Gvariant

Creates a string Glib.Variant.Gvariant with the contents of String. String must be valid UTF-8, and must not be null. To encode potentially-null strings, use this with g_variant_new_maybe. After this call, String belongs to the Glib.Variant.Gvariant and may no longer be modified by the caller. The memory of Data has to be dynamically allocated and will eventually be freed with g_free. You must not modify or access String in any other way after passing it to this function. It is even possible that String is immediately freed. Since: gtk+ 2.38

Parameters
String

a normal UTF-8 nul-terminated string

Return Value

Gvariant_New_Uint16

function Gvariant_New_Uint16 (Value : Guint16) return Gvariant

Creates a new uint16 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Guint16 value

Return Value

Gvariant_New_Uint32

function Gvariant_New_Uint32 (Value : Guint32) return Gvariant

Creates a new uint32 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Guint32 value

Return Value

Gvariant_New_Uint64

function Gvariant_New_Uint64 (Value : Guint64) return Gvariant

Creates a new uint64 Glib.Variant.Gvariant instance. Since: gtk+ 2.24

Parameters
Value

a Guint64 value

Return Value

Gvariant_New_Variant

function Gvariant_New_Variant (Value : Gvariant) return Gvariant

Boxes Value. The result is a Glib.Variant.Gvariant instance representing a variant containing the original value. If Child is a floating reference (see Glib.Variant.Ref_Sink), the new instance takes ownership of Child. Since: gtk+ 2.24

Parameters
Value

a Glib.Variant.Gvariant instance

Return Value

Gvariant_Type

type Gvariant_Type is new Glib.C_Proxy;

Gvariant_Type_Boolean

Gvariant_Type_Boolean : constant Gvariant_Type;

Gvariant_Type_Byte

Gvariant_Type_Byte    : constant Gvariant_Type;

Gvariant_Type_Double

Gvariant_Type_Double  : constant Gvariant_Type;

Gvariant_Type_Int16

Gvariant_Type_Int16   : constant Gvariant_Type;

Gvariant_Type_Int32

Gvariant_Type_Int32   : constant Gvariant_Type;

Gvariant_Type_Int64

Gvariant_Type_Int64   : constant Gvariant_Type;

Gvariant_Type_New

function Gvariant_Type_New
   (Type_String : UTF8_String) return Gvariant_Type

Creates a new Glib.Variant.Gvariant_Type corresponding to the type string given by Type_String. It is appropriate to call Glib.Variant.Free on the return value. It is a programmer error to call this function with an invalid type string. Use Glib.Variant.String_Is_Valid if you are unsure. Since: gtk+ 2.24

Parameters
Type_String

a valid GVariant type string

Return Value

Gvariant_Type_New_Dict_Entry

function Gvariant_Type_New_Dict_Entry
   (Key   : Gvariant_Type;
    Value : Gvariant_Type) return Gvariant_Type

Constructs the type corresponding to a dictionary entry with a key of type Key and a value of type Value. It is appropriate to call Glib.Variant.Free on the return value.

Parameters
Key

a basic Glib.Variant.Gvariant_Type

Value

a Glib.Variant.Gvariant_Type

Return Value

Gvariant_Type_String

Gvariant_Type_String  : constant Gvariant_Type;

Gvariant_Type_Uint16

Gvariant_Type_Uint16  : constant Gvariant_Type;

Gvariant_Type_Uint32

Gvariant_Type_Uint32  : constant Gvariant_Type;

Gvariant_Type_Uint64

Gvariant_Type_Uint64  : constant Gvariant_Type;

Hash

function Hash (Self : System.Address) return Guint

Generates a hash value for a Glib.Variant.Gvariant instance. The output of this function is guaranteed to be the same for a given value only per-process. It may change between different processor architectures or even different versions of GLib. Do not use this function as a basis for building protocols or file formats. The type of Value is System.Address only to allow use of this function with GHash_Table. Value must be a Glib.Variant.Gvariant. Since: gtk+ 2.24

Parameters
Self
Return Value

a hash value corresponding to Value

Init

function Init (Self : Gvariant_Iter; Value : Gvariant) return Gsize

Initialises (without allocating) a Glib.Variant.Gvariant_Iter. Iter may be completely uninitialised prior to this call; its old value is ignored. The iterator remains valid for as long as Value exists, and need not be freed in any way. Since: gtk+ 2.24

Parameters
Self
Value

a container Glib.Variant.Gvariant

Return Value

the number of items in Value

Is_Array

function Is_Array (Self : Gvariant_Type) return Boolean

Determines if the given Type is an array type. This is true if the type string for Type starts with an 'a'. This function returns True for any indefinite type for which every definite subtype is an array type -- G_VARIANT_TYPE_ARRAY, for example.

Parameters
Self
Return Value

True if Type is an array type Since 2.24

Is_Basic

function Is_Basic (Self : Gvariant_Type) return Boolean

Determines if the given Type is a basic type. Basic types are booleans, bytes, integers, doubles, strings, object paths and signatures. Only a basic type may be used as the key of a dictionary entry. This function returns False for all indefinite types except G_VARIANT_TYPE_BASIC.

Parameters
Self
Return Value

True if Type is a basic type Since 2.24

Is_Container

function Is_Container (Self : Gvariant) return Boolean

Checks if Value is a container. Since: gtk+ 2.24

Parameters
Self
Return Value

True if Value is a container

Is_Container

function Is_Container (Self : Gvariant_Type) return Boolean

Determines if the given Type is a container type. Container types are any array, maybe, tuple, or dictionary entry types plus the variant type. This function returns True for any indefinite type for which every definite subtype is a container -- G_VARIANT_TYPE_ARRAY, for example.

Parameters
Self
Return Value

True if Type is a container type Since 2.24

Is_Definite

function Is_Definite (Self : Gvariant_Type) return Boolean

Determines if the given Type is definite (ie: not indefinite). A type is definite if its type string does not contain any indefinite type characters ('*', '?', or 'r'). A Glib.Variant.Gvariant instance may not have an indefinite type, so calling this function on the result of Glib.Variant.Get_Type will always result in True being returned. Calling this function on an indefinite type like G_VARIANT_TYPE_ARRAY, however, will result in False being returned.

Parameters
Self
Return Value

True if Type is definite Since 2.24

Is_Dict_Entry

function Is_Dict_Entry (Self : Gvariant_Type) return Boolean

Determines if the given Type is a dictionary entry type. This is true if the type string for Type starts with a '{'. This function returns True for any indefinite type for which every definite subtype is a dictionary entry type -- G_VARIANT_TYPE_DICT_ENTRY, for example.

Parameters
Self
Return Value

True if Type is a dictionary entry type Since 2.24

Is_Floating

function Is_Floating (Self : Gvariant) return Boolean

Checks whether Value has a floating reference count. This function should only ever be used to assert that a given variant is or is not floating, or for debug purposes. To acquire a reference to a variant that might be floating, always use Glib.Variant.Ref_Sink or Glib.Variant.Take_Ref. See Glib.Variant.Ref_Sink for more information about floating reference counts. Since: gtk+ 2.26

Parameters
Self
Return Value

whether Value is floating

Is_Maybe

function Is_Maybe (Self : Gvariant_Type) return Boolean

Determines if the given Type is a maybe type. This is true if the type string for Type starts with an 'm'. This function returns True for any indefinite type for which every definite subtype is a maybe type -- G_VARIANT_TYPE_MAYBE, for example.

Parameters
Self
Return Value

True if Type is a maybe type Since 2.24

Is_Normal_Form

function Is_Normal_Form (Self : Gvariant) return Boolean

Checks if Value is in normal form. The main reason to do this is to detect if a given chunk of serialized data is in normal form: load the data into a Glib.Variant.Gvariant using g_variant_new_from_data and then use this function to check. If Value is found to be in normal form then it will be marked as being trusted. If the value was already marked as being trusted then this function will immediately return True. There may be implementation specific restrictions on deeply nested values. GVariant is guaranteed to handle nesting up to at least 64 levels. Since: gtk+ 2.24

Parameters
Self
Return Value

True if Value is in normal form

Is_Object_Path

function Is_Object_Path (String : UTF8_String) return Boolean

Determines if a given string is a valid D-Bus object path. You should ensure that a string is a valid D-Bus object path before passing it to g_variant_new_object_path. A valid object path starts with / followed by zero or more sequences of characters separated by / characters. Each sequence must contain only the characters [A-Z][a-z][0-9]_. No sequence (including the one following the final / character) may be empty. Since: gtk+ 2.24

Parameters
String

a normal C nul-terminated string

Return Value

True if String is a D-Bus object path

Is_Of_Type

function Is_Of_Type
   (Self     : Gvariant;
    The_Type : Gvariant_Type) return Boolean

Checks if a value has a type matching the provided type. Since: gtk+ 2.24

Parameters
Self
The_Type

a Glib.Variant.Gvariant_Type

Return Value

True if the type of Value matches Type

Is_Signature

function Is_Signature (String : UTF8_String) return Boolean

Determines if a given string is a valid D-Bus type signature. You should ensure that a string is a valid D-Bus type signature before passing it to g_variant_new_signature. D-Bus type signatures consist of zero or more definite Glib.Variant.Gvariant_Type strings in sequence. Since: gtk+ 2.24

Parameters
String

a normal C nul-terminated string

Return Value

True if String is a D-Bus type signature

Is_Subtype_Of

function Is_Subtype_Of
   (Self      : Gvariant_Type;
    Supertype : Gvariant_Type) return Boolean

Checks if Type is a subtype of Supertype. This function returns True if Type is a subtype of Supertype. All types are considered to be subtypes of themselves. Aside from that, only indefinite types can have subtypes.

Parameters
Self
Supertype

a Glib.Variant.Gvariant_Type

Return Value

True if Type is a subtype of Supertype Since 2.24

Is_Tuple

function Is_Tuple (Self : Gvariant_Type) return Boolean

Determines if the given Type is a tuple type. This is true if the type string for Type starts with a '(' or if Type is G_VARIANT_TYPE_TUPLE. This function returns True for any indefinite type for which every definite subtype is a tuple type -- G_VARIANT_TYPE_TUPLE, for example.

Parameters
Self
Return Value

True if Type is a tuple type Since 2.24

Is_Variant

function Is_Variant (Self : Gvariant_Type) return Boolean

Determines if the given Type is the variant type.

Parameters
Self
Return Value

True if Type is the variant type Since 2.24

Iter_New

function Iter_New (Self : Gvariant) return Gvariant_Iter

Creates a heap-allocated Glib.Variant.Gvariant_Iter for iterating over the items in Value. Use g_variant_iter_free to free the return value when you no longer need it. A reference is taken to Value and will be released only when g_variant_iter_free is called. Since: gtk+ 2.24

Parameters
Self
Return Value

a new heap-allocated Glib.Variant.Gvariant_Iter

Key

function Key (Self : Gvariant_Type) return Gvariant_Type

Determines the key type of a dictionary entry type. This function may only be used with a dictionary entry type. Other than the additional restriction, this call is equivalent to Glib.Variant.First.

Parameters
Self
Return Value

the key type of the dictionary entry Since 2.24

Lookup_Value

function Lookup_Value
   (Self          : Gvariant;
    Key           : UTF8_String;
    Expected_Type : Gvariant_Type) return Gvariant

Looks up a value in a dictionary Glib.Variant.Gvariant. This function works with dictionaries of the type a{s*} (and equally well with type a{o*}, but we only further discuss the string case for sake of clarity). In the event that Dictionary has the type a{sv}, the Expected_Type string specifies what type of value is expected to be inside of the variant. If the value inside the variant has a different type then null is returned. In the event that Dictionary has a value type other than v then Expected_Type must directly match the value type and it is used to unpack the value directly or an error occurs. In either case, if Key is not found in Dictionary, null is returned. If the key is found and the value has the correct type, it is returned. If Expected_Type was specified then any non-null return value will have this type. This function is currently implemented with a linear scan. If you plan to do many lookups then Gvariant.Dict.Gvariant_Dict may be more efficient. Since: gtk+ 2.28

Parameters
Self
Key

the key to look up in the dictionary

Expected_Type

a Glib.Variant.Gvariant_Type, or null

Return Value

the value of the dictionary key, or null. Has transfer-ownership='full'.

N_Children

function N_Children (Self : Gvariant) return Gsize

Determines the number of children in a container Glib.Variant.Gvariant instance. This includes variants, maybes, arrays, tuples and dictionary entries. It is an error to call this function on any other type of Glib.Variant.Gvariant. For variants, the return value is always 1. For values with maybe types, it is always zero or one. For arrays, it is the length of the array. For tuples it is the number of tuple items (which depends only on the type). For dictionary entries, it is always 2 This function is O(1). Since: gtk+ 2.24

Parameters
Self
Return Value

the number of children in the container

N_Items

function N_Items (Self : Gvariant_Type) return Gsize

Determines the number of items contained in a tuple or dictionary entry type. This function may only be used with tuple or dictionary entry types, but must not be used with the generic tuple type G_VARIANT_TYPE_TUPLE. In the case of a dictionary entry type, this function will always return 2.

Parameters
Self
Return Value

the number of items in Type Since 2.24

Next

function Next (Self : Gvariant_Type) return Gvariant_Type

Determines the next item type of a tuple or dictionary entry type. Type must be the result of a previous call to Glib.Variant.First or Glib.Variant.Next. If called on the key type of a dictionary entry then this call returns the value type. If called on the value type of a dictionary entry then this call returns null. For tuples, null is returned when Type is the last item in a tuple.

Parameters
Self
Return Value

the next Glib.Variant.Gvariant_Type after Type, or null Since 2.24

Next_Value

function Next_Value (Self : Gvariant_Iter) return Gvariant

Gets the next item in the container. If no more items remain then null is returned. Use Glib.Variant.Unref to drop your reference on the return value when you no longer need it. Here is an example for iterating with Glib.Variant.Next_Value:

// recursively iterate a container
void
iterate_container_recursive (GVariant *container)
{
  GVariantIter iter;
  GVariant *child;

  g_variant_iter_init (&iter, container);
  while ((child = g_variant_iter_next_value (&iter)))
    {
      g_print ("type '%s'\n", g_variant_get_type_string (child));

      if (g_variant_is_container (child))
        iterate_container_recursive (child);

      g_variant_unref (child);
    }
}

Since: gtk+ 2.24

Parameters
Self
Return Value

a Glib.Variant.Gvariant, or null. Has transfer-ownership='full'.

Null_Gvariant

Null_Gvariant : constant Gvariant;

Parse

function Parse
   (The_Type : Gvariant_Type;
    Text     : UTF8_String;
    Limit    : UTF8_String := "";
    Endptr   : GNAT.Strings.String_List;
    Error    : out Glib.Error.GError) return Gvariant

Parses a Glib.Variant.Gvariant from a text representation. A single Glib.Variant.Gvariant is parsed from the content of Text. The format is described [here][gvariant-text]. The memory at Limit will never be accessed and the parser behaves as if the character at Limit is the nul terminator. This has the effect of bounding Text. If Endptr is non-null then Text is permitted to contain data following the value that this function parses and Endptr will be updated to point to the first character past the end of the text parsed by this function. If Endptr is null and there is extra data then an error is returned. If Type is non-null then the value will be parsed to have that type. This may result in additional parse errors (in the case that the parsed value doesn't fit the type) but may also result in fewer errors (in the case that the type would have been ambiguous, such as with empty arrays). In the event that the parsing is successful, the resulting Glib.Variant.Gvariant is returned. It is never floating, and must be freed with Glib.Variant.Unref. In case of any error, null will be returned. If Error is non-null then it will be set to reflect the error that occurred. Officially, the language understood by the parser is "any string produced by Glib.Variant.Print". There may be implementation specific restrictions on deeply nested values, which would result in a Glib.Error_Enums.G_Variant_Parse_Error_Recursion error. Glib.Variant.Gvariant is guaranteed to handle nesting up to at least 64 levels.

Parameters
The_Type

a Glib.Variant.Gvariant_Type, or null

Text

a string containing a GVariant in text form

Limit

a pointer to the end of Text, or null

Endptr

a location to store the end pointer, or null

Error

the return location for a recoverable error

Return Value

a non-floating reference to a Glib.Variant.Gvariant, or null. Has transfer-ownership='full'.

Parse_Error_Print_Context

function Parse_Error_Print_Context
   (Error      : Glib.Error.GError;
    Source_Str : UTF8_String) return UTF8_String

Pretty-prints a message showing the context of a Glib.Variant.Gvariant parse error within the string for which parsing was attempted. The resulting string is suitable for output to the console or other monospace media where newlines are treated in the usual way. The message will typically look something like one of the following:

unterminated string constant:
  (1, 2, 3, 'abc
            ^^^^

or

unable to find a common type:
  [1, 2, 3, 'str']
   ^        ^^^^^

The format of the message may change in a future version. Error must have come from a failed attempt to Glib.Variant.Parse and Source_Str must be exactly the same string that caused the error. If Source_Str was not nul-terminated when you passed it to Glib.Variant.Parse then you must add nul termination before using this function. Since: gtk+ 2.40

Parameters
Error

a Gerror.Gerror from the Glib.Error_Enums.GVariant_Parse_Error domain

Source_Str

the string that was given to the parser

Return Value

the printed message

Parse_Error_Quark

function Parse_Error_Quark return Glib.GQuark
Return Value

Parser_Get_Error_Quark

function Parser_Get_Error_Quark return Glib.GQuark

Same as g_variant_error_quark. Deprecated since None, 1

Return Value

Peek_String

function Peek_String (Self : Gvariant_Type) return UTF8_String

Returns the type string corresponding to the given Type. The result is not nul-terminated; in order to determine its length you must call Glib.Variant.Get_String_Length. To get a nul-terminated string, see Glib.Variant.Dup_String.

Parameters
Self
Return Value

the corresponding type string (not nul-terminated) Since 2.24

Print

function Print
   (Self          : Gvariant;
    Type_Annotate : Boolean) return UTF8_String

Pretty-prints Value in the format understood by Glib.Variant.Parse. The format is described [here][gvariant-text]. If Type_Annotate is True, then type information is included in the output. Since: gtk+ 2.24

Parameters
Self
Type_Annotate

True if type information should be included in the output

Return Value

a newly-allocated string holding the result.

Print_String

function Print_String
   (Self          : Gvariant;
    String        : Glib.String.Gstring;
    Type_Annotate : Boolean) return Glib.String.Gstring

Behaves as Glib.Variant.Print, but operates on a Glib.String.Gstring. If String is non-null then it is appended to and returned. Else, a new empty Glib.String.Gstring is allocated and it is returned. Since: gtk+ 2.24

Parameters
Self
String

a Glib.String.Gstring, or null

Type_Annotate

True if type information should be included in the output

Return Value

a Glib.String.Gstring containing the string

Property_GVariant_Class

type Property_GVariant_Class is new GVariant_Class_Properties.Property;

Ref

function Ref (Self : Gvariant) return Gvariant

Increases the reference count of Value. Since: gtk+ 2.24

Parameters
Self
Return Value

the same Value. Has transfer-ownership='full'.

Ref_Sink

function Ref_Sink (Self : Gvariant) return Gvariant

Glib.Variant.Gvariant uses a floating reference count system. All functions with names starting with g_variant_new_ return floating references. Calling Glib.Variant.Ref_Sink on a Glib.Variant.Gvariant with a floating reference will convert the floating reference into a full reference. Calling Glib.Variant.Ref_Sink on a non-floating Glib.Variant.Gvariant results in an additional normal reference being added. In other words, if the Value is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference. If the Value is not floating, then this call adds a new normal reference increasing the reference count by one. All calls that result in a Glib.Variant.Gvariant instance being inserted into a container will call Glib.Variant.Ref_Sink on the instance. This means that if the value was just created (and has only its floating reference) then the container will assume sole ownership of the value at that point and the caller will not need to unreference it. This makes certain common styles of programming much easier while still maintaining normal refcounting semantics in situations where values are not floating. Since: gtk+ 2.24

Parameters
Self
Return Value

the same Value. Has transfer-ownership='full'.

Store

procedure Store (Self : Gvariant; Data : System.Address)

Stores the serialized form of Value at Data. Data should be large enough. See Glib.Variant.Get_Size. The stored data is in machine native byte order but may not be in fully-normalised form if read from an untrusted source. See Glib.Variant.Get_Normal_Form for a solution. As with g_variant_get_data, to be able to deserialize the serialized variant successfully, its type and (if the destination machine might be different) its endianness must also be available. This function is approximately O(n) in the size of Data. Since: gtk+ 2.24

Parameters
Self
Data

the location to store the serialized data at

String_Get_Depth

function String_Get_Depth (Type_String : UTF8_String) return Gsize
Parameters
Type_String
Return Value

String_Is_Valid

function String_Is_Valid (Type_String : UTF8_String) return Boolean

Checks if Type_String is a valid GVariant type string. This call is equivalent to calling g_variant_type_string_scan and confirming that the following character is a nul terminator.

Parameters
Type_String

a pointer to any string

Return Value

True if Type_String is exactly one valid type string Since 2.24

Take_Ref

function Take_Ref (Self : Gvariant) return Gvariant

If Value is floating, sink it. Otherwise, do nothing. Typically you want to use Glib.Variant.Ref_Sink in order to automatically do the correct thing with respect to floating or non-floating references, but there is one specific scenario where this function is helpful. The situation where this function is helpful is when creating an API that allows the user to provide a callback function that returns a Glib.Variant.Gvariant. We certainly want to allow the user the flexibility to return a non-floating reference from this callback (for the case where the value that is being returned already exists). At the same time, the style of the Glib.Variant.Gvariant API makes it likely that for newly-created Glib.Variant.Gvariant instances, the user can be saved some typing if they are allowed to return a Glib.Variant.Gvariant with a floating reference. Using this function on the return value of the user's callback allows the user to do whichever is more convenient for them. The caller will always receives exactly one full reference to the value: either the one that was returned in the first place, or a floating reference that has been converted to a full reference. This function has an odd interaction when combined with Glib.Variant.Ref_Sink running at the same time in another thread on the same Glib.Variant.Gvariant instance. If Glib.Variant.Ref_Sink runs first then the result will be that the floating reference is converted to a hard reference. If Glib.Variant.Take_Ref runs first then the result will be that the floating reference is converted to a hard reference and an additional reference on top of that one is added. It is best to avoid this situation.

Parameters
Self
Return Value

the same Value. Has transfer-ownership='full'.

Unref

procedure Unref (Self : Gvariant)

Decreases the reference count of Value. When its reference count drops to 0, the memory used by the variant is freed. Since: gtk+ 2.24

Parameters
Self

Value

function Value (Self : Gvariant_Type) return Gvariant_Type

Determines the value type of a dictionary entry type. This function may only be used with a dictionary entry type.

Parameters
Self
Return Value

the value type of the dictionary entry Since 2.24

Simple Types

Tagged Types

Constants

Subprograms

Generic Instantiations