Exemplo n.º 1
0
/*
 * Function    : libaroma_window_isactive
 * Return Value: byte
 * Descriptions: check if window is active
 */
byte libaroma_window_isactive(LIBAROMA_WINDOWP win){
  if (win!=NULL){
    LIBAROMA_WINDOWP w = win;
    while(w->parent){
      w=w->parent;
    }
    return ((w==libaroma_wm_get_active_window())?1:0);
  }
  return 0;
} /* End of libaroma_window_isactive */
Exemplo n.º 2
0
/*
 * Function    : libaroma_window_free
 * Return Value: byte
 * Descriptions: free window
 */
byte libaroma_window_free(
  LIBAROMA_WINDOWP win
){
  __CHECK_WM(0);
  if (win==NULL){
    return 0;
  }
  
  /* inactivate it */
  if (win->parent==NULL){
    if (libaroma_wm_get_active_window()==win){
      /* detach active window from window manager */
      libaroma_wm_set_active_window(NULL);
    }
    
    LIBAROMA_MSG _msg;
    libaroma_window_process_event(win,
      libaroma_wm_compose(&_msg, LIBAROMA_MSG_WIN_INACTIVE, NULL, 0, 0));
  }
  
  if (win->handler!=NULL){
    if (win->handler->prefree!=NULL){
      win->handler->prefree(win);
    }
  }
  
  /* delete childs */
  int i;
  if (win->childn>0){
#ifdef LIBAROMA_CONFIG_OPENMP
  #pragma omp parallel for
#endif
    for (i=0;i<win->childn;i++){
      libaroma_control_free(win->childs[i]);
    }
    free(win->childs);
  }
  if (win->bg){
    libaroma_canvas_free(win->bg);
    win->bg=NULL;
  }
  if (win->dc){
    libaroma_canvas_free(win->dc);
    win->dc=NULL;
  }
  

  if (win->handler!=NULL){
    if (win->handler->postfree!=NULL){
      win->handler->postfree(win);
    }
  }
  free(win);
  return 1;
} /* End of libaroma_window_free */
Exemplo n.º 3
0
/* load icon and mask the color */
LIBAROMA_CANVASP recovery_load_icon_ex(const char * icon_name, word color){
  char uri[256];
  snprintf(uri,256,"res:///ico/%s.png",icon_name);
  LIBAROMA_CANVASP ico = libaroma_image_uri(uri);
  if (ico){
    libaroma_canvas_fillcolor(ico,
      libaroma_colorget(NULL,libaroma_wm_get_active_window())->accent
    );
  }
  return ico;
}
Exemplo n.º 4
0
void recovery_usb_transition_cb(
  LIBAROMA_CANVASP dst,
  LIBAROMA_CANVASP bottom,
  LIBAROMA_CANVASP top,
  float state,
  LIBAROMA_RECTP r1,
  LIBAROMA_RECTP r2
){
  if (r2){
    r1=r2;
    LIBAROMA_CANVASP top2 = top;
    top = bottom;
    bottom=top2;
    state=1-state;
  }
  if (!r1){
    return;
  }
  state=libaroma_motion_fluid(state);
  libaroma_canvas_fillcolor(dst,
    libaroma_colorget(NULL,libaroma_wm_get_active_window())->window_bg
  );
  int y1 = r1->y * (1-state);
  int y3 = r1->y+r1->h;
  int y4 = ((dst->h - y3) * state) + y3;
  int y2 = y4 - y1;
  byte vopa=255-(220*state);
  libaroma_draw_ex(
    dst, bottom,
    0, 0, 
    0, r1->y-y1,
    dst->w, y3,
    0,
    vopa
  );
  libaroma_draw_ex(
    dst, bottom,
    0, y4,
    0, y3,
    dst->w, dst->h-y4,
    0,
    vopa
  );
  float statef = state;
  if (statef>1){
    statef=1;
  }
  libaroma_draw_ex(
    dst, top,
    0, y1, 0, 0, dst->w, y2,
    0, 255 * statef
  );
  
}
Exemplo n.º 5
0
/* load icon and mask the color */
LIBAROMA_CANVASP recovery_load_icon_ex(const char * icon_name, word color){
  char uri[256];
  if (libaroma_stristr(icon_name,".svg",strlen(icon_name))!=NULL){
    snprintf(uri,256,"file:///sdcard/svg/%s",icon_name);
  }
  else{
    snprintf(uri,256,"res:///ico/%s.png",icon_name);
  }
  LIBAROMA_CANVASP ico = libaroma_image_uri(uri);
  if (ico){
    libaroma_canvas_fillcolor(ico,
      libaroma_colorget(NULL,libaroma_wm_get_active_window())->accent
    );
  }
  return ico;
}