summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-28 09:16:22 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-28 09:16:22 -0500
commit6d4357d943acb2ee7813e0b10804b2b55e2ff003 (patch)
tree9d8a04bb0b6530e12175772303dd50a4fabd2c90
parentf8f71d05cdc7a8578329f75b0101662220390f20 (diff)
ecore-imf-wayland: Formatting fixes
NB: No functional changes Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c131
1 files changed, 63 insertions, 68 deletions
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index 75e4d80149..c9c6347e8d 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -146,7 +146,8 @@ update_state(WaylandIMContext *imcontext)
146 _clear_hide_timer(); 146 _clear_hide_timer();
147} 147}
148 148
149static Eina_Bool _clear_hide_timer() 149static Eina_Bool
150_clear_hide_timer(void)
150{ 151{
151 if (_hide_timer) 152 if (_hide_timer)
152 { 153 {
@@ -158,14 +159,16 @@ static Eina_Bool _clear_hide_timer()
158 return EINA_FALSE; 159 return EINA_FALSE;
159} 160}
160 161
161static void _send_input_panel_hide_request(Ecore_IMF_Context *ctx) 162static void
163_send_input_panel_hide_request(Ecore_IMF_Context *ctx)
162{ 164{
163 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 165 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
164 if (imcontext && imcontext->text_input) 166 if (imcontext && imcontext->text_input)
165 zwp_text_input_v1_hide_input_panel(imcontext->text_input); 167 zwp_text_input_v1_hide_input_panel(imcontext->text_input);
166} 168}
167 169
168static Eina_Bool _hide_timer_handler(void *data) 170static Eina_Bool
171_hide_timer_handler(void *data)
169{ 172{
170 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data; 173 Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data;
171 _send_input_panel_hide_request(ctx); 174 _send_input_panel_hide_request(ctx);
@@ -174,13 +177,18 @@ static Eina_Bool _hide_timer_handler(void *data)
174 return ECORE_CALLBACK_CANCEL; 177 return ECORE_CALLBACK_CANCEL;
175} 178}
176 179
177static void _input_panel_hide_timer_start(void *data) 180static void
181_input_panel_hide_timer_start(void *data)
178{ 182{
179 if (!_hide_timer) 183 if (!_hide_timer)
180 _hide_timer = ecore_timer_add(HIDE_TIMER_INTERVAL, _hide_timer_handler, data); 184 {
185 _hide_timer =
186 ecore_timer_add(HIDE_TIMER_INTERVAL, _hide_timer_handler, data);
187 }
181} 188}
182 189
183static void _input_panel_hide(Ecore_IMF_Context *ctx, Eina_Bool instant) 190static void
191_input_panel_hide(Ecore_IMF_Context *ctx, Eina_Bool instant)
184{ 192{
185 if (instant || (_hide_timer && ecore_timer_pending_get(_hide_timer) <= 0.0)) 193 if (instant || (_hide_timer && ecore_timer_pending_get(_hide_timer) <= 0.0))
186 { 194 {
@@ -254,10 +262,9 @@ clear_preedit(WaylandIMContext *imcontext)
254} 262}
255 263
256static void 264static void
257text_input_commit_string(void *data, 265text_input_commit_string(void *data,
258 struct zwp_text_input_v1 *text_input EINA_UNUSED, 266 struct zwp_text_input_v1 *text_input EINA_UNUSED,
259 uint32_t serial, 267 uint32_t serial, const char *text)
260 const char *text)
261{ 268{
262 WaylandIMContext *imcontext = (WaylandIMContext *)data; 269 WaylandIMContext *imcontext = (WaylandIMContext *)data;
263 Eina_Bool old_preedit = EINA_FALSE; 270 Eina_Bool old_preedit = EINA_FALSE;
@@ -408,11 +415,9 @@ show_input_panel(Ecore_IMF_Context *ctx)
408} 415}
409 416
410static void 417static void
411text_input_preedit_string(void *data, 418text_input_preedit_string(void *data,
412 struct zwp_text_input_v1 *text_input EINA_UNUSED, 419 struct zwp_text_input_v1 *text_input EINA_UNUSED,
413 uint32_t serial, 420 uint32_t serial, const char *text, const char *commit)
414 const char *text,
415 const char *commit)
416{ 421{
417 WaylandIMContext *imcontext = (WaylandIMContext *)data; 422 WaylandIMContext *imcontext = (WaylandIMContext *)data;
418 Eina_Bool old_preedit = EINA_FALSE; 423 Eina_Bool old_preedit = EINA_FALSE;
@@ -461,10 +466,9 @@ text_input_preedit_string(void *data,
461} 466}
462 467
463static void 468static void
464text_input_delete_surrounding_text(void *data, 469text_input_delete_surrounding_text(void *data,
465 struct zwp_text_input_v1 *text_input EINA_UNUSED, 470 struct zwp_text_input_v1 *text_input EINA_UNUSED,
466 int32_t index, 471 int32_t index, uint32_t length)
467 uint32_t length)
468{ 472{
469 WaylandIMContext *imcontext = (WaylandIMContext *)data; 473 WaylandIMContext *imcontext = (WaylandIMContext *)data;
470 Ecore_IMF_Event_Delete_Surrounding ev; 474 Ecore_IMF_Event_Delete_Surrounding ev;
@@ -480,10 +484,9 @@ text_input_delete_surrounding_text(void *data,
480} 484}
481 485
482static void 486static void
483text_input_cursor_position(void *data, 487text_input_cursor_position(void *data,
484 struct zwp_text_input_v1 *text_input EINA_UNUSED, 488 struct zwp_text_input_v1 *text_input EINA_UNUSED,
485 int32_t index, 489 int32_t index, int32_t anchor)
486 int32_t anchor)
487{ 490{
488 WaylandIMContext *imcontext = (WaylandIMContext *)data; 491 WaylandIMContext *imcontext = (WaylandIMContext *)data;
489 492
@@ -496,11 +499,9 @@ text_input_cursor_position(void *data,
496} 499}
497 500
498static void 501static void
499text_input_preedit_styling(void *data, 502text_input_preedit_styling(void *data,
500 struct zwp_text_input_v1 *text_input EINA_UNUSED, 503 struct zwp_text_input_v1 *text_input EINA_UNUSED,
501 uint32_t index, 504 uint32_t index, uint32_t length, uint32_t style)
502 uint32_t length,
503 uint32_t style)
504{ 505{
505 WaylandIMContext *imcontext = (WaylandIMContext *)data; 506 WaylandIMContext *imcontext = (WaylandIMContext *)data;
506 Ecore_IMF_Preedit_Attr *attr = calloc(1, sizeof(*attr)); 507 Ecore_IMF_Preedit_Attr *attr = calloc(1, sizeof(*attr));
@@ -531,9 +532,9 @@ text_input_preedit_styling(void *data,
531} 532}
532 533
533static void 534static void
534text_input_preedit_cursor(void *data, 535text_input_preedit_cursor(void *data,
535 struct zwp_text_input_v1 *text_input EINA_UNUSED, 536 struct zwp_text_input_v1 *text_input EINA_UNUSED,
536 int32_t index) 537 int32_t index)
537{ 538{
538 WaylandIMContext *imcontext = (WaylandIMContext *)data; 539 WaylandIMContext *imcontext = (WaylandIMContext *)data;
539 540
@@ -559,8 +560,7 @@ modifiers_get_index(struct wl_array *modifiers_map, const char *name)
559} 560}
560 561
561static xkb_mod_mask_t 562static xkb_mod_mask_t
562modifiers_get_mask(struct wl_array *modifiers_map, 563modifiers_get_mask(struct wl_array *modifiers_map, const char *name)
563 const char *name)
564{ 564{
565 xkb_mod_index_t index = modifiers_get_index(modifiers_map, name); 565 xkb_mod_index_t index = modifiers_get_index(modifiers_map, name);
566 566
@@ -569,10 +569,11 @@ modifiers_get_mask(struct wl_array *modifiers_map,
569 569
570 return 1 << index; 570 return 1 << index;
571} 571}
572
572static void 573static void
573text_input_modifiers_map(void *data, 574text_input_modifiers_map(void *data,
574 struct zwp_text_input_v1 *text_input EINA_UNUSED, 575 struct zwp_text_input_v1 *text_input EINA_UNUSED,
575 struct wl_array *map) 576 struct wl_array *map)
576{ 577{
577 WaylandIMContext *imcontext = (WaylandIMContext *)data; 578 WaylandIMContext *imcontext = (WaylandIMContext *)data;
578 579
@@ -582,13 +583,10 @@ text_input_modifiers_map(void *data,
582} 583}
583 584
584static void 585static void
585text_input_keysym(void *data, 586text_input_keysym(void *data,
586 struct zwp_text_input_v1 *text_input EINA_UNUSED, 587 struct zwp_text_input_v1 *text_input EINA_UNUSED,
587 uint32_t serial EINA_UNUSED, 588 uint32_t serial EINA_UNUSED, uint32_t time, uint32_t sym,
588 uint32_t time, 589 uint32_t state, uint32_t modifiers)
589 uint32_t sym,
590 uint32_t state,
591 uint32_t modifiers)
592{ 590{
593 WaylandIMContext *imcontext = (WaylandIMContext *)data; 591 WaylandIMContext *imcontext = (WaylandIMContext *)data;
594 char string[32], key[32], keyname[32]; 592 char string[32], key[32], keyname[32];
@@ -643,9 +641,9 @@ text_input_keysym(void *data,
643} 641}
644 642
645static void 643static void
646text_input_enter(void *data, 644text_input_enter(void *data,
647 struct zwp_text_input_v1 *text_input EINA_UNUSED, 645 struct zwp_text_input_v1 *text_input EINA_UNUSED,
648 struct wl_surface *surface EINA_UNUSED) 646 struct wl_surface *surface EINA_UNUSED)
649{ 647{
650 WaylandIMContext *imcontext = (WaylandIMContext *)data; 648 WaylandIMContext *imcontext = (WaylandIMContext *)data;
651 649
@@ -655,7 +653,7 @@ text_input_enter(void *data,
655} 653}
656 654
657static void 655static void
658text_input_leave(void *data, 656text_input_leave(void *data,
659 struct zwp_text_input_v1 *text_input EINA_UNUSED) 657 struct zwp_text_input_v1 *text_input EINA_UNUSED)
660{ 658{
661 WaylandIMContext *imcontext = (WaylandIMContext *)data; 659 WaylandIMContext *imcontext = (WaylandIMContext *)data;
@@ -666,17 +664,16 @@ text_input_leave(void *data,
666} 664}
667 665
668static void 666static void
669text_input_input_panel_state(void *data EINA_UNUSED, 667text_input_input_panel_state(void *data EINA_UNUSED,
670 struct zwp_text_input_v1 *text_input EINA_UNUSED, 668 struct zwp_text_input_v1 *text_input EINA_UNUSED,
671 uint32_t state EINA_UNUSED) 669 uint32_t state EINA_UNUSED)
672{ 670{
673} 671}
674 672
675static void 673static void
676text_input_language(void *data, 674text_input_language(void *data,
677 struct zwp_text_input_v1 *text_input EINA_UNUSED, 675 struct zwp_text_input_v1 *text_input EINA_UNUSED,
678 uint32_t serial EINA_UNUSED, 676 uint32_t serial EINA_UNUSED, const char *language)
679 const char *language)
680{ 677{
681 WaylandIMContext *imcontext = (WaylandIMContext *)data; 678 WaylandIMContext *imcontext = (WaylandIMContext *)data;
682 Eina_Bool changed = EINA_FALSE; 679 Eina_Bool changed = EINA_FALSE;
@@ -704,10 +701,10 @@ text_input_language(void *data,
704} 701}
705 702
706static void 703static void
707text_input_text_direction(void *data EINA_UNUSED, 704text_input_text_direction(void *data EINA_UNUSED,
708 struct zwp_text_input_v1 *text_input EINA_UNUSED, 705 struct zwp_text_input_v1 *text_input EINA_UNUSED,
709 uint32_t serial EINA_UNUSED, 706 uint32_t serial EINA_UNUSED,
710 uint32_t direction EINA_UNUSED) 707 uint32_t direction EINA_UNUSED)
711{ 708{
712} 709}
713 710
@@ -815,9 +812,8 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx)
815} 812}
816 813
817void 814void
818wayland_im_context_preedit_string_get(Ecore_IMF_Context *ctx, 815wayland_im_context_preedit_string_get(Ecore_IMF_Context *ctx,
819 char **str, 816 char **str, int *cursor_pos)
820 int *cursor_pos)
821{ 817{
822 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 818 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
823 819
@@ -833,10 +829,10 @@ wayland_im_context_preedit_string_get(Ecore_IMF_Context *ctx,
833} 829}
834 830
835void 831void
836wayland_im_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, 832wayland_im_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx,
837 char **str, 833 char **str,
838 Eina_List **attrs, 834 Eina_List **attrs,
839 int *cursor_pos) 835 int *cursor_pos)
840{ 836{
841 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 837 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
842 838
@@ -865,8 +861,7 @@ wayland_im_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx,
865} 861}
866 862
867void 863void
868wayland_im_context_cursor_position_set(Ecore_IMF_Context *ctx, 864wayland_im_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
869 int cursor_pos)
870{ 865{
871 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 866 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
872 867
@@ -879,13 +874,12 @@ wayland_im_context_cursor_position_set(Ecore_IMF_Context *ctx,
879 874
880void 875void
881wayland_im_context_use_preedit_set(Ecore_IMF_Context *ctx EINA_UNUSED, 876wayland_im_context_use_preedit_set(Ecore_IMF_Context *ctx EINA_UNUSED,
882 Eina_Bool use_preedit EINA_UNUSED) 877 Eina_Bool use_preedit EINA_UNUSED)
883{ 878{
884} 879}
885 880
886void 881void
887wayland_im_context_client_window_set(Ecore_IMF_Context *ctx, 882wayland_im_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
888 void *window)
889{ 883{
890 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 884 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
891 885
@@ -899,8 +893,7 @@ wayland_im_context_client_window_set(Ecore_IMF_Context *ctx,
899} 893}
900 894
901void 895void
902wayland_im_context_client_canvas_set(Ecore_IMF_Context *ctx, 896wayland_im_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
903 void *canvas)
904{ 897{
905 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 898 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
906 899
@@ -927,9 +920,9 @@ wayland_im_context_hide(Ecore_IMF_Context *ctx)
927} 920}
928 921
929Eina_Bool 922Eina_Bool
930wayland_im_context_filter_event(Ecore_IMF_Context *ctx, 923wayland_im_context_filter_event(Ecore_IMF_Context *ctx,
931 Ecore_IMF_Event_Type type, 924 Ecore_IMF_Event_Type type,
932 Ecore_IMF_Event *event EINA_UNUSED) 925 Ecore_IMF_Event *event EINA_UNUSED)
933{ 926{
934 927
935 if (type == ECORE_IMF_EVENT_MOUSE_UP) 928 if (type == ECORE_IMF_EVENT_MOUSE_UP)
@@ -962,8 +955,9 @@ wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
962 } 955 }
963} 956}
964 957
965void wayland_im_context_autocapital_type_set(Ecore_IMF_Context *ctx, 958void
966 Ecore_IMF_Autocapital_Type autocapital_type) 959wayland_im_context_autocapital_type_set(Ecore_IMF_Context *ctx,
960 Ecore_IMF_Autocapital_Type autocapital_type)
967{ 961{
968 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 962 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
969 963
@@ -1023,7 +1017,7 @@ wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Inpu
1023 1017
1024void 1018void
1025wayland_im_context_input_mode_set(Ecore_IMF_Context *ctx, 1019wayland_im_context_input_mode_set(Ecore_IMF_Context *ctx,
1026 Ecore_IMF_Input_Mode input_mode) 1020 Ecore_IMF_Input_Mode input_mode)
1027{ 1021{
1028 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1022 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1029 1023
@@ -1035,7 +1029,7 @@ wayland_im_context_input_mode_set(Ecore_IMF_Context *ctx,
1035 1029
1036void 1030void
1037wayland_im_context_input_hint_set(Ecore_IMF_Context *ctx, 1031wayland_im_context_input_hint_set(Ecore_IMF_Context *ctx,
1038 Ecore_IMF_Input_Hints input_hints) 1032 Ecore_IMF_Input_Hints input_hints)
1039{ 1033{
1040 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1034 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1041 1035
@@ -1089,7 +1083,8 @@ wayland_im_context_prediction_allow_set(Ecore_IMF_Context *ctx,
1089 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION; 1083 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION;
1090} 1084}
1091 1085
1092WaylandIMContext *wayland_im_context_new (struct zwp_text_input_manager_v1 *text_input_manager) 1086WaylandIMContext *
1087wayland_im_context_new(struct zwp_text_input_manager_v1 *text_input_manager)
1093{ 1088{
1094 WaylandIMContext *context = calloc(1, sizeof(WaylandIMContext)); 1089 WaylandIMContext *context = calloc(1, sizeof(WaylandIMContext));
1095 1090