Lines Matching refs:ext
114 lv_cpicker_ext_t * ext = lv_obj_allocate_ext_attr(cpicker, sizeof(lv_cpicker_ext_t)); in lv_cpicker_create() local
115 LV_ASSERT_MEM(ext); in lv_cpicker_create()
116 if(ext == NULL) { in lv_cpicker_create()
122 ext->type = LV_CPICKER_DEF_TYPE; in lv_cpicker_create()
123 ext->hsv = LV_CPICKER_DEF_HSV; in lv_cpicker_create()
124 ext->knob.colored = 1; in lv_cpicker_create()
125 ext->color_mode = LV_CPICKER_COLOR_MODE_HUE; in lv_cpicker_create()
126 ext->color_mode_fixed = 0; in lv_cpicker_create()
127 ext->last_click_time = 0; in lv_cpicker_create()
128 ext->last_change_time = 0; in lv_cpicker_create()
130 lv_style_list_init(&ext->knob.style_list); in lv_cpicker_create()
146 ext->type = copy_ext->type; in lv_cpicker_create()
147 ext->color_mode = copy_ext->color_mode; in lv_cpicker_create()
148 ext->color_mode_fixed = copy_ext->color_mode_fixed; in lv_cpicker_create()
149 ext->hsv = copy_ext->hsv; in lv_cpicker_create()
150 ext->knob.colored = copy_ext->knob.colored; in lv_cpicker_create()
152 lv_style_list_copy(&ext->knob.style_list, ©_ext->knob.style_list); in lv_cpicker_create()
176 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_set_type() local
177 if(ext->type == type) return; in lv_cpicker_set_type()
179 ext->type = type; in lv_cpicker_set_type()
239 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_set_hsv() local
241 if(ext->hsv.h == hsv.h && ext->hsv.s == hsv.s && ext->hsv.v == hsv.v) return false; in lv_cpicker_set_hsv()
243 ext->hsv = hsv; in lv_cpicker_set_hsv()
278 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_set_color_mode() local
280 ext->color_mode = mode; in lv_cpicker_set_color_mode()
294 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_set_color_mode_fixed() local
296 ext->color_mode_fixed = fixed; in lv_cpicker_set_color_mode_fixed()
308 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_set_knob_colored() local
309 ext->knob.colored = en ? 1 : 0; in lv_cpicker_set_knob_colored()
326 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_color_mode() local
328 return ext->color_mode; in lv_cpicker_get_color_mode()
340 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_color_mode_fixed() local
342 return ext->color_mode_fixed; in lv_cpicker_get_color_mode_fixed()
354 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_hue() local
356 return ext->hsv.h; in lv_cpicker_get_hue()
368 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_saturation() local
370 return ext->hsv.s; in lv_cpicker_get_saturation()
382 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_value() local
384 return ext->hsv.v; in lv_cpicker_get_value()
396 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_hsv() local
398 return ext->hsv; in lv_cpicker_get_hsv()
410 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_color() local
412 return lv_color_hsv_to_rgb(ext->hsv.h, ext->hsv.s, ext->hsv.v); in lv_cpicker_get_color()
424 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_knob_colored() local
426 return ext->knob.colored ? true : false; in lv_cpicker_get_knob_colored()
456 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_design() local
458 if(ext->type == LV_CPICKER_TYPE_DISC) { in lv_cpicker_design()
461 else if(ext->type == LV_CPICKER_TYPE_RECT) { in lv_cpicker_design()
609 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in draw_knob() local
617 if(ext->knob.colored) { in draw_knob()
635 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in get_knob_area() local
639 if(ext->type == LV_CPICKER_TYPE_DISC) { in get_knob_area()
642 else if(ext->type == LV_CPICKER_TYPE_RECT) { in get_knob_area()
653 knob_area.x1 = cpicker->coords.x1 + ext->knob.pos.x - r - left; in get_knob_area()
654 knob_area.y1 = cpicker->coords.y1 + ext->knob.pos.y - r - right; in get_knob_area()
655 knob_area.x2 = cpicker->coords.x1 + ext->knob.pos.x + r + top; in get_knob_area()
656 knob_area.y2 = cpicker->coords.y1 + ext->knob.pos.y + r + bottom; in get_knob_area()
684 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_signal() local
697 if(ext->type == LV_CPICKER_TYPE_DISC) { in lv_cpicker_signal()
726 hsv_cur = ext->hsv; in lv_cpicker_signal()
728 switch(ext->color_mode) { in lv_cpicker_signal()
730 hsv_cur.h = (ext->hsv.h + 1) % 360; in lv_cpicker_signal()
733 hsv_cur.s = (ext->hsv.s + 1) % 100; in lv_cpicker_signal()
736 hsv_cur.v = (ext->hsv.v + 1) % 100; in lv_cpicker_signal()
747 hsv_cur = ext->hsv; in lv_cpicker_signal()
749 switch(ext->color_mode) { in lv_cpicker_signal()
751 hsv_cur.h = ext->hsv.h > 0 ? (ext->hsv.h - 1) : 360; in lv_cpicker_signal()
754 hsv_cur.s = ext->hsv.s > 0 ? (ext->hsv.s - 1) : 100; in lv_cpicker_signal()
757 hsv_cur.v = ext->hsv.v > 0 ? (ext->hsv.v - 1) : 100; in lv_cpicker_signal()
769 ext->last_change_time = lv_tick_get(); in lv_cpicker_signal()
770 lv_indev_get_point(lv_indev_get_act(), &ext->last_press_point); in lv_cpicker_signal()
788 if((LV_MATH_ABS(p.x - ext->last_press_point.x) > indev->driver.drag_limit / 2) || in lv_cpicker_signal()
789 (LV_MATH_ABS(p.y - ext->last_press_point.y) > indev->driver.drag_limit / 2)) { in lv_cpicker_signal()
790 ext->last_change_time = lv_tick_get(); in lv_cpicker_signal()
791 ext->last_press_point.x = p.x; in lv_cpicker_signal()
792 ext->last_press_point.y = p.y; in lv_cpicker_signal()
803 if(ext->type == LV_CPICKER_TYPE_RECT) { in lv_cpicker_signal()
805 uint32_t diff = lv_tick_elaps(ext->last_change_time); in lv_cpicker_signal()
806 if(diff > (uint32_t)indev->driver.long_press_time * 2 && !ext->color_mode_fixed) { in lv_cpicker_signal()
817 else if(ext->type == LV_CPICKER_TYPE_DISC) { in lv_cpicker_signal()
837 uint32_t diff = lv_tick_elaps(ext->last_change_time); in lv_cpicker_signal()
838 if(!on_ring && diff > indev->driver.long_press_time && !ext->color_mode_fixed) { in lv_cpicker_signal()
851 hsv_cur = ext->hsv; in lv_cpicker_signal()
853 switch(ext->color_mode) { in lv_cpicker_signal()
889 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in lv_cpicker_get_style() local
897 style_dsc_p = &ext->knob.style_list; in lv_cpicker_get_style()
912 lv_cpicker_ext_t * ext = (lv_cpicker_ext_t *)lv_obj_get_ext_attr(cpicker); in lv_cpicker_hit() local
913 if(ext->type == LV_CPICKER_TYPE_RECT) in lv_cpicker_hit()
924 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in next_color_mode() local
925 ext->color_mode = (ext->color_mode + 1) % 3; in next_color_mode()
934 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in refr_knob_pos() local
938 if(ext->type == LV_CPICKER_TYPE_RECT) { in refr_knob_pos()
940 switch(ext->color_mode) { in refr_knob_pos()
942 ind_pos += (ext->hsv.h * w) / 360; in refr_knob_pos()
945 ind_pos += (ext->hsv.s * w) / 100; in refr_knob_pos()
948 ind_pos += (ext->hsv.v * w) / 100; in refr_knob_pos()
952 ext->knob.pos.x = ind_pos; in refr_knob_pos()
953 ext->knob.pos.y = h / 2; in refr_knob_pos()
955 else if(ext->type == LV_CPICKER_TYPE_DISC) { in refr_knob_pos()
959 ext->knob.pos.x = (((int32_t)r * _lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT); in refr_knob_pos()
960 ext->knob.pos.y = (((int32_t)r * _lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT); in refr_knob_pos()
961 ext->knob.pos.x = ext->knob.pos.x + w / 2; in refr_knob_pos()
962 ext->knob.pos.y = ext->knob.pos.y + h / 2; in refr_knob_pos()
970 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in double_click_reset() local
973 if(lv_tick_elaps(ext->last_click_time) < indev->driver.long_press_time) { in double_click_reset()
975 hsv_cur = ext->hsv; in double_click_reset()
977 switch(ext->color_mode) { in double_click_reset()
996 ext->last_click_time = lv_tick_get(); in double_click_reset()
1003 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in angle_to_mode_color() local
1005 switch(ext->color_mode) { in angle_to_mode_color()
1008 color = lv_color_hsv_to_rgb(angle % 360, ext->hsv.s, ext->hsv.v); in angle_to_mode_color()
1011 color = lv_color_hsv_to_rgb(ext->hsv.h, ((angle % 360) * 100) / 360, ext->hsv.v); in angle_to_mode_color()
1014 color = lv_color_hsv_to_rgb(ext->hsv.h, ext->hsv.s, ((angle % 360) * 100) / 360); in angle_to_mode_color()
1022 lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker); in get_angle() local
1024 switch(ext->color_mode) { in get_angle()
1027 angle = ext->hsv.h; in get_angle()
1030 angle = (ext->hsv.s * 360) / 100; in get_angle()
1033 angle = (ext->hsv.v * 360) / 100 ; in get_angle()