Beispiel #1
0
int	MIOText_GetMaxRow (void)
{
    MIO_CheckOuputIsToWindow ("maxrow");
    MIO_CheckOuputWindowIsInGraphicsMode ("maxrow");

    return MIOWin_GetInfo (MIO_selectedRunWindow) -> maxRow;
} // MIOText_GetMaxRow
Beispiel #2
0
void	MIOSprite_SetPosition (OOTint pmSpriteID, OOTint pmX, OOTint pmY,
			       OOTint pmCentered)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    if (pmCentered) 
    {
	pmX -= mySpriteInfo -> picWidth / 2;
	pmY -= mySpriteInfo -> picHeight / 2;
    }
    mySpriteInfo -> centered = pmCentered;
    
    if ((mySpriteInfo -> x == pmX) && (mySpriteInfo -> y == pmY))
    {
	return;
    }
    
    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }

    mySpriteInfo -> x = pmX;
    mySpriteInfo -> y =  myInfo -> height - pmY - mySpriteInfo -> picHeight;
    mySpriteInfo -> spriteRect = MyGetSpriteRect (mySpriteInfo);

    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_SetPosition
Beispiel #3
0
int	MIOText_GetCurrentRow (void)
{
    MIO_CheckOuputIsToWindow ("Text.WhatRow");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.WhatRow");

    return MIOWin_GetInfo (MIO_selectedRunWindow) -> actualRow + 1;
} // MIOText_GetCurrentRow
Beispiel #4
0
int	MIOText_GetCurrentColourBack (void)
{
    MIO_CheckOuputIsToWindow ("Text.WhatColorBack");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.WhatColorBack");

    return MIOWin_GetInfo (MIO_selectedRunWindow) -> textBGColour;
} // MIOText_GetCurrentColourBack
Beispiel #5
0
void	MIOText_SetColour (OOTint pmClr)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    
    MIO_CheckOuputIsToWindow ("Text.Color");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.Color");
    MIO_CheckColourRange (pmClr);        

    myInfo -> textColour = pmClr;
} // MIOText_SetColour
Beispiel #6
0
void	MIOText_LocateXY (OOTint pmX, OOTint pmY)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    int			myRow, myCol;
    
    MIO_CheckOuputIsToWindow ("Text.LocateXY");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.LocateXY");
 
    myRow = (myInfo -> height - pmY - 1) / myInfo -> fontCharHeight + 1;
    myCol = pmX / myInfo -> fontCharWidth + 1;
    
    MIOText_Locate (myRow, myCol);
} // MIOText_LocateXY
Beispiel #7
0
void	MIOSprite_Hide (OOTint pmSpriteID)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    if (mySpriteInfo -> visible) 
    {
	mySpriteInfo -> visible = FALSE;
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_Hide
void	MIOMouse_ButtonWait (OOTstring pmString, OOTint *pmX, OOTint *pmY, 
			     OOTint *pmButtonNumber, OOTint *pmButtonUpDown)
{
    int			myMotionType = MyConvertButtonString (pmString);
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    MOUSEPOINT		*myPtr;
    EventDescriptor	myEvent;
    
    MIO_CheckOuputIsToWindow ("Mouse.ButtonWait");
    MIO_CheckOuputWindowIsInGraphicsMode ("Mouse.ButtonWait");
    MIO_MakePopupWindowVisible ();

    if (MIOMouse_ButtonMoved1 (myMotionType))
    {
    	while (myInfo -> mouseBufferTail != myInfo -> mouseBufferHead)
    	{
	    myPtr = &myInfo -> mouseBuffer [myInfo -> mouseBufferTail];
	    myInfo -> mouseBufferTail = INC(myInfo -> mouseBufferTail);
	    if (myPtr -> buttonDirection & myMotionType)
	    {
	    	*pmX = myPtr -> x;
	    	*pmY = myPtr -> y;
	    	*pmButtonNumber = 1;
	    	if (stMultiButtonMode)
	    	{
	    	    if (myPtr -> button == LEFT_BUTTON)
		    	*pmButtonNumber = 1;
		    else if (myPtr -> button == MIDDLE_BUTTON)
		    	*pmButtonNumber = 2;
		    else if (myPtr -> button == RIGHT_BUTTON)
		    	*pmButtonNumber = 3;
	    	}
	    	if (myPtr -> buttonDirection = BUTTON_UP)
	            *pmButtonUpDown = 1;
	    	else
	    	    *pmButtonUpDown = 0;
	    	
	    	return;
	    } // if (myPtr -> buttonDirection & myMotionType)    	
        } // while

	// TW - Internal Error!    	
    }

    // There is no mouse event in the queue.  Wait for the event
    myEvent.mode = EventMode_MouseButton;
    myEvent.count = myMotionType;
    Language_Execute_EventQueueInsert ((int) NULL, &myEvent);
} // MIOMouse_ButtonWait
int	MIOMouse_ButtonMoved1 (int pmDirection)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    int			myIndex = myInfo -> mouseBufferTail;
    MOUSEPOINT		*myPtr;

    while (myIndex != myInfo -> mouseBufferHead)
    {
	myPtr = &myInfo -> mouseBuffer [myIndex];
	if (myPtr -> buttonDirection & pmDirection)
	{
	    return TRUE;
	}
	myIndex = INC(myIndex);
    }

    return FALSE;
} // MIOMouse_ButtonMoved1
Beispiel #10
0
void	MIOSprite_ChangePic (OOTint pmSpriteID, OOTint pmPicID)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;
    int			myOldWidth, myOldHeight;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myOldWidth = mySpriteInfo -> picWidth;
    myOldHeight = mySpriteInfo -> picHeight;
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }

    MDIOPic_DecrementUse (mySpriteInfo -> picMDPicInfo);

    if (mySpriteInfo -> centered)
    {
	MIOPic_GetInfoForSprite (pmPicID, &(mySpriteInfo -> picWidth),
				 &(mySpriteInfo -> picHeight),
				 &(mySpriteInfo -> picTransparentColour),
				 &(mySpriteInfo -> picMDPicInfo));
	mySpriteInfo -> x += (myOldWidth - mySpriteInfo -> picWidth) / 2;
	mySpriteInfo -> y += (myOldHeight - mySpriteInfo -> picHeight) / 2;
    }
    else
    {
	MIOPic_GetInfoForSprite (pmPicID, &(mySpriteInfo -> picWidth),
				 &(mySpriteInfo -> picHeight),
				 &(mySpriteInfo -> picTransparentColour),
				 &(mySpriteInfo -> picMDPicInfo));
	mySpriteInfo -> y += (myOldHeight - mySpriteInfo -> picHeight);
    }
    mySpriteInfo -> spriteRect = MyGetSpriteRect (mySpriteInfo);
    
    MDIOPic_IncrementUse (mySpriteInfo -> picMDPicInfo);

    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_ChangePic
Beispiel #11
0
void	MIOSprite_Show (OOTint pmSpriteID)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    if (!mySpriteInfo -> visible) 
    {
	if (!stSpritesInUse)
	{
	    stSpritesInUse = TRUE;		// Start updating sprites
	    MDIOSprite_InitializeSpriteContext (myInfo);
	}
	mySpriteInfo -> visible = TRUE;
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_Show
Beispiel #12
0
void	MIOSprite_SetHeight (OOTint pmSpriteID, OOTint pmHeight)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    MyRemoveFromQueue (myInfo, mySpriteInfo);

    mySpriteInfo -> spriteHeight = pmHeight;

    MyAddToQueue (myInfo, mySpriteInfo);
    
    if (mySpriteInfo -> visible) 
    {
	// If visible, a redisplay is in order
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_SetHeight
Beispiel #13
0
void	MIOText_Locate (OOTint pmRow, OOTint pmCol)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    char		myMessage [1024];

    MIO_CheckOuputIsToWindow ("Text.Locate");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.Locate");

    if (pmRow < 1) 
    {
	MDIO_sprintf (myMessage, "Row of %d is less than 1", pmRow);
	ABORT_WITH_ERRMSG (E_TEXT_ROW_TOO_SMALL, myMessage);
    }
    if (pmRow > myInfo -> maxRow) 
    {
	MDIO_sprintf (myMessage, "Row of %d is greater than maxrow (%d)", 
		      pmRow, myInfo -> maxRow);
	ABORT_WITH_ERRMSG (E_TEXT_ROW_TOO_LARGE, myMessage);
    }
    if (pmCol < 1) 
    {
	MDIO_sprintf (myMessage, "Column of %d is less than 1", pmCol);
	ABORT_WITH_ERRMSG (E_TEXT_COL_TOO_SMALL, myMessage);
    }
    if (pmCol > myInfo -> maxCol)
    {
	MDIO_sprintf (myMessage, "Column of %d is greater than maxcol (%d)", 
		      pmCol, myInfo -> maxCol);
	ABORT_WITH_ERRMSG (E_TEXT_COL_TOO_LARGE, myMessage);
    }
    
    myInfo -> row = pmRow - 1;
    myInfo -> col = pmCol - 1;
    myInfo -> actualRow = myInfo -> row;
    myInfo -> actualCol = myInfo -> col;
    
    // Display the caret, if appropriate
    MIOWin_CaretDisplay (MIO_selectedRunWindow);
} // MIOText_Locate
Beispiel #14
0
void	MIOSprite_Free (OOTint pmSpriteID)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    if (mySpriteInfo -> runWindow != NULL)
    {
	myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

	if (mySpriteInfo -> visible) 
	{
	    MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
	}

	MyRemoveFromQueue (myInfo, mySpriteInfo);
    }

    MDIOPic_DecrementUse (mySpriteInfo -> picMDPicInfo);

    MyFreeSprite (mySpriteInfo);
    MIO_IDRemove (pmSpriteID, SPRITE_ID);
} // MIOSprite_Free
Beispiel #15
0
void	MIOSprite_Animate (OOTint pmSpriteID, OOTint pmPicID, 
			   OOTint pmX, OOTint pmY, OOTint pmCentered)
{
    SpriteInfo		*mySpriteInfo;
    MIOWinInfoPtr	myInfo;

    mySpriteInfo = (SpriteInfo *) MIO_IDGet (pmSpriteID, SPRITE_ID);
    myInfo = MIOWin_GetInfo (mySpriteInfo -> runWindow);

    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }

    MDIOPic_DecrementUse (mySpriteInfo -> picMDPicInfo);
    MIOPic_GetInfoForSprite (pmPicID, &(mySpriteInfo -> picWidth),
			     &(mySpriteInfo -> picHeight),
			     &(mySpriteInfo -> picTransparentColour),
			     &(mySpriteInfo -> picMDPicInfo));
    MDIOPic_IncrementUse (mySpriteInfo -> picMDPicInfo);
    
    if (pmCentered) 
    {
	pmX -= mySpriteInfo -> picWidth / 2;
	pmY -= mySpriteInfo -> picHeight / 2;
    }
    mySpriteInfo -> x = pmX;
    mySpriteInfo -> y =  myInfo -> height - pmY - mySpriteInfo -> picHeight;
    mySpriteInfo -> spriteRect = MyGetSpriteRect (mySpriteInfo);
    mySpriteInfo -> centered = pmCentered;
    
    if (mySpriteInfo -> visible) 
    {
	MyAddDirtyRect (myInfo, mySpriteInfo -> spriteRect);
    }
} // MIOSprite_Animate
Beispiel #16
0
xxx
#endif

/**********/
/* Macros */
/**********/

/*************/
/* Constants */
/*************/

/********************/
/* Global variables */
/********************/

/*********/
/* Types */
/*********/

/**********************/
/* External variables */
/**********************/

/********************/
/* Static constants */
/********************/

/********************/
/* Static variables */
/********************/

/******************************/
/* Static callback procedures */
/******************************/

/*********************/
/* Static procedures */
/*********************/


/***********************/
/* External procedures */
/***********************/
/************************************************************************/
/* MIOText_Cls								*/
/************************************************************************/
void	MIOText_Cls (void)
{
    MIOWinInfoPtr	myInfo = MIOWin_GetInfo (MIO_selectedRunWindow);
    BOOL		myOldXOR;
    
    MIO_CheckOuputIsToWindow ("Text.Cls");
    MIO_CheckOuputWindowIsInGraphicsMode ("Text.Cls");
    MIO_MakePopupWindowVisible ();
    
    // Implemented simply as a drawfillbox of the entire screen in the
    // text background color
    myOldXOR = myInfo -> xor;
    myInfo -> xor = FALSE;
    MIODraw_Box (0, 0, myInfo -> width - 1, myInfo -> height - 1, NO_STYLE,
    		 NORMAL_WIDTH, myInfo -> textBGColour, FILL);
    myInfo -> xor = myOldXOR;

    // Set the cursor positon to upper-left corner
    myInfo -> actualCol = 0;
    myInfo -> actualRow = 0;
    myInfo -> row = 0;
    myInfo -> col = 0;
    myInfo -> startInputRow = 0;
    myInfo -> startInputCol = 0;
    
    // Display the caret, if appropriate
    MIOWin_CaretDisplay (MIO_selectedRunWindow);
} // MIOText_Cls