Merge "afm-user-daemon: Remove it by default"
[src/app-framework-main.git] / src / wgt.h
index d95e65b..301a869 100644 (file)
--- a/src/wgt.h
+++ b/src/wgt.h
@@ -1,5 +1,7 @@
 /*
- Copyright 2015 IoT.bzh
+ Copyright (C) 2015-2019 IoT.bzh
+
+ author: José Bollo <jose.bollo@iot.bzh>
 
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  limitations under the License.
 */
 
+struct wgt;
 
-#include <libxml/tree.h>
-#include "config.h"
-
-
-/**************************************************************/
-/* from wgt-config-xml */
-
-extern int confixml_open();
-extern void confixml_close();
-extern xmlNodePtr confixml_name();
-extern xmlNodePtr confixml_description();
-extern xmlNodePtr confixml_license();
-extern xmlNodePtr confixml_author();
-extern xmlNodePtr confixml_content();
-extern xmlNodePtr confixml_icon(int width, int height);
-extern xmlNodePtr confixml_first_feature();
-extern xmlNodePtr confixml_next_feature(xmlNodePtr node);
-extern xmlNodePtr confixml_first_preference();
-extern xmlNodePtr confixml_next_preference(xmlNodePtr node);
-extern xmlNodePtr confixml_first_icon();
-extern xmlNodePtr confixml_next_icon(xmlNodePtr node);
-
-/**************************************************************/
-/* from wgt-locales */
-
-extern void locales_reset();
-extern int locales_add(const char *locstr);
-extern int locales_score(const char *lang);
-extern char *locales_locate_file(const char *filename);
+/* creation and reference */
+extern struct wgt *wgt_create();
+extern void wgt_addref(struct wgt *wgt);
+extern void wgt_unref(struct wgt *wgt);
 
-/**************************************************************/
-/* from wgt-rootdir */
+/* connection and disconnection */
+extern struct wgt *wgt_createat(int dirfd, const char *pathname);
+extern int wgt_connect(struct wgt *wgt, const char *pathname);
+extern int wgt_connectat(struct wgt *wgt, int dirfd, const char *pathname);
+extern void wgt_disconnect(struct wgt *wgt);
+extern int wgt_is_connected(struct wgt *wgt);
 
-extern int widget_set_rootdir(const char *pathname);
-extern int widget_has(const char *filename);
-extern int widget_open_read(const char *filename);
+/* management of locales */
+extern void wgt_locales_reset(struct wgt *wgt);
+extern int wgt_locales_add(struct wgt *wgt, const char *locstr);
+extern unsigned int wgt_locales_score(struct wgt *wgt, const char *lang);
 
-/**************************************************************/
-/* from wgt-strings */
+/* direct access to files */
+extern int wgt_has(struct wgt *wgt, const char *filename);
+extern int wgt_open_read(struct wgt *wgt, const char *filename);
 
-extern const char _config_xml_[];
-extern const char _name_[];
-extern const char _description_[];
-extern const char _author_[];
-extern const char _license_[];
-extern const char _icon_[];
-extern const char _content_[];
-extern const char _feature_[];
-extern const char _preference_[];
-extern const char _width_[];
-extern const char _height_[];
+/* localised access to files */
+extern char *wgt_locales_locate(struct wgt *wgt, const char *filename);
+extern int wgt_locales_open_read(struct wgt *wgt, const char *filename);