Ejemplo n.º 1
0
/**
  * @brief  Start VNC server
  * @param  None
  * @retval None
  */
static void VNCServer_Start(void)
{
  WM_HWIN hItem;
  
  hItem = WM_GetDialogItem(hWinVNC, ID_MULTIEDIT_VNC);
  MULTIEDIT_AddText(hItem, (const char *) "VNC Server intialization ...\r\n");
  
  /* Start VNC */
  if (GUI_VNC_X_StartServer(0, 0))
  {
    
    VNC_Initialized = 1;
    hItem = WM_GetDialogItem(hWinVNC, ID_MULTIEDIT_VNC);
    MULTIEDIT_AddText(hItem, (const char *) "The VNC Server is started \r\n"); 
    
    /* Change connection png pic from connecting to connected */
    hItem = WM_GetDialogItem(hWinVNC, ID_IMAGE_STATE);
    IMAGE_SetBitmap(hItem, &bmok32);
    
  }
  else /* Failed to start VNC server */
  {
    hItem = WM_GetDialogItem(hWinVNC, ID_MULTIEDIT_VNC);
    MULTIEDIT_AddText(hItem, (const char *) "Failed: The VNC server cannot start\r\n");
    
    /* Change connection png pic from connecting to disconnected */
    hItem = WM_GetDialogItem(hWinVNC, ID_IMAGE_STATE);
    IMAGE_SetBitmap(hItem, &bmDelete32);      
  }
}
Ejemplo n.º 2
0
void DisplaySetup(void)
{
  GUI_Init();
  OS_SendString("GUI init done\n");

#ifdef __WEB_ENABLE
  GUI_VNC_X_StartServer(0, 0);
  OS_DebugSendString("VNC server init done\n");
#endif

}
Ejemplo n.º 3
0
/*********************************************************************
*
*       GUIDEMO_Main
*/
void GUIDEMO_Main(void) {
  FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
#if AUTO_BK
  int                     NumFreeBytes;
  int                     BitsPerPixel;
#endif

  GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed);
  WM_SetCallback(WM_HBKWIN, _cbBk);
  BUTTON_SetReactOnLevel();
  FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  Framewin_Props.Radius = 0;
  FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  Framewin_Props.Radius = 0;
  FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  FRAMEWIN_SetDefaultSkin  (_FRAMEWIN_DrawSkinFlex);
  PROGBAR_SetDefaultSkin   (PROGBAR_SKIN_FLEX);
  BUTTON_SetDefaultSkin    (BUTTON_SKIN_FLEX);
  SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX);
  SLIDER_SetDefaultSkin    (SLIDER_SKIN_FLEX);
  HEADER_SetDefaultSkin    (HEADER_SKIN_FLEX);
  GUI_SetTextMode          (GUI_TM_TRANS);
  #if GUIDEMO_USE_VNC
    GUI_VNC_X_StartServer(0, 0);
  #endif

#if AUTO_BK  // Commented out as hardware is not fast enough to draw gradient background. Can be used on faster targets like ARM9
  //
  // Determine if HW has enough memory to draw the gradient circle as background
  //
  BitsPerPixel = LCD_GetBitsPerPixel();
  if (BitsPerPixel >= 16) {
    NumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
    if (NumFreeBytes > NUMBYTES_NEEDED) {
      _pfDrawBk = _DrawBkCircle;
    } else {
      _pfDrawBk = _DrawBk;
    }
  } else {
    _pfDrawBk = _DrawBkSimple;
  }
#else
  _pfDrawBk = _DrawBkSimple;
#endif
  _Main();
}