From e0163d2b8daae98ced81f4bc737998c00858e771 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Fri, 29 Sep 2017 20:42:53 +0900 Subject: Add agl-service-homescreen-2017 Add a new binding agl-service-homescreen-2017 for homescreen-2017. There is a gles sample how to use this binding in sample/simple-egl. A image about this see JIRA SPEC-871. [PatchSets2] Use aglwgt make package. Change-Id: I9ae89188f9eb2de4c98ec8baa2f05fccca8b2372 Signed-off-by: zheng_wenlong --- doc/api-ref/html/d0/d1e/homescreen_8c.html | 727 +++++++++++++++++++++++++++++ 1 file changed, 727 insertions(+) create mode 100644 doc/api-ref/html/d0/d1e/homescreen_8c.html (limited to 'doc/api-ref/html/d0/d1e/homescreen_8c.html') diff --git a/doc/api-ref/html/d0/d1e/homescreen_8c.html b/doc/api-ref/html/d0/d1e/homescreen_8c.html new file mode 100644 index 0000000..8907a06 --- /dev/null +++ b/doc/api-ref/html/d0/d1e/homescreen_8c.html @@ -0,0 +1,727 @@ + + + + + + + +HomeScreenBinding: homescreen_service/homescreen.c File Reference + + + + + + + + + +
+
+ + + + + + +
+
HomeScreenBinding +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
homescreen.c File Reference
+
+
+
#include <afb/afb-binding.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <json-c/json.h>
+#include <glib.h>
+#include <pthread.h>
+#include "hs-helper.h"
+
+

Go to the source code of this file.

+ + + + +

+Classes

struct  event
 
+ + + + + + + + + +

+Macros

#define _GNU_SOURCE
 
#define AFB_BINDING_VERSION   2
 
#define COMMAND_EVENT_NUM   3
 
#define EVENT_SUBSCRIBE_ERROR_CODE   100
 
+ + + + + + + + + + + + + + + + + +

+Functions

static void pingSample (struct afb_req request)
 
static void tap_shortcut (struct afb_req request)
 
static void on_screen_message (struct afb_req request)
 
static void subscribe (struct afb_req request)
 
static void unsubscribe (struct afb_req request)
 
static int preinit ()
 
static int init ()
 
static void onevent (const char *event, struct json_object *object)
 
+ + + + + + + + + + + + + + + + + + + +

+Variables

static struct event event_list [COMMAND_EVENT_NUM]
 
static struct afb_event ev_tap_shortcut
 
static struct afb_event ev_on_screen_message
 
static struct afb_event ev_reserved
 
static const char _error [] = "error"
 
static const char _application_name [] = "application_name"
 
static const char _display_message [] = "display_message"
 
static const struct afb_verb_v2 verbs []
 
const struct afb_binding_v2 afbBindingV2
 
+

Macro Definition Documentation

+ +

◆ _GNU_SOURCE

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+ +

Definition at line 17 of file homescreen.c.

+ +
+
+ +

◆ AFB_BINDING_VERSION

+ +
+
+ + + + +
#define AFB_BINDING_VERSION   2
+
+ +

Definition at line 18 of file homescreen.c.

+ +
+
+ +

◆ COMMAND_EVENT_NUM

+ +
+
+ + + + +
#define COMMAND_EVENT_NUM   3
+
+ +

Definition at line 31 of file homescreen.c.

+ +
+
+ +

◆ EVENT_SUBSCRIBE_ERROR_CODE

+ +
+
+ + + + +
#define EVENT_SUBSCRIBE_ERROR_CODE   100
+
+ +

Definition at line 32 of file homescreen.c.

+ +
+
+

Function Documentation

+ +

◆ init()

+ +
+
+ + + + + +
+ + + + + + + +
static int init ()
+
+static
+
+ +

Definition at line 238 of file homescreen.c.

+
239 {
240  AFB_NOTICE("binding init");
241 
242  ev_tap_shortcut = afb_daemon_make_event(evlist[0]);
243  ev_on_screen_message = afb_daemon_make_event(evlist[1]);
244  ev_reserved = afb_daemon_make_event(evlist[2]);
245 
246  event_list[0].name = evlist[0];
248 
249  event_list[1].name = evlist[1];
251 
252  event_list[2].name = evlist[2];
254 
255  return 0;
256 }
struct afb_event * event
Definition: homescreen.c:37
+
static struct afb_event ev_reserved
Definition: homescreen.c:44
+
static const char * evlist[]
Definition: hs-helper.h:33
+
const char * name
Definition: homescreen.c:36
+
static struct afb_event ev_on_screen_message
Definition: homescreen.c:43
+
static struct event event_list[COMMAND_EVENT_NUM]
Definition: homescreen.c:40
+
static struct afb_event ev_tap_shortcut
Definition: homescreen.c:42
+
+
+
+ +

◆ on_screen_message()

+ +
+
+ + + + + +
+ + + + + + + + +
static void on_screen_message (struct afb_req request)
+
+static
+
+

HomeScreenのOnScreenを表示する

+

Parameters

+

Request key

    +
  • display_message : 表示したい文字列
  • +
+

Return

+

Nothing

+ +

Definition at line 113 of file homescreen.c.

+
114 {
115  AFB_NOTICE("%s is called.", __FUNCTION__);
116 
117  int ret = 0;
118  const char* value = afb_req_value(request, _display_message);
119  if (value) {
120 
121  AFB_NOTICE("request params = %s.", value);
122 
123  struct json_object* push_obj = json_object_new_object();
125  _display_message, value);
126  afb_event_push(ev_on_screen_message, push_obj);
127  } else {
128  afb_req_fail_f(request, "failed", "called %s, Unknown palameter", __FUNCTION__);
129  return;
130  }
131 
132  // HomeScreenに返すレスポンス
133  struct json_object *res = json_object_new_object();
134  hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
135  _error, ret);
136  afb_req_success(request, res, "afb_event_push event [on_screen_message]");
137 }
void hs_add_object_to_json_object_str(struct json_object *j_obj, int count,...)
Definition: hs-helper.c:110
+
static const char _error[]
Definition: homescreen.c:46
+
static struct afb_event ev_on_screen_message
Definition: homescreen.c:43
+
static const char _display_message[]
Definition: homescreen.c:49
+
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
+
+
+
+ +

◆ onevent()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void onevent (const char * event,
struct json_object * object 
)
+
+static
+
+ +

Definition at line 258 of file homescreen.c.

+
259 {
260  AFB_NOTICE("on_event %s", event);
261 }
+
+
+
+ +

◆ pingSample()

+ +
+
+ + + + + +
+ + + + + + + + +
static void pingSample (struct afb_req request)
+
+static
+
+ +

Definition at line 55 of file homescreen.c.

+
56 {
57  static int pingcount = 0;
58  afb_req_success_f(request, json_object_new_int(pingcount), "Ping count = %d", pingcount);
59  AFB_NOTICE("Verbosity macro at level notice invoked at ping invocation count = %d", pingcount);
60  pingcount++;
61 }
+
+
+ +

◆ preinit()

+ +
+
+ + + + + +
+ + + + + + + +
static int preinit ()
+
+static
+
+ +

Definition at line 232 of file homescreen.c.

+
233 {
234  AFB_NOTICE("binding preinit (was register)");
235  return 0;
236 }
+
+
+ +

◆ subscribe()

+ +
+
+ + + + + +
+ + + + + + + + +
static void subscribe (struct afb_req request)
+
+static
+
+

Subscribe event

+

Parameters

+ +

Return

+

Nothing

+

Note

+ +

Definition at line 151 of file homescreen.c.

+
152 {
153  const char *value = afb_req_value(request, "event");
154  AFB_NOTICE("value is %s", value);
155  int ret = 0;
156  if(value) {
157  int index = hs_search_event_name_index(value);
158  if(index < 0)
159  {
160  AFB_NOTICE("dedicated event doesn't exist");
162  }
163  else
164  {
165  afb_req_subscribe(request, *event_list[index].event);
166  }
167  }
168  else{
169  AFB_NOTICE("Please input event name");
171  }
172  /*create response json object*/
173  struct json_object *res = json_object_new_object();
174  hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
175  _error, ret);
176  afb_req_success_f(request, res, "homescreen binder subscribe event name [%s]", value);
177 }
static const char _error[]
Definition: homescreen.c:46
+ +
int hs_search_event_name_index(const char *value)
Definition: hs-helper.c:142
+
static struct event event_list[COMMAND_EVENT_NUM]
Definition: homescreen.c:40
+
#define EVENT_SUBSCRIBE_ERROR_CODE
Definition: homescreen.c:32
+
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
+
+
+
+ +

◆ tap_shortcut()

+ +
+
+ + + + + +
+ + + + + + + + +
static void tap_shortcut (struct afb_req request)
+
+static
+
+

HomeScreenから呼ばれる ショートカットがタップされたことをアプリケーションに通知するために使用する アプリケーションからは使用されない

+

Parameters

+

Request key

    +
  • application_name : アプリケーション名
  • +
+

Return

+

Nothing

+ +

Definition at line 76 of file homescreen.c.

+
77 {
78  AFB_NOTICE("%s is called.", __FUNCTION__);
79 
80  int ret = 0;
81  const char* value = afb_req_value(request, _application_name);
82  if (value) {
83 
84  AFB_NOTICE("request params = %s.", value);
85 
86  struct json_object* push_obj = json_object_new_object();
88  _application_name, value);
89  afb_event_push(ev_tap_shortcut, push_obj);
90  } else {
91  afb_req_fail_f(request, "failed", "called %s, Unknown palameter", __FUNCTION__);
92  return;
93  }
94 
95  // HomeScreenに返すレスポンス
96  struct json_object *res = json_object_new_object();
97  hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
98  _error, ret);
99  afb_req_success(request, res, "afb_event_push event [tap_shortcut]");
100 }
void hs_add_object_to_json_object_str(struct json_object *j_obj, int count,...)
Definition: hs-helper.c:110
+
static const char _application_name[]
Definition: homescreen.c:48
+
static const char _error[]
Definition: homescreen.c:46
+
static struct afb_event ev_tap_shortcut
Definition: homescreen.c:42
+
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
+
+
+
+ +

◆ unsubscribe()

+ +
+
+ + + + + +
+ + + + + + + + +
static void unsubscribe (struct afb_req request)
+
+static
+
+

Unsubscribe event

+

Parameters

+ +

Return

+

Nothing

+

Note

+ +

Definition at line 191 of file homescreen.c.

+
192 {
193  const char *value = afb_req_value(request, "event");
194  AFB_NOTICE("value is %s", value);
195  int ret = 0;
196  if(value) {
197  int index = hs_search_event_name_index(value);
198  if(index < 0)
199  {
200  AFB_NOTICE("dedicated event doesn't exist");
202  }
203  else
204  {
205  afb_req_unsubscribe(request, *event_list[index].event);
206  }
207  }
208  else{
209  AFB_NOTICE("Please input event name");
211  }
212  /*create response json object*/
213  struct json_object *res = json_object_new_object();
214  hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
215  _error, ret);
216  afb_req_success_f(request, res, "homescreen binder unsubscribe event name [%s]", value);
217 }
static const char _error[]
Definition: homescreen.c:46
+ +
int hs_search_event_name_index(const char *value)
Definition: hs-helper.c:142
+
static struct event event_list[COMMAND_EVENT_NUM]
Definition: homescreen.c:40
+
#define EVENT_SUBSCRIBE_ERROR_CODE
Definition: homescreen.c:32
+
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
+
+
+
+

Variable Documentation

+ +

◆ _application_name

+ +
+
+ + + + + +
+ + + + +
const char _application_name[] = "application_name"
+
+static
+
+ +

Definition at line 48 of file homescreen.c.

+ +
+
+ +

◆ _display_message

+ +
+
+ + + + + +
+ + + + +
const char _display_message[] = "display_message"
+
+static
+
+ +

Definition at line 49 of file homescreen.c.

+ +
+
+ +

◆ _error

+ +
+
+ + + + + +
+ + + + +
const char _error[] = "error"
+
+static
+
+ +

Definition at line 46 of file homescreen.c.

+ +
+
+ +

◆ afbBindingV2

+ +
+
+ + + + +
const struct afb_binding_v2 afbBindingV2
+
+Initial value:
= {
.api = "homescreen",
.specification = NULL,
.verbs = verbs,
.preinit = preinit,
.init = init,
.onevent = onevent
}
static int preinit()
Definition: homescreen.c:232
+
static void onevent(const char *event, struct json_object *object)
Definition: homescreen.c:258
+
static int init()
Definition: homescreen.c:238
+
static const struct afb_verb_v2 verbs[]
Definition: homescreen.c:222
+
+

Definition at line 263 of file homescreen.c.

+ +
+
+ +

◆ ev_on_screen_message

+ +
+
+ + + + + +
+ + + + +
struct afb_event ev_on_screen_message
+
+static
+
+ +

Definition at line 43 of file homescreen.c.

+ +
+
+ +

◆ ev_reserved

+ +
+
+ + + + + +
+ + + + +
struct afb_event ev_reserved
+
+static
+
+ +

Definition at line 44 of file homescreen.c.

+ +
+
+ +

◆ ev_tap_shortcut

+ +
+
+ + + + + +
+ + + + +
struct afb_event ev_tap_shortcut
+
+static
+
+ +

Definition at line 42 of file homescreen.c.

+ +
+
+ +

◆ event_list

+ +
+
+ + + + + +
+ + + + +
struct event event_list[COMMAND_EVENT_NUM]
+
+static
+
+ +

Definition at line 40 of file homescreen.c.

+ +
+
+ +

◆ verbs

+ +
+
+ + + + + +
+ + + + +
const struct afb_verb_v2 verbs[]
+
+static
+
+Initial value:
= {
{ .verb = "ping", .session = AFB_SESSION_NONE, .callback = pingSample, .auth = NULL },
{ .verb = "tap_shortcut", .session = AFB_SESSION_NONE, .callback = tap_shortcut, .auth = NULL },
{ .verb = "on_screen_message", .session = AFB_SESSION_NONE, .callback = on_screen_message, .auth = NULL },
{ .verb = "subscribe", .session = AFB_SESSION_NONE, .callback = subscribe, .auth = NULL },
{ .verb = "unsubscribe", .session = AFB_SESSION_NONE, .callback = unsubscribe, .auth = NULL },
{NULL }
}
static void tap_shortcut(struct afb_req request)
Definition: homescreen.c:76
+
static void pingSample(struct afb_req request)
Definition: homescreen.c:55
+
static void unsubscribe(struct afb_req request)
Definition: homescreen.c:191
+
static void on_screen_message(struct afb_req request)
Definition: homescreen.c:113
+
static void subscribe(struct afb_req request)
Definition: homescreen.c:151
+
+

Definition at line 222 of file homescreen.c.

+ +
+
+
+ + + + -- cgit 1.2.3-korg