Exemplo n.º 1
0
void controlyPlugin::getCatalog(QList<CatItem>* items) {
	getApps(items);

	CatItem tmp = CatItem("Launchy.controly", "Launchy", HASH_controly, getIcon());
	tmp.usage = 5000;
	items->push_back(tmp);
}
Exemplo n.º 2
0
void CApp::onRefresh() {
  getApps();
  curPage = 0;
  onScreenChange();
  
  // kill any cursors that may be waiting in the beginning
  map< int, GnmsCursor*>::iterator it;
  for (it=gnmsCursors.begin(); it!=gnmsCursors.end(); it++) {
    if (it->second != NULL) {
      delete it->second;
    }
  }

  gnmsCursors.clear();

  return;
}
Exemplo n.º 3
0
bool CApp::onInit() {
  if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
    return false;
  }

  #if GNMS_OS_NO_MOUSE == 1
  SDL_ShowCursor(SDL_DISABLE);
  #endif

  tuioClient = new TuioClient(TUIO_PORT);
  tuioClient->addTuioListener(this);
  tuioClient->connect();
  if (tuioClient->isConnected() == false) {
    cerr << "Failed to start TUIO" << endl;
    return false;
  }
  SDL_WM_SetCaption("GNMS OS", NULL);

  #if GNMS_OS_NO_FULLSCREEN == 1
  dispSurf =  SDL_SetVideoMode(WWIDTH, WHEIGHT, 32,
			       SDL_SWSURFACE | SDL_DOUBLEBUF);
  #else
  dispSurf =  SDL_SetVideoMode(WWIDTH, WHEIGHT, 32,
			       SDL_SWSURFACE | SDL_DOUBLEBUF | 
			       SDL_FULLSCREEN);
  #endif

  if(dispSurf == NULL) {
    cerr << "Failed to set video mode" << endl;
    return false;
  }

  menuSurf = CSurface::onLoad(string(OS_DIR)+"/images/gnms_menu.png");

  if (menuSurf == NULL) {
    cerr << "Failed to load menu image" << endl;
    return false;
  }

  if(CArea::areaControl.onLoad(string(OS_DIR)+"/map/1.area") == false) {
    cerr << "area not loaded properly!" << endl;
    return false;
  }

  SDL_EnableKeyRepeat(1, SDL_DEFAULT_REPEAT_INTERVAL / 3);

  if (getApps() == false) {
    cerr << "Failed to load apps" << endl;
    return false;
  }
  curPage = 0;
  onScreenChange();

  USBsymbol = new CEntity(WWIDTH-USB_WIDTH-10, WHEIGHT-USB_HEIGHT-10);
  if (USBsymbol->onLoad(string(OS_DIR)+"/images/usb-logo.png", 
			USB_WIDTH, USB_HEIGHT, 1) == false) {
    cerr << "Failed to load USB symbol" << endl;
  }

  return true;
}