diff options
author | Chris Michael <cp.michael@samsung.com> | 2017-06-08 09:15:56 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2017-06-08 10:03:30 -0400 |
commit | 75b5310781bc4c89f8accc94eecae83e3259e422 (patch) | |
tree | c6109146d05c2e1b5599dff81f9b7af26db244be /src/lib/elput/elput_evdev.c | |
parent | 06b8a76954be169c83f09e58081924453cb26baf (diff) |
elput: Minor formatting fixes
NB: No functional changes
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r-- | src/lib/elput/elput_evdev.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 1e1254e4a6..f2fd46b36c 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c | |||
@@ -201,16 +201,21 @@ static void | |||
201 | _keyboard_compose_init(Elput_Keyboard *kbd) | 201 | _keyboard_compose_init(Elput_Keyboard *kbd) |
202 | { | 202 | { |
203 | const char *locale; | 203 | const char *locale; |
204 | |||
204 | if (!(locale = getenv("LC_ALL"))) | 205 | if (!(locale = getenv("LC_ALL"))) |
205 | if (!(locale = getenv("LC_CTYPE"))) | 206 | if (!(locale = getenv("LC_CTYPE"))) |
206 | if (!(locale = getenv("LANG"))) | 207 | if (!(locale = getenv("LANG"))) |
207 | locale = "C"; | 208 | locale = "C"; |
209 | |||
208 | if (kbd->compose_table) xkb_compose_table_unref(kbd->compose_table); | 210 | if (kbd->compose_table) xkb_compose_table_unref(kbd->compose_table); |
209 | kbd->compose_table = xkb_compose_table_new_from_locale(kbd->context, locale, | 211 | kbd->compose_table = xkb_compose_table_new_from_locale(kbd->context, locale, |
210 | XKB_COMPOSE_COMPILE_NO_FLAGS); | 212 | XKB_COMPOSE_COMPILE_NO_FLAGS); |
211 | if (kbd->compose_state) xkb_compose_state_unref(kbd->compose_state); | 213 | if (kbd->compose_state) xkb_compose_state_unref(kbd->compose_state); |
212 | if (kbd->compose_table) | 214 | if (kbd->compose_table) |
213 | kbd->compose_state = xkb_compose_state_new(kbd->compose_table, XKB_COMPOSE_STATE_NO_FLAGS); | 215 | { |
216 | kbd->compose_state = | ||
217 | xkb_compose_state_new(kbd->compose_table, XKB_COMPOSE_STATE_NO_FLAGS); | ||
218 | } | ||
214 | else | 219 | else |
215 | kbd->compose_state = NULL; | 220 | kbd->compose_state = NULL; |
216 | } | 221 | } |
@@ -375,7 +380,8 @@ _keyboard_state_update(Elput_Keyboard *kbd, struct xkb_keymap *map, xkb_mod_mask | |||
375 | 380 | ||
376 | *latched = xkb_state_serialize_mods(kbd->state, XKB_STATE_MODS_LATCHED); | 381 | *latched = xkb_state_serialize_mods(kbd->state, XKB_STATE_MODS_LATCHED); |
377 | *locked = xkb_state_serialize_mods(kbd->state, XKB_STATE_MODS_LOCKED); | 382 | *locked = xkb_state_serialize_mods(kbd->state, XKB_STATE_MODS_LOCKED); |
378 | xkb_state_update_mask(state, 0, *latched, *locked, kbd->seat->manager->cached.group, 0, 0); | 383 | xkb_state_update_mask(state, 0, *latched, *locked, |
384 | kbd->seat->manager->cached.group, 0, 0); | ||
379 | 385 | ||
380 | xkb_state_unref(kbd->state); | 386 | xkb_state_unref(kbd->state); |
381 | kbd->state = state; | 387 | kbd->state = state; |
@@ -403,11 +409,15 @@ _keyboard_keymap_update(Elput_Seat *seat) | |||
403 | kbd->context = xkb_context_ref(kbd->seat->manager->cached.context); | 409 | kbd->context = xkb_context_ref(kbd->seat->manager->cached.context); |
404 | info = _keyboard_info_create(kbd->seat->manager->cached.keymap); | 410 | info = _keyboard_info_create(kbd->seat->manager->cached.keymap); |
405 | if (!info) return; | 411 | if (!info) return; |
406 | state = _keyboard_state_update(kbd, info->keymap.map, &latched, &locked); | 412 | state = _keyboard_state_update(kbd, info->keymap.map, |
413 | &latched, &locked); | ||
407 | } | 414 | } |
408 | else if (!_keyboard_global_build(kbd)) return; | 415 | else if (!_keyboard_global_build(kbd)) |
416 | return; | ||
409 | else | 417 | else |
410 | state = _keyboard_state_update(kbd, kbd->info->keymap.map, &latched, &locked); | 418 | state = _keyboard_state_update(kbd, kbd->info->keymap.map, |
419 | &latched, &locked); | ||
420 | |||
411 | kbd->pending_keymap = 0; | 421 | kbd->pending_keymap = 0; |
412 | if (!state) | 422 | if (!state) |
413 | { | 423 | { |
@@ -901,8 +911,10 @@ _pointer_motion_abs(struct libinput_device *idev, struct libinput_event_pointer | |||
901 | ptr = _evdev_pointer_get(edev->seat); | 911 | ptr = _evdev_pointer_get(edev->seat); |
902 | if (!ptr) return EINA_FALSE; | 912 | if (!ptr) return EINA_FALSE; |
903 | 913 | ||
904 | ptr->seat->pointer.x = libinput_event_pointer_get_absolute_x_transformed(event, edev->ow); | 914 | ptr->seat->pointer.x = |
905 | ptr->seat->pointer.y = libinput_event_pointer_get_absolute_y_transformed(event, edev->oh); | 915 | libinput_event_pointer_get_absolute_x_transformed(event, edev->ow); |
916 | ptr->seat->pointer.y = | ||
917 | libinput_event_pointer_get_absolute_y_transformed(event, edev->oh); | ||
906 | ptr->timestamp = libinput_event_pointer_get_time(event); | 918 | ptr->timestamp = libinput_event_pointer_get_time(event); |
907 | 919 | ||
908 | /* TODO: these needs to run a matrix transform based on output */ | 920 | /* TODO: these needs to run a matrix transform based on output */ |
@@ -1253,8 +1265,10 @@ _touch_down(struct libinput_device *idevice, struct libinput_event_touch *event) | |||
1253 | touch->slot = libinput_event_touch_get_slot(event); | 1265 | touch->slot = libinput_event_touch_get_slot(event); |
1254 | touch->timestamp = libinput_event_touch_get_time(event); | 1266 | touch->timestamp = libinput_event_touch_get_time(event); |
1255 | 1267 | ||
1256 | touch->seat->pointer.x = libinput_event_touch_get_x_transformed(event, dev->ow); | 1268 | touch->seat->pointer.x = |
1257 | touch->seat->pointer.y = libinput_event_touch_get_y_transformed(event, dev->oh); | 1269 | libinput_event_touch_get_x_transformed(event, dev->ow); |
1270 | touch->seat->pointer.y = | ||
1271 | libinput_event_touch_get_y_transformed(event, dev->oh); | ||
1258 | 1272 | ||
1259 | /* TODO: these needs to run a matrix transform based on output */ | 1273 | /* TODO: these needs to run a matrix transform based on output */ |
1260 | /* _ecore_drm2_output_coordinate_transform(dev->output, */ | 1274 | /* _ecore_drm2_output_coordinate_transform(dev->output, */ |
@@ -1313,8 +1327,10 @@ _touch_motion(struct libinput_device *idevice, struct libinput_event_touch *even | |||
1313 | touch = _evdev_touch_get(dev->seat); | 1327 | touch = _evdev_touch_get(dev->seat); |
1314 | if (!touch) return; | 1328 | if (!touch) return; |
1315 | 1329 | ||
1316 | touch->seat->pointer.x = libinput_event_touch_get_x_transformed(event, dev->ow); | 1330 | touch->seat->pointer.x = |
1317 | touch->seat->pointer.y = libinput_event_touch_get_y_transformed(event, dev->oh); | 1331 | libinput_event_touch_get_x_transformed(event, dev->ow); |
1332 | touch->seat->pointer.y = | ||
1333 | libinput_event_touch_get_y_transformed(event, dev->oh); | ||
1318 | 1334 | ||
1319 | /* TODO: these needs to run a matrix transform based on output */ | 1335 | /* TODO: these needs to run a matrix transform based on output */ |
1320 | /* _ecore_drm2_output_coordinate_transform(dev->output, */ | 1336 | /* _ecore_drm2_output_coordinate_transform(dev->output, */ |
@@ -1394,8 +1410,10 @@ _tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_too | |||
1394 | EINA_SAFETY_ON_NULL_RETURN(ptr); | 1410 | EINA_SAFETY_ON_NULL_RETURN(ptr); |
1395 | tool = libinput_event_tablet_tool_get_tool(event); | 1411 | tool = libinput_event_tablet_tool_get_tool(event); |
1396 | 1412 | ||
1397 | ptr->seat->pointer.x = libinput_event_tablet_tool_get_x_transformed(event, dev->ow); | 1413 | ptr->seat->pointer.x = |
1398 | ptr->seat->pointer.y = libinput_event_tablet_tool_get_y_transformed(event, dev->oh); | 1414 | libinput_event_tablet_tool_get_x_transformed(event, dev->ow); |
1415 | ptr->seat->pointer.y = | ||
1416 | libinput_event_tablet_tool_get_y_transformed(event, dev->oh); | ||
1399 | 1417 | ||
1400 | if (libinput_event_tablet_tool_x_has_changed(event)) | 1418 | if (libinput_event_tablet_tool_x_has_changed(event)) |
1401 | { | 1419 | { |
@@ -1414,7 +1432,8 @@ _tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_too | |||
1414 | if (libinput_event_tablet_tool_pressure_has_changed(event)) | 1432 | if (libinput_event_tablet_tool_pressure_has_changed(event)) |
1415 | { | 1433 | { |
1416 | ax[num].label = ECORE_AXIS_LABEL_PRESSURE; | 1434 | ax[num].label = ECORE_AXIS_LABEL_PRESSURE; |
1417 | ax[num].value = ptr->pressure = libinput_event_tablet_tool_get_pressure(event); | 1435 | ax[num].value = ptr->pressure = |
1436 | libinput_event_tablet_tool_get_pressure(event); | ||
1418 | num++; | 1437 | num++; |
1419 | } | 1438 | } |
1420 | } | 1439 | } |
@@ -1457,12 +1476,12 @@ _tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_too | |||
1457 | } | 1476 | } |
1458 | 1477 | ||
1459 | ptr->timestamp = libinput_event_tablet_tool_get_time(event); | 1478 | ptr->timestamp = libinput_event_tablet_tool_get_time(event); |
1479 | |||
1460 | /* FIXME: other properties which efl event structs don't support: | 1480 | /* FIXME: other properties which efl event structs don't support: |
1461 | * slider_position | 1481 | * slider_position |
1462 | * wheel_delta | 1482 | * wheel_delta |
1463 | */ | 1483 | */ |
1464 | 1484 | ||
1465 | |||
1466 | if (libinput_event_tablet_tool_x_has_changed(event) || | 1485 | if (libinput_event_tablet_tool_x_has_changed(event) || |
1467 | libinput_event_tablet_tool_y_has_changed(event)) | 1486 | libinput_event_tablet_tool_y_has_changed(event)) |
1468 | _pointer_motion_send(dev); | 1487 | _pointer_motion_send(dev); |
@@ -1493,10 +1512,10 @@ _tablet_tool_tip(struct libinput_device *idev, struct libinput_event_tablet_tool | |||
1493 | Elput_Device *dev = libinput_device_get_user_data(idev); | 1512 | Elput_Device *dev = libinput_device_get_user_data(idev); |
1494 | int state; | 1513 | int state; |
1495 | int press[] = | 1514 | int press[] = |
1496 | { | 1515 | { |
1497 | [LIBINPUT_TABLET_TOOL_TIP_DOWN] = LIBINPUT_BUTTON_STATE_PRESSED, | 1516 | [LIBINPUT_TABLET_TOOL_TIP_DOWN] = LIBINPUT_BUTTON_STATE_PRESSED, |
1498 | [LIBINPUT_TABLET_TOOL_TIP_UP] = LIBINPUT_BUTTON_STATE_RELEASED, | 1517 | [LIBINPUT_TABLET_TOOL_TIP_UP] = LIBINPUT_BUTTON_STATE_RELEASED, |
1499 | }; | 1518 | }; |
1500 | 1519 | ||
1501 | ptr = _evdev_pointer_get(dev->seat); | 1520 | ptr = _evdev_pointer_get(dev->seat); |
1502 | EINA_SAFETY_ON_NULL_RETURN(ptr); | 1521 | EINA_SAFETY_ON_NULL_RETURN(ptr); |