summaryrefslogtreecommitdiff
path: root/daemon/modules.c
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:38:12 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:38:12 +0900
commit7c83e9661e76a4297913256f65d84709c9c3e26e (patch)
tree7f76d9983beab3974ec626e29f8b30fd969778ce /daemon/modules.c
parentd122c66eb003810833ffc2c9e7ba275c48ef5b95 (diff)
downloadquickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.tar.gz
quickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.tar.bz2
quickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.zip
Tizen 2.1 base
Diffstat (limited to 'daemon/modules.c')
-rwxr-xr-xdaemon/modules.c197
1 files changed, 197 insertions, 0 deletions
diff --git a/daemon/modules.c b/daemon/modules.c
new file mode 100755
index 0000000..a1ddd81
--- /dev/null
+++ b/daemon/modules.c
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (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.
+ */
+
+#include "common.h"
+#include "modules.h"
+
+/*******************************************************************
+ *
+ * MODULES
+ *
+ *****************************************************************/
+/* searchbar */
+/* extern QP_Module searchbar; */
+#ifdef QP_MINICTRL_ENABLE
+extern QP_Module minictrl;
+#endif /* QP_MINICTRL_ENABLE */
+#ifdef QP_BRIGHTNESS_ENABLE
+/* brightness */
+extern QP_Module brightness_ctrl;
+#endif /* QP_BRIGHTNESS_ENABLE */
+/* notification */
+extern QP_Module noti;
+extern QP_Module ticker;
+extern QP_Module ticker_status;
+/* idle test */
+extern QP_Module idletxt;
+
+static QP_Module *modules[] = {
+#ifdef QP_MINICTRL_ENABLE
+ &minictrl,
+#endif /* QP_MINICTRL_ENABLE */
+#ifdef QP_BRIGHTNESS_ENABLE
+ &brightness_ctrl,
+#endif /* QP_BRIGHTNESS_ENABLE */
+ &noti,
+ &ticker,
+ &ticker_status,
+ &idletxt
+};
+
+int init_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->init)
+ modules[i]->init(data);
+ }
+
+ return QP_OK;
+}
+
+int fini_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->fini)
+ modules[i]->fini(data);
+ }
+
+ return QP_OK;
+}
+
+int suspend_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->suspend)
+ modules[i]->suspend(data);
+ }
+
+ return QP_OK;
+}
+
+int resume_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->resume)
+ modules[i]->resume(data);
+ }
+
+ return QP_OK;
+}
+
+int hib_enter_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->hib_enter)
+ modules[i]->hib_enter(data);
+ }
+
+ return QP_OK;
+}
+
+int hib_leave_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->hib_leave)
+ modules[i]->hib_leave(data);
+ }
+
+ return QP_OK;
+}
+
+/******************************************************************
+ *
+ * LANGUAGE
+ *
+ ****************************************************************/
+
+void lang_change_modules(void *data)
+{
+ int i;
+ retif(data == NULL, , "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->lang_changed)
+ modules[i]->lang_changed(data);
+ }
+}
+
+void refresh_modules(void *data)
+{
+ int i;
+ retif(data == NULL, , "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->refresh)
+ modules[i]->refresh(data);
+ }
+}
+
+/******************************************************************
+ *
+ * Quickpanel open/close Events
+ *
+ ****************************************************************/
+int qp_opened_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->qp_opened)
+ modules[i]->qp_opened(data);
+ }
+
+ return QP_OK;
+}
+
+int qp_closed_modules(void *data)
+{
+ int i;
+
+ retif(data == NULL, QP_FAIL, "Invalid parameter!");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ if (modules[i]->qp_closed)
+ modules[i]->qp_closed(data);
+ }
+
+ return QP_OK;
+}