e_mod_atoms.h \
e_mod_rotation.c \
e_mod_rotation.h \
- e_mod_utils.h
+ e_mod_utils.h \
+ e_mod_keyboard.c \
+ e_mod_keyboard.h
module_la_LIBADD =
module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@
module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@
--- /dev/null
+#include "e_mod_keyboard.h"
+#include "e_mod_rotation.h"
+
+EINTERN Eina_Bool
+e_mod_pol_client_is_keyboard(E_Client *ec)
+{
+ E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
+ E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE);
+
+ if (ec->vkbd.vkbd) return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+EINTERN Eina_Bool
+e_mod_pol_client_is_keyboard_sub(E_Client *ec)
+{
+ E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
+ E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE);
+
+ if (ec->vkbd.vkbd) return EINA_FALSE;
+
+ if ((ec->icccm.class) &&
+ (!strcmp(ec->icccm.class, "ISF")))
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+EINTERN void
+e_mod_pol_keyboard_layout_apply(E_Client *ec)
+{
+ int angle;
+ int angle_id = 0;
+ int kbd_x, kbd_y, kbd_w, kbd_h;
+
+ if (!e_mod_pol_client_is_keyboard(ec)) return;
+
+ angle = e_client_rotation_curr_angle_get(ec);
+
+ switch (angle)
+ {
+ case 0: angle_id = 0; break;
+ case 90: angle_id = 1; break;
+ case 180: angle_id = 2; break;
+ case 270: angle_id = 3; break;
+ default: angle_id = 0; break;
+ }
+
+ kbd_w = ec->e.state.rot.geom[angle_id].w;
+ kbd_h = ec->e.state.rot.geom[angle_id].h;
+
+ switch (angle)
+ {
+ case 0:
+ kbd_x = ec->zone->w - kbd_w;
+ kbd_y = ec->zone->h - kbd_h;
+ break;
+
+ case 90:
+ kbd_x = ec->zone->w - kbd_w;
+ kbd_y = ec->zone->h - kbd_h;
+ break;
+
+ case 180:
+ kbd_x = 0;
+ kbd_y = 0;
+ break;
+
+ case 270:
+ kbd_x = 0;
+ kbd_y = 0;
+ break;
+
+ default:
+ kbd_x = ec->zone->w - kbd_w;
+ kbd_y = ec->zone->h - kbd_h;
+ break;
+ }
+
+ if ((ec->frame) &&
+ ((ec->w != kbd_w) || (ec->h != kbd_h)))
+ evas_object_resize(ec->frame, kbd_w, kbd_h);
+
+ if ((ec->frame) &&
+ ((ec->x != kbd_x) || (ec->y != kbd_y)))
+ evas_object_move(ec->frame, kbd_x, kbd_y);
+}
--- /dev/null
+#ifndef E_MOD_KEYBOARD_H
+#define E_MOD_KEYBOARD_H
+#include <e.h>
+
+EINTERN Eina_Bool e_mod_pol_client_is_keyboard(E_Client *ec);
+EINTERN Eina_Bool e_mod_pol_client_is_keyboard_sub(E_Client *ec);
+EINTERN void e_mod_pol_keyboard_layout_apply(E_Client *ec);
+
+#endif
#include "e_mod_main.h"
#include "e_mod_atoms.h"
#include "e_mod_rotation.h"
+#include "e_mod_keyboard.h"
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Policy-Mobile" };
return EINA_FALSE;
}
+ if (e_mod_pol_client_is_keyboard(ec) ||
+ e_mod_pol_client_is_keyboard_sub(ec))
+ {
+ Pol_Client *pc;
+ pc = eina_hash_find(hash_pol_clients, &ec);
+ if (pc) _pol_client_del(pc);
+ return EINA_FALSE;
+ }
+
if ((ec->netwm.type == E_WINDOW_TYPE_NORMAL) ||
(ec->netwm.type == E_WINDOW_TYPE_UNKNOWN))
{
if (e_object_is_del(E_OBJECT(ec))) return;
- if (!_pol_client_normal_check(ec)) return;
if (ec->new_client) return;
+ if (e_mod_pol_client_is_keyboard(ec) ||
+ e_mod_pol_client_is_keyboard_sub(ec))
+ {
+ Pol_Client *pc;
+ pc = eina_hash_find(hash_pol_clients, &ec);
+ if (pc) _pol_client_del(pc);
+
+ if (e_mod_pol_client_is_keyboard(ec))
+ e_mod_pol_keyboard_layout_apply(ec);
+ }
+
+ if (!_pol_client_normal_check(ec)) return;
+
pd = eina_hash_find(hash_pol_desks, &ec->desk);
if (!pd) return;
}
_pol_client_add(ec);
+
}
static void
static Eina_Bool e_client_rotation_is_progress(const E_Client *ec);
static Eina_Bool e_client_rotation_is_available(const E_Client *ec, int ang);
static Eina_List *e_client_rotation_available_list_get(const E_Client *ec);
-static int e_client_rotation_curr_angle_get(const E_Client *ec);
static int e_client_rotation_next_angle_get(const E_Client *ec);
static int e_client_rotation_prev_angle_get(const E_Client *ec);
static int e_client_rotation_recommend_angle_get(const E_Client *ec);
* @param ec e_client
* @return int current angle
*/
-static int
+EINTERN int
e_client_rotation_curr_angle_get(const E_Client *ec)
{
E_OBJECT_CHECK_RETURN(ec, -1);
EINTERN Eina_Bool e_mod_pol_rot_cb_window_property(Ecore_X_Event_Window_Property *ev);
EINTERN Eina_Bool e_mod_pol_rot_cb_window_message(Ecore_X_Event_Client_Message *ev);
EINTERN Eina_Bool e_mod_pol_rot_hook_eval_fetch(E_Client *ec);
+EINTERN int e_client_rotation_curr_angle_get(const E_Client *ec);
#endif