FireBirdLib - Topfield TMS PVR TAP Programming Library
TAP_Osd_Savebox_Chk.c
Go to the documentation of this file.
1#define FB_DEBUG_CHK
2#define FB_LOG_ENTRY_LIB_PRINTF
3#include "libFireBird.h"
4
5byte* TAP_Osd_SaveBox_Chk(char *Comment, word rgn, dword x, dword y, dword w, dword h)
6{
8
9 byte *ret;
10 dword RgnH, RgnW;
11
12 if(Comment)
13 {
14 RgnH = GetOSDRegionHeight(rgn);
15 RgnW = GetOSDRegionWidth(rgn);
16
17 if(!isOSDRegionAlive(rgn)) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: rgn(%d) points to an undefined region @ %s", rgn, Comment);
18 if(x >= RgnW) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: x(%lu) out of range @ %s", x, Comment);
19 if(y >= RgnH) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: y(%lu) out of range @ %s", y, Comment);
20 if((x + w) > RgnW) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: x(%lu) + w(%lu) out of range @ %s", x, w, Comment);
21 if((y + h) > RgnH) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: y(%lu) + h(%lu) out of range @ %s", y, h, Comment);
22 }
23
24 ret = TAP_Osd_SaveBox(rgn, x, y, w, h);
25
26 if(Comment) if(ret == NULL) LogEntryFBLibPrintf(TRUE, "TAP_Osd_SaveBox_Chk Warning: TAP_Osd_SaveBox() returned a NULL pointer @ %s", Comment);
27
28 TRACEEXIT();
29 return ret;
30}
word GetOSDRegionHeight(word Region)
word GetOSDRegionWidth(word Region)
void LogEntryFBLibPrintf(bool Console, char *format,...)
byte * TAP_Osd_SaveBox_Chk(char *Comment, word rgn, dword x, dword y, dword w, dword h)
bool isOSDRegionAlive(word Region)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243