Пример #1
0
// ---------------------------------------------------------------------------
// Set scale mode for the image brush
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfImageBrush::SetScaleMode(CAlfImageVisual::TScaleMode aScaleMode)
    {
    TPckgC<TInt> paramsPckg(aScaleMode);        

    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetScaleMode, paramsPckg );    
    
    if ( err )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::SetScaleMode panic error %d", err )
        USER_INVARIANT();
        }
    }
Пример #2
0
// ---------------------------------------------------------------------------
// Returns scale factor
// ---------------------------------------------------------------------------
//    
EXPORT_C const TAlfTimedValue& CAlfImageBrush::Scale() const
    {
    TPckg<TAlfTimedValue> buf(iImageBrushData->iScale);
    TInt err = Comms()->DoSynchronousCmd( EAlfImageBrushScale, KNullDesC8, buf);

    if ( err != KErrNone )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::Scale panic error %d", err )
        USER_INVARIANT();
        }
    
    return iImageBrushData->iScale;
    }
Пример #3
0
// ---------------------------------------------------------------------------
// Returns the offset
// ---------------------------------------------------------------------------
//    
EXPORT_C const TAlfTimedPoint& CAlfImageBrush::Offset() const
    {
    TPckg<TAlfTimedPoint> offsetPckg(iImageBrushData->iOffset);
    
    TInt err = Comms()->DoSynchronousCmd(EAlfImageBrushOffset, KNullDesC8, offsetPckg);
    
    if ( err )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::Offset ignore error %d", err )
        }

    return iImageBrushData->iOffset;
    }
Пример #4
0
// ---------------------------------------------------------------------------
// Sets scale factor
// ---------------------------------------------------------------------------
//    
EXPORT_C void CAlfImageBrush::SetScale(const TAlfTimedValue& aScale)
    {
    TPckgC<TAlfTimedValue> buf(aScale);

    TInt err = Comms()->DoCmdNoReply( EAlfImageBrushSetScale, buf );

    if ( err == KErrNone )
        {
        iImageBrushData->iScale = aScale;
        }
    else
        {
        __ALFLOGSTRING1( "CAlfImageBrush::SetScale panic error %d", err )
        USER_INVARIANT();
        }
    }
Пример #5
0
// ---------------------------------------------------------------------------
// Sets offfset for the image
// ---------------------------------------------------------------------------
//    
EXPORT_C void CAlfImageBrush::SetOffset(const TAlfTimedPoint& aOffset)
    {
    iImageBrushData->iOffset.iX = aOffset.iX;
    iImageBrushData->iOffset.iY = aOffset.iY;


    TPckgC<TAlfTimedPoint> offsetPckg(iImageBrushData->iOffset);
    
    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetOffset, offsetPckg);
    
    if ( err )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::SetOffset panic error %d", err )
        USER_INVARIANT();
        }
    }
Пример #6
0
// ---------------------------------------------------------------------------
// Set image
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfImageBrush::SetImage(const TAlfImage& aImage)
    {
    iImageBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
    
    TAlfImageBrushParams params;
    params.iTextureHandle = aImage.Texture().ServerHandle(); 
    params.iTl = aImage.TimedTopLeft();
    params.iBr = aImage.TimedBottomRight();
    params.iLeftBorderWidth = iImageBrushData->iLeftBorderWidth;
    params.iRightBorderWidth = iImageBrushData->iRightBorderWidth;
    params.iTopBorderWidth = iImageBrushData->iTopBorderWidth;
    params.iBottomBorderWidth = iImageBrushData->iBottomBorderWidth;    
    TPckgC<TAlfImageBrushParams> paramsPckg(params);        

    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetImage, paramsPckg);    
    
    if ( err )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::SetImage ignore error %d", err )
        }
    }
Пример #7
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
EXPORT_C void CAlfImageBrush::SetBorders(TInt aLeftBorderWidth,
                             TInt aRightBorderWidth,
                             TInt aTopBorderHeight,
                             TInt aBottomBorderHeight)
    {
    iImageBrushData->iLeftBorderWidth = aLeftBorderWidth;
    iImageBrushData->iRightBorderWidth = aRightBorderWidth;
    iImageBrushData->iTopBorderWidth = aTopBorderHeight;
    iImageBrushData->iBottomBorderWidth = aBottomBorderHeight;    

    TAlfImageBrushParams params;
    params.iLeftBorderWidth = iImageBrushData->iLeftBorderWidth;
    params.iRightBorderWidth = iImageBrushData->iRightBorderWidth;
    params.iTopBorderWidth = iImageBrushData->iTopBorderWidth;
    params.iBottomBorderWidth = iImageBrushData->iBottomBorderWidth;    
    TPckgC<TAlfImageBrushParams> paramsPckg(params);        

    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetBorders, paramsPckg);    
    
    if ( err )
        {
        __ALFLOGSTRING1( "CAlfImageBrush::SetBorders ignore error %d", err )
        }
    }
Пример #8
0
#include <Arduino.h>
#include "pins.h"
#include "comms.h"
#include "SHETSource.h"

DirectPins pins = DirectPins(2,3);
Comms comms = Comms(&pins);


/* All addresses from this arduino will be prefixed with the string given as the
 * argument below, don't forget the trailing slash if you want it to be a
 * subdirectory! */
SHETSource::Client client = SHETSource::Client(&comms, "testduino");

SHETSource::LocalEvent *press_event;

int var;
uint8_t led;
bool button_down;


void
set_light(int value)
{
	digitalWrite(8, value);
	led = value;
}


int get_light(void)
{