Lines Matching refs:c

159     lv_demo_high_res_ctx_t * c = lv_malloc_zeroed(sizeof(lv_demo_high_res_ctx_t));  in lv_demo_high_res_base_obj_create()  local
160 LV_ASSERT_MALLOC(c); in lv_demo_high_res_base_obj_create()
162 lv_obj_set_user_data(base_obj, c); in lv_demo_high_res_base_obj_create()
185 c->sz = &lv_demo_high_res_sizes_all[size]; in lv_demo_high_res_base_obj_create()
263 c->imgs[i] = lv_demo_high_res_image_preload(path_buf, image_details[i].cf, LV_SCALE_NONE); in lv_demo_high_res_base_obj_create()
268 lv_style_init(&c->styles[i][j]); in lv_demo_high_res_base_obj_create()
273 lv_style_init(&c->fonts[i]); in lv_demo_high_res_base_obj_create()
275 c->sz->init_fonts_cb(c->fonts); in lv_demo_high_res_base_obj_create()
277 lv_subject_init_pointer(&c->th, (void *)&lv_demo_high_res_theme_dark); in lv_demo_high_res_base_obj_create()
278 c->th.user_data = c; in lv_demo_high_res_base_obj_create()
279 lv_subject_add_observer(&c->th, theme_observer_cb, c); in lv_demo_high_res_base_obj_create()
281 c->logo_path = lv_strdup(logo_path); in lv_demo_high_res_base_obj_create()
282 LV_ASSERT_MALLOC(c->logo_path); in lv_demo_high_res_base_obj_create()
283 c->slides_path = lv_strdup(slides_path); in lv_demo_high_res_base_obj_create()
284 LV_ASSERT_MALLOC(c->slides_path); in lv_demo_high_res_base_obj_create()
286 c->exit_cb = exit_cb; in lv_demo_high_res_base_obj_create()
288 lv_subject_init_int(&c->temperature_units_are_celsius, 1); in lv_demo_high_res_base_obj_create()
289 c->ev_charging_bg_cont = NULL; in lv_demo_high_res_base_obj_create()
290 lv_subject_init_int(&c->ev_charging_progress, EV_CHARGING_RANGE_END * 0 / 100); in lv_demo_high_res_base_obj_create()
291 lv_subject_init_int(&c->smart_meter_selected_bar, 4); in lv_demo_high_res_base_obj_create()
293 c->top_margin_subjects_are_init = false; in lv_demo_high_res_base_obj_create()
298 lv_subject_init_int(&c->api.subjects.hour, 9); in lv_demo_high_res_base_obj_create()
299 lv_subject_init_int(&c->api.subjects.minute, 36); in lv_demo_high_res_base_obj_create()
300 lv_subject_init_pointer(&c->api.subjects.week_day_name, "Tuesday"); in lv_demo_high_res_base_obj_create()
301 lv_subject_init_int(&c->api.subjects.month_day, 31); in lv_demo_high_res_base_obj_create()
302 lv_subject_init_pointer(&c->api.subjects.month_name, "October"); in lv_demo_high_res_base_obj_create()
303 lv_subject_init_int(&c->api.subjects.temperature_outdoor, 140); /* tenths of a degree */ in lv_demo_high_res_base_obj_create()
304 lv_subject_init_int(&c->api.subjects.temperature_indoor, 225); /* tenths of a degree */ in lv_demo_high_res_base_obj_create()
305 lv_subject_init_pointer(&c->api.subjects.wifi_ssid, NULL); in lv_demo_high_res_base_obj_create()
306 lv_subject_init_pointer(&c->api.subjects.wifi_ip, NULL); in lv_demo_high_res_base_obj_create()
309 lv_subject_init_int(&c->api.subjects.music_play, 1); in lv_demo_high_res_base_obj_create()
312 lv_subject_init_int(&c->api.subjects.locked, 0); in lv_demo_high_res_base_obj_create()
313 lv_subject_init_int(&c->api.subjects.volume, 63); in lv_demo_high_res_base_obj_create()
314 lv_subject_init_int(&c->api.subjects.main_light_temperature, 4000); in lv_demo_high_res_base_obj_create()
315 lv_subject_init_int(&c->api.subjects.main_light_intensity, 52); in lv_demo_high_res_base_obj_create()
316 lv_subject_init_int(&c->api.subjects.thermostat_fan_speed, 40); in lv_demo_high_res_base_obj_create()
317 … lv_subject_init_int(&c->api.subjects.thermostat_target_temperature, 240); /* tenths of a degree */ in lv_demo_high_res_base_obj_create()
319 c->api.base_obj = base_obj; in lv_demo_high_res_base_obj_create()
320 c->api.user_data = NULL; in lv_demo_high_res_base_obj_create()
322 c->subject_groups.time.members[0] = &c->api.subjects.hour; in lv_demo_high_res_base_obj_create()
323 c->subject_groups.time.members[1] = &c->api.subjects.minute; in lv_demo_high_res_base_obj_create()
324 lv_subject_init_group(&c->subject_groups.time.group, c->subject_groups.time.members, in lv_demo_high_res_base_obj_create()
325 ARRAY_LEN(c->subject_groups.time.members)); in lv_demo_high_res_base_obj_create()
326 c->subject_groups.date.members[0] = &c->api.subjects.week_day_name; in lv_demo_high_res_base_obj_create()
327 c->subject_groups.date.members[1] = &c->api.subjects.month_day; in lv_demo_high_res_base_obj_create()
328 c->subject_groups.date.members[2] = &c->api.subjects.month_name; in lv_demo_high_res_base_obj_create()
329 lv_subject_init_group(&c->subject_groups.date.group, c->subject_groups.date.members, in lv_demo_high_res_base_obj_create()
330 ARRAY_LEN(c->subject_groups.date.members)); in lv_demo_high_res_base_obj_create()
331 c->subject_groups.wifi.members[0] = &c->api.subjects.wifi_ssid; in lv_demo_high_res_base_obj_create()
332 c->subject_groups.wifi.members[1] = &c->api.subjects.wifi_ip; in lv_demo_high_res_base_obj_create()
333 lv_subject_init_group(&c->subject_groups.wifi.group, c->subject_groups.wifi.members, in lv_demo_high_res_base_obj_create()
334 ARRAY_LEN(c->subject_groups.wifi.members)); in lv_demo_high_res_base_obj_create()
336 lv_array_init(&c->about_slides_array, 1, sizeof(lv_image_dsc_t *)); in lv_demo_high_res_base_obj_create()
343 c->about_slides_dir_exists = true; in lv_demo_high_res_base_obj_create()
367 lv_array_push_back(&c->about_slides_array, &loaded_draw_buf); in lv_demo_high_res_base_obj_create()
394 …gh_res_label_bind_temperature(lv_obj_t * label, lv_subject_t * subject, lv_demo_high_res_ctx_t * c) in lv_demo_high_res_label_bind_temperature() argument
396 lv_obj_set_user_data(label, c); in lv_demo_high_res_label_bind_temperature()
398 …lv_subject_add_observer_obj(&c->temperature_units_are_celsius, label_text_temperature_cb, label, s… in lv_demo_high_res_label_bind_temperature()
527 lv_demo_high_res_ctx_t * c = lv_observer_get_user_data(observer); in theme_observer_cb() local
533 lv_style_set_bg_color(&c->styles[i][STYLE_TYPE_OBJ], color); in theme_observer_cb()
534 lv_style_set_outline_color(&c->styles[i][STYLE_TYPE_OBJ], color); in theme_observer_cb()
536 lv_style_set_text_color(&c->styles[i][STYLE_TYPE_TEXT], color_inv); in theme_observer_cb()
537 lv_style_set_line_color(&c->styles[i][STYLE_TYPE_TEXT], color_inv); in theme_observer_cb()
539 lv_style_set_image_recolor_opa(&c->styles[i][STYLE_TYPE_A8_IMG], LV_OPA_COVER); in theme_observer_cb()
540 lv_style_set_image_recolor(&c->styles[i][STYLE_TYPE_A8_IMG], color_inv); in theme_observer_cb()
545 lv_obj_report_style_change(&c->styles[i][j]); in theme_observer_cb()
553 lv_demo_high_res_ctx_t * c = lv_obj_get_user_data(base_obj); in free_ctx_event_cb() local
555 lv_subject_deinit(&c->th); in free_ctx_event_cb()
558 lv_draw_buf_destroy((lv_draw_buf_t *)c->imgs[i]); in free_ctx_event_cb()
563 lv_style_reset(&c->styles[i][j]); in free_ctx_event_cb()
568 lv_style_reset(&c->fonts[i]); in free_ctx_event_cb()
571 lv_free(c->logo_path); in free_ctx_event_cb()
572 lv_free(c->slides_path); in free_ctx_event_cb()
574 lv_subject_deinit(&c->temperature_units_are_celsius); in free_ctx_event_cb()
575 lv_subject_deinit(&c->ev_charging_progress); in free_ctx_event_cb()
576 lv_subject_deinit(&c->smart_meter_selected_bar); in free_ctx_event_cb()
578 lv_demo_high_res_top_margin_deinit_subjects(c); in free_ctx_event_cb()
580 lv_subject_deinit(&c->subject_groups.time.group); in free_ctx_event_cb()
581 lv_subject_deinit(&c->subject_groups.date.group); in free_ctx_event_cb()
582 lv_subject_deinit(&c->subject_groups.wifi.group); in free_ctx_event_cb()
584 lv_subject_t * subjects = (lv_subject_t *) &c->api.subjects; in free_ctx_event_cb()
585 for(uint32_t i = 0; i < sizeof(c->api.subjects) / sizeof(lv_subject_t); i++) { in free_ctx_event_cb()
589 uint32_t about_slides_count = lv_array_size(&c->about_slides_array); in free_ctx_event_cb()
591 lv_image_dsc_t ** slide = lv_array_at(&c->about_slides_array, i); in free_ctx_event_cb()
594 lv_array_deinit(&c->about_slides_array); in free_ctx_event_cb()
596 lv_free(c); in free_ctx_event_cb()
607 lv_demo_high_res_ctx_t * c = lv_obj_get_user_data(label); in label_text_temperature_cb() local
609 if(!lv_subject_get_int(&c->temperature_units_are_celsius)) { in label_text_temperature_cb()