summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/CModule.h49
-rw-r--r--include/c-abi.h50
-rw-r--r--include/debug.h19
-rw-r--r--include/dlist.h43
-rw-r--r--include/livebox-cpp.h49
-rw-r--r--include/livebox-cpp_PG.h0
-rw-r--r--include/livebox-impl.h41
7 files changed, 251 insertions, 0 deletions
diff --git a/include/CModule.h b/include/CModule.h
new file mode 100644
index 0000000..f7c66ac
--- /dev/null
+++ b/include/CModule.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class CModule
+{
+private:
+ static const char *m_sModulePath;
+ static struct dlist *m_pModuleList;
+
+ void *m_pHandle;
+ void *(*m_fNew)(void);
+ char *m_sPkgname;
+ struct dlist *m_pList;
+ int (*m_fNeedToCreate)(const char *cluster, const char *category);
+ int (*m_fInitialize)(const char *pkgname);
+ int (*m_fFinalize)(void);
+
+ CModule(char *pkgname) : m_pHandle(NULL), m_fNew(NULL), m_sPkgname(pkgname), m_pList(NULL), m_fNeedToCreate(NULL), m_fInitialize(NULL), m_fFinalize(NULL) {}
+ virtual ~CModule() {}
+
+public:
+ static CModule *FindModule(const char *pkgname);
+
+ static CModule *Load(const char *pkgname);
+ int Unload(void);
+
+ int Create(const char *filename, const char *content, const char *cluster, const char *category);
+ int NeedToCreate(const char *cluster, const char *category);
+ int Destroy(CLiveBoxImpl *inst);
+
+ CLiveBoxImpl *FindLiveBox(const char *filename);
+
+ const char *PackageName(void) { return m_sPkgname; }
+};
+
+/* End of a file */
diff --git a/include/c-abi.h b/include/c-abi.h
new file mode 100644
index 0000000..d0a0666
--- /dev/null
+++ b/include/c-abi.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int livebox_initialize(const char *pkgname);
+extern int livebox_finalize(const char *pkgname);
+
+extern int livebox_create(const char *pkgname, const char *filename, const char *content, const char *cluster, const char *category);
+extern int livebox_destroy(const char *pkgname, const char *filename);
+extern int livebox_need_to_update(const char *pkgname, const char *filename);
+extern int livebox_need_to_destroy(const char *pkgname, const char *filename);
+extern int livebox_update_content(const char *pkgname, const char *filename);
+
+/*!
+ * \param[in] event "clicked" only
+ */
+extern int livebox_clicked(const char *pkgname, const char *filename, const char *event, double timestamp, double x, double y);
+
+/*!
+ * if "source" == "filename", emission could be "pd,show", "pd,hide", "lb,show", "lb,hide".
+ */
+extern int livebox_content_event(const char *pkgname, const char *filename, const char *emission, const char *source, struct event_info *event_info);
+extern int livebox_resize(const char *pkgname, const char *filename, int type);
+extern int livebox_change_group(const char *pkgname, const char *filename, const char *cluster, const char *category);
+extern int livebox_get_info(const char *pkgname, const char *filename, int *w, int *h, double *priority, char **content, char **title);
+extern int livebox_need_to_create(const char *pkgname, const char *cluster, const char *category);
+extern char *livebox_pinup(const char *pkgname, const char *filename, int pinup);
+extern int livebox_is_pinned_up(const char *pkgname, const char *filename);
+extern int livebox_system_event(const char *pkgname, const char *filename, int event);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* End of a file */
diff --git a/include/debug.h b/include/debug.h
new file mode 100644
index 0000000..6f5df3f
--- /dev/null
+++ b/include/debug.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
+/* End of a file */
diff --git a/include/dlist.h b/include/dlist.h
new file mode 100644
index 0000000..6ce75e0
--- /dev/null
+++ b/include/dlist.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define dlist_remove_data(list, data) do { \
+ struct dlist *l; \
+ l = dlist_find_data(list, data); \
+ list = dlist_remove(list, l); \
+} while (0)
+
+#define dlist_foreach(list, l, data) \
+ for ((l) = (list); ((data) = dlist_data(l)); (l) = dlist_next(l))
+
+#define dlist_foreach_safe(list, l, n, data) \
+ for ((l) = (list), (n) = dlist_next(l); \
+ ((data) = dlist_data(l)); \
+ (l) = (n), (n) = dlist_next(l))
+
+struct dlist;
+
+extern struct dlist *dlist_append(struct dlist *list, void *data);
+extern struct dlist *dlist_prepend(struct dlist *list, void *data);
+extern struct dlist *dlist_remove(struct dlist *list, struct dlist *l);
+extern struct dlist *dlist_find_data(struct dlist *list, void *data);
+extern void *dlist_data(struct dlist *l);
+extern struct dlist *dlist_next(struct dlist *l);
+extern struct dlist *dlist_prev(struct dlist *l);
+extern int dlist_count(struct dlist *l);
+extern struct dlist *dlist_nth(struct dlist *l, int nth);
+
+/* End of a file */
diff --git a/include/livebox-cpp.h b/include/livebox-cpp.h
new file mode 100644
index 0000000..37a8f51
--- /dev/null
+++ b/include/livebox-cpp.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Pure virtual class */
+class CLiveBox
+{
+public:
+ CLiveBox(void) {};
+ virtual ~CLiveBox(void) {}
+
+ virtual int Create(const char *filename, const char *content, const char *cluster, const char *category) = 0;
+ virtual int Destroy(void) = 0;
+
+ virtual int NeedToUpdate(void) = 0;
+ virtual int NeedToDestroy(void) = 0;
+ virtual int UpdateContent(void) = 0;
+
+ /*!
+ * \param[in] event "clicked" only
+ */
+ virtual int Clicked(const char *event, double timestamp, double x, double y) = 0;
+ virtual int ContentEvent(const char *emission, const char *source, struct event_info *info) = 0;
+
+ /*!
+ * if "source" == "filename", emission could be "pd,show", "pd,hide", "lb,show", "lb,hide".
+ */
+ virtual int Resize(int type) = 0;
+ virtual int ChangeGroup(const char *cluster, const char *category) = 0;
+ virtual int GetInfo(int *w, int *h, double *priority, char **content, char **title) = 0;
+ virtual char *PinUp(int on_pin) = 0;
+ virtual const char *Filename(void) = 0;
+ virtual int IsPinnedUp(void) = 0;
+ virtual int SystemEvent(int event) = 0;
+};
+
+/* End of a file */
diff --git a/include/livebox-cpp_PG.h b/include/livebox-cpp_PG.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/livebox-cpp_PG.h
diff --git a/include/livebox-impl.h b/include/livebox-impl.h
new file mode 100644
index 0000000..82a28f6
--- /dev/null
+++ b/include/livebox-impl.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+class CLiveBoxImpl : public CLiveBox
+{
+public:
+ CLiveBoxImpl(void);
+ virtual ~CLiveBoxImpl(void);
+
+ int Create(const char *filename, const char *content, const char *cluster, const char *category);
+ int Destroy(void);
+
+ int NeedToCreate(void);
+ int UpdateContent(void);
+
+ int Clicked(const char *event, double timestamp, double x, double y);
+ int ContentEvent(const char *emission, const char *source, struct event_info *info);
+
+ int Resize(int type);
+ int ChangeGroup(const char *cluster, const char *category);
+ int GetInfo(int *w, int *h, double *priority, char **content, char **title);
+ char *PinUp(int on_pin);
+ const char *Filename(void);
+ int IsPinnedUp(void);
+ int SystemEvent(int event);
+};
+
+// End of a file