1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef __APP_H__
- #define __APP_H__
- #pragma once
- #include "sp_svc.h"
- #include "sp_iom.h"
- #include "sp_mod.h"
- #include "sp_var.h"
- #include "sp_env.h"
- #include "sp_rpc.h"
- #include "sp_gui.h"
- #include "sp_sps.h"
- #include "sp_bcm.h"
- #include "sp_cfg.h"
- #include <utility>
- #ifndef _WIN32
- #include <functional>
- #endif //NOT _WIN32
- #include "SimpleString.h"
- #ifndef SPSHELL_TAG
- #include <winpr/wlog.h>
- #ifndef RVC_TAG
- #define RVC_TAG(tag) "rvc." tag
- #endif
- #define SPSHELL_TAG(tag) RVC_TAG("spshell.") tag
- #endif //SPSHELL_TAG
- /*indicate use qt to create gui*/
- #ifdef WITH_QT
- #define NO_GUI_WITH_WTL 1
- #else
- #define NO_GUI_WITH_WTL 0
- #endif
- #define EXIT_FROM_GUARDIAN 1
- #define EXIT_FROM_KILL 2
- #define EXIT_FROM_REBOOT_CMD 3
- #define EXIT_FROM_QT 10
- typedef struct app_t app_t;
- typedef struct log_t log_t;
- typedef class CSpShellConsole CSpShellConsole;
- struct app_t {
- bus_daemon_t *bus_daemon;
- sp_svc_t *svc;
- sp_iom_t *iom;
- sp_var_client_t* var_client;
- sp_var_daemon_t *var_daemon;
- sp_bcm_daemon_t *bcm_daemon;
- log_t *log;
- #if defined(_MSC_VER)
- sp_gui_t* bsc_gui;
- #else
- sp_gui_format_t* bsc_gui;
- #endif //_MSC_VER
- sp_rpc_server_t *rpc_server;
- sp_sps_t *sps;
- CSpShellConsole *pConsole;
- };
- app_t *get_app_instance();
- #if defined(_MSC_VER)
- std::pair<int, CSimpleStringA> app_init(const sp_cfg_start_args_t* args);
- #else
- int app_init(const sp_cfg_start_args_t* args, std::function<void(const char* msg, bool)> const& popup);
- #endif //_MSC_VER
- int app_term();
- int app_run();
- void app_stop(int from_id);
- int app_update_terminal_state(int state);
- void app_clear();
- void app_upload_last_log();
- #endif //__APP_H__
|