get_focused_context (client, context);
ctx = get_helper_ic (client, context);
m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
+ return true;
}
return false;
get_focused_context (client, context);
ctx = get_helper_ic (client, context);
m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
+ return true;
}
return false;
set_helper_return_key_disable (m_current_helper_uuid, disabled);
}
//ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
- void get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
+ bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
SCIM_DEBUG_MAIN (4) << __func__ << "\n";
+ bool ret = false;
if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
- get_helper_return_key_disable (m_current_helper_uuid, disabled);
+ ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
+
+ return ret;
}
void reset_helper_context (const String& uuid) {
}
//ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
-void InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
+bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
{
- m_impl->get_ise_return_key_disable (client_id, disabled);
+ return m_impl->get_ise_return_key_disable (client_id, disabled);
}
//ISM_TRANS_CMD_SET_CAPS_MODE
void set_ise_return_key_disable (int client_id, uint32 disabled);
//ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
- void get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled);
+ bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled);
//ISM_TRANS_CMD_SET_CAPS_MODE
void set_ise_caps_mode (int client_id, uint32 mode);
#include "scim_private.h"
#include "scim.h"
#include <unistd.h>
+#include <string.h>
using namespace scim;
+static String sanitize_string (const char *str, int maxlen = 32)
+{
+ String ret;
+ static char acceptables[] =
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "1234567890_-.@:";
+
+ char *newstr = NULL;
+ if (maxlen > 0) {
+ newstr = new char[maxlen + 1];
+ }
+ int len = 0;
+ if (newstr) {
+ memset (newstr, 0x00, sizeof (char) * (maxlen + 1));
+
+ if (str) {
+ while (len < maxlen && str[len] != '\0' && strchr (acceptables, str[len]) != NULL) {
+ newstr[len] = str[len];
+ len++;
+ }
+ ret = newstr;
+ }
+ delete [] newstr;
+ }
+ return ret;
+}
+
int main (int argc, char *argv [])
{
int i = 0;
std::cerr << "No argument for option " << argv [i-1] << "\n";
return -1;
}
- DebugOutput::set_output (String (argv [i]));
+ DebugOutput::set_output (sanitize_string (argv [i]));
continue;
}
}
}
- String exec = argv[0];
+ String exec = sanitize_string (argv[0]);
if (exec != String (SCIM_HELPER_LAUNCHER_PROGRAM)) {
/* 3rd party shared object type IME */