static int isLocatedOnDesktop(WindowInfo *window, long currentDesktop) { long windowDesktop; if (currentDesktop == -1) return True; /* No desktop information available */ windowDesktop = QueryDesktop(TheDisplay, window->shell); /* Sticky windows have desktop 0xFFFFFFFF by convention */ if (windowDesktop == currentDesktop || windowDesktop == 0xFFFFFFFFL) return True; /* Desktop matches, or window is sticky */ return False; }
static int Create(advanced* p) { int Caps = QueryPlatform(PLATFORM_CAPS); video Desktop; QueryDesktop(&Desktop); p->Node.Enum = (nodeenum)Enum, p->Node.Get = (nodeget)Get, p->Node.Set = (nodeset)Set, p->SlowVideo = 0; #if defined(TARGET_WINCE) p->SystemVolume = QueryPlatform(PLATFORM_VER) < 421; #else p->SystemVolume = 0; #endif p->BenchFromPos = 0; p->VR41XX = 1; p->MemoryOverride = 0; p->KeyFollowDir = HaveDPad(); p->ColorLookup = !(Caps & CAPS_MIPS_VR41XX) && !(Caps & CAPS_ARM_XSCALE); p->OldShell = (Caps & CAPS_OLDSHELL) != 0; p->DropTolerance = (TICKSPERSEC*55)/1000; p->SkipTolerance = (TICKSPERSEC*700)/1000; p->AVOffset = 0; p->BlinkLED = 1; #if defined(TARGET_ANDROID) p->NoDeblocking = 1; #endif #if defined(TARGET_PALMOS) // causes major problems on Sony TJ35, like screen not turning off with audio, or hold/power button not working... //p->NoEventChecking = (QueryPlatform(PLATFORM_CAPS) & CAPS_SONY)!=0; #endif #if defined(TARGET_WINCE) { tchar_t FileName[MAXPATH]; GetSystemPath(FileName,TSIZEOF(FileName),T("BtCeAvIf.dll")); p->WidcommAudio = p->WidcommDLL = FileExits(FileName); } #endif return ERR_NONE; }
static int Init(gapi* p) { GXDisplayProperties Info; video GDI; int Caps = QueryPlatform(PLATFORM_CAPS); if (!p->Opened) { ShowError(p->Overlay.Node.Class,GAPI_ID,GAPI_OPEN_ERROR); return ERR_NOT_SUPPORTED; // don't show device error } Info = p->Info; if (Info.cxWidth == GetSystemMetrics(SM_CXSCREEN) && Info.cyHeight < GetSystemMetrics(SM_CYSCREEN)) { // HPC devices we need the taskbar counted in the height too RECT WorkArea; SystemParametersInfo(SPI_GETWORKAREA,0,&WorkArea,0); if (WorkArea.top == 0 && WorkArea.bottom == Info.cyHeight) Info.cyHeight = GetSystemMetrics(SM_CYSCREEN); } p->Overlay.Output.Format.Video.Direction = 0; p->Overlay.Output.Format.Video.Aspect = ASPECT_ONE; if (Info.ffFormat & kfPalette) { QueryDesktop(&GDI); p->Overlay.Output.Format.Video.Pixel.Flags = PF_PALETTE; p->Overlay.Output.Format.Video.Pixel.BitCount = Info.cBPP; p->Overlay.Output.Format.Video.Pixel.Palette = GDI.Pixel.Palette; } else if (Info.ffFormat & kfDirect444) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,4,4,4,0,0,0); else if (Info.ffFormat & kfDirect565) { if (Caps & CAPS_ONLY12BITRGB) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,4,4,4,1,2,1); else DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,5,6,5,0,0,0); } else if (Info.ffFormat & kfDirect555) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,5,5,5,0,0,0); else if (Info.ffFormat & kfDirect888) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,8,8,8,0,0,0); if (Info.ffFormat & kfDirectInverted) p->Overlay.Output.Format.Video.Pixel.Flags |= PF_INVERTED; // get signed x/y pitches in bits Info.cbxPitch <<= 3; Info.cbyPitch <<= 3; // one pitch is probably zero when BPP<8 if (!Info.cbxPitch) if (Info.cbyPitch < 0) Info.cbxPitch = -Info.cBPP; else Info.cbxPitch = Info.cBPP; else if (!Info.cbyPitch) if (Info.cbxPitch < 0) Info.cbyPitch = Info.cBPP; else Info.cbyPitch = -Info.cBPP; // one of the pitches absolute value must be BPP if (abs(Info.cbyPitch) < abs(Info.cbxPitch)) { if (abs(Info.cbxPitch) < Info.cyHeight*Info.cBPP && abs(Info.cbxPitch) >= Info.cxWidth*Info.cBPP) //swapped gapi resolution SwapInt(&Info.cxWidth,&Info.cyHeight); Info.ffFormat |= kfLandscape; Info.cbyPitch = Info.cbyPitch<0 ? -Info.cBPP : Info.cBPP; } else { if (abs(Info.cbyPitch) < Info.cxWidth*Info.cBPP && abs(Info.cbyPitch) >= Info.cyHeight*Info.cBPP) //swapped gapi resolution SwapInt(&Info.cxWidth,&Info.cyHeight); Info.ffFormat &= ~kfLandscape; Info.cbxPitch = Info.cbxPitch<0 ? -Info.cBPP : Info.cBPP; } p->Overlay.Output.Format.Video.Width = Info.cxWidth; p->Overlay.Output.Format.Video.Height = Info.cyHeight; // we need the physical start of the framebuffer p->AdjustPtr = 0; if (Info.cbxPitch<0) p->AdjustPtr += (Info.cbxPitch * (Info.cxWidth-1)) >> 3; if (Info.cbyPitch<0) p->AdjustPtr += (Info.cbyPitch * (Info.cyHeight-1)) >> 3; if (Info.ffFormat & kfLandscape) { p->Overlay.Output.Format.Video.Direction |= DIR_SWAPXY; p->Overlay.Output.Format.Video.Pitch = abs(Info.cbxPitch) >> 3; SwapInt(&p->Overlay.Output.Format.Video.Width,&p->Overlay.Output.Format.Video.Height); if (Info.cbxPitch<0) p->Overlay.Output.Format.Video.Direction |= DIR_MIRRORUPDOWN; if (Info.cbyPitch<0) p->Overlay.Output.Format.Video.Direction |= DIR_MIRRORLEFTRIGHT; }