* Distribution License ("CDDL")(collectively, the "License"). You may not use this
* file except in compliance with the License. You can obtain a copy of the CDDL at
* http://www.opensource.org/licenses/cddl1.php and a copy of the LGPLv2.1 at
- * http://www.opensource.org/licenses/lgpl-license.php. See the License for the
+ * http://www.opensource.org/licenses/lgpl-license.php. See the License for the
* specific language governing permissions and limitations under the License. When
* distributing the software, include this License Header Notice in each file and
* include the full text of the License in the License file as well as the
* following notice:
- *
+ *
* NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
* (CDDL)
* For Covered Software in this distribution, this License shall be governed by the
* Any litigation relating to this License shall be subject to the jurisdiction of
* the Federal Courts of the Northern District of California and the state courts
* of the State of California, with venue lying in Santa Clara County, California.
- *
+ *
* Contributor(s):
- *
+ *
* If you wish your version of this file to be governed by only the CDDL or only
* the LGPL Version 2.1, indicate your decision by adding "[Contributor]" elects to
* include this software in this distribution under the [CDDL or LGPL Version 2.1]
* Version 2.1, or to extend the choice of license to its licensees as provided
* above. However, if you add LGPL Version 2.1 code and therefore, elected the LGPL
* Version 2 license, then the option applies only if the new code is made subject
- * to such option by the copyright holder.
+ * to such option by the copyright holder.
*
* Modifications by Samsung Electronics Co., Ltd.
*
#define SCIM_FULL_PUNCT_ICON (SCIM_ICONDIR "/full-punct.png")
#define SCIM_HALF_PUNCT_ICON (SCIM_ICONDIR "/half-punct.png")
+#define ISE_DEFAULT_FLUSH_EVENT_CMD 1001
+
using namespace scim;
-static IMEngineFactoryPointer _scim_pinyin_factory (0);
+static IMEngineFactoryPointer _scim_pinyin_factory (0);
static ConfigPointer _scim_config (0);
SCIM_DEBUG_IMENGINE (3) << "module_init\n";
_status_property.set_tip (_("The status of the current input method. Click to change it."));
_status_property.set_label ("英");
-
+
_letter_property.set_icon (SCIM_HALF_LETTER_ICON);
_letter_property.set_tip (_("The input mode of the letters. Click to toggle between half and full."));
_letter_property.set_label (_("Full/Half Letter"));
SCIM_DEBUG_IMENGINE (3) << "entering scim_imengine_module_create_factory()\n";
if (engine != 0) return IMEngineFactoryPointer (0);
if (_scim_pinyin_factory.null ()) {
- SunPyFactory *factory = new SunPyFactory (_scim_config);
+ SunPyFactory *factory = new SunPyFactory (_scim_config);
if (factory->valid ())
_scim_pinyin_factory = factory;
else
SunPyFactory::init ()
{
bool valid = true;
-
+
if (m_config) {
valid = load_user_config();
}
-
+
// postpone the load_user_data() to the ctor of SunPyInstance
return valid;
}
IMEngineInstancePointer
SunPyFactory::create_instance (const String& encoding, int id)
{
- SCIM_DEBUG_IMENGINE (3) << "SunPyFactory::create_instance(" << id << ")\n";
+ SCIM_DEBUG_IMENGINE (3) << "SunPyFactory::create_instance(" << id << ")\n";
return new SunPyInstance (this, m_hotkey_profile, encoding, id);
}
key.code << ", " <<
key.mask << ", " <<
key.layout << ")\n";
-
+
if (!m_focused) return false;
CKeyEvent ev = translate_key(key);
-
+
if ( !m_pv->getStatusAttrValue(CScimWinHandler::STATUS_ID_CN) ) {
// we are in English input mode
if ( !m_hotkey_profile->isModeSwitchKey(ev) ) {
m_focused = true;
//show_lookup_table ();
initialize_all_properties ();
-
+
hide_preedit_string ();
//hide_aux_string ();
-
+
init_lookup_table_labels ();
-
+
//hide_aux_string ();
m_pv->updateWindows(CIMIView::PREEDIT_MASK | CIMIView::CANDIDATE_MASK);
SunPyInstance::trigger_property (const String &property)
{
SCIM_DEBUG_IMENGINE (3) << get_id() << ": trigger_property(" << property << ")\n";
-
+
if (property == SCIM_PROP_STATUS) {
const int is_CN = m_pv->getStatusAttrValue(CIMIWinHandler::STATUS_ID_CN);
m_pv->setStatusAttrValue(CIMIWinHandler::STATUS_ID_CN, is_CN?0:1);
m_pv->getStatusAttrValue(CIMIWinHandler::STATUS_ID_CN));
m_wh->updateStatus(CIMIWinHandler::STATUS_ID_FULLPUNC,
m_pv->getStatusAttrValue(CIMIWinHandler::STATUS_ID_FULLPUNC));
- m_wh->updateStatus(CIMIWinHandler::STATUS_ID_FULLSYMBOL,
+ m_wh->updateStatus(CIMIWinHandler::STATUS_ID_FULLSYMBOL,
m_pv->getStatusAttrValue(CIMIWinHandler::STATUS_ID_FULLSYMBOL));
}
SCIM_DEBUG_IMENGINE (3) << get_id() << " factory.createSession() failed\n";
return;
}
-
+
m_pv->setHotkeyProfile(hotkey_profile);
m_lookup_table = new SunLookupTable();
SunPyInstance::destroy_session()
{
SCIM_DEBUG_IMENGINE (3) << get_id() << ": destroy_session()\n";
-
+
// wh and ic are not pointers, I don't think it's necessary to delete them
// either
delete m_pv;
delete m_wh;
delete m_lookup_table;
delete m_common_lookup_table;
-
+
m_pv = 0;
m_wh = 0;
m_lookup_table = 0;
m_factory->load_user_config();
}
}
+
+void
+SunPyInstance::process_helper_event (const String &helper_uuid,
+ const Transaction &recv)
+{
+ TransactionReader reader (recv);
+ int cmd;
+
+ if (!reader.get_command (cmd))
+ return;
+
+ switch (cmd) {
+ case ISE_DEFAULT_FLUSH_EVENT_CMD:
+ flush ();
+ break;
+ }
+}
* Distribution License ("CDDL")(collectively, the "License"). You may not use this
* file except in compliance with the License. You can obtain a copy of the CDDL at
* http://www.opensource.org/licenses/cddl1.php and a copy of the LGPLv2.1 at
- * http://www.opensource.org/licenses/lgpl-license.php. See the License for the
+ * http://www.opensource.org/licenses/lgpl-license.php. See the License for the
* specific language governing permissions and limitations under the License. When
* distributing the software, include this License Header Notice in each file and
* include the full text of the License in the License file as well as the
* following notice:
- *
+ *
* NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
* (CDDL)
* For Covered Software in this distribution, this License shall be governed by the
* Any litigation relating to this License shall be subject to the jurisdiction of
* the Federal Courts of the Northern District of California and the state courts
* of the State of California, with venue lying in Santa Clara County, California.
- *
+ *
* Contributor(s):
- *
+ *
* If you wish your version of this file to be governed by only the CDDL or only
* the LGPL Version 2.1, indicate your decision by adding "[Contributor]" elects to
* include this software in this distribution under the [CDDL or LGPL Version 2.1]
* Version 2.1, or to extend the choice of license to its licensees as provided
* above. However, if you add LGPL Version 2.1 code and therefore, elected the LGPL
* Version 2 license, then the option applies only if the new code is made subject
- * to such option by the copyright holder.
+ * to such option by the copyright holder.
*
* Modifications by Samsung Electronics Co., Ltd.
*
CHotkeyProfile *m_hotkey_profile;
friend class SunPyInstance;
-
+
public:
SunPyFactory (const ConfigPointer &config);
virtual String get_icon_file () const;
virtual IMEngineInstancePointer create_instance (const String& encoding, int id = -1);
-
+
public:
bool valid () const { return m_valid; }
void reload_config(const ConfigPointer& config);
-
+
private:
bool init ();
bool load_user_config ();
Connection m_reload_signal_connection;
bool m_focused;
bool m_lookup_table_always_on;
-
+
public:
SunPyInstance(SunPyFactory *factory,
CHotkeyProfile *hotkey_profile,
* decide whether to display candidate window according to layout
*/
virtual void set_layout (unsigned int layout);
+ virtual void process_helper_event (const String &helper_uuid, const Transaction &trans);
public:
/**
* so that CScimWinHandler can call it
*/
using IMEngineInstanceBase::commit_string;
-
+
void refresh_status_property(bool cn);
void refresh_fullsymbol_property(bool full);
void refresh_fullpunc_property(bool full);
private:
void create_session(CHotkeyProfile*);
void destroy_session();
-
+
void init_lookup_table_labels ();
void reload_config (const ConfigPointer &config);
void refresh_all_properties ();
void initialize_all_properties();
-
+
AttributeList build_preedit_attribs(const IPreeditString* ppd);
void lookup_page_up();