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


C++ GetEvent函数代码示例

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


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

示例1: SetYAMLSequenceFromMapping

u32 SetYAMLSequenceFromMapping(char ***dest, char *key, ctr_yaml_context *ctx, bool StoreKey)
{
	if(*dest){
		fprintf(stderr,"[RSF ERROR] %s already set\n",key);
		ctx->error = YAML_MEM_ERROR;
		return 0;
	}

	u32 ActualCount = 0;
	u32 SlotCount = 0;
	char **tmp = *dest;
	if(!CheckMappingEvent(ctx)) return 0;
	SlotCount = 10;
	tmp = malloc((SlotCount+1)*sizeof(char*));
	if(!tmp){
		ctx->error = YAML_MEM_ERROR;
		return 0;
	}	
	memset(tmp,0,(SlotCount+1)*sizeof(char*));
	GetEvent(ctx);
	if(ctx->error || ctx->done) return 0;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return 0;
	}
	
	
	if(!GetYamlStringSize(ctx)) return 0;
	u32 InitLevel = ctx->Level;
	while(ctx->Level == InitLevel){
		if(ctx->error || ctx->done) return 0;
		if(ctx->IsKey == StoreKey){
			tmp[ActualCount] = malloc(GetYamlStringSize(ctx)+1);
			memset(tmp[ActualCount],0,GetYamlStringSize(ctx)+1);
			memcpy(tmp[ActualCount],GetYamlString(ctx),GetYamlStringSize(ctx));
			ActualCount++;
			if(ActualCount >= SlotCount){ // if Exceeding Ptr capacity, expand buffer
				SlotCount = SlotCount*2;
				char **tmp1 = malloc((SlotCount+1)*sizeof(char*)); // allocate new buffer
				if(!tmp1){
					ctx->error = YAML_MEM_ERROR;
					return 0;
				}	
				memset(tmp1,0,(SlotCount+1)*sizeof(char*));
				for(u32 i = 0; i < ActualCount; i++) tmp1[i] = tmp[i]; // Transfer ptrs
				free(tmp); // free original buffer
				tmp = tmp1; // transfer main ptr
			}
		}
		FinishEvent(ctx);
		GetEvent(ctx);
	}
	FinishEvent(ctx);
	*dest = tmp; // Give main ptr to location
	return ActualCount++; // return number of strings
}
开发者ID:44670,项目名称:Project_CTR,代码行数:57,代码来源:yaml_parser.c

示例2: Contains

bool EventsList::Contains(const gd::BaseEvent & eventToSearch, bool recursive) const
{
    for (std::size_t i = 0;i<GetEventsCount();++i)
    {
        if ( &GetEvent(i) == &eventToSearch) return true;
        if ( recursive && GetEvent(i).CanHaveSubEvents() && GetEvent(i).GetSubEvents().Contains(eventToSearch) )
            return true;
    }

    return false;
}
开发者ID:HaoDrang,项目名称:GD,代码行数:11,代码来源:EventsList.cpp

示例3: GetEvent

//_____________________________________
Bool_t KVINDRAReconIdent::Analysis(void)
{
   //For each event we:
   //     perform primary event identification and calibration and fill tree

   fEventNumber = GetEvent()->GetNumber();
   if (GetEvent()->GetMult() > 0) {
      GetEvent()->IdentifyEvent();
      GetEvent()->CalibrateEvent();
   }
   fIdentTree->Fill();
   return kTRUE;
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:14,代码来源:KVINDRAReconIdent.cpp

示例4: sprintf

//-----------------------------------------------------------------------------
// Purpose: 
// Output : const char
//-----------------------------------------------------------------------------
const char *CChoreoEventWidget::GetLabelText( void )
{
	static char label[ 256 ];
	if ( GetEvent()->GetType() == CChoreoEvent::EXPRESSION )
	{
		sprintf( label, "%s : %s", GetEvent()->GetParameters(), GetEvent()->GetParameters2() );
	}
	else
	{
		strcpy( label, GetEvent()->GetParameters() );
	}

	return label;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:18,代码来源:choreoeventwidget.cpp

示例5: SetBoolYAMLValue

void SetBoolYAMLValue(bool *dest, char *key, ctr_yaml_context *ctx)
{
	GetEvent(ctx);
	if(ctx->error || ctx->done) return;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	if(!GetYamlStringSize(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	
	if(casecmpYamlValue("true",ctx))
		*dest = true;
	else if(casecmpYamlValue("false",ctx))
		*dest = false;
	else{
		fprintf(stderr,"[RSF ERROR] Invalid '%s'\n",key);
		ctx->error = YAML_BAD_FORMATTING;
	}
	
	return;
	
}
开发者ID:44670,项目名称:Project_CTR,代码行数:27,代码来源:yaml_parser.c

示例6: SetSimpleYAMLValue

void SetSimpleYAMLValue(char **dest, char *key, ctr_yaml_context *ctx, u32 size_limit)
{
	if(*dest){
		fprintf(stderr,"[RSF ERROR] Item '%s' is already set\n",key);
		ctx->error = YAML_MEM_ERROR;
		return;
	}

	GetEvent(ctx);
	if(ctx->error || ctx->done) return;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	if(!GetYamlStringSize(ctx)) return;
	
	u32 size = GetYamlStringSize(ctx);
	if(size > size_limit && size_limit) size = size_limit;
	

	char *tmp = *dest;
	tmp = malloc(size+2);
	if(!tmp) {
		ctx->error = YAML_MEM_ERROR;
		return;
	}
	memset(tmp,0,size+2);
	memcpy(tmp,GetYamlString(ctx),size);	
	
	//printf("Setting %s to %s (size of %d)\n",key,GetYamlString(ctx),size);
	//printf("Check: %s & %x\n",tmp,tmp);
	*dest = tmp;
	
}
开发者ID:44670,项目名称:Project_CTR,代码行数:35,代码来源:yaml_parser.c

示例7: GetString

bool WizardApp::SetString( const wchar_t* lpSection, const wchar_t* lpKey, const wchar_t* lpValue )
{
	std::wstring strCurValue;
	GetString(lpSection, lpKey, strCurValue, L"{EA93CC4C-E460-4465-AEC9-57F2A8A348E1}");

	bool changed = false;
	if (lpValue != NULL)
	{
		if (strCurValue != lpValue)
		{
			changed = true;
		}
	}
	else
	{
		if (!strCurValue.empty())
		{
			changed = true;
		}
	}

	if (changed)
	{
		::WritePrivateProfileString(lpSection, lpKey, lpValue, m_strConfig.c_str());

		GetEvent()->FireConfigChange(lpSection, lpKey, lpValue);
	}

	return true;
}
开发者ID:Emily8713,项目名称:BOLT_SDK,代码行数:30,代码来源:WizardApp.cpp

示例8: GetEvent

void CChoreoGlobalEventWidget::DrawLabel( CChoreoWidgetDrawHelper& drawHelper, COLORREF clr, int x, int y, bool right )
{
	CChoreoEvent *event = GetEvent();
	if ( !event )
		return;

	int len = drawHelper.CalcTextWidth( "Arial", 9, FW_NORMAL, va( "%s", event->GetName() ) );

	RECT rcText;
	rcText.top = y;
	rcText.bottom = y + 10;
	rcText.left = x - len / 2;
	rcText.right = rcText.left + len;

	if ( !right )
	{
		drawHelper.DrawColoredTextCharset( "Marlett", 9, FW_NORMAL, SYMBOL_CHARSET, clr, rcText, "3" );
		OffsetRect( &rcText, 8, 0 );
		drawHelper.DrawColoredText( "Arial", 9, FW_NORMAL, clr, rcText, va( "%s", event->GetName() ) );
	}
	else
	{
		drawHelper.DrawColoredText( "Arial", 9, FW_NORMAL, clr, rcText, va( "%s", event->GetName() ) );
		OffsetRect( &rcText, len, 0 );
		drawHelper.DrawColoredTextCharset( "Marlett", 9, FW_NORMAL, SYMBOL_CHARSET, clr, rcText, "4" );
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:27,代码来源:choreoglobaleventwidget.cpp

示例9: while

/*
===============
idEventLoop::RunEventLoop
===============
*/
int idEventLoop::RunEventLoop( bool commandExecution )
{
	sysEvent_t	ev;
	
	while( 1 )
	{
	
		if( commandExecution )
		{
			// execute any bound commands before processing another event
			cmdSystem->ExecuteCommandBuffer();
		}
		
		ev = GetEvent();
		
		// if no more events are available
		if( ev.evType == SE_NONE )
		{
			return 0;
		}
		ProcessEvent( ev );
	}
	
	return 0;	// never reached
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:30,代码来源:EventLoop.cpp

示例10: Flash

static void Flash()
{
#if 0               // FIXME
    FILE *animf;
    TEvent e;

    VVF_DrawFrame = DrawFlash;
    animf = GetAnimFile("flash");
    do {GetEvent(&e);} while (e.What != evNothing);
    DoneTimer();
    PlayVVF(animf);
    InitTimer();
    do {GetEvent(&e);} while (e.What != evNothing);
    fclose(animf);
#endif
}
开发者ID:danvac,项目名称:signus,代码行数:16,代码来源:mainmenu.cpp

示例11: MainLoop

void MainLoop(Display *display)
{
    Event *e = NULL;
    while ((e = GetEvent(display))) {
        callbacks_call(display->callbacks, display, e);
    }
}
开发者ID:cafiend,项目名称:W12,代码行数:7,代码来源:hlib.c

示例12: nacl_processevents

static void nacl_processevents(int wait, int* mx, int* my, int* mb, int* k) {
  static unsigned int mousebuttons = 0;
  static unsigned int mousex = 100;
  static unsigned int mousey = 0;
  static int iflag = 0; /* FIXEM*/

  struct PpapiEvent* event = GetEvent(wait);
  if (event != NULL) {
    /* only support mouse events for now */
    switch (event->type) {
      default:
        break;
      case PP_INPUTEVENT_TYPE_MOUSEDOWN:
        mousebuttons |= ButtonToMask(event->button);
        break;
      case PP_INPUTEVENT_TYPE_MOUSEUP:
        mousebuttons &= ~ButtonToMask(event->button);
        break;
      case PP_INPUTEVENT_TYPE_MOUSEMOVE:
        mousex = event->position.x;
        mousey = event->position.y;
        break;
    }
    free(event);
  }

  *mx = mousex;
  *my = mousey;
  *mb = mousebuttons;
  *k = iflag;
}
开发者ID:888,项目名称:naclports,代码行数:31,代码来源:ui_nacl.c

示例13: GetEvent

void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite)
{
    CalendarEvent* calendarEvent = GetEvent(invite.GetEventId());
    time_t statusTime = invite.GetStatusTime();
    bool hasStatusTime = statusTime != 946684800;   // 01/01/2000 00:00:00

    ObjectGuid invitee = invite.GetInviteeGUID();
    Player* player = ObjectAccessor::FindConnectedPlayer(invitee);

    uint8 level = player ? player->getLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee);

    WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (4) + 1);
    data << invitee.WriteAsPacked();
    data << uint64(invite.GetEventId());
    data << uint64(invite.GetInviteId());
    data << uint8(level);
    data << uint8(invite.GetStatus());
    data << uint8(hasStatusTime);
    if (hasStatusTime)
        data.AppendPackedTime(statusTime);
    data << uint8(invite.GetSenderGUID() != invite.GetInviteeGUID()); // false only if the invite is sign-up

    if (!calendarEvent) // Pre-invite
    {
        if (Player* playerSender = ObjectAccessor::FindConnectedPlayer(invite.GetSenderGUID()))
            playerSender->SendDirectMessage(&data);
    }
    else
    {
        if (calendarEvent->GetCreatorGUID() != invite.GetInviteeGUID()) // correct?
            SendPacketToAllEventRelatives(data, *calendarEvent);
    }
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:33,代码来源:CalendarMgr.cpp

示例14: GetNumEvents

bool CChoreoChannel::GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& events )
{
	events.RemoveAll();

	int i;
	// Sort items
	int c = GetNumEvents();
	for ( i = 0; i < c; i++ )
	{
		CChoreoEvent *e = GetEvent( i );
		Assert( e );
		if ( e->GetType() != CChoreoEvent::SPEAK )
			continue;

		if ( e->GetCloseCaptionType() == CChoreoEvent::CC_DISABLED )
			continue;

		// A master with no slaves is not a combined event
		if ( e->GetCloseCaptionType() == CChoreoEvent::CC_MASTER &&
			 e->GetNumSlaves() == 0 )
			 continue;

		char const *token = e->GetCloseCaptionToken();
		if ( Q_stricmp( token, cctoken ) )
			continue;

		events.Insert( e );
	}

	return ( events.Count() > 0 ) ? true : false;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:31,代码来源:choreochannel.cpp

示例15: tempInstance

	FMOD::Studio::EventInstance* SoundManager::GetSound( std::string eventID )
	{
		FMOD::Studio::EventInstance* tempInstance(nullptr);
//		ERRCHECK( GetEvent( eventID )->createInstance( &tempInstance ) );
		GetEvent( eventID )->createInstance( &tempInstance );
		return tempInstance;
	}
开发者ID:NHNNEXT,项目名称:2014-01-HUDIGAME-PoopTube,代码行数:7,代码来源:SoundManager.cpp


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