perl
view release on metacpan or search on metacpan
os2/OS2/OS2-Process/Process.xs view on Meta::CPAN
/* XXXX This assumes DOS type return type, without SEVERITY?! */
DeclFuncByORD(HSWITCH, myWinQuerySwitchHandle, ORD_WinQuerySwitchHandle,
(HWND hwnd, PID pid), (hwnd, pid))
DeclFuncByORD(ULONG, myWinQuerySwitchEntry, ORD_WinQuerySwitchEntry,
(HSWITCH hsw, PSWCNTRL pswctl), (hsw, pswctl))
DeclFuncByORD(ULONG, myWinSetWindowText, ORD_WinSetWindowText,
(HWND hwnd, char* text), (hwnd, text))
DeclFuncByORD(BOOL, myWinQueryWindowProcess, ORD_WinQueryWindowProcess,
(HWND hwnd, PPID ppid, PTID ptid), (hwnd, ppid, ptid))
DeclFuncByORD(ULONG, XmyWinSwitchToProgram, ORD_WinSwitchToProgram,
(HSWITCH hsw), (hsw))
#define myWinSwitchToProgram(hsw) (!CheckOSError(XmyWinSwitchToProgram(hsw)))
/* These function croak if the return value is 0. */
DeclWinFunc_CACHE(HWND, QueryWindow, (HWND hwnd, LONG cmd), (hwnd, cmd))
DeclWinFunc_CACHE(BOOL, QueryWindowPos, (HWND hwnd, PSWP pswp),
(hwnd, pswp))
DeclWinFunc_CACHE(LONG, QueryWindowText,
(HWND hwnd, LONG cchBufferMax, PCH pchBuffer),
(hwnd, cchBufferMax, pchBuffer))
DeclWinFunc_CACHE(LONG, QueryClassName, (HWND hwnd, LONG cchMax, PCH pch),
(hwnd, cchMax, pch))
DeclWinFunc_CACHE(HWND, QueryFocus, (HWND hwndDesktop), (hwndDesktop))
DeclWinFunc_CACHE(BOOL, SetFocus, (HWND hwndDesktop, HWND hwndFocus),
(hwndDesktop, hwndFocus))
DeclWinFunc_CACHE(BOOL, ShowWindow, (HWND hwnd, BOOL fShow), (hwnd, fShow))
DeclWinFunc_CACHE(BOOL, EnableWindow, (HWND hwnd, BOOL fEnable),
(hwnd, fEnable))
DeclWinFunc_CACHE(BOOL, SetWindowPos,
(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y,
LONG cx, LONG cy, ULONG fl),
(hwnd, hwndInsertBehind, x, y, cx, cy, fl))
DeclWinFunc_CACHE(HENUM, BeginEnumWindows, (HWND hwnd), (hwnd))
DeclWinFunc_CACHE(BOOL, EndEnumWindows, (HENUM henum), (henum))
DeclWinFunc_CACHE(BOOL, EnableWindowUpdate, (HWND hwnd, BOOL fEnable),
(hwnd, fEnable))
DeclWinFunc_CACHE(BOOL, SetWindowBits,
(HWND hwnd, LONG index, ULONG flData, ULONG flMask),
(hwnd, index, flData, flMask))
DeclWinFunc_CACHE(BOOL, SetWindowPtr, (HWND hwnd, LONG index, PVOID p),
(hwnd, index, p))
DeclWinFunc_CACHE(BOOL, SetWindowULong, (HWND hwnd, LONG index, ULONG ul),
(hwnd, index, ul))
DeclWinFunc_CACHE(BOOL, SetWindowUShort, (HWND hwnd, LONG index, USHORT us),
(hwnd, index, us))
DeclWinFunc_CACHE(HWND, IsChild, (HWND hwnd, HWND hwndParent),
(hwnd, hwndParent))
DeclWinFunc_CACHE(HWND, WindowFromId, (HWND hwnd, ULONG id), (hwnd, id))
DeclWinFunc_CACHE(HWND, EnumDlgItem, (HWND hwndDlg, HWND hwnd, ULONG code),
(hwndDlg, hwnd, code))
DeclWinFunc_CACHE(HWND, QueryDesktopWindow, (HAB hab, HDC hdc), (hab, hdc));
DeclWinFunc_CACHE(BOOL, SetActiveWindow, (HWND hwndDesktop, HWND hwnd),
(hwndDesktop, hwnd));
DeclWinFunc_CACHE(BOOL, QueryActiveDesktopPathname, (PSZ pszPathName, ULONG ulSize),
(pszPathName, ulSize));
DeclWinFunc_CACHE(BOOL, InvalidateRect,
(HWND hwnd, /*RECTL*/ char *prcl, BOOL fIncludeChildren),
(hwnd, prcl, fIncludeChildren));
DeclWinFunc_CACHE(BOOL, CreateFrameControls,
(HWND hwndFrame, /*PFRAMECDATA*/ char* pfcdata, PCSZ pszTitle),
(hwndFrame, pfcdata, pszTitle));
DeclWinFunc_CACHE(BOOL, OpenClipbrd, (HAB hab), (hab));
DeclWinFunc_CACHE(BOOL, EmptyClipbrd, (HAB hab), (hab));
DeclWinFunc_CACHE(BOOL, CloseClipbrd, (HAB hab), (hab));
DeclWinFunc_CACHE(BOOL, QueryClipbrdFmtInfo, (HAB hab, ULONG fmt, PULONG prgfFmtInfo), (hab, fmt, prgfFmtInfo));
DeclWinFunc_CACHE(ULONG, QueryClipbrdData, (HAB hab, ULONG fmt), (hab, fmt));
DeclWinFunc_CACHE(HWND, SetClipbrdViewer, (HAB hab, HWND hwnd), (hab, hwnd));
DeclWinFunc_CACHE(HWND, SetClipbrdOwner, (HAB hab, HWND hwnd), (hab, hwnd));
DeclWinFunc_CACHE(ULONG, EnumClipbrdFmts, (HAB hab, ULONG fmt), (hab, fmt));
DeclWinFunc_CACHE(ATOM, AddAtom, (HATOMTBL hAtomTbl, PCSZ pszAtomName),
(hAtomTbl, pszAtomName));
DeclWinFunc_CACHE(ULONG, QueryAtomUsage, (HATOMTBL hAtomTbl, ATOM atom),
(hAtomTbl, atom));
DeclWinFunc_CACHE(ULONG, QueryAtomLength, (HATOMTBL hAtomTbl, ATOM atom),
(hAtomTbl, atom));
DeclWinFunc_CACHE(ULONG, QueryAtomName,
(HATOMTBL hAtomTbl, ATOM atom, PSZ pchBuffer, ULONG cchBufferMax),
(hAtomTbl, atom, pchBuffer, cchBufferMax));
DeclWinFunc_CACHE(HATOMTBL, QuerySystemAtomTable, (VOID), ());
DeclWinFunc_CACHE(HATOMTBL, CreateAtomTable, (ULONG initial, ULONG buckets),
(initial, buckets));
DeclWinFunc_CACHE(ULONG, MessageBox, (HWND hwndParent, HWND hwndOwner, PCSZ pszText, PCSZ pszCaption, ULONG idWindow, ULONG flStyle), (hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle));
DeclWinFunc_CACHE(ULONG, MessageBox2,
(HWND hwndParent, HWND hwndOwner, PCSZ pszText,
PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info),
(hwndParent, hwndOwner, pszText, pszCaption, idWindow, pmb2info));
DeclWinFunc_CACHE(HPOINTER, LoadPointer,
(HWND hwndDesktop, HMODULE hmod, ULONG idres),
(hwndDesktop, hmod, idres));
DeclWinFunc_CACHE(HPOINTER, QuerySysPointer,
(HWND hwndDesktop, LONG lId, BOOL fCopy),
(hwndDesktop, lId, fCopy));
DeclWinFunc_CACHE(BOOL, Alarm, (HWND hwndDesktop, ULONG rgfType), (hwndDesktop, rgfType));
DeclWinFunc_CACHE(BOOL, FlashWindow, (HWND hwndFrame, BOOL fFlash), (hwndFrame, fFlash));
#if 0 /* Need to have the entry points described in the parent */
DeclWinFunc_CACHE(BOOL, QueryClassInfo, (HAB hab, char* pszClassName, PCLASSINFO pClassInfo), (hab, pszClassName, pClassInfo));
#define _QueryClassInfo(hab, pszClassName, pClassInfo) \
QueryClassInfo(hab, pszClassName, (PCLASSINFO)pClassInfo)
#endif
/* These functions do not croak on error */
DeclWinFunc_CACHE_survive(BOOL, SetClipbrdData,
(HAB hab, ULONG ulData, ULONG fmt, ULONG rgfFmtInfo),
(hab, ulData, fmt, rgfFmtInfo));
#define get_InvalidateRect InvalidateRect
#define get_CreateFrameControls CreateFrameControls
/* These functions may return 0 on success; check $^E/Perl_rc on res==0: */
DeclWinFunc_CACHE_resetError(PVOID, QueryWindowPtr, (HWND hwnd, LONG index),
(hwnd, index))
DeclWinFunc_CACHE_resetError(ULONG, QueryWindowULong, (HWND hwnd, LONG index),
(hwnd, index))
DeclWinFunc_CACHE_resetError(SHORT, QueryWindowUShort, (HWND hwnd, LONG index),
(hwnd, index))
DeclWinFunc_CACHE_resetError(LONG, QueryWindowTextLength, (HWND hwnd), (hwnd))
DeclWinFunc_CACHE_resetError(HWND, QueryActiveWindow, (HWND hwnd), (hwnd))
DeclWinFunc_CACHE_resetError(BOOL, PostMsg,
os2/OS2/OS2-Process/Process.xs view on Meta::CPAN
if (CheckOSError(DosQueryCp( sizeof(cps), cps, &cp )))
croak_with_os2error("DosQueryCp()");
return cp;
}
int
out_codepage()
{
USHORT cp, rc;
if (CheckOSError(VioGetCp( 0, &cp, 0 )))
croak_with_os2error("VioGetCp()");
return cp;
}
bool
out_codepage_set(int cp)
{
USHORT rc;
return !(CheckOSError(VioSetCp( 0, cp, 0 )));
}
int
in_codepage()
{
USHORT cp, rc;
if (CheckOSError(KbdGetCp( 0, &cp, 0 )))
croak_with_os2error("KbdGetCp()");
return cp;
}
bool
in_codepage_set(int cp)
{
USHORT rc;
return !(CheckOSError(KbdSetCp( 0, cp, 0 )));
}
bool
process_codepage_set(int cp)
{
USHORT rc;
return !(CheckOSError(DosSetProcessCp( cp )));
}
int
ppidOf(int pid)
{
PQTOPLEVEL psi;
int ppid;
if (!pid)
return -1;
psi = get_sysinfo(pid, QSS_PROCESS);
if (!psi)
return -1;
ppid = psi->procdata->ppid;
Safefree(psi);
return ppid;
}
int
sidOf(int pid)
{
PQTOPLEVEL psi;
int sid;
if (!pid)
return -1;
psi = get_sysinfo(pid, QSS_PROCESS);
if (!psi)
return -1;
sid = psi->procdata->sessid;
Safefree(psi);
return sid;
}
STRLEN
StrLen(ULONG addr, ULONG lim, I32 unitsize)
{
switch (unitsize) {
case 1:
{
char *s = (char *)addr;
char *s1 = s, *e = (char *)(addr + lim);
while (s < e && *s)
s++;
return s - s1;
}
break;
case 2:
{
short *s = (short *)addr;
short *s1 = s, *e = (short *)(addr + lim);
while (s < e && *s)
s++;
return (char*)s - (char*)s1;
}
break;
case 4:
{
int *s = (int *)addr;
int *s1 = s, *e = (int *)(addr + lim);
while (s < e && *s)
s++;
return (char*)s - (char*)s1;
}
break;
case 8:
{
long long *s = (long long *)addr;
long long *s1 = s, *e = (long long *)(addr + lim);
while (s < e && *s)
s++;
return (char*)s - (char*)s1;
}
break;
default:
croak("StrLen: unknown unitsize %d", (int)unitsize);
}
}
#define ulMPFROMSHORT(i) ((unsigned long)MPFROMSHORT(i))
#define ulMPVOID() ((unsigned long)MPVOID)
#define ulMPFROMCHAR(i) ((unsigned long)MPFROMCHAR(i))
#define ulMPFROM2SHORT(x1,x2) ((unsigned long)MPFROM2SHORT(x1,x2))
#define ulMPFROMSH2CH(s, c1, c2) ((unsigned long)MPFROMSH2CH(s, c1, c2))
#define ulMPFROMLONG(x) ((unsigned long)MPFROMLONG(x))
os2/OS2/OS2-Process/Process.xs view on Meta::CPAN
void
myWinQueryClipbrdFmtInfo(OUTLIST unsigned long prgfFmtInfo, unsigned long fmt = CF_TEXT, HAB hab = perl_hab_GET())
C_ARGS: hab, fmt, &prgfFmtInfo
SV *
myWinQueryAtomName(ATOM atom, HATOMTBL hAtomTbl = QuerySystemAtomTable())
MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWin
int
myWinSwitchToProgram(HSWITCH hsw = switch_of(NULLHANDLE, getpid()))
PREINIT:
ULONG rc;
#if 0
unsigned long
myWinMessageBox(unsigned long pszText, char* pszCaption = "Perl script message", unsigned long flStyle = MB_CANCEL | MB_ICONHAND, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = HWND_DESKTOP, unsigned long idWindow = 0)
C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
#endif
unsigned long
_MessageBox(char* pszText, char* pszCaption = "Perl script message", unsigned long flStyle = MB_CANCEL | MB_INFORMATION | MB_MOVEABLE, HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, flStyle
POSTCALL:
if (RETVAL == MBID_ERROR)
RETVAL = 0;
unsigned long
_MessageBox2(char *pszText, char* pmb2info, char *pszCaption = "Perl script message", HWND hwndParent = HWND_DESKTOP, HWND hwndOwner = NULLHANDLE, unsigned long idWindow = 0)
C_ARGS: hwndParent, hwndOwner, pszText, pszCaption, idWindow, (PMB2INFO)pmb2info
POSTCALL:
if (RETVAL == MBID_ERROR)
RETVAL = 0;
MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = myWinQuery
MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = get
int
getppid()
int
ppidOf(int pid = getpid())
int
sidOf(int pid = getpid())
void
getscrsize(OUTLIST int wp, OUTLIST int hp)
PROTOTYPE:
bool
scrsize_set(int w_or_h, int h = -9999)
void
get_InvalidateRect(HWND hwnd, char *prcl, bool fIncludeChildren)
void
get_CreateFrameControls(HWND hwndFrame, char *pfcdata, char* pszTitle)
MODULE = OS2::Process PACKAGE = OS2::Process PREFIX = ul
unsigned long
ulMPFROMSHORT(unsigned short i)
unsigned long
ulMPVOID()
unsigned long
ulMPFROMCHAR(unsigned char i)
unsigned long
ulMPFROM2SHORT(unsigned short x1, unsigned short x2)
PROTOTYPE: DISABLE
unsigned long
ulMPFROMSH2CH(unsigned short s, unsigned char c1, unsigned char c2)
PROTOTYPE: DISABLE
unsigned long
ulMPFROMLONG(unsigned long x)
( run in 0.823 second using v1.01-cache-2.11-cpan-39bf76dae61 )