summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-03-10 08:46:18 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-12 18:05:06 +0100
commit765c5c2a0b2c28c4b8497b28ffbd64f159a446d6 (patch)
treedee5a4686bb607ec103b10e7e289d3e37bc36cb3
parent35727d29c37a9cb4a60b83475ced265fdb92e0a9 (diff)
efl.ui.textbox: proxy for efl.ui.scrollable interface
Allow users to use scroller functinality with efl.ui.textbox Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11479
-rw-r--r--src/lib/elementary/efl_ui_textbox.c142
-rw-r--r--src/lib/elementary/efl_ui_textbox.eo14
2 files changed, 155 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index 11f79b23fd..17cd36fd4a 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3233,6 +3233,148 @@ _efl_ui_textbox_item_factory_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data
3233 return pd->item_factory; 3233 return pd->item_factory;
3234} 3234}
3235 3235
3236/*Efl.Ui.Scrollable*/
3237EOLIAN static Eina_Size2D
3238_efl_ui_textbox_efl_ui_scrollable_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3239{
3240 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_SIZE2D(0, 0));
3241 return efl_ui_scrollable_content_size_get(sd->scroller);
3242}
3243
3244EOLIAN static Eina_Rect
3245_efl_ui_textbox_efl_ui_scrollable_viewport_geometry_get(const Eo *obj EINA_UNUSED,
3246 Efl_Ui_Textbox_Data *sd)
3247{
3248 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_RECT_EMPTY());
3249 return efl_ui_scrollable_viewport_geometry_get(sd->scroller);
3250}
3251
3252EOLIAN static void
3253_efl_ui_textbox_efl_ui_scrollable_match_content_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool w, Eina_Bool h)
3254{
3255 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3256 return efl_ui_scrollable_match_content_set(sd->scroller, !!w, !!h);
3257}
3258
3259EOLIAN static void
3260_efl_ui_textbox_efl_ui_scrollable_step_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Position2D step)
3261{
3262 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3263 efl_ui_scrollable_step_size_set(sd->scroller, step);
3264}
3265
3266EOLIAN static Eina_Position2D
3267_efl_ui_textbox_efl_ui_scrollable_step_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3268{
3269 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0));
3270 return efl_ui_scrollable_step_size_get(sd->scroller);
3271}
3272
3273EOLIAN static Eina_Position2D
3274_efl_ui_textbox_efl_ui_scrollable_content_pos_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3275{
3276 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0));
3277 return efl_ui_scrollable_content_pos_get(sd->scroller);
3278}
3279
3280EOLIAN static void
3281_efl_ui_textbox_efl_ui_scrollable_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Position2D pos)
3282{
3283 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3284 efl_ui_scrollable_content_pos_set(sd->scroller, pos);
3285}
3286
3287EOLIAN static Eina_Bool
3288_efl_ui_textbox_efl_ui_scrollable_scroll_hold_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3289{
3290 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE);
3291 return efl_ui_scrollable_scroll_hold_get(sd->scroller);
3292}
3293
3294EOLIAN static void
3295_efl_ui_textbox_efl_ui_scrollable_scroll_hold_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool hold)
3296{
3297 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3298 efl_ui_scrollable_scroll_hold_set(sd->scroller, !!hold);
3299}
3300
3301EOLIAN static Eina_Bool
3302_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3303{
3304 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE);
3305 return efl_ui_scrollable_scroll_freeze_get(sd->scroller);
3306}
3307
3308EOLIAN static void
3309_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool freeze)
3310{
3311 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3312 efl_ui_scrollable_scroll_freeze_set(sd->scroller, !!freeze);
3313}
3314
3315EOLIAN static void
3316_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool horiz, Eina_Bool vert)
3317{
3318 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3319 efl_ui_scrollable_bounce_enabled_set(sd->scroller, !!horiz, !!vert);
3320}
3321
3322EOLIAN static void
3323_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool *horiz, Eina_Bool *vert)
3324{
3325 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3326 efl_ui_scrollable_bounce_enabled_get(sd->scroller, horiz, vert);
3327}
3328
3329EOLIAN static void
3330_efl_ui_textbox_efl_ui_scrollable_scroll(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Rect rect, Eina_Bool animation)
3331{
3332 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3333 efl_ui_scrollable_scroll(sd->scroller, rect, animation);
3334}
3335
3336EOLIAN static void
3337_efl_ui_textbox_efl_ui_scrollable_gravity_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, double *x, double *y)
3338{
3339 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3340 efl_ui_scrollable_gravity_get(sd->scroller, x, y);
3341}
3342
3343EOLIAN static void
3344_efl_ui_textbox_efl_ui_scrollable_gravity_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, double x, double y)
3345{
3346 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3347 efl_ui_scrollable_gravity_set(sd->scroller, x, y);
3348}
3349
3350EOLIAN static void
3351_efl_ui_textbox_efl_ui_scrollable_movement_block_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Efl_Ui_Layout_Orientation block)
3352{
3353 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3354 efl_ui_scrollable_movement_block_set(sd->scroller, block);
3355}
3356
3357EOLIAN static Efl_Ui_Layout_Orientation
3358_efl_ui_textbox_efl_ui_scrollable_movement_block_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd)
3359{
3360 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EFL_UI_LAYOUT_ORIENTATION_DEFAULT);
3361 return efl_ui_scrollable_movement_block_get(sd->scroller);
3362}
3363
3364EOLIAN static void
3365_efl_ui_textbox_efl_ui_scrollable_looping_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool loop_h, Eina_Bool loop_v)
3366{
3367 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3368 efl_ui_scrollable_looping_set(sd->scroller, !!loop_h, !!loop_v);
3369}
3370
3371EOLIAN static void
3372_efl_ui_textbox_efl_ui_scrollable_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool *loop_h, Eina_Bool *loop_v)
3373{
3374 EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
3375 efl_ui_scrollable_looping_get(sd->scroller, loop_h, loop_v);
3376}
3377
3236/* Efl.Part begin */ 3378/* Efl.Part begin */
3237 3379
3238static Eina_Bool 3380static Eina_Bool
diff --git a/src/lib/elementary/efl_ui_textbox.eo b/src/lib/elementary/efl_ui_textbox.eo
index 2605c477a3..c4833f315d 100644
--- a/src/lib/elementary/efl_ui_textbox.eo
+++ b/src/lib/elementary/efl_ui_textbox.eo
@@ -11,7 +11,7 @@ enum @beta Efl.Ui.Textbox_Cnp_Content {
11} 11}
12 12
13class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, 13class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Clickable,
14 Efl.Access.Text, Efl.Access.Editable.Text 14 Efl.Access.Text, Efl.Access.Editable.Text, Efl.Ui.Scrollable
15 composites 15 composites
16 Efl.Text_Interactive, Efl.Text_Markup, Efl.Input_Text 16 Efl.Text_Interactive, Efl.Text_Markup, Efl.Input_Text
17{ 17{
@@ -133,6 +133,18 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click
133 Efl.Access.Editable.Text.paste; 133 Efl.Access.Editable.Text.paste;
134 Efl.Text_Interactive.editable { set; } 134 Efl.Text_Interactive.editable { set; }
135 Efl.Part.part_get; 135 Efl.Part.part_get;
136 Efl.Ui.Scrollable.content_pos { set; get; }
137 Efl.Ui.Scrollable.content_size{ get; }
138 Efl.Ui.Scrollable.viewport_geometry{ get; }
139 Efl.Ui.Scrollable.bounce_enabled { set; get; }
140 Efl.Ui.Scrollable.scroll_freeze { get; set; }
141 Efl.Ui.Scrollable.scroll_hold { get; set; }
142 Efl.Ui.Scrollable.looping { get; set; }
143 Efl.Ui.Scrollable.movement_block { get; set; }
144 Efl.Ui.Scrollable.gravity { get; set; }
145 Efl.Ui.Scrollable.match_content { set; }
146 Efl.Ui.Scrollable.step_size { set; get; }
147 Efl.Ui.Scrollable.scroll;
136 } 148 }
137 events { 149 events {
138 selection,paste: void; [[Called when selection is pasted.]] 150 selection,paste: void; [[Called when selection is pasted.]]