src/ise-emoticon-list.cpp
src/ise-emoticon-mode.cpp
+ src/cbhm.cpp
)
SET(ISE_PACKAGE ${PROJECT_NAME})
<?xml version="1.0" encoding="UTF-8"?>
-<layout width="160" height="124" style="popup" key_width="75" key_height="116" key_spacing="2" row_spacing="2" hit_left="1" hit_right="1" hit_top="4" hit_bottom="4" label_type="PUNC_POPUP" vibe_style="DEFAULT" sound_style="DEFAULT">
+<layout width="237" height="124" style="popup" key_width="75" key_height="116" key_spacing="2" row_spacing="2" hit_left="1" hit_right="1" hit_top="4" hit_bottom="4" label_type="PUNC_POPUP" vibe_style="DEFAULT" sound_style="DEFAULT">
<image_path>
<button_normal>B09_popup_bg.png</button_normal>
</image_path>
<rec button="normal">popup_line/popup_line_left.png</rec>
</background_image>
</key>
- <key key_type="modechange" custom_id="EMOTICON_KEY" hit_right="4">
+ <key key_type="modechange" custom_id="EMOTICON_KEY">
<key_value>
<rec>EMOTICON_LAYOUT</rec>
</key_value>
<rec button="disabled"></rec>
</image_label>
<background_image>
+ <rec button="normal">popup_line/popup_line_center.png</rec>
+ <rec button="disabled">popup_line/popup_line_center.png</rec>
+ </background_image>
+ </key>
+ <key key_type="user" hit_right="4">
+ <key_value>
+ <rec>CLIPBOARD</rec>
+ </key_value>
+ <image_label>
+ <rec button="normal">icon_clipboard.png</rec>
+ <rec button="pressed">icon_clipboard.png</rec>
+ <rec button="disabled"></rec>
+ </image_label>
+ <background_image>
<rec button="normal">popup_line/popup_line_right.png</rec>
<rec button="disabled">popup_line/popup_line_right.png</rec>
</background_image>
--- /dev/null
+/*
+ * Copyright (c) 2012 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 <Eldbus.h>
+
+#define CBHM_DBUS_OBJPATH "/org/tizen/cbhm/dbus"
+#ifndef CBHM_DBUS_INTERFACE
+#define CBHM_DBUS_INTERFACE "org.tizen.cbhm.dbus"
+#endif /* CBHM_DBUS_INTERFACE */
+
+static Eldbus_Proxy *eldbus_proxy = NULL;
+static Eldbus_Connection *cbhm_conn = NULL;
+
+Eldbus_Proxy* cbhm_proxy_get()
+{
+ return eldbus_proxy;
+}
+
+static void _cbhm_on_name_owner_changed(void *data EINA_UNUSED,
+ const char *bus EINA_UNUSED, const char *old_id EINA_UNUSED,
+ const char *new_id EINA_UNUSED)
+{
+ /* If client should know the time clipboard service is started or stoped,
+ * use this function. */
+}
+
+void cbhm_eldbus_init()
+{
+ Eldbus_Object *eldbus_obj;
+
+ cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+ eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
+ eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
+ eldbus_name_owner_changed_callback_add(cbhm_conn, CBHM_DBUS_INTERFACE,
+ _cbhm_on_name_owner_changed, cbhm_conn, EINA_TRUE);
+}
+
+void cbhm_eldbus_deinit()
+{
+ if (cbhm_conn)
+ eldbus_connection_unref(cbhm_conn);
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2012 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#ifndef __CBHM_H__
+#define __CBHM_H__
+
+Eldbus_Proxy* cbhm_proxy_get();
+
+void cbhm_eldbus_init();
+void cbhm_eldbus_deinit();
+
+#endif //__CBHM_H__
\ No newline at end of file
#include "languages.h"
#include "candidate-factory.h"
#include "ise-emoticon-mode.h"
+#include "cbhm.h"
+
#define CANDIDATE_WINDOW_HEIGHT 84
using namespace scl;
#include <vector>
#define MVK_Shift_Enable 0x9fe7
#define MVK_Shift_Disable 0x9fe8
-#define CM_KEY_LIST_SIZE 2
-#define USER_KEYSTRING_OPTION "OPTION"
-#define USER_KEYSTRING_EMOTICON "EMOTICON_LAYOUT"
+#define CM_KEY_LIST_SIZE 3
+#define USER_KEYSTRING_OPTION "OPTION"
+#define USER_KEYSTRING_EMOTICON "EMOTICON_LAYOUT"
+#define USER_KEYSTRING_CLIPBOARD "CLIPBOARD"
static sclboolean _cm_popup_opened = FALSE;
-static const char *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON};
+static const char *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON, USER_KEYSTRING_CLIPBOARD};
static scluint _current_cm_key_id = 0;
/*
const_cast<sclchar*>("setting icon/B09_icon_setting_press_54x54.png"),
const_cast<sclchar*>("setting icon/B09_icon_setting_dim_54x54.png")};
g_ui->set_private_key("CM_KEY", const_cast<sclchar*>(""), imagelabel, NULL, 0, const_cast<sclchar*>(USER_KEYSTRING_OPTION), TRUE);
+ } else if (strcmp(_cm_key_list[cm_key_id], USER_KEYSTRING_CLIPBOARD) == 0) {
+ sclchar* imagelabel[SCL_BUTTON_STATE_MAX] = {
+ const_cast<sclchar*>("icon_clipboard.png"),
+ const_cast<sclchar*>("icon_clipboard.png"),
+ const_cast<sclchar*>("icon_clipboard.png")};
+ g_ui->set_private_key("CM_KEY", const_cast<sclchar*>(""), imagelabel, NULL, 0, const_cast<sclchar*>(USER_KEYSTRING_CLIPBOARD), TRUE);
}
}
{
LOGD("CCoreEventCallback::init()\n");
ise_create();
+ cbhm_eldbus_init();
}
void CCoreEventCallback::on_run(int argc, char **argv)
{
::ise_hide();
ise_destroy();
+ cbhm_eldbus_deinit();
}
void CCoreEventCallback::on_attach_input_context(sclint ic, const sclchar *ic_uuid)
if (!option_window_is_available (OPTION_WINDOW_TYPE_NORMAL))
g_core.create_option_window();
ret = SCL_EVENT_DONE;
+ } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
+ ret = SCL_EVENT_DONE;
} else if (on_input_mode_changed(event_desc.key_value, event_desc.key_event, event_desc.key_type)) {
ret = SCL_EVENT_DONE;
}
if (!option_window_is_available (OPTION_WINDOW_TYPE_NORMAL))
g_core.create_option_window();
ret = SCL_EVENT_DONE;
+ } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
+ ret = SCL_EVENT_DONE;
} else {
const sclchar *input_mode = g_ui->get_input_mode();
if ((NULL != input_mode) && (!strcmp(input_mode, "EMOTICON_LAYOUT")))
_current_cm_key_id = id;
ise_set_cm_private_key(_current_cm_key_id);
}
+ } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
+ scluint id = ise_get_cm_key_id(USER_KEYSTRING_CLIPBOARD);
+ if (id != _current_cm_key_id) {
+ _current_cm_key_id = id;
+ ise_set_cm_private_key(_current_cm_key_id);
+ }
}
_cm_popup_opened = FALSE;
}