[+] AuLoop::DbgLoopSourceToReadFd
[+] AuLoop::DbgLoopSourceToWriteFd
This commit is contained in:
parent
81093fa2cd
commit
1c0efebd87
@ -88,6 +88,12 @@ namespace Aurora::IO::Loop
|
||||
AUKN_SYM AuSPtr<ILoopSource> NewLSAppleSource();
|
||||
AUKN_SYM AuSPtr<ILoopSource> NewLSIOHandle(const AuSPtr<IIOHandle> &pHandle);
|
||||
|
||||
// warn: only works on singular loop sources
|
||||
AUKN_SYM AuInt64 DbgLoopSourceToReadFd(AuSPtr<ILoopSource> pLoopSource);
|
||||
|
||||
// warn: only works on singular loop sources
|
||||
AUKN_SYM AuInt64 DbgLoopSourceToWriteFd(AuSPtr<ILoopSource> pLoopSource);
|
||||
|
||||
#if defined(X_PROTOCOL)
|
||||
static AuSPtr<ILoopSource> NewLSX11(Display *display)
|
||||
{
|
||||
|
@ -517,4 +517,50 @@ namespace Aurora::IO::Loop
|
||||
|
||||
return triggered;
|
||||
}
|
||||
|
||||
AUKN_SYM AuInt64 DbgLoopSourceToReadFd(AuSPtr<ILoopSource> pLoopSource)
|
||||
{
|
||||
if (!pLoopSource)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto pSourceEx = AuDynamicCast<Loop::ILoopSourceEx>(pLoopSource);
|
||||
if (!pSourceEx)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!pSourceEx->Singular())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return pSourceEx->GetHandle();
|
||||
}
|
||||
|
||||
AUKN_SYM AuInt64 DbgLoopSourceToWriteFd(AuSPtr<ILoopSource> pLoopSource)
|
||||
{
|
||||
if (!pLoopSource)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto pSourceEx = AuDynamicCast<Loop::ILoopSourceEx>(pLoopSource);
|
||||
if (!pSourceEx)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!pSourceEx->Singular())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined(AURORA_IS_POSIX_DERIVED)
|
||||
return pSourceEx->GetWriteHandle();
|
||||
#else
|
||||
return pSourceEx->GetHandle();
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user