示例#1
0
/******************************************************************************
 * ACPIDebug::start
 ******************************************************************************/
bool ACPIDebug::start(IOService *provider)
{
    DEBUG_LOG("ACPIDebug::start: called\n");
    
    m_pDevice = OSDynamicCast(IOACPIPlatformDevice, provider);
    if (NULL == m_pDevice || !super::start(provider))
        return false;

    // need a work loop to send timer events to
    m_pWorkLoop = getWorkLoop();
    if (NULL == m_pWorkLoop)
        return false;
    m_pWorkLoop->retain();

    // need a timer to kick off every second
    m_pTimer = IOTimerEventSource::timerEventSource(this,
        OSMemberFunctionCast(IOTimerEventSource::Action, this, &ACPIDebug::OnTimerEvent));
    if (NULL == m_pTimer)
        return false;
	if (kIOReturnSuccess != m_pWorkLoop->addEventSource(m_pTimer))
        return false;

    // command gate to route setProperties through workloop
    m_pCmdGate = IOCommandGate::commandGate(this);
    if (m_pCmdGate)
        m_pWorkLoop->addEventSource(m_pCmdGate);
    
	IOLog("ACPIDebug: Version 0.1.0 starting\n");
    
    // call it once
    OnTimerEvent();
    
	this->registerService(0);
    return true;
}
示例#2
0
/******************************************************************************
 * ACPIDebug::start
 ******************************************************************************/
bool ACPIDebug::start(IOService *provider)
{
    DEBUG_LOG("ACPIDebug::start: called\n");
    
    // announce version
    extern kmod_info_t kmod_info;
    IOLog("ACPIDebug: Version %s starting on OS X Darwin %d.%d.\n", kmod_info.version, version_major, version_minor);

    // place version/build info in ioreg properties RM,Build and RM,Version
    char buf[128];
    snprintf(buf, sizeof(buf), "%s %s", kmod_info.name, kmod_info.version);
    setProperty("RM,Version", buf);
#ifdef DEBUG
    setProperty("RM,Build", "Debug-" LOGNAME);
#else
    setProperty("RM,Build", "Release-" LOGNAME);
#endif

    m_pDevice = OSDynamicCast(IOACPIPlatformDevice, provider);
    if (NULL == m_pDevice || !super::start(provider))
        return false;

    m_pLock = IOLockAlloc();
    if (!m_pLock)
        return false;

    // need a work loop to send timer events to
    m_pWorkLoop = getWorkLoop();
    if (NULL == m_pWorkLoop)
        return false;
    m_pWorkLoop->retain();

    // need a timer to kick off every second
    m_pTimer = IOTimerEventSource::timerEventSource(this,
        OSMemberFunctionCast(IOTimerEventSource::Action, this, &ACPIDebug::OnTimerEvent));
    if (NULL == m_pTimer)
        return false;
	if (kIOReturnSuccess != m_pWorkLoop->addEventSource(m_pTimer))
        return false;

    // command gate to route setProperties through workloop
    m_pCmdGate = IOCommandGate::commandGate(this);
    if (m_pCmdGate)
        m_pWorkLoop->addEventSource(m_pCmdGate);

    // call it once
    OnTimerEvent();
    
	this->registerService(0);
    return true;
}
示例#3
0
bool wxComboCtrl::AnimateShow( const wxRect& rect, int flags )
{
    if ( GetUserPreferencesMask() & wxMSW_DESKTOP_USERPREFERENCESMASK_COMBOBOXANIM )
    {
        m_animStart = ::wxGetLocalTimeMillis();
        m_animRect = rect;
        m_animFlags = flags;

        wxWindow* win = GetPopupWindow();
        win->SetSize( rect.x, rect.y, rect.width, 0 );
        win->Show();

        m_animTimer.SetOwner( this, wxID_ANY );
        m_animTimer.Start( COMBOBOX_ANIMATION_RESOLUTION, wxTIMER_CONTINUOUS );

        OnTimerEvent(*((wxTimerEvent*)NULL));  // Event is never used, so we can give NULL

        return false;
    }

    return true;
}