diff options
author | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:38:12 +0900 |
---|---|---|
committer | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:38:12 +0900 |
commit | 7c83e9661e76a4297913256f65d84709c9c3e26e (patch) | |
tree | 7f76d9983beab3974ec626e29f8b30fd969778ce /daemon/modules.c | |
parent | d122c66eb003810833ffc2c9e7ba275c48ef5b95 (diff) | |
download | quickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.tar.gz quickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.tar.bz2 quickpanel-7c83e9661e76a4297913256f65d84709c9c3e26e.zip |
Tizen 2.1 base
Diffstat (limited to 'daemon/modules.c')
-rwxr-xr-x | daemon/modules.c | 197 |
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 */ + ¬i, + &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; +} |