    ui_draw_image(s->vg, settings_btn_xr, settings_btn_y, settings_btn_w, settings_btn_h, s->img_button_settings, settingsActive ? 1.0f : 0.65f);
  }
  
  static void ui_draw_sidebar_home_button(UIState *s) {
    bool homeActive = s->active_app == cereal_UiLayoutState_App_home;
    const int home_btn_xr = !s->scene.uilayout_sidebarcollapsed ? home_btn_x : -(sbr_w);
  
    ui_draw_image(s->vg, home_btn_xr, home_btn_y, home_btn_w, home_btn_h, s->img_button_home, homeActive ? 1.0f : 0.65f);
  }
  
 
</s> remove   bool settingsActive = s->active_app == cereal_UiLayoutState_App_settings;
 </s> add   bool settingsActive = s->active_app == cereal::UiLayoutState::App::SETTINGS; </s> remove void ui_draw_vision_alert(UIState *s, int va_size, int va_color,
 </s> add void ui_draw_vision_alert(UIState *s, cereal::ControlsState::AlertSize va_size, int va_color, </s> remove   } else if (eventd.which == cereal_Event_model) {
    s->scene.model = read_model(eventd.model);
 </s> add   } else if (which == cereal::Event::MODEL) {
    scene.model = read_model(event.getModel()); </s> remove   } else if (eventd.which == cereal_Event_liveMpc) {
    struct cereal_LiveMpcData datad;
    cereal_read_LiveMpcData(&datad, eventd.liveMpc);

    capn_list32 x_list = datad.x;
    capn_resolve(&x_list.p);

    for (int i = 0; i < 50; i++){
      s->scene.mpc_x[i] = capn_to_f32(capn_get32(x_list, i));
    }

    capn_list32 y_list = datad.y;
    capn_resolve(&y_list.p);
 </s> add   } else if (which == cereal::Event::LIVE_MPC) {
    auto data = event.getLiveMpc(); </s> remove       s->scene.extrinsic_matrix.v[i] =
          capn_to_f32(capn_get32(extrinsicl, i));
 </s> add       scene.extrinsic_matrix.v[i] = extrinsicl[i];
  bool homeActive = s->active_app == cereal::UiLayoutState::App::HOME;
    ui_draw_image(s->vg, settings_btn_xr, settings_btn_y, settings_btn_w, settings_btn_h, s->img_button_settings, settingsActive ? 1.0f : 0.65f);
  }
  
  static void ui_draw_sidebar_home_button(UIState *s) {
  bool homeActive = s->active_app == cereal::UiLayoutState::App::HOME;
    const int home_btn_xr = !s->scene.uilayout_sidebarcollapsed ? home_btn_x : -(sbr_w);
  
    ui_draw_image(s->vg, home_btn_xr, home_btn_y, home_btn_w, home_btn_h, s->img_button_home, homeActive ? 1.0f : 0.65f);
  }
  
keep keep keep keep replace keep keep keep keep keep
 UI: move c-capnp to c++ (#1455)

* ui:move c-capnp to c++

* move Subsockets into vector

* rename reader to msg

include cereal/gen/cpp/log.capnp

* fix some errors

restore some changes

restore previous

* cleanup codes

cleanup codes

* remove unused variable alert_size

* handle capnproto's enum in a robust way

add break to default

* switch -> std:map

* use static std::map instead of switch

do cleanup

* fix wrong variable name

* use FlatArrayMessageReader instead of custom MessageReader

remove messagehelp.h

Revert "use FlatArrayMessageReader instead of custom MessageReader"

This reverts commit 57d8b6b1e2b4bad908246f35eb068535b1627167.

use FlatArrayMessageReader instead of custom MessageReader

add header file

remove capnp_c lib,add kj lib

include serialize.h

fix

remove duplicate includes 
selfdrive/ui/sidebar.cc