Advertisement
Guest User

Libpamac Patch

a guest
Nov 22nd, 2023
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.84 KB | None | 0 0
  1. diff --git a/src/appstream_plugin.vala b/src/appstream_plugin.vala
  2. index e955952..4aec585 100644
  3. --- a/src/appstream_plugin.vala
  4. +++ b/src/appstream_plugin.vala
  5. @@ -69,7 +69,7 @@ namespace Pamac {
  6. get {
  7. if (_long_desc == null && _as_app != null) {
  8. try {
  9. - _long_desc = AppStream.markup_convert_simple (_as_app.get_description ());
  10. + _long_desc = AppStream.markup_convert (_as_app.get_description (), AppStream.MarkupKind.MARKDOWN);
  11. } catch (Error e) {
  12. warning (e.message);
  13. }
  14. @@ -119,7 +119,7 @@ namespace Pamac {
  15. if (_screenshots == null) {
  16. _screenshots = new GenericArray<string> ();
  17. if (_as_app != null) {
  18. - unowned GenericArray<AppStream.Screenshot> as_screenshots = _as_app.get_screenshots ();
  19. + unowned GenericArray<AppStream.Screenshot> as_screenshots = _as_app.get_screenshots_all ();
  20. foreach (unowned AppStream.Screenshot as_screenshot in as_screenshots) {
  21. unowned GenericArray<AppStream.Image> as_images = as_screenshot.get_images ();
  22. foreach (unowned AppStream.Image as_image in as_images) {
  23. @@ -178,10 +178,10 @@ namespace Pamac {
  24. File appstream_file = File.new_for_path ("/usr/share/swcatalog/xml/%s.xml.gz".printf (repo));
  25. if (appstream_file.query_exists ()) {
  26. var mdata = new AppStream.Metadata ();
  27. - mdata.set_format_style (AppStream.FormatStyle.COLLECTION);
  28. + mdata.set_format_style (AppStream.FormatStyle.CATALOG);
  29. mdata.parse_file (appstream_file, AppStream.FormatKind.XML);
  30. var desktop_apps = new HashTable<unowned string, App> (str_hash, str_equal);
  31. - unowned GenericArray<AppStream.Component> apps = mdata.get_components ();
  32. + unowned GenericArray<AppStream.Component> apps = mdata.get_components ().as_array ();
  33. foreach (unowned AppStream.Component app in apps) {
  34. if (app.get_kind () == AppStream.ComponentKind.DESKTOP_APP) {
  35. // add pkgnames
  36. diff --git a/src/flatpak_plugin.vala b/src/flatpak_plugin.vala
  37. index 4d3201a..3462e70 100644
  38. --- a/src/flatpak_plugin.vala
  39. +++ b/src/flatpak_plugin.vala
  40. @@ -133,7 +133,7 @@ namespace Pamac {
  41. if (_long_desc == null) {
  42. if (as_app != null) {
  43. try {
  44. - _long_desc = AppStream.markup_convert_simple (as_app.get_description ());
  45. + _long_desc = AppStream.markup_convert (as_app.get_description (), AppStream.MarkupKind.MARKDOWN);
  46. } catch (Error e) {
  47. warning (e.message);
  48. }
  49. @@ -192,10 +192,10 @@ namespace Pamac {
  50. if (_screenshots == null) {
  51. _screenshots = new GenericArray<string> ();
  52. if (as_app != null) {
  53. - unowned GenericArray<AppStream.Screenshot> as_screenshots = as_app.get_screenshots ();
  54. + unowned GenericArray<AppStream.Screenshot> as_screenshots = as_app.get_screenshots_all ();
  55. foreach (unowned AppStream.Screenshot as_screenshot in as_screenshots) {
  56. // get a url with small image
  57. - unowned AppStream.Image as_image = as_screenshot.get_image (500, 300);
  58. + unowned AppStream.Image as_image = as_screenshot.get_image (500, 300, 1);
  59. unowned string? url = as_image.get_url ();
  60. if (url != null) {
  61. _screenshots.add (url);
  62. @@ -221,7 +221,7 @@ namespace Pamac {
  63. _installed_version = installed_ref.commit;
  64. }
  65. if (is_update && this.as_app != null) {
  66. - unowned GenericArray<AppStream.Release> as_releases = as_app.get_releases ();
  67. + unowned GenericArray<AppStream.Release> as_releases = as_app.get_releases_plain ().get_entries ();
  68. foreach (unowned AppStream.Release as_release in as_releases) {
  69. if (as_release.get_kind () == AppStream.ReleaseKind.STABLE) {
  70. _version = as_release.get_version ();
  71. @@ -235,7 +235,7 @@ namespace Pamac {
  72. _id = "%s/%s".printf (remote_ref.remote_name, remote_ref.format_ref ());
  73. _name = remote_ref.get_name ();
  74. if (this.as_app != null) {
  75. - unowned GenericArray<AppStream.Release> as_releases = as_app.get_releases ();
  76. + unowned GenericArray<AppStream.Release> as_releases = as_app.get_releases_plain ().get_entries ();
  77. foreach (unowned AppStream.Release as_release in as_releases) {
  78. if (as_release.get_kind () == AppStream.ReleaseKind.STABLE) {
  79. _version = as_release.get_version ();
  80. @@ -300,10 +300,10 @@ namespace Pamac {
  81. if (appstream_file.query_exists ()) {
  82. unowned string remote_name = remote.get_name ();
  83. var mdata = new AppStream.Metadata ();
  84. - mdata.set_format_style (AppStream.FormatStyle.COLLECTION);
  85. + mdata.set_format_style (AppStream.FormatStyle.CATALOG);
  86. mdata.parse_file (appstream_file, AppStream.FormatKind.XML);
  87. var desktop_apps = new HashTable<string, AppStream.Component> (str_hash, str_equal);
  88. - unowned GenericArray<AppStream.Component> apps = mdata.get_components ();
  89. + unowned GenericArray<AppStream.Component> apps = mdata.get_components ().as_array ();
  90. foreach (unowned AppStream.Component app in apps) {
  91. if (app.get_kind () == AppStream.ComponentKind.DESKTOP_APP) {
  92. unowned AppStream.Bundle? bundle = app.get_bundle (AppStream.BundleKind.FLATPAK);
  93. diff --git a/vapi/appstream.vapi b/vapi/appstream.vapi
  94. index 06236db..53f8742 100644
  95. --- a/vapi/appstream.vapi
  96. +++ b/vapi/appstream.vapi
  97. @@ -26,14 +26,16 @@ namespace AppStream {
  98. [CCode (has_construct_function = false)]
  99. [Version (since = "0.12.1")]
  100. public AgreementSection ();
  101. - public unowned string get_active_locale ();
  102. + [Version (since = "0.12.1")]
  103. + public unowned AppStream.Context? get_context ();
  104. [Version (since = "0.12.1")]
  105. public unowned string get_description ();
  106. [Version (since = "0.12.1")]
  107. public unowned string get_kind ();
  108. [Version (since = "0.12.1")]
  109. public unowned string get_name ();
  110. - public void set_active_locale (string? locale);
  111. + [Version (since = "0.12.1")]
  112. + public void set_context (AppStream.Context context);
  113. [Version (since = "0.12.1")]
  114. public void set_description (string desc, string? locale);
  115. [Version (since = "0.12.1")]
  116. @@ -118,13 +120,13 @@ namespace AppStream {
  117. public class Checksum : GLib.Object {
  118. [CCode (has_construct_function = false)]
  119. public Checksum ();
  120. - [CCode (has_construct_function = false)]
  121. - [Version (since = "0.12.11")]
  122. - public Checksum.for_kind_value (AppStream.ChecksumKind kind, string value);
  123. public AppStream.ChecksumKind get_kind ();
  124. public unowned string get_value ();
  125. public void set_kind (AppStream.ChecksumKind kind);
  126. public void set_value (string value);
  127. + [CCode (has_construct_function = false)]
  128. + [Version (since = "0.12.11")]
  129. + public Checksum.with_value (AppStream.ChecksumKind kind, string value);
  130. }
  131. [CCode (cheader_filename = "appstream.h", type_id = "as_component_get_type ()")]
  132. public class Component : GLib.Object {
  133. @@ -142,6 +144,7 @@ namespace AppStream {
  134. [Version (since = "0.15.5")]
  135. public void add_extends (string cpt_id);
  136. public void add_icon (AppStream.Icon icon);
  137. + public void add_keyword (string keyword, string? locale);
  138. [Version (since = "0.7.0")]
  139. public void add_language (string? locale, int percentage);
  140. [Version (since = "0.11.0")]
  141. @@ -149,6 +152,8 @@ namespace AppStream {
  142. [Version (since = "0.6.2")]
  143. public void add_provided (AppStream.Provided prov);
  144. public void add_provided_item (AppStream.ProvidedKind kind, string item);
  145. + [Version (since = "1.0.0")]
  146. + public void add_reference (AppStream.Reference reference);
  147. [Version (since = "0.12.0")]
  148. public void add_relation (AppStream.Relation relation);
  149. public void add_release (AppStream.Release release);
  150. @@ -163,11 +168,13 @@ namespace AppStream {
  151. public void add_translation (AppStream.Translation tr);
  152. [Version (since = "0.6.2")]
  153. public void add_url (AppStream.UrlKind url_kind, string url);
  154. + [Version (since = "1.0.0")]
  155. + public GLib.GenericArray<weak AppStream.RelationCheckResult> check_relations (AppStream.SystemInfo? sysinfo, AppStream.Pool? pool, AppStream.RelationKind rel_kind);
  156. + public void clear_keywords (string? locale);
  157. [Version (since = "0.14.5")]
  158. public void clear_languages ();
  159. [Version (since = "0.15.0")]
  160. public void clear_tags ();
  161. - public unowned string get_active_locale ();
  162. [Version (since = "0.9.2")]
  163. public unowned GLib.GenericArray<AppStream.Component> get_addons ();
  164. [Version (since = "0.12.1")]
  165. @@ -198,17 +205,14 @@ namespace AppStream {
  166. [Version (since = "0.15.2")]
  167. public unowned string get_date_eol ();
  168. public unowned string get_description ();
  169. - [Version (deprecated = true, deprecated_since = "0.11.0", since = "0.9.8")]
  170. - public unowned string get_desktop_id ();
  171. - public unowned string get_developer_name ();
  172. + public unowned AppStream.Developer get_developer ();
  173. [Version (since = "0.15.5")]
  174. public unowned GLib.GenericArray<string>? get_extends ();
  175. public unowned AppStream.Icon? get_icon_by_size (uint width, uint height);
  176. public unowned AppStream.Icon? get_icon_stock ();
  177. public unowned GLib.GenericArray<AppStream.Icon> get_icons ();
  178. public unowned string get_id ();
  179. - [CCode (array_length = false, array_null_terminated = true)]
  180. - public unowned string[] get_keywords ();
  181. + public unowned GLib.GenericArray<string> get_keywords ();
  182. public unowned GLib.HashTable<void*,void*> get_keywords_table ();
  183. public AppStream.ComponentKind get_kind ();
  184. [Version (since = "0.7.0")]
  185. @@ -238,11 +242,9 @@ namespace AppStream {
  186. public unowned AppStream.Provided? get_provided_for_kind (AppStream.ProvidedKind kind);
  187. [Version (since = "0.12.0")]
  188. public unowned GLib.GenericArray<AppStream.Relation> get_recommends ();
  189. - public unowned GLib.GenericArray<AppStream.Release> get_releases ();
  190. - [Version (since = "0.16.0")]
  191. - public AppStream.ReleasesKind get_releases_kind ();
  192. - [Version (since = "0.16.0")]
  193. - public unowned string get_releases_url ();
  194. + [Version (since = "1.0.0")]
  195. + public unowned GLib.GenericArray<AppStream.Reference> get_references ();
  196. + public unowned AppStream.ReleaseList get_releases_plain ();
  197. public unowned GLib.GenericArray<string> get_replaces ();
  198. [Version (since = "0.12.0")]
  199. public unowned GLib.GenericArray<AppStream.Relation> get_requires ();
  200. @@ -250,7 +252,7 @@ namespace AppStream {
  201. public unowned GLib.GenericArray<AppStream.Review> get_reviews ();
  202. [Version (since = "0.10.2")]
  203. public AppStream.ComponentScope get_scope ();
  204. - public unowned GLib.GenericArray<AppStream.Screenshot> get_screenshots ();
  205. + public unowned GLib.GenericArray<AppStream.Screenshot> get_screenshots_all ();
  206. [Version (since = "0.9.7")]
  207. public GLib.GenericArray<weak string> get_search_tokens ();
  208. [Version (since = "0.12.11")]
  209. @@ -261,13 +263,13 @@ namespace AppStream {
  210. public unowned GLib.HashTable<void*,void*> get_summary_table ();
  211. [Version (since = "0.15.0")]
  212. public unowned GLib.GenericArray<AppStream.Relation> get_supports ();
  213. + public int get_system_compatibility_score (AppStream.SystemInfo sysinfo, bool is_template, out GLib.GenericArray<weak AppStream.RelationCheckResult> results);
  214. [Version (since = "0.15.2")]
  215. public uint64 get_timestamp_eol ();
  216. [Version (since = "0.9.2")]
  217. public unowned GLib.GenericArray<AppStream.Translation> get_translations ();
  218. [Version (since = "0.6.2")]
  219. public unowned string? get_url (AppStream.UrlKind url_kind);
  220. - public AppStream.ValueFlags get_value_flags ();
  221. public bool has_bundle ();
  222. public bool has_category (string category);
  223. [Version (since = "0.15.0")]
  224. @@ -276,38 +278,35 @@ namespace AppStream {
  225. public bool insert_custom_value (string key, string value);
  226. public bool is_compulsory_for_desktop (string desktop);
  227. [Version (since = "0.15.5")]
  228. - public bool is_free ();
  229. + public bool is_floss ();
  230. [Version (since = "0.10.2")]
  231. public bool is_ignored ();
  232. public bool is_member_of_category (AppStream.Category category);
  233. public bool is_valid ();
  234. [Version (since = "0.14.0")]
  235. public bool load_from_bytes (AppStream.Context context, AppStream.FormatKind format, GLib.Bytes bytes) throws GLib.Error;
  236. - [Version (since = "0.12.10")]
  237. - public bool load_from_xml_data (AppStream.Context context, string data) throws GLib.Error;
  238. - [Version (since = "0.16.0")]
  239. - public bool load_releases (bool reload, bool allow_net) throws GLib.Error;
  240. - [Version (since = "0.16.0")]
  241. - public bool load_releases_from_bytes (GLib.Bytes bytes) throws GLib.Error;
  242. + public unowned AppStream.ReleaseList? load_releases (bool allow_net) throws GLib.Error;
  243. [Version (since = "0.15.0")]
  244. public bool remove_tag (string ns, string tag);
  245. [Version (since = "0.9.7")]
  246. public uint search_matches (string term);
  247. [Version (since = "0.9.8")]
  248. public uint search_matches_all ([CCode (array_length = false, array_null_terminated = true)] string[] terms);
  249. - public void set_active_locale (string? locale);
  250. [Version (since = "0.14.0")]
  251. public void set_branch (string branch);
  252. [Version (since = "0.15.2")]
  253. public void set_branding (AppStream.Branding branding);
  254. public void set_compulsory_for_desktop (string desktop);
  255. + [Version (since = "0.11.2")]
  256. + public void set_context (AppStream.Context context);
  257. + public void set_context_locale (string locale);
  258. public void set_data_id (string value);
  259. [Version (since = "0.15.2")]
  260. public void set_date_eol (string date);
  261. public void set_description (string value, string? locale);
  262. - public void set_developer_name (string value, string? locale);
  263. + public void set_developer (AppStream.Developer developer);
  264. public void set_id (string value);
  265. - public void set_keywords ([CCode (array_length = false, array_null_terminated = true)] string[] value, string? locale);
  266. + public void set_keywords (GLib.GenericArray<string> new_keywords, string? locale, bool deep_copy);
  267. public void set_kind (AppStream.ComponentKind value);
  268. [Version (since = "0.9.8")]
  269. public void set_merge_kind (AppStream.MergeKind kind);
  270. @@ -323,24 +322,19 @@ namespace AppStream {
  271. public void set_priority (int priority);
  272. public void set_project_group (string value);
  273. public void set_project_license (string value);
  274. - [Version (since = "0.16.0")]
  275. - public void set_releases_kind (AppStream.ReleasesKind kind);
  276. - [Version (since = "0.16.0")]
  277. - public void set_releases_url (string url);
  278. + public void set_releases (AppStream.ReleaseList releases);
  279. public void set_scope (AppStream.ComponentScope scope);
  280. [Version (since = "0.9.8")]
  281. public void set_sort_score (uint score);
  282. public void set_source_pkgname (string spkgname);
  283. public void set_summary (string value, string? locale);
  284. - public void set_value_flags (AppStream.ValueFlags flags);
  285. + public void sort_screenshots (string? environment, string? style, bool prioritize_style);
  286. public string to_string ();
  287. [Version (since = "0.12.10")]
  288. public string to_xml_data (AppStream.Context context) throws GLib.Error;
  289. public GLib.GenericArray<void*> categories { get; }
  290. [NoAccessorMethod]
  291. public string description { owned get; set; }
  292. - [NoAccessorMethod]
  293. - public string developer_name { owned get; set; }
  294. public GLib.List<AppStream.Icon> icons { get; }
  295. public string id { get; set; }
  296. [CCode (array_length = false, array_null_terminated = true)]
  297. @@ -353,12 +347,32 @@ namespace AppStream {
  298. public string[] pkgnames { get; set; }
  299. public string project_group { get; set; }
  300. public string project_license { get; set; }
  301. - public GLib.GenericArray<AppStream.Screenshot> screenshots { get; }
  302. + [NoAccessorMethod]
  303. + public GLib.GenericArray<AppStream.Screenshot> screenshots { owned get; }
  304. [NoAccessorMethod]
  305. public string summary { owned get; set; }
  306. [NoAccessorMethod]
  307. public GLib.HashTable<AppStream.UrlKind,string> urls { owned get; }
  308. }
  309. + [CCode (cheader_filename = "appstream.h", type_id = "as_component_box_get_type ()")]
  310. + public class ComponentBox : GLib.Object {
  311. + [CCode (has_construct_function = false)]
  312. + [Version (since = "1.0")]
  313. + public ComponentBox (AppStream.ComponentBoxFlags flags);
  314. + public bool add (AppStream.Component cpt) throws GLib.Error;
  315. + public unowned GLib.GenericArray<AppStream.Component> as_array ();
  316. + public void clear ();
  317. + public AppStream.ComponentBoxFlags get_flags ();
  318. + public uint get_size ();
  319. + public unowned AppStream.Component index_safe (uint index);
  320. + public bool is_empty ();
  321. + public void remove_at (uint index);
  322. + [CCode (has_construct_function = false)]
  323. + public ComponentBox.simple ();
  324. + public void sort ();
  325. + public void sort_by_score ();
  326. + public uint flags { get; construct; }
  327. + }
  328. [CCode (cheader_filename = "appstream.h", type_id = "as_content_rating_get_type ()")]
  329. public class ContentRating : GLib.Object {
  330. [CCode (has_construct_function = false)]
  331. @@ -396,35 +410,30 @@ namespace AppStream {
  332. public unowned string get_filename ();
  333. public AppStream.FormatVersion get_format_version ();
  334. public unowned string get_locale ();
  335. - public bool get_locale_all_enabled ();
  336. + public bool get_locale_use_all ();
  337. public unowned string get_media_baseurl ();
  338. public unowned string get_origin ();
  339. public int get_priority ();
  340. public AppStream.FormatStyle get_style ();
  341. + public AppStream.ValueFlags get_value_flags ();
  342. public bool has_media_baseurl ();
  343. public void set_filename (string fname);
  344. public void set_format_version (AppStream.FormatVersion ver);
  345. - public void set_locale (string value);
  346. + public void set_locale (string? locale);
  347. public void set_media_baseurl (string value);
  348. public void set_origin (string value);
  349. public void set_priority (int priority);
  350. public void set_style (AppStream.FormatStyle style);
  351. + public void set_value_flags (AppStream.ValueFlags flags);
  352. }
  353. - [CCode (cheader_filename = "appstream.h", type_id = "as_distro_details_get_type ()")]
  354. - public class DistroDetails : GLib.Object {
  355. + [CCode (cheader_filename = "appstream.h", type_id = "as_developer_get_type ()")]
  356. + public class Developer : GLib.Object {
  357. [CCode (has_construct_function = false)]
  358. - public DistroDetails ();
  359. - public bool get_bool (string key, bool default_val);
  360. - public unowned string get_cid ();
  361. - public unowned string get_homepage ();
  362. + public Developer ();
  363. public unowned string get_id ();
  364. public unowned string get_name ();
  365. - public string get_str (string key);
  366. - public unowned string get_version ();
  367. - public string homepage { get; }
  368. - public string id { get; }
  369. - public string name { get; }
  370. - public string version { get; }
  371. + public void set_id (string id);
  372. + public void set_name (string value, string? locale);
  373. }
  374. [CCode (cheader_filename = "appstream.h", type_id = "as_icon_get_type ()")]
  375. public class Icon : GLib.Object {
  376. @@ -455,12 +464,14 @@ namespace AppStream {
  377. public AppStream.ImageKind get_kind ();
  378. [Version (since = "0.9.5")]
  379. public unowned string get_locale ();
  380. + public uint get_scale ();
  381. public unowned string get_url ();
  382. public uint get_width ();
  383. public void set_height (uint height);
  384. public void set_kind (AppStream.ImageKind kind);
  385. [Version (since = "0.9.5")]
  386. public void set_locale (string locale);
  387. + public void set_scale (uint scale);
  388. public void set_url (string url);
  389. public void set_width (uint width);
  390. }
  391. @@ -495,35 +506,36 @@ namespace AppStream {
  392. public Metadata ();
  393. public void add_component (AppStream.Component cpt);
  394. public void clear_components ();
  395. + public void clear_releases ();
  396. public string component_to_metainfo (AppStream.FormatKind format) throws GLib.Error;
  397. public string components_to_catalog (AppStream.FormatKind format) throws GLib.Error;
  398. - public string components_to_collection (AppStream.FormatKind format) throws GLib.Error;
  399. [Version (since = "0.14.0")]
  400. public static AppStream.FormatStyle file_guess_style (string filename);
  401. public unowned string get_architecture ();
  402. public unowned AppStream.Component? get_component ();
  403. - public unowned GLib.GenericArray<AppStream.Component> get_components ();
  404. + public unowned AppStream.ComponentBox get_components ();
  405. public AppStream.FormatStyle get_format_style ();
  406. public AppStream.FormatVersion get_format_version ();
  407. public unowned string get_locale ();
  408. public unowned string get_media_baseurl ();
  409. public unowned string get_origin ();
  410. public AppStream.ParseFlags get_parse_flags ();
  411. + public unowned AppStream.ReleaseList? get_release_list ();
  412. + public unowned GLib.GenericArray<AppStream.ReleaseList> get_release_lists ();
  413. public bool get_update_existing ();
  414. public bool get_write_header ();
  415. - public bool parse (string data, AppStream.FormatKind format) throws GLib.Error;
  416. [Version (since = "0.14.0")]
  417. public bool parse_bytes (GLib.Bytes bytes, AppStream.FormatKind format) throws GLib.Error;
  418. - public bool parse_desktop_data (string data, string cid) throws GLib.Error;
  419. + public bool parse_data (string data, ssize_t data_len, AppStream.FormatKind format) throws GLib.Error;
  420. + public bool parse_desktop_data (string cid, string data, ssize_t data_len) throws GLib.Error;
  421. public bool parse_file (GLib.File file, AppStream.FormatKind format) throws GLib.Error;
  422. [Version (since = "0.16.0")]
  423. - public GLib.GenericArray<weak AppStream.Release>? parse_releases_bytes (GLib.Bytes bytes) throws GLib.Error;
  424. + public bool parse_releases_bytes (GLib.Bytes bytes) throws GLib.Error;
  425. [Version (since = "0.16.0")]
  426. - public GLib.GenericArray<weak AppStream.Release>? parse_releases_file (GLib.File file) throws GLib.Error;
  427. + public bool parse_releases_file (GLib.File file) throws GLib.Error;
  428. [Version (since = "0.16.0")]
  429. - public string releases_to_data (GLib.GenericArray<AppStream.Release> releases) throws GLib.Error;
  430. + public string releases_to_data (AppStream.ReleaseList releases) throws GLib.Error;
  431. public bool save_catalog (string fname, AppStream.FormatKind format) throws GLib.Error;
  432. - public bool save_collection (string fname, AppStream.FormatKind format) throws GLib.Error;
  433. public bool save_metainfo (string fname, AppStream.FormatKind format) throws GLib.Error;
  434. public void set_architecture (string arch);
  435. public void set_format_style (AppStream.FormatStyle mode);
  436. @@ -539,64 +551,37 @@ namespace AppStream {
  437. public class Pool : GLib.Object {
  438. [CCode (has_construct_function = false)]
  439. public Pool ();
  440. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  441. - public bool add_component (AppStream.Component cpt) throws GLib.Error;
  442. [Version (since = "0.15.0")]
  443. - public bool add_components (GLib.GenericArray<AppStream.Component> cpts) throws GLib.Error;
  444. + public bool add_components (AppStream.ComponentBox cbox) throws GLib.Error;
  445. public void add_extra_data_location (string directory, AppStream.FormatStyle format_style);
  446. [Version (since = "0.15.0")]
  447. public void add_flags (AppStream.PoolFlags flags);
  448. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  449. - public void add_metadata_location (string directory);
  450. [CCode (array_length = false, array_null_terminated = true)]
  451. public string[] build_search_tokens (string search);
  452. public void clear ();
  453. - public bool clear2 () throws GLib.Error;
  454. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  455. - public void clear_metadata_locations ();
  456. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  457. - public AppStream.CacheFlags get_cache_flags ();
  458. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  459. - public unowned string get_cache_location ();
  460. - [CCode (cname = "as_pool_get_components_gir")]
  461. - public GLib.GenericArray<AppStream.Component> get_components ();
  462. - [CCode (cname = "as_pool_get_components_by_bundle_id_gir")]
  463. + public AppStream.ComponentBox get_components ();
  464. [Version (since = "0.16.0")]
  465. - public GLib.GenericArray<AppStream.Component> get_components_by_bundle_id (AppStream.BundleKind kind, string bundle_id, bool match_prefix);
  466. - [CCode (cname = "as_pool_get_components_by_categories_gir")]
  467. - public GLib.GenericArray<AppStream.Component> get_components_by_categories ([CCode (array_length = false, array_null_terminated = true)] string[] categories);
  468. - [CCode (cname = "as_pool_get_components_by_extends_gir")]
  469. + public AppStream.ComponentBox get_components_by_bundle_id (AppStream.BundleKind kind, string bundle_id, bool match_prefix);
  470. + public AppStream.ComponentBox get_components_by_categories ([CCode (array_length = false, array_null_terminated = true)] string[] categories);
  471. [Version (since = "0.15.0")]
  472. - public GLib.GenericArray<AppStream.Component> get_components_by_extends (string extended_id);
  473. - [CCode (cname = "as_pool_get_components_by_id_gir")]
  474. - public GLib.GenericArray<AppStream.Component> get_components_by_id (string cid);
  475. - [CCode (cname = "as_pool_get_components_by_kind_gir")]
  476. - public GLib.GenericArray<AppStream.Component> get_components_by_kind (AppStream.ComponentKind kind);
  477. - [CCode (cname = "as_pool_get_components_by_launchable_gir")]
  478. + public AppStream.ComponentBox get_components_by_extends (string extended_id);
  479. + public AppStream.ComponentBox get_components_by_id (string cid);
  480. + public AppStream.ComponentBox get_components_by_kind (AppStream.ComponentKind kind);
  481. [Version (since = "0.11.4")]
  482. - public GLib.GenericArray<AppStream.Component> get_components_by_launchable (AppStream.LaunchableKind kind, string id);
  483. - [CCode (cname = "as_pool_get_components_by_provided_item_gir")]
  484. - public GLib.GenericArray<AppStream.Component> get_components_by_provided_item (AppStream.ProvidedKind kind, string item);
  485. + public AppStream.ComponentBox get_components_by_launchable (AppStream.LaunchableKind kind, string id);
  486. + public AppStream.ComponentBox get_components_by_provided_item (AppStream.ProvidedKind kind, string item);
  487. public AppStream.PoolFlags get_flags ();
  488. public unowned string get_locale ();
  489. public bool is_empty ();
  490. public bool load (GLib.Cancellable? cancellable = null) throws GLib.Error;
  491. [Version (since = "0.12.10")]
  492. public async bool load_async (GLib.Cancellable? cancellable) throws GLib.Error;
  493. - public bool load_cache_file (string fname) throws GLib.Error;
  494. - public bool refresh_cache (bool force) throws GLib.Error;
  495. [Version (since = "0.15.0")]
  496. public void remove_flags (AppStream.PoolFlags flags);
  497. [Version (since = "0.15.0")]
  498. public void reset_extra_data_locations ();
  499. - public bool save_cache_file (string fname) throws GLib.Error;
  500. - [CCode (cname = "as_pool_search_gir")]
  501. [Version (since = "0.9.7")]
  502. - public GLib.GenericArray<weak AppStream.Component> search (string search);
  503. - [Version (deprecated = true, deprecated_since = "0.15.0")]
  504. - public void set_cache_flags (AppStream.CacheFlags flags);
  505. - [Version (deprecated = true, deprecated_since = "0.15.0", since = "0.12.7")]
  506. - public void set_cache_location (string fname);
  507. + public AppStream.ComponentBox search (string search);
  508. public void set_flags (AppStream.PoolFlags flags);
  509. [Version (since = "0.15.0")]
  510. public void set_load_std_data_locations (bool enabled);
  511. @@ -614,11 +599,25 @@ namespace AppStream {
  512. public bool has_item (string item);
  513. public void set_kind (AppStream.ProvidedKind kind);
  514. }
  515. + [CCode (cheader_filename = "appstream.h", type_id = "as_reference_get_type ()")]
  516. + public class Reference : GLib.Object {
  517. + [CCode (has_construct_function = false)]
  518. + public Reference ();
  519. + [Version (since = "1.0.0")]
  520. + public AppStream.ReferenceKind get_kind ();
  521. + public unowned string? get_registry_name ();
  522. + public unowned string get_value ();
  523. + [Version (since = "1.0.0")]
  524. + public void set_kind (AppStream.ReferenceKind kind);
  525. + public void set_registry_name (string name);
  526. + public void set_value (string value);
  527. + }
  528. [CCode (cheader_filename = "appstream.h", type_id = "as_relation_get_type ()")]
  529. public class Relation : GLib.Object {
  530. [CCode (has_construct_function = false)]
  531. [Version (since = "0.11.0")]
  532. public Relation ();
  533. + public static int check_results_get_compatibility_score (GLib.GenericArray<AppStream.RelationCheckResult> rc_results);
  534. [Version (since = "0.12.0")]
  535. public AppStream.RelationCompare get_compare ();
  536. [Version (since = "0.12.12")]
  537. @@ -627,12 +626,8 @@ namespace AppStream {
  538. public AppStream.RelationItemKind get_item_kind ();
  539. [Version (since = "0.12.0")]
  540. public AppStream.RelationKind get_kind ();
  541. - [Version (since = "0.12.0")]
  542. - public unowned string get_value ();
  543. [Version (since = "0.12.11")]
  544. public AppStream.ControlKind get_value_control_kind ();
  545. - [Version (since = "0.12.12")]
  546. - public AppStream.DisplayLengthKind get_value_display_length_kind ();
  547. [Version (since = "0.12.0")]
  548. public int get_value_int ();
  549. [Version (since = "0.15.5")]
  550. @@ -645,7 +640,7 @@ namespace AppStream {
  551. public unowned string get_value_str ();
  552. [Version (since = "0.12.0")]
  553. public unowned string get_version ();
  554. - public AppStream.CheckResult is_satisfied (AppStream.SystemInfo? system_info, AppStream.Pool? pool, out string message) throws GLib.Error;
  555. + public AppStream.RelationCheckResult? is_satisfied (AppStream.SystemInfo? system_info, AppStream.Pool? pool) throws GLib.Error;
  556. [Version (since = "0.12.0")]
  557. public void set_compare (AppStream.RelationCompare compare);
  558. [Version (since = "0.12.12")]
  559. @@ -654,13 +649,9 @@ namespace AppStream {
  560. public void set_item_kind (AppStream.RelationItemKind kind);
  561. [Version (since = "0.12.0")]
  562. public void set_kind (AppStream.RelationKind kind);
  563. - [Version (since = "0.12.0")]
  564. - public void set_value (string value);
  565. [Version (since = "0.12.12")]
  566. public void set_value_control_kind (AppStream.ControlKind kind);
  567. [Version (since = "0.12.12")]
  568. - public void set_value_display_length_kind (AppStream.DisplayLengthKind kind);
  569. - [Version (since = "0.12.12")]
  570. public void set_value_int (int value);
  571. public void set_value_internet_bandwidth (uint bandwidth_mbitps);
  572. [Version (since = "0.15.5")]
  573. @@ -674,25 +665,35 @@ namespace AppStream {
  574. [Version (since = "0.12.0")]
  575. public bool version_compare (string version) throws GLib.Error;
  576. }
  577. + [CCode (cheader_filename = "appstream.h", type_id = "as_relation_check_result_get_type ()")]
  578. + public class RelationCheckResult : GLib.Object {
  579. + [CCode (has_construct_function = false)]
  580. + [Version (since = "1.0.0")]
  581. + public RelationCheckResult ();
  582. + public unowned AppStream.RelationError get_error_code ();
  583. + public unowned string? get_message ();
  584. + public unowned AppStream.Relation? get_relation ();
  585. + public AppStream.RelationStatus get_status ();
  586. + public void set_error_code (AppStream.RelationError ecode);
  587. + public void set_relation (AppStream.Relation relation);
  588. + public void set_status (AppStream.RelationStatus status);
  589. + }
  590. [CCode (cheader_filename = "appstream.h", type_id = "as_release_get_type ()")]
  591. public class Release : GLib.Object {
  592. [CCode (has_construct_function = false)]
  593. public Release ();
  594. [Version (since = "0.12.6")]
  595. public void add_artifact (AppStream.Artifact artifact);
  596. - [Version (deprecated = true, since = "0.8.2")]
  597. - public void add_checksum (AppStream.Checksum cs);
  598. [Version (since = "0.12.9")]
  599. public void add_issue (AppStream.Issue issue);
  600. - [Version (deprecated = true, since = "0.8.1")]
  601. - public void add_location (string location);
  602. - public unowned string get_active_locale ();
  603. + [Version (since = "1.0.0")]
  604. + public bool add_tag (string ns, string tag);
  605. + [Version (since = "1.0.0")]
  606. + public void clear_tags ();
  607. [Version (since = "0.12.6")]
  608. public unowned GLib.GenericArray<AppStream.Artifact> get_artifacts ();
  609. - [Version (deprecated = true, since = "0.8.2")]
  610. - public unowned AppStream.Checksum? get_checksum (AppStream.ChecksumKind kind);
  611. - [Version (deprecated = true, since = "0.10")]
  612. - public unowned GLib.GenericArray<AppStream.Checksum> get_checksums ();
  613. + [Version (since = "0.11.2")]
  614. + public unowned AppStream.Context? get_context ();
  615. [Version (since = "0.12.5")]
  616. public unowned string? get_date ();
  617. [Version (since = "0.12.5")]
  618. @@ -702,10 +703,6 @@ namespace AppStream {
  619. public unowned GLib.GenericArray<AppStream.Issue> get_issues ();
  620. [Version (since = "0.12.0")]
  621. public AppStream.ReleaseKind get_kind ();
  622. - [Version (deprecated = true, since = "0.8.1")]
  623. - public unowned GLib.GenericArray<string> get_locations ();
  624. - [Version (deprecated = true, since = "0.8.6")]
  625. - public uint64 get_size (AppStream.SizeKind kind);
  626. public uint64 get_timestamp ();
  627. [Version (since = "0.12.5")]
  628. public uint64 get_timestamp_eol ();
  629. @@ -714,7 +711,12 @@ namespace AppStream {
  630. [Version (since = "0.12.5")]
  631. public unowned string? get_url (AppStream.ReleaseUrlKind url_kind);
  632. public unowned string? get_version ();
  633. - public void set_active_locale (string? locale);
  634. + [Version (since = "1.0.0")]
  635. + public bool has_tag (string ns, string tag);
  636. + [Version (since = "1.0.0")]
  637. + public bool remove_tag (string ns, string tag);
  638. + [Version (since = "0.11.2")]
  639. + public void set_context (AppStream.Context context);
  640. [Version (since = "0.12.5")]
  641. public void set_date (string date);
  642. [Version (since = "0.12.5")]
  643. @@ -722,8 +724,6 @@ namespace AppStream {
  644. public void set_description (string description, string? locale);
  645. [Version (since = "0.12.0")]
  646. public void set_kind (AppStream.ReleaseKind kind);
  647. - [Version (deprecated = true, since = "0.8.6")]
  648. - public void set_size (uint64 size, AppStream.SizeKind kind);
  649. public void set_timestamp (uint64 timestamp);
  650. [Version (since = "0.12.5")]
  651. public void set_timestamp_eol (uint64 timestamp);
  652. @@ -734,6 +734,32 @@ namespace AppStream {
  653. public void set_version (string version);
  654. public int vercmp (AppStream.Release rel2);
  655. }
  656. + [CCode (cheader_filename = "appstream.h", type_id = "as_release_list_get_type ()")]
  657. + public class ReleaseList : GLib.Object {
  658. + [CCode (has_construct_function = false)]
  659. + [Version (since = "1.0")]
  660. + public ReleaseList ();
  661. + public void add (AppStream.Release release);
  662. + public void clear ();
  663. + public unowned AppStream.Context? get_context ();
  664. + public unowned GLib.GenericArray<AppStream.Release> get_entries ();
  665. + [Version (since = "0.16.0")]
  666. + public AppStream.ReleaseListKind get_kind ();
  667. + public uint get_size ();
  668. + [Version (since = "0.16.0")]
  669. + public unowned string? get_url ();
  670. + public unowned AppStream.Release index_safe (uint index);
  671. + public bool is_empty ();
  672. + [Version (since = "0.16.0")]
  673. + public bool load_from_bytes (AppStream.Context? context, GLib.Bytes bytes) throws GLib.Error;
  674. + public void set_context (AppStream.Context context);
  675. + [Version (since = "0.16.0")]
  676. + public void set_kind (AppStream.ReleaseListKind kind);
  677. + public void set_size (uint size);
  678. + [Version (since = "0.16.0")]
  679. + public void set_url (string url);
  680. + public void sort ();
  681. + }
  682. [CCode (cheader_filename = "appstream.h", type_id = "as_review_get_type ()")]
  683. public class Review : GLib.Object {
  684. [CCode (has_construct_function = false)]
  685. @@ -822,10 +848,12 @@ namespace AppStream {
  686. public void add_video (AppStream.Video video);
  687. [Version (since = "0.15.4")]
  688. public void clear_images ();
  689. - public unowned string get_active_locale ();
  690. public unowned string get_caption ();
  691. + [Version (since = "0.11.2")]
  692. + public unowned AppStream.Context? get_context ();
  693. + public unowned string? get_environment ();
  694. [Version (since = "0.14.0")]
  695. - public unowned AppStream.Image get_image (uint width, uint height);
  696. + public unowned AppStream.Image? get_image (uint width, uint height, uint scale);
  697. public unowned GLib.GenericArray<AppStream.Image> get_images ();
  698. [Version (since = "0.10")]
  699. public unowned GLib.GenericArray<AppStream.Image> get_images_all ();
  700. @@ -834,8 +862,10 @@ namespace AppStream {
  701. public unowned GLib.GenericArray<AppStream.Video> get_videos ();
  702. public unowned GLib.GenericArray<AppStream.Video> get_videos_all ();
  703. public bool is_valid ();
  704. - public void set_active_locale (string? locale);
  705. public void set_caption (string caption, string locale);
  706. + [Version (since = "0.11.2")]
  707. + public void set_context (AppStream.Context context);
  708. + public void set_environment (string? env_id);
  709. public void set_kind (AppStream.ScreenshotKind kind);
  710. }
  711. [CCode (cheader_filename = "appstream.h", type_id = "as_suggested_get_type ()")]
  712. @@ -855,6 +885,7 @@ namespace AppStream {
  713. public SystemInfo ();
  714. public string get_device_name_for_modalias (string modalias, bool allow_fallback) throws GLib.Error;
  715. public ulong get_display_length (AppStream.DisplaySideKind side);
  716. + public bool get_gui_available ();
  717. public unowned string get_kernel_name ();
  718. public unowned string get_kernel_version ();
  719. public ulong get_memory_total ();
  720. @@ -868,7 +899,11 @@ namespace AppStream {
  721. public AppStream.CheckResult has_input_control (AppStream.ControlKind kind) throws GLib.Error;
  722. public unowned string modalias_to_syspath (string modalias);
  723. public void set_display_length (AppStream.DisplaySideKind side, ulong value_dip);
  724. + public void set_gui_available (bool available);
  725. public void set_input_control (AppStream.ControlKind kind, bool found);
  726. + [CCode (has_construct_function = false)]
  727. + [Version (since = "1.0.0")]
  728. + public SystemInfo.template_for_chassis (AppStream.ChassisKind chassis) throws GLib.Error;
  729. }
  730. [CCode (cheader_filename = "appstream.h", type_id = "as_translation_get_type ()")]
  731. public class Translation : GLib.Object {
  732. @@ -893,23 +928,23 @@ namespace AppStream {
  733. public bool add_release_bytes (string release_fname, GLib.Bytes release_metadata) throws GLib.Error;
  734. [Version (since = "0.16.0")]
  735. public bool add_release_file (GLib.File release_file) throws GLib.Error;
  736. - public void clear_issues ();
  737. + public bool check_success ();
  738. [Version (since = "0.16.0")]
  739. public void clear_release_data ();
  740. - public bool get_check_urls ();
  741. + public bool get_allow_net ();
  742. [Version (since = "0.16.0")]
  743. public uint get_issue_files_count ();
  744. public GLib.List<weak AppStream.ValidatorIssue> get_issues ();
  745. [Version (since = "0.12.8")]
  746. public unowned GLib.HashTable<string,GLib.GenericArray<AppStream.ValidatorIssue>> get_issues_per_file ();
  747. - public bool get_report_yaml (string yaml_report);
  748. + public string get_report_yaml () throws GLib.Error;
  749. [Version (since = "0.15.4")]
  750. public bool get_strict ();
  751. public unowned string get_tag_explanation (string tag);
  752. public AppStream.IssueSeverity get_tag_severity (string tag);
  753. [CCode (array_length = false, array_null_terminated = true)]
  754. public string[] get_tags ();
  755. - public void set_check_urls (bool value);
  756. + public void set_allow_net (bool value);
  757. [Version (since = "0.15.4")]
  758. public void set_strict (bool is_strict);
  759. [Version (since = "0.14.0")]
  760. @@ -928,10 +963,8 @@ namespace AppStream {
  761. public unowned string get_filename ();
  762. [Version (since = "0.12.8")]
  763. public unowned string get_hint ();
  764. - public AppStream.IssueSeverity get_importance ();
  765. public long get_line ();
  766. public string get_location ();
  767. - public unowned string get_message ();
  768. public AppStream.IssueSeverity get_severity ();
  769. [Version (since = "0.12.8")]
  770. public unowned string get_tag ();
  771. @@ -941,9 +974,7 @@ namespace AppStream {
  772. public void set_filename (string fname);
  773. [Version (since = "0.12.8")]
  774. public void set_hint (string hint);
  775. - public void set_importance (AppStream.IssueSeverity importance);
  776. public void set_line (long line);
  777. - public void set_message (string message);
  778. public void set_severity (AppStream.IssueSeverity severity);
  779. [Version (since = "0.12.8")]
  780. public void set_tag (string tag);
  781. @@ -998,7 +1029,8 @@ namespace AppStream {
  782. APPIMAGE,
  783. SNAP,
  784. TARBALL,
  785. - CABINET;
  786. + CABINET,
  787. + LINGLONG;
  788. public static AppStream.BundleKind from_string (string bundle_str);
  789. [Version (since = "0.8.0")]
  790. public unowned string to_string ();
  791. @@ -1012,6 +1044,19 @@ namespace AppStream {
  792. NO_CLEAR,
  793. REFRESH_SYSTEM
  794. }
  795. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_CHASSIS_KIND_", type_id = "as_chassis_kind_get_type ()")]
  796. + public enum ChassisKind {
  797. + UNKNOWN,
  798. + DESKTOP,
  799. + LAPTOP,
  800. + SERVER,
  801. + TABLET,
  802. + HANDSET;
  803. + [Version (since = "1.0.0")]
  804. + public static AppStream.ChassisKind from_string (string kind_str);
  805. + [Version (since = "1.0.0")]
  806. + public unowned string to_string ();
  807. + }
  808. [CCode (cheader_filename = "appstream.h", cprefix = "AS_CHECK_RESULT_", type_id = "as_check_result_get_type ()")]
  809. public enum CheckResult {
  810. ERROR,
  811. @@ -1024,8 +1069,9 @@ namespace AppStream {
  812. NONE,
  813. SHA1,
  814. SHA256,
  815. + SHA512,
  816. BLAKE2B,
  817. - BLAKE2S;
  818. + BLAKE3;
  819. public static AppStream.ChecksumKind from_string (string kind_str);
  820. public unowned string to_string ();
  821. }
  822. @@ -1048,27 +1094,31 @@ namespace AppStream {
  823. [Version (since = "0.15.2")]
  824. public unowned string to_string ();
  825. }
  826. - [CCode (cheader_filename = "appstream.h", cprefix = "AS_COMPONENT_KIND_", has_type_id = false)]
  827. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_COMPONENT_BOX_FLAG_", type_id = "as_component_box_flags_get_type ()")]
  828. + [Flags]
  829. + public enum ComponentBoxFlags {
  830. + NONE,
  831. + NO_CHECKS
  832. + }
  833. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_COMPONENT_KIND_", type_id = "as_component_kind_get_type ()")]
  834. public enum ComponentKind {
  835. - [Version (deprecated = true, replacement = "INPUT_METHOD")]
  836. - INPUTMETHOD,
  837. UNKNOWN,
  838. GENERIC,
  839. DESKTOP_APP,
  840. CONSOLE_APP,
  841. WEB_APP,
  842. + SERVICE,
  843. ADDON,
  844. + RUNTIME,
  845. FONT,
  846. CODEC,
  847. INPUT_METHOD,
  848. + OPERATING_SYSTEM,
  849. FIRMWARE,
  850. DRIVER,
  851. LOCALIZATION,
  852. - SERVICE,
  853. REPOSITORY,
  854. - OPERATING_SYSTEM,
  855. - ICON_THEME,
  856. - RUNTIME;
  857. + ICON_THEME;
  858. public static AppStream.ComponentKind from_string (string kind_str);
  859. public unowned string to_string ();
  860. }
  861. @@ -1146,19 +1196,6 @@ namespace AppStream {
  862. ID,
  863. BRANCH
  864. }
  865. - [CCode (cheader_filename = "appstream.h", cprefix = "AS_DISPLAY_LENGTH_KIND_", type_id = "as_display_length_kind_get_type ()")]
  866. - public enum DisplayLengthKind {
  867. - UNKNOWN,
  868. - XSMALL,
  869. - SMALL,
  870. - MEDIUM,
  871. - LARGE,
  872. - XLARGE;
  873. - [Version (since = "0.12.12")]
  874. - public static AppStream.DisplayLengthKind from_string (string kind_str);
  875. - [Version (since = "0.12.12")]
  876. - public unowned string to_string ();
  877. - }
  878. [CCode (cheader_filename = "appstream.h", cprefix = "AS_DISPLAY_SIDE_KIND_", type_id = "as_display_side_kind_get_type ()")]
  879. public enum DisplaySideKind {
  880. UNKNOWN,
  881. @@ -1175,42 +1212,31 @@ namespace AppStream {
  882. XML,
  883. YAML,
  884. DESKTOP_ENTRY;
  885. - [Version (since = "0.10")]
  886. + [Version (since = "0.10.0")]
  887. public static AppStream.FormatKind from_string (string kind_str);
  888. - [Version (since = "0.10")]
  889. + [Version (since = "0.10.0")]
  890. public unowned string to_string ();
  891. }
  892. [CCode (cheader_filename = "appstream.h", cprefix = "AS_FORMAT_STYLE_", type_id = "as_format_style_get_type ()")]
  893. public enum FormatStyle {
  894. UNKNOWN,
  895. METAINFO,
  896. - CATALOG,
  897. - COLLECTION
  898. + CATALOG
  899. }
  900. [CCode (cheader_filename = "appstream.h", cprefix = "AS_FORMAT_VERSION_", type_id = "as_format_version_get_type ()")]
  901. public enum FormatVersion {
  902. - V0_6,
  903. - V0_7,
  904. - V0_8,
  905. - V0_9,
  906. - V0_10,
  907. - V0_11,
  908. - V0_12,
  909. - V0_13,
  910. - V0_14,
  911. - V0_15,
  912. - V0_16,
  913. - UNKNOWN;
  914. - [Version (since = "0.10")]
  915. + UNKNOWN,
  916. + V1_0;
  917. + [Version (since = "0.10.0")]
  918. public static AppStream.FormatVersion from_string (string version_str);
  919. - [Version (since = "0.10")]
  920. + [Version (since = "0.10.0")]
  921. public unowned string to_string ();
  922. }
  923. [CCode (cheader_filename = "appstream.h", cprefix = "AS_ICON_KIND_", type_id = "as_icon_kind_get_type ()")]
  924. public enum IconKind {
  925. UNKNOWN,
  926. - CACHED,
  927. STOCK,
  928. + CACHED,
  929. LOCAL,
  930. REMOTE;
  931. public static AppStream.IconKind from_string (string kind_str);
  932. @@ -1245,10 +1271,10 @@ namespace AppStream {
  933. [CCode (cheader_filename = "appstream.h", cprefix = "AS_ISSUE_SEVERITY_", type_id = "as_issue_severity_get_type ()")]
  934. public enum IssueSeverity {
  935. UNKNOWN,
  936. - ERROR,
  937. - WARNING,
  938. + PEDANTIC,
  939. INFO,
  940. - PEDANTIC;
  941. + WARNING,
  942. + ERROR;
  943. public static AppStream.IssueSeverity from_string (string str);
  944. public unowned string to_string ();
  945. }
  946. @@ -1264,6 +1290,13 @@ namespace AppStream {
  947. [Version (since = "0.11.0")]
  948. public unowned string to_string ();
  949. }
  950. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_MARKUP_KIND_", type_id = "as_markup_kind_get_type ()")]
  951. + public enum MarkupKind {
  952. + UNKNOWN,
  953. + XML,
  954. + TEXT,
  955. + MARKDOWN
  956. + }
  957. [CCode (cheader_filename = "appstream.h", cprefix = "AS_MERGE_KIND_", type_id = "as_merge_kind_get_type ()")]
  958. public enum MergeKind {
  959. NONE,
  960. @@ -1275,6 +1308,7 @@ namespace AppStream {
  961. }
  962. [CCode (cheader_filename = "appstream.h", cprefix = "AS_METADATA_LOCATION_", type_id = "as_metadata_location_get_type ()")]
  963. public enum MetadataLocation {
  964. + UNKNOWN,
  965. SHARED,
  966. STATE,
  967. CACHE,
  968. @@ -1289,14 +1323,6 @@ namespace AppStream {
  969. [CCode (cheader_filename = "appstream.h", cprefix = "AS_POOL_FLAG_", type_id = "as_pool_flags_get_type ()")]
  970. [Flags]
  971. public enum PoolFlags {
  972. - [Version (deprecated = true, replacement = "LOAD_OS_COLLECTION")]
  973. - READ_COLLECTION,
  974. - [Version (deprecated = true, replacement = "LOAD_OS_CATALOG")]
  975. - LOAD_OS_COLLECTION,
  976. - [Version (deprecated = true, replacement = "LOAD_OS_METAINFO")]
  977. - READ_METAINFO,
  978. - [Version (deprecated = true, replacement = "LOAD_OS_DESKTOP_FILES")]
  979. - READ_DESKTOP_FILES,
  980. NONE,
  981. LOAD_OS_CATALOG,
  982. LOAD_OS_METAINFO,
  983. @@ -1307,17 +1333,14 @@ namespace AppStream {
  984. PREFER_OS_METAINFO,
  985. MONITOR
  986. }
  987. - [CCode (cheader_filename = "appstream.h", cprefix = "AS_PROVIDED_KIND_", has_type_id = false)]
  988. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_PROVIDED_KIND_", type_id = "as_provided_kind_get_type ()")]
  989. public enum ProvidedKind {
  990. - [Version (deprecated = true, replacement = "MEDIATYPE")]
  991. - MIMETYPE,
  992. UNKNOWN,
  993. LIBRARY,
  994. BINARY,
  995. MEDIATYPE,
  996. FONT,
  997. MODALIAS,
  998. - PYTHON_2,
  999. PYTHON,
  1000. DBUS_SYSTEM,
  1001. DBUS_USER,
  1002. @@ -1328,6 +1351,16 @@ namespace AppStream {
  1003. public unowned string to_l10n_string ();
  1004. public unowned string to_string ();
  1005. }
  1006. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_REFERENCE_KIND_", type_id = "as_reference_kind_get_type ()")]
  1007. + public enum ReferenceKind {
  1008. + UNKNOWN,
  1009. + DOI,
  1010. + CITATION_CFF,
  1011. + REGISTRY;
  1012. + public static AppStream.ReferenceKind from_string (string str);
  1013. + [Version (since = "1.0.0")]
  1014. + public unowned string to_string ();
  1015. + }
  1016. [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELATION_COMPARE_", type_id = "as_relation_compare_get_type ()")]
  1017. public enum RelationCompare {
  1018. UNKNOWN,
  1019. @@ -1372,15 +1405,32 @@ namespace AppStream {
  1020. [Version (since = "0.12.0")]
  1021. public unowned string to_string ();
  1022. }
  1023. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELATION_STATUS_", type_id = "as_relation_status_get_type ()")]
  1024. + public enum RelationStatus {
  1025. + UNKNOWN,
  1026. + ERROR,
  1027. + NOT_SATISFIED,
  1028. + SATISFIED
  1029. + }
  1030. [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELEASE_KIND_", type_id = "as_release_kind_get_type ()")]
  1031. [Version (since = "0.12.0")]
  1032. public enum ReleaseKind {
  1033. UNKNOWN,
  1034. STABLE,
  1035. - DEVELOPMENT;
  1036. + DEVELOPMENT,
  1037. + SNAPSHOT;
  1038. public static AppStream.ReleaseKind from_string (string kind_str);
  1039. public unowned string to_string ();
  1040. }
  1041. + [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELEASE_LIST_KIND_", type_id = "as_release_list_kind_get_type ()")]
  1042. + [Version (since = "0.16.0")]
  1043. + public enum ReleaseListKind {
  1044. + UNKNOWN,
  1045. + EMBEDDED,
  1046. + EXTERNAL;
  1047. + public static AppStream.ReleaseListKind from_string (string kind_str);
  1048. + public unowned string to_string ();
  1049. + }
  1050. [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELEASE_URL_KIND_", type_id = "as_release_url_kind_get_type ()")]
  1051. [Version (since = "0.12.5")]
  1052. public enum ReleaseUrlKind {
  1053. @@ -1389,15 +1439,6 @@ namespace AppStream {
  1054. public static AppStream.ReleaseUrlKind from_string (string kind_str);
  1055. public unowned string to_string ();
  1056. }
  1057. - [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELEASES_KIND_", type_id = "as_releases_kind_get_type ()")]
  1058. - [Version (since = "0.16.0")]
  1059. - public enum ReleasesKind {
  1060. - UNKNOWN,
  1061. - EMBEDDED,
  1062. - EXTERNAL;
  1063. - public static AppStream.ReleasesKind from_string (string kind_str);
  1064. - public unowned string to_string ();
  1065. - }
  1066. [CCode (cheader_filename = "appstream.h", cprefix = "AS_REVIEW_FLAG_", type_id = "as_review_flags_get_type ()")]
  1067. [Flags]
  1068. [Version (since = "0.14.0")]
  1069. @@ -1420,19 +1461,6 @@ namespace AppStream {
  1070. IMAGE,
  1071. VIDEO
  1072. }
  1073. - [CCode (cheader_filename = "appstream.h", cprefix = "AS_SEARCH_TOKEN_MATCH_", has_type_id = false)]
  1074. - [Flags]
  1075. - public enum SearchTokenMatch {
  1076. - NONE,
  1077. - MEDIATYPE,
  1078. - PKGNAME,
  1079. - ORIGIN,
  1080. - DESCRIPTION,
  1081. - SUMMARY,
  1082. - KEYWORD,
  1083. - NAME,
  1084. - ID
  1085. - }
  1086. [CCode (cheader_filename = "appstream.h", cprefix = "AS_SIZE_KIND_", type_id = "as_size_kind_get_type ()")]
  1087. [Version (since = "0.8.6")]
  1088. public enum SizeKind {
  1089. @@ -1526,10 +1554,10 @@ namespace AppStream {
  1090. [CCode (cheader_filename = "appstream.h", cprefix = "AS_POOL_ERROR_", type_id = "as_pool_error_get_type ()")]
  1091. public errordomain PoolError {
  1092. FAILED,
  1093. - TARGET_NOT_WRITABLE,
  1094. INCOMPLETE,
  1095. COLLISION,
  1096. - OLD_CACHE;
  1097. + CACHE_WRITE_FAILED,
  1098. + CACHE_DAMAGED;
  1099. public static GLib.Quark quark ();
  1100. }
  1101. [CCode (cheader_filename = "appstream.h", cprefix = "AS_RELATION_ERROR_", type_id = "as_relation_error_get_type ()")]
  1102. @@ -1556,23 +1584,11 @@ namespace AppStream {
  1103. [CCode (cheader_filename = "appstream.h", cprefix = "AS_VALIDATOR_ERROR_", type_id = "as_validator_error_get_type ()")]
  1104. public errordomain ValidatorError {
  1105. FAILED,
  1106. - OVERRIDE_INVALID,
  1107. + INVALID_OVERRIDE,
  1108. INVALID_FILENAME;
  1109. [Version (since = "0.15.4")]
  1110. public static GLib.Quark quark ();
  1111. }
  1112. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_LARGE_HEIGHT")]
  1113. - public const int IMAGE_LARGE_HEIGHT;
  1114. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_LARGE_WIDTH")]
  1115. - public const int IMAGE_LARGE_WIDTH;
  1116. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_NORMAL_HEIGHT")]
  1117. - public const int IMAGE_NORMAL_HEIGHT;
  1118. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_NORMAL_WIDTH")]
  1119. - public const int IMAGE_NORMAL_WIDTH;
  1120. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_THUMBNAIL_HEIGHT")]
  1121. - public const int IMAGE_THUMBNAIL_HEIGHT;
  1122. - [CCode (cheader_filename = "appstream.h", cname = "AS_IMAGE_THUMBNAIL_WIDTH")]
  1123. - public const int IMAGE_THUMBNAIL_WIDTH;
  1124. [CCode (cheader_filename = "appstream.h", cname = "AS_MAJOR_VERSION")]
  1125. public const int MAJOR_VERSION;
  1126. [CCode (cheader_filename = "appstream.h", cname = "AS_MICRO_VERSION")]
  1127. @@ -1598,6 +1614,12 @@ namespace AppStream {
  1128. [Version (replacement = "BundleKind.to_string", since = "0.8.0")]
  1129. public static unowned string bundle_kind_to_string (AppStream.BundleKind kind);
  1130. [CCode (cheader_filename = "appstream.h")]
  1131. + [Version (replacement = "ChassisKind.from_string", since = "1.0.0")]
  1132. + public static AppStream.ChassisKind chassis_kind_from_string (string kind_str);
  1133. + [CCode (cheader_filename = "appstream.h")]
  1134. + [Version (replacement = "ChassisKind.to_string", since = "1.0.0")]
  1135. + public static unowned string chassis_kind_to_string (AppStream.ChassisKind kind);
  1136. + [CCode (cheader_filename = "appstream.h")]
  1137. [Version (replacement = "ChecksumKind.from_string")]
  1138. public static AppStream.ChecksumKind checksum_kind_from_string (string kind_str);
  1139. [CCode (cheader_filename = "appstream.h")]
  1140. @@ -1655,42 +1677,35 @@ namespace AppStream {
  1141. [Version (replacement = "ControlKind.to_string", since = "0.12.11")]
  1142. public static unowned string control_kind_to_string (AppStream.ControlKind kind);
  1143. [CCode (cheader_filename = "appstream.h")]
  1144. - [Version (replacement = "DisplayLengthKind.from_string", since = "0.12.12")]
  1145. - public static AppStream.DisplayLengthKind display_length_kind_from_string (string kind_str);
  1146. - [CCode (cheader_filename = "appstream.h")]
  1147. - [Version (replacement = "DisplayLengthKind.to_string", since = "0.12.12")]
  1148. - public static unowned string display_length_kind_to_string (AppStream.DisplayLengthKind kind);
  1149. - [CCode (cheader_filename = "appstream.h")]
  1150. [Version (replacement = "DisplaySideKind.from_string", since = "0.12.12")]
  1151. public static AppStream.DisplaySideKind display_side_kind_from_string (string kind_str);
  1152. [CCode (cheader_filename = "appstream.h")]
  1153. [Version (replacement = "DisplaySideKind.to_string", since = "0.12.12")]
  1154. public static unowned string display_side_kind_to_string (AppStream.DisplaySideKind kind);
  1155. [CCode (cheader_filename = "appstream.h")]
  1156. - [Version (replacement = "FormatKind.from_string", since = "0.10")]
  1157. + [Version (replacement = "FormatKind.from_string", since = "0.10.0")]
  1158. public static AppStream.FormatKind format_kind_from_string (string kind_str);
  1159. [CCode (cheader_filename = "appstream.h")]
  1160. - [Version (replacement = "FormatKind.to_string", since = "0.10")]
  1161. + [Version (replacement = "FormatKind.to_string", since = "0.10.0")]
  1162. public static unowned string format_kind_to_string (AppStream.FormatKind kind);
  1163. [CCode (cheader_filename = "appstream.h")]
  1164. - [Version (replacement = "FormatVersion.from_string", since = "0.10")]
  1165. + [Version (replacement = "FormatVersion.from_string", since = "0.10.0")]
  1166. public static AppStream.FormatVersion format_version_from_string (string version_str);
  1167. [CCode (cheader_filename = "appstream.h")]
  1168. - [Version (replacement = "FormatVersion.to_string", since = "0.10")]
  1169. + [Version (replacement = "FormatVersion.to_string", since = "0.10.0")]
  1170. public static unowned string format_version_to_string (AppStream.FormatVersion version);
  1171. [CCode (cheader_filename = "appstream.h")]
  1172. - public static unowned string get_appstream_version ();
  1173. - [CCode (cheader_filename = "appstream.h")]
  1174. public static string get_current_distro_component_id ();
  1175. - [CCode (cheader_filename = "appstream.h", cname = "as_get_default_categories_gir")]
  1176. + [CCode (cheader_filename = "appstream.h", cname = "as_get_default_categories_gi")]
  1177. public static GLib.GenericArray<AppStream.Category> get_default_categories (bool with_special);
  1178. [CCode (cheader_filename = "appstream.h")]
  1179. - [Version (since = "0.12.7")]
  1180. - public static string get_license_url (string license);
  1181. + [Version (since = "1.0.0")]
  1182. + public static string? get_license_name (string license);
  1183. [CCode (cheader_filename = "appstream.h")]
  1184. - public static uint gstring_replace (GLib.StringBuilder string, string find, string replace);
  1185. + [Version (since = "0.12.7")]
  1186. + public static string? get_license_url (string license);
  1187. [CCode (cheader_filename = "appstream.h")]
  1188. - public static uint gstring_replace2 (GLib.StringBuilder string, string find, string replace, uint limit);
  1189. + public static uint gstring_replace (GLib.StringBuilder string, string find, string replace, uint limit);
  1190. [CCode (cheader_filename = "appstream.h")]
  1191. [Version (replacement = "IconKind.from_string")]
  1192. public static AppStream.IconKind icon_kind_from_string (string kind_str);
  1193. @@ -1747,7 +1762,7 @@ namespace AppStream {
  1194. [Version (since = "0.9.8")]
  1195. public static string license_to_spdx_id (string license);
  1196. [CCode (cheader_filename = "appstream.h")]
  1197. - public static string markup_convert_simple (string markup) throws GLib.Error;
  1198. + public static string markup_convert (string markup, AppStream.MarkupKind to_kind) throws GLib.Error;
  1199. [CCode (array_length = false, array_null_terminated = true, cheader_filename = "appstream.h")]
  1200. [Version (since = "0.14.0")]
  1201. public static string[] markup_strsplit_words (string text, uint line_len);
  1202. @@ -1773,6 +1788,12 @@ namespace AppStream {
  1203. [Version (replacement = "ProvidedKind.to_string")]
  1204. public static unowned string provided_kind_to_string (AppStream.ProvidedKind kind);
  1205. [CCode (cheader_filename = "appstream.h")]
  1206. + [Version (replacement = "ReferenceKind.from_string")]
  1207. + public static AppStream.ReferenceKind reference_kind_from_string (string str);
  1208. + [CCode (cheader_filename = "appstream.h")]
  1209. + [Version (replacement = "ReferenceKind.to_string", since = "1.0.0")]
  1210. + public static unowned string reference_kind_to_string (AppStream.ReferenceKind kind);
  1211. + [CCode (cheader_filename = "appstream.h")]
  1212. [Version (replacement = "RelationCompare.from_string", since = "0.12.0")]
  1213. public static AppStream.RelationCompare relation_compare_from_string (string compare_str);
  1214. [CCode (cheader_filename = "appstream.h")]
  1215. @@ -1803,18 +1824,18 @@ namespace AppStream {
  1216. [Version (replacement = "ReleaseKind.to_string", since = "0.12.0")]
  1217. public static unowned string release_kind_to_string (AppStream.ReleaseKind kind);
  1218. [CCode (cheader_filename = "appstream.h")]
  1219. + [Version (replacement = "ReleaseListKind.from_string", since = "0.16.0")]
  1220. + public static AppStream.ReleaseListKind release_list_kind_from_string (string kind_str);
  1221. + [CCode (cheader_filename = "appstream.h")]
  1222. + [Version (replacement = "ReleaseListKind.to_string", since = "0.16.0")]
  1223. + public static unowned string release_list_kind_to_string (AppStream.ReleaseListKind kind);
  1224. + [CCode (cheader_filename = "appstream.h")]
  1225. [Version (replacement = "ReleaseUrlKind.from_string", since = "0.12.5")]
  1226. public static AppStream.ReleaseUrlKind release_url_kind_from_string (string kind_str);
  1227. [CCode (cheader_filename = "appstream.h")]
  1228. [Version (replacement = "ReleaseUrlKind.to_string", since = "0.12.5")]
  1229. public static unowned string release_url_kind_to_string (AppStream.ReleaseUrlKind kind);
  1230. [CCode (cheader_filename = "appstream.h")]
  1231. - [Version (replacement = "ReleasesKind.from_string", since = "0.16.0")]
  1232. - public static AppStream.ReleasesKind releases_kind_from_string (string kind_str);
  1233. - [CCode (cheader_filename = "appstream.h")]
  1234. - [Version (replacement = "ReleasesKind.to_string", since = "0.16.0")]
  1235. - public static unowned string releases_kind_to_string (AppStream.ReleasesKind kind);
  1236. - [CCode (cheader_filename = "appstream.h")]
  1237. [Version (replacement = "ScreenshotKind.from_string")]
  1238. public static AppStream.ScreenshotKind screenshot_kind_from_string (string kind);
  1239. [CCode (cheader_filename = "appstream.h")]
  1240. @@ -1863,8 +1884,6 @@ namespace AppStream {
  1241. [Version (since = "0.14.0")]
  1242. public static string utils_build_data_id (AppStream.ComponentScope scope, AppStream.BundleKind bundle_kind, string origin, string cid, string branch);
  1243. [CCode (cheader_filename = "appstream.h")]
  1244. - public static int utils_compare_versions (string a, string b);
  1245. - [CCode (cheader_filename = "appstream.h")]
  1246. [Version (since = "0.14.0")]
  1247. public static bool utils_data_id_equal (string data_id1, string data_id2);
  1248. [CCode (cheader_filename = "appstream.h")]
  1249. @@ -1882,6 +1901,14 @@ namespace AppStream {
  1250. [Version (replacement = "UtilsError.quark", since = "0.14.0")]
  1251. public static GLib.Quark utils_error_quark ();
  1252. [CCode (cheader_filename = "appstream.h")]
  1253. + [Version (since = "1.0.0")]
  1254. + public static unowned string utils_get_desktop_environment_name (string de_id);
  1255. + [CCode (cheader_filename = "appstream.h")]
  1256. + [Version (since = "1.0.0")]
  1257. + public static unowned string utils_get_gui_environment_style_name (string env_style);
  1258. + [CCode (cheader_filename = "appstream.h")]
  1259. + public static uint16 utils_get_tag_search_weight (string tag_name);
  1260. + [CCode (cheader_filename = "appstream.h")]
  1261. [Version (since = "0.15.0")]
  1262. public static AppStream.ComponentScope utils_guess_scope_from_path (string path);
  1263. [CCode (cheader_filename = "appstream.h")]
  1264. @@ -1891,7 +1918,10 @@ namespace AppStream {
  1265. public static bool utils_is_category_name (string category_name);
  1266. [CCode (cheader_filename = "appstream.h")]
  1267. [Version (since = "0.10.0")]
  1268. - public static bool utils_is_desktop_environment (string desktop);
  1269. + public static bool utils_is_desktop_environment (string de_id);
  1270. + [CCode (cheader_filename = "appstream.h")]
  1271. + [Version (since = "1.0.0")]
  1272. + public static bool utils_is_gui_environment_style (string env_style);
  1273. [CCode (cheader_filename = "appstream.h")]
  1274. [Version (since = "0.14.0")]
  1275. public static bool utils_is_platform_triplet (string triplet);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement