当前位置: 首页>>代码示例>>C++>>正文


C++ LaunchItem函数代码示例

本文整理汇总了C++中LaunchItem函数的典型用法代码示例。如果您正苦于以下问题:C++ LaunchItem函数的具体用法?C++ LaunchItem怎么用?C++ LaunchItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LaunchItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VectorCopy

/*
================
Drop_Item

Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle, qboolean copytarget ) {
	gentity_t	*dropped = NULL;
	vec3_t	velocity;
	vec3_t	angles;

	VectorCopy( ent->s.apos.trBase, angles );
	angles[YAW] += angle;
	angles[PITCH] = 0;	// always forward

	AngleVectors( angles, velocity, NULL, NULL );
	VectorScale( velocity, 150, velocity );
	velocity[2] += 200 + crandom() * 50;
	
	if ( copytarget )
	{
		dropped = LaunchItem( item, ent->s.pos.trBase, velocity, ent->opentarget );
	}
	else
	{
		dropped = LaunchItem( item, ent->s.pos.trBase, velocity, NULL );
	}

	dropped->activator = ent;//so we know who we belonged to so they can pick it back up later
	dropped->s.time = level.time;//mark this time so we aren't picked up instantly by the guy who dropped us
	return dropped;
}
开发者ID:Almightygir,项目名称:OpenJK,代码行数:33,代码来源:g_items.cpp

示例2: ClearScrollArea

void StartMenu::UpdateFavs(){
  //SYNTAX NOTE: (per-line) "<name>::::[dir/app/<mimetype>]::::<path>"
  QStringList newfavs = LUtils::listFavorites();
  if(favs == newfavs){ return; } //nothing to do - same as before
  favs = newfavs;
  ClearScrollArea(ui->scroll_favs);
  favs.sort();
  //Iterate over types of favorites
  QStringList rest = favs;
  for(int type = 0; type<3; type++){
    QStringList tmp;
    if(type==0){ tmp = favs.filter("::::app::::"); } //apps first
    else if(type==1){ tmp = favs.filter("::::dir::::"); } //dirs next
    else{ tmp = rest;  } //everything left over
    for(int i=0; i<tmp.length(); i++){
      if(type<2){ rest.removeAll(tmp[i]); }
      if(!QFile::exists(tmp[i].section("::::",2,50))){ continue; } //invalid favorite - skip it
      ItemWidget *it = new ItemWidget(ui->scroll_favs->widget(), tmp[i].section("::::",2,50), tmp[i].section("::::",1,1) );
      if(!it->gooditem){ continue; } //invalid for some reason
      ui->scroll_favs->widget()->layout()->addWidget(it);
      connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) );
      connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) );
      connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
    }
    QApplication::processEvents();
  }
}
开发者ID:grahamperrin,项目名称:lumina,代码行数:27,代码来源:StartMenu.cpp

示例3: if

void UserWidget::updateFavItems(bool newfilter){
  if(updatingfavs){ return; }
  updatingfavs = true;
  //qDebug() << "Updating User Favorite Items";
  QStringList newfavs = LUtils::listFavorites();
  //qDebug() << "Favorites:" << newfavs;
  if(lastHomeUpdate.isNull() || (QFileInfo(QDir::homePath()+"/Desktop").lastModified() > lastHomeUpdate) || newfavs!=favs ){
    favs = newfavs;
   
    homefiles = LSession::handle()->DesktopFiles();
    lastHomeUpdate = QDateTime::currentDateTime();
  }else if(!newfilter){ updatingfavs = false; return; } //nothing new to change - stop now
  //qDebug() << " - Passed Smoke Test...";
  QStringList favitems;
  //Remember for format for favorites: <name>::::[app/dir/<mimetype>]::::<full path>
  if(ui->tool_fav_apps->isChecked()){ 
    favitems = favs.filter("::::app::::");
    for(int i=0; i<homefiles.length(); i++){
      if(homefiles[i].fileName().endsWith(".desktop")){
        favitems << homefiles[i].fileName()+"::::app-home::::"+homefiles[i].absoluteFilePath();
      }
    }
  }else if(ui->tool_fav_dirs->isChecked()){ 
    favitems = favs.filter("::::dir::::");
    for(int i=0; i<homefiles.length(); i++){
      if(homefiles[i].isDir()){
        favitems << homefiles[i].fileName()+"::::dir-home::::"+homefiles[i].absoluteFilePath();
      }
    }
  }else{ 
    //Files
    for(int i=0; i<favs.length(); i++){
      QString type = favs[i].section("::::",1,1);
      if(type != "app" && type !="dir"){
        favitems << favs[i];
      }
    }
    for(int i=0; i<homefiles.length(); i++){
      if(!homefiles[i].isDir() && !homefiles[i].fileName().endsWith(".desktop") ){
        favitems << homefiles[i].fileName()+"::::"+LXDG::findAppMimeForFile(homefiles[i].fileName())+"-home::::"+homefiles[i].absoluteFilePath();
      }
    }
  }
  ClearScrollArea(ui->scroll_fav);
  //qDebug() << " - Sorting Items";
    favitems.sort(); //sort them alphabetically
    //qDebug() << " - Creating Items:" << favitems;
    for(int i=0; i<favitems.length(); i++){
      UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), favitems[i].section("::::",2,50), favitems[i].section("::::",1,1) );
      if(!it->gooditem){ continue; }
      ui->scroll_fav->widget()->layout()->addWidget(it);
      connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
      connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
      connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
      QApplication::processEvents(); //keep the UI snappy - might be a number of these
    }
  SortScrollArea(ui->scroll_fav);
  updatingfavs = false;
  //qDebug() << " - Done";
}
开发者ID:abishai,项目名称:lumina,代码行数:60,代码来源:UserWidget.cpp

示例4: ClearScrollArea

//Listing Update routines
void StartMenu::UpdateApps(){
  ClearScrollArea(ui->scroll_apps);
  //Now assemble the apps list (note: this normally happens in the background - not when it is visible/open)
  //qDebug() << "Update Apps:" << CCat << ui->check_apps_showcats->checkState();
  if(ui->check_apps_showcats->checkState() == Qt::PartiallyChecked){
    //qDebug() << " - Partially Checked";
    //Show a single page of apps, but still divided up by categories
    CCat.clear();
    QStringList cats = sysapps->keys();
    cats.sort();
    cats.removeAll("All");
    for(int c=0; c<cats.length(); c++){
      QList<XDGDesktop> apps = sysapps->value(cats[c]);
      if(apps.isEmpty()){ continue; }
      //Add the category label to the scroll
      QLabel *catlabel = new QLabel("<b>"+cats[c]+"</b>",ui->scroll_apps->widget());
        catlabel->setAlignment(Qt::AlignCenter);
      ui->scroll_apps->widget()->layout()->addWidget(catlabel);
      //Now add all the apps for this category
      for(int i=0; i<apps.length(); i++){
        ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] );
        if(!it->gooditem){ continue; } //invalid for some reason
        ui->scroll_apps->widget()->layout()->addWidget(it);
        connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) );
        connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) );
        connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
        connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
      }
    }
    
  }else if(ui->check_apps_showcats->checkState() == Qt::Checked){
开发者ID:yamajun,项目名称:lumina,代码行数:32,代码来源:StartMenu.cpp

示例5: ClearScrollArea

void UserWidget::updateFavItems(){
  ClearScrollArea(ui->scroll_fav);
  QFileInfoList items;
  QDir homedir = QDir( QDir::homePath()+"/Desktop");
  QDir favdir = QDir( QDir::homePath()+"/.lumina/favorites");
  if(!favdir.exists()){ favdir.mkpath( QDir::homePath()+"/.lumina/favorites"); }
  if(ui->tool_fav_apps->isChecked()){ 
    items = homedir.entryInfoList(QStringList()<<"*.desktop", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
    items << favdir.entryInfoList(QStringList()<<"*.desktop", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
  }else if(ui->tool_fav_dirs->isChecked()){ 
    items = homedir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
    items << favdir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
  }else{ 
    //Files
    items = homedir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
    items << favdir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
    for(int i=0; i<items.length(); i++){
      if(items[i].suffix()=="desktop"){ items.removeAt(i); i--; }
    }
  }
  for(int i=0; i<items.length(); i++){
    UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), items[i].absoluteFilePath(), ui->tool_fav_dirs->isChecked());
    ui->scroll_fav->widget()->layout()->addWidget(it);
    connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
    connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
    connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
  }
  static_cast<QBoxLayout*>(ui->scroll_fav->widget()->layout())->addStretch();
}
开发者ID:KhuramAli,项目名称:lumina,代码行数:29,代码来源:UserWidget.cpp

示例6: QMainWindow

MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI) {
    ui->setupUi(this); //load the designer file
    //setupIcons();
    ui->radio_apps->setChecked(true); //always default to starting here
    ui->tool_stop->setVisible(false); //no search running initially
    ui->tool_configure->setVisible(false); //app search initially set

    livetime = new QTimer(this);
    livetime->setInterval(300); //1/3 second for live searches
    livetime->setSingleShot(true);

    workthread = new QThread(this);
    workthread->setObjectName("Lumina Search Process");

    searcher = new Worker();
    searcher->moveToThread(workthread);

    closeShort = new QShortcut(QKeySequence(tr("Esc")), this);

    //Setup the connections
    connect(livetime, SIGNAL(timeout()), this, SLOT(startSearch()) );
    connect(this, SIGNAL(SearchTerm(QString, bool)), searcher, SLOT(StartSearch(QString, bool)) );
    connect(searcher, SIGNAL(FoundItem(QString)), this, SLOT(foundSearchItem(QString)) );
    connect(searcher, SIGNAL(SearchUpdate(QString)), this, SLOT(searchMessage(QString)) );
    connect(searcher, SIGNAL(SearchDone()), this, SLOT(searchFinished()) );
    connect(ui->tool_stop, SIGNAL(clicked()), this, SLOT(stopSearch()) );
    connect(ui->push_done, SIGNAL(clicked()), this, SLOT(closeApplication()) );
    connect(ui->push_launch, SIGNAL(clicked()), this, SLOT(LaunchItem()) );
    connect(ui->line_search, SIGNAL(textEdited(QString)), this, SLOT(searchChanged()) );
    connect(ui->line_search, SIGNAL(returnPressed()), this, SLOT(LaunchItem()) );
    connect(ui->radio_apps, SIGNAL(toggled(bool)), this, SLOT(searchTypeChanged()) );
    connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
    connect(ui->listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
    connect(ui->tool_configure, SIGNAL(clicked()), this, SLOT(configureSearch()) );
    connect(closeShort, SIGNAL(activated()), this, SLOT( close() ) );

    //Setup the settings file
    QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
    settings = new QSettings("LuminaDE", "lumina-search",this);
    searcher->startDir = settings->value("StartSearchDir", QDir::homePath()).toString();
    searcher->skipDirs = settings->value("SkipSearchDirs", QStringList()).toStringList();
    updateDefaultStatusTip();
    this->show();
    workthread->start();
    QTimer::singleShot(0,this, SLOT(setupIcons()) );
}
开发者ID:abishai,项目名称:lumina,代码行数:46,代码来源:MainUI.cpp

示例7: LaunchItem

void UserWidget::slotGoToDir(QString dir){
  if(!QFileInfo(dir).isDir()){
    LaunchItem(dir);
  }else{
    ui->label_home_dir->setWhatsThis(dir);
    updateHome();
  }
}
开发者ID:abishai,项目名称:lumina,代码行数:8,代码来源:UserWidget.cpp

示例8: ParseCommandLine

////////////////////////////////////////////////////////////////////////////////////////////////////
// Parses command line options and invokes required functionality or reports an error to user.
// Returns TRUE if application should stay alive, FALSE if job is done and we need to exit.
BOOL ParseCommandLine ( LPCTSTR lpCmdLine )
{
    // First we need to parse command line options and perform validation.
    LPWSTR *szArglist;
    int nArgs;
    HRESULT hr ;

    szArglist = CommandLineToArgvW ( lpCmdLine , &nArgs ) ;

    if ( 2 != nArgs ) // we always expect 2 arguments - option and parameter
    {
        Usage ( ) ;
        return FALSE ;
    }

    switch ( szArglist [ 0 ] [ 1 ] )
    {
    case L'l': // User wants to list directory content
        // Copy path of the directory to list to the global buffer
        hr = StringCchCopy ( g_szTargetDir , MAX_PATH , szArglist [ 1 ] ) ;
        if ( FAILED ( hr ) )
        {
            MessageBox ( g_hWnd , 
                         TEXT ( "Invalid directory name passed as parameter" ) , 
                         TEXT ( "Invalid Parameter" ) , 
                         MB_ICONERROR | MB_OK ) ;
            return FALSE ;
        }

        // And ask directory lister to perform it's work
        g_pLister = new CDirectoryLister ( g_hWnd ) ;
        if ( -1 == g_pLister->ShowMenu ( g_szTargetDir ) )
        {
            MessageBox ( g_hWnd , 
                         g_szTargetDir , 
                         TEXT ( "Could not list directory" ) , 
                         MB_OK | MB_ICONERROR ) ;
            return FALSE ;
        }

        return TRUE ; // Wait while user selects something from the popup menu
    case L'o': // User wants to launch a predefined application
        LaunchItem ( szArglist [ 1 ] ) ;

        return FALSE ;
    default:
        Usage ( ) ;
        return FALSE ;
    }
}
开发者ID:sergey-rybalkin,项目名称:QLaunch,代码行数:53,代码来源:QuickLaunch.cpp

示例9: ClearScrollArea

void UserWidget::updateApps(){
  if(ui->combo_app_cats->currentIndex() < 0){ return; } //no cat
  QString cat = ui->combo_app_cats->itemData( ui->combo_app_cats->currentIndex() ).toString();
  QList<XDGDesktop> items = sysapps->value(cat);
  ClearScrollArea(ui->scroll_apps);
  for(int i=0; i<items.length(); i++){
    UserItemWidget *it = new UserItemWidget(ui->scroll_apps->widget(), items[i]);
    ui->scroll_apps->widget()->layout()->addWidget(it);
    connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
    connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
    connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
  }
  static_cast<QBoxLayout*>(ui->scroll_apps->widget()->layout())->addStretch();
}
开发者ID:xiazhen06,项目名称:lumina,代码行数:14,代码来源:UserWidget.cpp

示例10: ClearScrollArea

void UserWidget::updateApps(){
  if(ui->combo_app_cats->currentIndex() < 0){ return; } //no cat
  QString cat = ui->combo_app_cats->itemData( ui->combo_app_cats->currentIndex() ).toString();
  QList<XDGDesktop> items = sysapps->value(cat);
  ClearScrollArea(ui->scroll_apps);
  for(int i=0; i<items.length(); i++){
    UserItemWidget *it = new UserItemWidget(ui->scroll_apps->widget(), items[i]);
    ui->scroll_apps->widget()->layout()->addWidget(it);
    connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
    connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
    connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
    QApplication::processEvents(); //keep the UI snappy - might be a number of these
  }
}
开发者ID:abishai,项目名称:lumina,代码行数:14,代码来源:UserWidget.cpp

示例11: TossClientCubes

void TossClientCubes(gentity_t * self)
{
	gitem_t        *item;
	gentity_t      *drop;
	vec3_t          velocity;
	vec3_t          angles;
	vec3_t          origin;

	self->client->ps.generic1 = 0;

	// this should never happen but we should never
	// get the server to crash due to skull being spawned in
	if(!G_EntitiesFree())
	{
		return;
	}

	if(self->client->sess.sessionTeam == TEAM_RED)
	{
		item = BG_FindItem("Red Cube");
	}
	else
	{
		item = BG_FindItem("Blue Cube");
	}

	angles[YAW] = (float)(level.time % 360);
	angles[PITCH] = 0;			// always forward
	angles[ROLL] = 0;

	AngleVectors(angles, velocity, NULL, NULL);
	VectorScale(velocity, 150, velocity);
	velocity[2] += 200 + crandom() * 50;

	if(neutralObelisk)
	{
		VectorCopy(neutralObelisk->s.pos.trBase, origin);
		origin[2] += 44;
	}
	else
	{
		VectorClear(origin);
	}

	drop = LaunchItem(item, origin, velocity);

	drop->nextthink = level.time + g_cubeTimeout.integer * 1000;
	drop->think = G_FreeEntity;
	drop->spawnflags = self->client->sess.sessionTeam;
}
开发者ID:SinSiXX,项目名称:Rogue-Reborn,代码行数:50,代码来源:g_combat.c

示例12: VectorCopy

// Spawns an item and drops it
gentity_t *Drop_Item( gentity_t *ent, const gitem_t *item, float angle ) {
	vector3	velocity;
	vector3	angles;

	VectorCopy( &ent->s.apos.trBase, &angles );
	angles.yaw += angle;
	angles.pitch = 0;	// always forward

	AngleVectors( &angles, &velocity, NULL, NULL );
	VectorScale( &velocity, 150, &velocity );
	velocity.z += 200 + crandom() * 50;
	
	return LaunchItem( item, &ent->s.pos.trBase, &velocity );
}
开发者ID:Razish,项目名称:QtZ,代码行数:15,代码来源:g_items.c

示例13: VectorCopy

/*
================
Drop_Item

Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle ) {
	vec3_t	velocity;
	vec3_t	angles;

	VectorCopy( ent->s.apos.trBase, angles );
	angles[YAW] += angle;
	angles[PITCH] = 0;	// always forward

	AngleVectors( angles, velocity, NULL, NULL );
	VectorScale( velocity, 150, velocity );
	velocity[2] += 200 + crandom() * 50;
	
	return LaunchItem( item, ent->s.pos.trBase, velocity );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:21,代码来源:g_items.c

示例14: VectorCopy

/*
================
Drop_Item

Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle ) {
	vec3_t	velocity;
	vec3_t	angles;

	VectorCopy( ent->s.apos.trBase, angles );
	angles[YAW] += angle;
	angles[PITCH] = 0;	// always forward

	AngleVectors( angles, velocity, NULL, NULL );
	VectorScale( velocity, 150, velocity );
	velocity[2] += 200 + crandom() * 50;

	// FIXME: Cartridges call LaunchItem() directly
	G_LogPrintf( "DropItem: %ld %s\n", ( ent - g_entities ), item->classname );
	
	return LaunchItem( item, ent->s.pos.trBase, velocity );
}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:24,代码来源:g_items.c

示例15: VectorCopy

/*
================
Modified by Elder

dropWeapon XRAY FMJ
================
*/
gentity_t *dropWeapon(gentity_t * ent, gitem_t * item, float angle, int xr_flags)
{
	vec3_t velocity;
	vec3_t angles;
	vec3_t origin;

	//int           throwheight;
	vec3_t mins, maxs;
	trace_t tr;

	VectorCopy(ent->s.pos.trBase, origin);
	VectorCopy(ent->s.apos.trBase, angles);
	angles[YAW] += angle;
	angles[PITCH] = -55;	// always at a 55 degree above horizontal angle

	AngleVectors(angles, velocity, NULL, NULL);

	// set aiming directions
	//AngleVectors (ent->client->ps.viewangles, velocity, NULL, NULL);

	//Elder: don't toss from the head, but from the "waist"
	origin[2] += 10;	// (ent->client->ps.viewheight / 2);
	VectorMA(origin, 5, velocity, origin);	// 14 34 10

	// Set temporary bounding box for trace
	VectorSet(mins, -ITEM_RADIUS, -ITEM_RADIUS, -ITEM_RADIUS);
	VectorSet(maxs, ITEM_RADIUS, ITEM_RADIUS, ITEM_RADIUS);

	// NiceAss: Check if the new location starts in a solid.
	// FIXME: Use trap_point or whatever?
	trap_Trace(&tr, origin, mins, maxs, origin, ent->s.number, MASK_SOLID);
	if (tr.startsolid == qtrue)
		VectorMA(origin, -7, velocity, origin);	// -5 won't work (hint: it should work). Only -7 or less will..

	// snap to integer coordinates for more efficient network bandwidth usage
	SnapVector(origin);

	// less vertical velocity
	//velocity[2] += 0.2f;
	//velocity[2] = 20;
	VectorNormalize(velocity);
	VectorScale(velocity, 5, velocity);
	return LaunchItem(item, origin, velocity, xr_flags);
}
开发者ID:zturtleman,项目名称:reaction,代码行数:51,代码来源:g_items.c


注:本文中的LaunchItem函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。