本文整理汇总了C++中Message::AddInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ Message::AddInt32方法的具体用法?C++ Message::AddInt32怎么用?C++ Message::AddInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::AddInt32方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DispatchEvent
void KeyboardDriver::DispatchEvent( int nKeyCode )
{
SetLED( nKeyCode );
Message* pcEvent = new Message( nKeyCode & 0x80 ? M_KEY_UP : M_KEY_DOWN );
pcEvent->AddInt32( "_key", nKeyCode );
EnqueueEvent( pcEvent );
}
示例2: SaveToArchive
// Idiom: SaveToArchive() saves our current state into the specified Message object
status_t SaveToArchive(Message & msg) const
{
if (msg.AddString("name", _name) != B_NO_ERROR) return B_ERROR;
if (msg.AddString("address", _address) != B_NO_ERROR) return B_ERROR;
if (msg.AddString("city", _city) != B_NO_ERROR) return B_ERROR;
if (msg.AddString("state", _state) != B_NO_ERROR) return B_ERROR;
if (msg.AddInt32("zip_code", _zipCode) != B_NO_ERROR) return B_ERROR;
return B_NO_ERROR; // success!
}
示例3: SaveSettings
/*************************************************
* Description: Saves the settings
* Author: Rick Caudill
* Date: Thu Mar 18 20:17:32 2004
**************************************************/
void WallpaperChangerSettings::SaveSettings()
{
ListViewStringRow* pcRow = (ListViewStringRow*)pcDirectoryList->GetRow(pcDirectoryList->GetLastSelected());
Message* pcMessage = new Message(M_PREFS_SEND_TO_PARENT);
bRandom = pcRandom->GetValue().AsBool();
pcMessage->AddBool("random",bRandom);
pcMessage->AddInt32("time",pcTimeDrop->GetSelection());
pcMessage->AddString("currentimage",pcRow->GetString(0));
pcParentLooper->PostMessage(pcMessage,pcParentView);
}
示例4: DispatchEvent
void SylVNCMouseDriver::DispatchEvent( int nDeltaX, int nDeltaY, uint32 nButtons )
{
Point cDeltaMove( nDeltaX, nDeltaY );
uint32 nButtonFlg;
static uint32 nLastButtons = 0;
nButtonFlg = nButtons ^ nLastButtons;
nLastButtons = nButtons;
if ( nButtonFlg != 0 ) {
Message* pcEvent;
if ( nButtonFlg & 0x01 ) {
if ( nButtons & 0x01 ) {
pcEvent = new Message( M_MOUSE_DOWN );
// dbprintf( "Mouse Button 1 Down\n");
} else {
pcEvent = new Message( M_MOUSE_UP );
// dbprintf( "Mouse Button 1 Up\n");
}
pcEvent->AddInt32( "_button", 1 );
pcEvent->AddInt32( "_buttons", 1 ); // To be removed
EnqueueEvent( pcEvent );
}
if ( nButtonFlg & 0x02 ) {
if ( nButtons & 0x02 ) {
pcEvent = new Message( M_MOUSE_DOWN );
// dbprintf( "Mouse Button 2 Down\n");
} else {
pcEvent = new Message( M_MOUSE_UP );
// dbprintf( "Mouse Button 2 Up\n");
}
pcEvent->AddInt32( "_button", 2 );
pcEvent->AddInt32( "_buttons", 2 ); // To be removed
EnqueueEvent( pcEvent );
}
}
if ( nDeltaX != 0 || nDeltaY != 0 ) {
Message* pcEvent = new Message( M_MOUSE_MOVED );
pcEvent->AddPoint( "delta_move", cDeltaMove );
EnqueueEvent( pcEvent );
}
}
示例5: DispatchEvent
void USBMouseDriver::DispatchEvent( int nDeltaX, int nDeltaY, uint32 nButtons, int nVScroll, int nHScroll )
{
Point cDeltaMove( nDeltaX, nDeltaY );
static uint32 nLastButtons = 0;
uint32 nButtonFlg;
nButtonFlg = nButtons ^ nLastButtons;
nLastButtons = nButtons;
if ( nButtonFlg != 0 ) {
Message* pcEvent;
if ( nButtonFlg & 0x01 ) {
if ( nButtons & 0x01 ) {
pcEvent = new Message( M_MOUSE_DOWN );
} else {
pcEvent = new Message( M_MOUSE_UP );
}
pcEvent->AddInt32( "_button", 1 );
pcEvent->AddInt32( "_buttons", 1 ); // To be removed
EnqueueEvent( pcEvent );
}
if ( nButtonFlg & 0x02 ) {
if ( nButtons & 0x02 ) {
pcEvent = new Message( M_MOUSE_DOWN );
} else {
pcEvent = new Message( M_MOUSE_UP );
}
pcEvent->AddInt32( "_button", 2 );
pcEvent->AddInt32( "_buttons", 2 ); // To be removed
EnqueueEvent( pcEvent );
}
// (xxl) Middle mouse button
if ( nButtonFlg & 0x04 ) {
if ( nButtons & 0x04 ) {
pcEvent = new Message( M_MOUSE_DOWN );
} else {
pcEvent = new Message( M_MOUSE_UP );
}
pcEvent->AddInt32( "_button", 3 );
pcEvent->AddInt32( "_buttons", 3 ); // To be removed
EnqueueEvent( pcEvent );
}
}
if ( nDeltaX != 0 || nDeltaY != 0 ) {
Message* pcEvent = new Message( M_MOUSE_MOVED );
pcEvent->AddPoint( "delta_move", cDeltaMove );
EnqueueEvent( pcEvent );
}
// (xxl) Vertical and/or horizontal scroll
if( nVScroll !=0 || nHScroll != 0 ) {
Point cScroll( nHScroll, nVScroll );
// send a specific scroll message: M_MOUSE_SCROLL
Message* pcEvent = new Message( M_WHEEL_MOVED );
// the "delta_move" key contains the scroll amount
// as a os::Point structure ("x" for horizontal and
// "y" for vertical). Usually the scroll amount is
// either -1, 0 or 1, but I noticed that sometimes
// the mouse send other values as well (-2 and 2 are
// the most common).
pcEvent->AddPoint( "delta_move", cScroll );
EnqueueEvent( pcEvent );
}
}
示例6: CancelTransfer
/** \brief Cancel a job.
* This cancels the job with the given id.
*
* \param nJobID The ID of the job to cancel.
*/
int Server::CancelTransfer( int nJobID )
{
Message* pcMsg = new Message( M_TT_CANCEL );
pcMsg->AddInt32( "id", nJobID );
return( m_pcThread->SendMessage( pcMsg ) );
}
示例7: ResumeTransfer
/** \brief Resume (unpause) a job.
* This resumes the job with the given id.
*
* \param nJobID The job ID of the job to resume
*/
int Server::ResumeTransfer( int nJobID )
{
Message* pcMsg = new Message( M_TT_RESUME );
pcMsg->AddInt32( "id", nJobID );
return( m_pcThread->SendMessage( pcMsg ) );
}
示例8: RemoveJob
/** \brief Send a message to the transfer thread to delete a job & remove it from the job lists.
* \note The job must already have cleaned itself up and have detached itself from any curl handles.
*/
int Server::RemoveJob( Job* pcJob )
{
Message* pcMsg = new Message( M_TT_REMOVE );
pcMsg->AddInt32( "id", pcJob->m_nID );
return( m_pcThread->SendMessage( pcMsg ) );
}