X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgt.h;h=301a8693a96da1aa16cfa11a05148e51ec3dfc06;hb=2a319cf90daa6e3b01e8139923f7073e1c9bcf28;hp=d95e65becd15cc1c073ca6ddbd118a55c39d54e9;hpb=bf7b5918fcc07713a29b9ca32f766b65b15a4ec2;p=src%2Fapp-framework-main.git diff --git a/src/wgt.h b/src/wgt.h index d95e65b..301a869 100644 --- 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 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,56 +16,30 @@ limitations under the License. */ +struct wgt; -#include -#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);