一、 初始化篇:
1.1、int screen_create_context( screen_context_t *pctx, int flags );
#include <screen/screen.h>
Function:创建一个新的背景
pctx:context指针;
flags:创建类型,包括SCREEN_APPLICATION_CONTEXT、SCREEN_WINDOW_MANAGER_CONTEXT、SCREEN_INPUT_PROVIDER_CONTEXT、SCREEN_POWER_MANAGER_CONTEXT;
返回值:0(窗口创建成功)、-1(窗口创建失败);
1.2、int bps_initialize(void)
#include <sys/platform.h>
#include "bps/event.h"
Function:初始化BPS;
1.3、bbutil_init_egl()
#include< bbutil.h>Function:初始化egl
返回值:存在返回值,EXIT_SECCUSS表示失败。
1.4、 screen_destroy_context(screen_cxt);
#include< bbutil.h>
Function:关闭背景;
返回值:暂时不知道存不存在;
1.5、int navigator_request_events(int flags)
#include <stdbool.h>
#include <sys/platform.h>
#include "bps/event.h"
Function:声明本应用需要获取“Navigator”事件。
flags: 零(任何事情都處理),非零
返回值:BPS_SUCCESS 表示成功; BPS_FAILURE 表示失敗。
1.6、int bps_get_event(bps_event_t **event, int timeout_ms)
#include <sys/platform.h>
#include "bps/event.h"
Function:获取事件
event: even用来储存事件
timeout_ms:获取事件的方式,可为零、负值、正值。负数则表示bps_get_event方法会一直等待到获取到一个事件为止。如果第二个参数是零则表示bps_get_event不会等待,有事件就获取,没有事件就继续执行后面的代码。如果第二个参数是一个正整数则表示等待指定的时间,期间获取到事件就返回,没有获取到事件就在指定的时间结束后返回。
返回值:BPS_SUCCESS(成功)、, BPS_FAILURE(出错) 、BPS_SUCCESS(成功但是事件为空);
1.7、intlocale_request_events(int flags)
#include <sys/platform.h>
#include "bps/event.h"
Function:starts to deliver locale status change events to your applicationusing BPS
flag: Thetypes of events to deliver. A value of zero indicates that all events arerequested. The meaning of non-zero values is reserved for future use.
1.8、int bps_event_get_domain(bps_event_t *event)
#include <sys/platform.h>
#include <stdint.h>
Function:獲得事件event的domain
返回值:會event的domain
1.9、int navigator_rotation_lock(bool locked)
#include <stdbool.h>
#include <sys/platform.h>
#include "bps/event.h"
Function:鎖定屏幕;
1.10、int screen_request_events(screen_context_t context)
#include <screen/screen.h>
#include <sys/platform.h>
#include "bps/event.h"
context:The libscreen context to use for event retrieval.
Function:申明使用屏幕事件。
二、 创建使用对话框篇:
2.1、int dialog_request_events(int flags)