當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetPort函數代碼示例

本文整理匯總了C++中GetPort函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetPort函數的具體用法?C++ GetPort怎麽用?C++ GetPort使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetPort函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: PUSH_SERVER_ERROR

BOOL CPushServer::Start()
{
    m_pServer->DoAccept.connect(&m_handler, &CPushServerHandler::OnAccept);
    m_pServer->DoClose.connect(&m_handler, &CPushServerHandler::OnClose);
    
    if (m_pServer->Bind(GetListenIP().c_str(), GetPort()) == FALSE)
    {
        PUSH_SERVER_ERROR("push server bind failed, ip: %s, port: %u.", GetListenIP().c_str(),
                          GetPort());
        return FALSE;
    }
    
    m_pServer->Listen();
    PUSH_SERVER_DEBUG("push server start successed, ip: %s, port: %u.", GetListenIP().c_str(),
                      GetPort());
    return TRUE;
}
開發者ID:0359xiaodong,項目名稱:TeamTalk,代碼行數:17,代碼來源:push_server.cpp

示例2: device_dialog_filter_proc

static pascal Boolean device_dialog_filter_proc(
	DialogPtr dialog,
	EventRecord *event,
	short *item_hit)
{
	GrafPtr old_port;
	short item_type;
	Handle item_handle;
	Rect item_rectangle;
	boolean handled= FALSE;

	GetPort(&old_port);
	SetPort(dialog);
	
	GetDItem(dialog, iDEVICE_AREA, &item_type, &item_handle, &item_rectangle);

	/* preprocess events */	
	switch(event->what)
	{
		case mouseDown:
		{
			Point where= event->where;
			
			GlobalToLocal(&where);
			switch (FindDItem(dialog, where)+1)
			{
				case iDEVICE_AREA:
				{
					GDHandle new_device= click_in_device_area(&device_dialog_globals.device_spec, &item_rectangle, where);
					
					if (new_device && new_device!=device_dialog_globals.device)
					{
						device_dialog_globals.device= new_device;
						BuildExplicitGDSpec(&device_dialog_globals.device_spec, new_device, device_dialog_globals.device_spec.flags, device_dialog_globals.device_spec.bit_depth, 0, 0);
						draw_device_area(&device_dialog_globals.device_spec, device_dialog_globals.device, &item_rectangle);
						
						*item_hit= iDEVICE_AREA;
					}
					handled= TRUE;
					
					break;
				}
			}
			break;
		}
		
		case updateEvt:
			if ((DialogPtr)event->message==dialog)
			{
				draw_device_area(&device_dialog_globals.device_spec, device_dialog_globals.device, &item_rectangle);
			}
			break;
	}

	SetPort(old_port);

	return handled ? TRUE : general_filter_proc(dialog, event, item_hit);
}
開發者ID:DrItanium,項目名稱:moo,代碼行數:58,代碼來源:device_dialog.c

示例3: GetPort

void BURGER_API Burger::OkAlertMessage(const char *pMessage,const char *pTitle)
{
	Word8 *TitleStr;		/* Pointer to the window title */
	DialogPtr MyDialog;	/* My dialog pointer */
	Handle ItemList;	/* Handle to the item list */
	Rect DialogRect;	/* Rect of the dialog window */
	Word TitleLen;		/* Length of the title */
	Word MessLen;		/* Length of the caption */
	short ItemHit;		/* Junk */
	Rect WorkRect;
	GrafPtr MyPort;	/* My grafport */
	//Word Foo;
	
	//Foo = InputSetState(FALSE);
		
	GetPort(&MyPort);	/* Save the current port */
	
	/* Center my dialog to the screen */
#if ACCESSOR_CALLS_ARE_FUNCTIONS
	GetPortBounds(MyPort,&WorkRect);
#else
	WorkRect = MyPort->portRect;
#endif
	DialogRect.top = static_cast<short>((((WorkRect.bottom-WorkRect.top)-190)/2)+WorkRect.top);
	DialogRect.left = static_cast<short>((((WorkRect.right-WorkRect.left)-350)/2)+WorkRect.left);
	DialogRect.bottom = static_cast<short>(DialogRect.top+190);
	DialogRect.right = static_cast<short>(DialogRect.left+350);

	TitleLen = 0;			/* Assume no length */
	if (pTitle) {
		TitleLen = Burger::StringLength(pTitle);		/* Get the length of the title string */
	}
	TitleStr = (Word8 *)Burger::Alloc(TitleLen+1);	/* Get memory of pascal string */
	if (TitleStr) {			/* Did I get the memory? */
		MemoryCopy(TitleStr+1,pTitle,TitleLen);
		TitleStr[0] = static_cast<Word8>(TitleLen);		/* Set the pascal length */
		
		MessLen = Burger::StringLength(pMessage);	/* Size of the message */
		ItemList = NewHandle(static_cast<Size>(sizeof(Template)+MessLen));
		if (ItemList) {				/* Ok? */
			Template[sizeof(Template)-1]=static_cast<Word8>(MessLen);	/* Save the message length */
			MemoryCopy(ItemList[0],Template,sizeof(Template));	/* Copy the template */
			MemoryCopy((ItemList[0])+sizeof(Template),pMessage,MessLen);	/* Copy the message */
			MyDialog = NewDialog(0,&DialogRect,(Word8 *)TitleStr,TRUE,5,(WindowPtr)-1,FALSE,0,ItemList);
			if (MyDialog) {
				SetDialogDefaultItem(MyDialog,1);	/* Default for OK button */
				ModalDialog(0,&ItemHit);			/* Handle the event */
				DisposeDialog(MyDialog);			/* Kill the dialog */
			} else {
				DisposeHandle(ItemList);			/* I must kill this myself! */
			}
		}
		Burger::Free(TitleStr);				/* Kill the title */
	}
	SetPort(MyPort);			/* Restore my grafport */
	//InputSetState(Foo);
}
開發者ID:Olde-Skuul,項目名稱:burgerlib,代碼行數:57,代碼來源:brdebugmac.cpp

示例4: SetDialogPort

/*	SetDialogPort(theDialog)
	
	SetDialogPort sets the current GrafPort on Macintosh and does nothing on
	Windows.
	
	On Macintosh, it returns the current GrafPort before SetDialogPort was
	called. On Windows, it returns theDialog. This routine exists solely to avoid
	the need for an ifdef when you need to deal with the Macintosh current GrafPort
	in cross-platform dialog code. 

	Thread Safety: SetDialogPort is not thread-safe.
*/
CGrafPtr
SetDialogPort(DialogPtr theDialog)
{
	CGrafPtr savePort;
	
	GetPort(&savePort);
	SetPortDialogPort(theDialog);
	return savePort;
}
開發者ID:jgreenb2,項目名稱:DFMLoadWave,代碼行數:21,代碼來源:XOPDialogsMac.c

示例5: HAL_UART_RxCpltCallback

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	// Give back the mutex.
	xSemaphoreGiveFromISR( PxSemaphoreHandle[GetPort(huart)], &( xHigherPriorityTaskWoken ) );
	
	UartRxReady = SET;
}
開發者ID:OUWECAD,項目名稱:MOWE,代碼行數:9,代碼來源:stm32f0xx_it.c

示例6: main

int main(int argc, char *argv[])
{
 int rc;
 int Desc;
 int tm;
 int Port, Ip;
 char Tampon[80];

 struct sockaddr_in psoo; /* o = origine */
 struct sockaddr_in psos; /* s = serveur */
 struct sockaddr_in psor; /* r = remote */
 struct Requete UneRequete;

 memset(&psoo, 0, sizeof(struct sockaddr_in));
 memset(&psos, 0, sizeof(struct sockaddr_in));
 memset(&psor, 0, sizeof(struct sockaddr_in));

 if (argc!=5)

{
    printf("cli client portc serveur ports\n");
    exit(1);
 }
 Desc = CreateSockets(&psoo, &psos, argv[1], atoi(argv[2]), argv[3], atoi(argv[4]));
 if (Desc == -1)
    perror("CreateSockets:");
 else
    fprintf(stderr, "CreateSockets %d\n", Desc);

  Ip = GetIP(&psoo);
  Port = GetPort(&psoo);
  memset(Tampon, 0, sizeof(Tampon));
  Ipv4ToS(Ip, Tampon);
  printf("Adresse Ip du client %s : Port %d \n", Tampon, Port);

 UneRequete.Type = Question;
 strncpy(UneRequete.Message, "Multiclient; Bonjour", sizeof(UneRequete.Message));

 rc = SendDatagram(Desc, &UneRequete, sizeof(struct Requete), &psos);

 if (rc == -1)
    perror("SendDatagram");
 else
   fprintf(stderr, "Envoi de %d bytes\n", rc);

 memset(&UneRequete, 0, sizeof(struct Requete));
 tm = sizeof(struct Requete);

  rc = ReceiveDatagram(Desc, &UneRequete, tm, &psor);
 if (rc == -1)
    perror("ReceiveDatagram");
 else
   fprintf(stderr, "bytes:%d:%s\n", rc, UneRequete.Message);


 close(Desc);
}
開發者ID:bendem,項目名稱:DossierReseau,代碼行數:57,代碼來源:cli.c

示例7: UpdateAdditionsWin

void
UpdateAdditionsWin(void)
{
	Rect		r;
	Cell		c;
	int			i;
	GrafPtr		oldPort;
	GetPort(&oldPort);
	
	SetPort(gWPtr);
	
	MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad + 1);
	HLock(gControls->cfg->selAddMsg);
	DrawString( CToPascal(*gControls->cfg->selAddMsg));
	HUnlock(gControls->cfg->selAddMsg);
	
#if 0
	RGBColor backColorOld;
    Rect adjustedRect, *clRect = &gControls->aw->compListBox;
    SetRect(&adjustedRect, clRect->left, clRect->top+1, clRect->right, clRect->bottom-1);
    GetBackColor(&backColorOld);
    BackColor(whiteColor);
    EraseRect(&adjustedRect);
    RGBBackColor(&backColorOld);
#endif
   
	LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList);
	SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
	            gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
	FrameRect(&r);	
	
	SetPt(&c, 0, 0);
	if (LGetSelect(true, &c, gControls->aw->compList))
	{
		HLock((Handle)gControls->aw->compDescTxt);
		SetRect(&r, (*gControls->aw->compDescTxt)->viewRect.left,
					(*gControls->aw->compDescTxt)->viewRect.top,
					(*gControls->aw->compDescTxt)->viewRect.right,
					(*gControls->aw->compDescTxt)->viewRect.bottom);
		HUnlock((Handle)gControls->aw->compDescTxt);
		TEUpdate(&r, gControls->aw->compDescTxt);	
	}
	
	DrawDiskSpaceMsgs( gControls->opt->vRefNum );
	
	for (i = 0; i < numRows; i++)
	{
		if (gControls->cfg->comp[rowToComp[i]].highlighted)
		{
			AddInitRowHighlight(i);
			break;
		}
	}
	
	SetPort(oldPort);
}
開發者ID:rn10950,項目名稱:RetroZilla,代碼行數:56,代碼來源:AdditionsWin.c

示例8: LoadSettings

void WiimoteEmuGeneral::LoadSettings()
{
  auto* ce_extension = static_cast<ControllerEmu::Extension*>(
      Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension));

  m_extension_combo->setCurrentIndex(ce_extension->switch_extension);
  OnAttachmentChanged(ce_extension->switch_extension);

  Wiimote::LoadConfig();
}
開發者ID:OrN,項目名稱:dolphin,代碼行數:10,代碼來源:WiimoteEmuGeneral.cpp

示例9: GetFont

void GetFont(
	TextSpec *spec)
{
	GrafPtr port;

	GetPort(&port);
	spec->font=GetPortTextFont(port);
	spec->style=GetPortTextFace(port);
	spec->size=GetPortTextSize(port);
}
開發者ID:Aleph-One-Marathon,項目名稱:alephone-dingoo,代碼行數:10,代碼來源:csfonts.cpp

示例10: getCurrentPortBounds

void getCurrentPortBounds(Rect* inRect)
{
    /*------------------------------------------------------
        Simple utility function to get the bounds of the
        current port.
    --------------------------------------------------------*/
    CGrafPtr thePort;
    GetPort(&thePort);
    GetPortBounds(thePort,inRect);
}
開發者ID:fruitsamples,項目名稱:CustomWindow,代碼行數:10,代碼來源:CustomWindow.c

示例11: SetHost

void CCore::ConnectToServer(CString strHost, unsigned short usPort, CString strPass)
{
	// Declare our basic network connection
	SetHost(strHost);
	SetClientPort(usPort);
	SetPass(strPass);

	// Connect to the network
	CHECK_VALID_VOID(m_pNetworkManager)
		m_pNetworkManager->Connect(GetHost(), (unsigned short) GetPort(), GetPass());
}
開發者ID:MartinJK,項目名稱:IVNetwork,代碼行數:11,代碼來源:CCore.cpp

示例12: GetServer

	ServerOptions IrcJoinGroupChat::GetServerOptions () const
	{
		ServerOptions so;
		so.ServerName_ = GetServer ();
		so.ServerPort_ = GetPort ();
		so.ServerEncoding_ = GetEncoding ();
		so.ServerPassword_ = QString ();
		so.SSL_ = GetSSL ();
		so.ServerNickName_ = GetNickname ();
		return so;
	}
開發者ID:generatorglukoff,項目名稱:leechcraft,代碼行數:11,代碼來源:ircjoingroupchat.cpp

示例13: IN0

void openmax_processor::emptyThisBuffer(OMX_BUFFERHEADERTYPE_p buffer, t_uint8 portNb)
//*******************************************************************************
{ //Just wrap to the base component
	IN0("\n");
	Port *pPort=GetPort(portNb);
	WARNING(pPort);
	MSG3("%s->emptyThisBuffer[%lu] Header=%p \n", GetComponentName(), buffer->nInputPortIndex, (void *)buffer);
	WARNING(buffer->nInputPortIndex==portNb);
	Component::deliverBuffer(portNb, buffer);
	OUT0("\n");
}
開發者ID:Meticulus,項目名稱:vendor_st-ericsson_u8500,代碼行數:11,代碼來源:openmax_processor.cpp

示例14: apply_unseen_mask

void apply_unseen_mask()
{
	Rect base_rect = {9,9,53,45},to_rect,big_to = {13,13,337,265};
	GrafPtr old_port;
	short i,j,k,l;
	ConstPatternParam c;
	bool need_bother = false;
	
	if (PSD[SDF_NO_FRILLS] > 0)
		return;

	if ((is_combat()) && (which_combat_type == 0))
		return;
	if (!(is_out()) && (univ.town->lighting_type > 0))
		return;
		
	for (i = 0; i < 11; i++)
		for (j = 0; j < 11; j++) 
			if (unexplored_area[i + 1][j + 1] == 1)
				need_bother = true;
	if (need_bother == false)
		return;
				
	GetPort(&old_port);
	SetPort(terrain_screen_gworld);
	//p = *bw_pats[3];
	//c = p;
	c = *bw_pats[3];
	PenPat(c);
	PenMode(notPatOr);
	
	for (i = 0; i < 11; i++)
		for (j = 0; j < 11; j++) 
			if (unexplored_area[i + 1][j + 1] == 1) {

					to_rect = base_rect;
					OffsetRect(&to_rect,-28 + i * 28,-36 + 36 * j);
					SectRect(&to_rect,&big_to,&to_rect);
					PaintRect(&to_rect);
					//PaintRoundRect(&to_rect,4,4);
					for (k = i - 2; k < i + 1; k++)
						for (l = j - 2; l < j + 1; l++)
							if ((k >= 0) && (l >= 0) && (k < 9) && (l < 9) && ((k != i - 1) || (l != j - 1)))
								terrain_there[k][l] = -1;

				}
	
	//p = *bw_pats[6];
	//c = p;
	c = *bw_pats[6];
	PenPat(c);
	PenMode(patCopy);
	SetPort(old_port);
}
開發者ID:PBrookfield,項目名稱:cboe-msvc,代碼行數:54,代碼來源:boe.newgraph.cpp

示例15: GetPropertyValueInt

void ShapeKeyMatrix::MakeControlsXML( QDomElement &elem, const QList<class PinItem *> &pins, const QList<PropertyValue *> &values  ) const
{
    int nRows = GetPropertyValueInt("Rows",values,0);
    int nCols = GetPropertyValueInt("Columns",values,0);

    QStringList rows, cols;
    for ( int i = 0; i < nRows; i++ )
        rows << GetPort(pins, QString("R%1").arg(i) );

    for ( int i = 0; i < nCols; i++ )
        cols << GetPort(pins, QString("C%1").arg(i) );

    MakeKeyMatrixControl( elem, 
                          GetPropertyValueString("Key Names",values,""),
                          GetPropertyValueUsagePage("Usage",values,1),
                          GetPropertyValueUsage("Usage",values,1),
                          GetPropertyValueInt("DebounceMs",values,10),
                          rows,
                          cols );
}
開發者ID:neomilium,項目名稱:GenericHID,代碼行數:20,代碼來源:shapekeymatrix.cpp


注:本文中的GetPort函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。