summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-07-03 07:39:08 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-07-03 07:39:08 +0000
commit1d5c7fd1ecc0d4d3a7c31945467a89b7a267f0f9 (patch)
treeb7dcab44ef6473329b69ffeeda08034671515b18 /legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
parentbf69d7dcc6290024c1a0221b08f0931128aadc07 (diff)
Ecore_Imf: Merge Tizen changes to upstream EFL.
SVN revision: 73204
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c156
1 files changed, 156 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
index 5f4e5dc0c6..dbac20135a 100644
--- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
+++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
@@ -1736,3 +1736,159 @@ ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
1736 return ctx->input_panel_caps_lock_mode; 1736 return ctx->input_panel_caps_lock_mode;
1737} 1737}
1738 1738
1739/**
1740 * Get the position of the current active input panel.
1741 *
1742 * @param ctx An #Ecore_IMF_Context.
1743 * @param x top-left x co-ordinate of the input panel
1744 * @param y top-left y co-ordinate of the input panel
1745 * @param w width of the input panel
1746 * @param h height of the input panel
1747 * @ingroup Ecore_IMF_Context_Group
1748 * @since 1.2.0
1749 */
1750EAPI void
1751ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
1752{
1753 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1754 {
1755 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1756 "ecore_imf_context_input_panel_geometry_get");
1757 return;
1758 }
1759
1760 if (ctx->klass->input_panel_geometry_get)
1761 ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
1762}
1763
1764/**
1765 * Get state of current active input panel.
1766 *
1767 * @param ctx An #Ecore_IMF_Context.
1768 * @param The state of input panel.
1769 * @ingroup Ecore_IMF_Context_Group
1770 * @since 1.2.0
1771 */
1772EAPI Ecore_IMF_Input_Panel_State
1773ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx)
1774{
1775 Ecore_IMF_Input_Panel_State state = ECORE_IMF_INPUT_PANEL_STATE_HIDE;
1776 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1777 {
1778 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1779 "ecore_imf_context_input_panel_state_get");
1780 return ECORE_IMF_INPUT_PANEL_STATE_HIDE;
1781 }
1782
1783 if (ctx->klass->input_panel_state_get)
1784 state = ctx->klass->input_panel_state_get(ctx);
1785
1786 return state;
1787}
1788
1789/**
1790 * Register a callback function which will be called if there is change in input panel state,language,mode etc.
1791 * In order to deregister the callback function
1792 * Use @ref ecore_imf_context_input_panel_event_callback_del.
1793 *
1794 * @param ctx An #Ecore_IMF_Context
1795 * @param type event type
1796 * @param func the callback function
1797 * @param data application-input panel specific data.
1798 * @ingroup Ecore_IMF_Context_Group
1799 * @since 1.2.0
1800 */
1801EAPI void
1802ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx,
1803 Ecore_IMF_Input_Panel_Event type,
1804 void (*func) (void *data, Ecore_IMF_Context *ctx, int value),
1805 const void *data)
1806{
1807 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1808 {
1809 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1810 "ecore_imf_context_input_panel_event_callback_add");
1811 return;
1812 }
1813
1814 if (ctx->klass->input_panel_event_callback_add)
1815 ctx->klass->input_panel_event_callback_add(ctx, type, func, (void *)data);
1816}
1817
1818/**
1819 * Unregister a callback function which will be called if there is change in input panel state, language, mode etc.
1820 *
1821 * @param ctx An #Ecore_IMF_Context.
1822 * @param func the callback function
1823 * @param data application-input panel specific data.
1824 * @ingroup Ecore_IMF_Context_Group
1825 * @since 1.2.0
1826 */
1827EAPI void
1828ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx,
1829 Ecore_IMF_Input_Panel_Event type,
1830 void (*func) (void *data, Ecore_IMF_Context *ctx, int value))
1831{
1832 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1833 {
1834 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1835 "ecore_imf_context_input_panel_event_callback_del");
1836 return;
1837 }
1838
1839 if (ctx->klass->input_panel_event_callback_del)
1840 ctx->klass->input_panel_event_callback_del(ctx, type, func);
1841}
1842
1843/**
1844 * Get the current language locale of the input panel.
1845 *
1846 * ex) fr_FR
1847 *
1848 * @param ctx An #Ecore_IMF_Context.
1849 * @param lang Location to store the retrieved language string. The
1850 * string retrieved must be freed with free().
1851 * @ingroup Ecore_IMF_Context_Group
1852 */
1853EAPI void
1854ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang)
1855{
1856 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1857 {
1858 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1859 "ecore_imf_context_input_panel_language_locale_get");
1860 return;
1861 }
1862
1863 if (ctx->klass->input_panel_language_locale_get)
1864 ctx->klass->input_panel_language_locale_get(ctx, lang);
1865 else
1866 {
1867 if (lang) *lang = strdup("");
1868 }
1869}
1870
1871/**
1872 * Get the geometry information of the candidate panel.
1873 *
1874 * @param ctx An #Ecore_IMF_Context.
1875 * @param x top-left x co-ordinate of the candidate panel
1876 * @param y top-left y co-ordinate of the candidate panel
1877 * @param w width of the candidate panel
1878 * @param h height of the candidate panel
1879 * @ingroup Ecore_IMF_Context_Group
1880 */
1881EAPI void
1882ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
1883{
1884 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1885 {
1886 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1887 "ecore_imf_context_candidate_panel_geometry_get");
1888 return;
1889 }
1890
1891 if (ctx->klass->candidate_panel_geometry_get)
1892 ctx->klass->candidate_panel_geometry_get(ctx, x, y, w, h);
1893}
1894