10 #include"SDL_config_symbian.h"
14 //#undef DEBUG_TRACE_ENABLED
16 #ifdef DEBUG_TRACE_ENABLED
17 #define SDL_TRACE(error_str) RDebug_Print(error_str, (void*) NULL)
18 #define SDL_TRACE1(error_str, param) RDebug_Print(error_str, (void*) (param))
19 #define SDL_MEM() SDL_TRACE1("Free memory=%d", Debug_AvailMem())
22 void RDebug_Print(char* error_str
, void* param
);
23 void RDebug_Print_b(char* error_str
, void* param
);
27 #define SDL_TRACE(error_str)
28 #define SDL_TRACE1(error_str, param)
32 #define PANIC(x) Panic(x, __LINE__)
33 #define PANIC_IF_ERROR(x) (x == KErrNone || Panic(x, __LINE__))
35 TInt
Panic(TInt aErr
, TInt aLine
);
38 NONSHARABLE_CLASS(MEventQueue
)
41 virtual TInt
Append(const TWsEvent
& aEvent
) = 0;
42 // virtual const TWsEvent& Top() = 0;
43 virtual TBool
HasData() = 0;
44 // virtual TInt Shift() = 0;
45 virtual const TWsEvent
Shift() = 0;
46 virtual void Lock() = 0;
47 virtual void Unlock() = 0;
53 typedef void (*TSdlCleanupOperation
) (TAny
* aThis
);
55 NONSHARABLE_CLASS(TSdlCleanupItem
)
58 TSdlCleanupItem(TSdlCleanupOperation aOperation
, TAny
* aItem
);
60 TSdlCleanupOperation iOperation
;
66 NONSHARABLE_CLASS(EpocSdlEnv
)
69 enum {EDisableKeyBlocking
= 100, ELastService
};
70 static void Request(TInt aService
);
71 static MEventQueue
& EventQueue();
72 static TSize
WindowSize(const TSize
& aRequestedSize
);
73 static TSize
WindowSize();
74 static TDisplayMode
DisplayMode();
75 static TPointerCursorMode
PointerMode();
76 static TBool
Flags(TInt aFlag
);
79 static TBool
IsDsaAvailable();
80 // static void Dsa(const TPoint& aPoint, const CFbsBitmap& aBmp);
81 static TInt
AllocSwSurface(const TSize
& aSize
, TDisplayMode aMode
);
82 static TInt
AllocHwSurface(const TSize
& aSize
, TDisplayMode aMode
);
83 static void UnlockHwSurface();
84 static TUint8
* LockHwSurface();
85 static void UpdateSwSurface();
86 static TBool
AddUpdateRect(TUint8
* aAddress
, const TRect
& aUpdateRect
, const TRect
& aTargetRect
);
87 static void PanicMain(TInt aErr
);
88 static void PanicMain(const TDesC
& aInfo
, TInt aErr
);
89 static void WaitDeviceChange();
90 static TInt
SetPalette(TInt aFirstcolor
, TInt aColorCount
, TUint32
* aPalette
);
91 static void ObserverEvent(TInt aService
, TInt aParam
= 0);
92 static void WaitDsaAvailable();
93 static void LockPalette(TBool aLock
);
95 static void Suspend();
96 static TInt
AppendCleanupItem(const TSdlCleanupItem
& aItem
);
97 static void RemoveCleanupItem(TAny
* aItem
);
98 static void CleanupItems();
99 static void SetWaitDsa();
100 static TPoint
WindowCoordinates(const TPoint
& aPoint
);
101 static void FreeSurface();
102 static TInt
ApplyGlesDsa();
103 static RWindow
* Window();
104 // static TInt SetVolume(TInt aVolume);
105 // static TInt Volume();
106 // static TInt MaxVolume();