Symbian源代码还原——void CCoeControl::ActivateL(void)

 收藏
转自:http://dev.chinamobile.com/cmdn/bbs/viewthread.php?tid=2177&pid=10870&page=1&extra=page%3D1#pid10870

ActivateL是个好东西,好多人都想知道其内部实现,可惜苦于没有源代码。现在我把逆向代码贴出来,让大家一饱眼福,呵呵。错误在所难免。

RDrawableWindow* iWin;
CCoeControl::OwnsWindow()         Tests if the control is window-owning...
CCoeControl::CapturesPointer()     Tests whether pointer capture is set for the control.This returns true if SetPointerCapture() has been called with aCapture=ETrue.
CCoeControl::IsReadyToDraw()      Tests if the control is ready for drawing.This returns true if the control has been activated and is visible
RWsSession::PurgePointerEvents()  Removes all pointer events waiting to be delivered to this session.The events are removed from the event queue without being processed. This might occur, for example, at application startup.
CCoeControl::IsBackedUp()            Tests if the window owned by the control is a backed-up window.

 =================================================================================

void CCoeControl::ActivateL(void)
{
    if(iFlags & 0x80000)
    {
    User::LeaveNoMemory();
    }
   
    if(EFalse == IsActivated)
    {
     iFlags |= 0x10; //set to active
       
     if( OwnsWindow() ) //Tests if the control is window-owning...
     {
        iWin->Activate();
        if(CapturesPointer())
        {
            if(IsReadyToDraw())
            {
            //Removes all pointer events waiting to be delivered to this session.
            //The events are removed from the event queue without being processed.
            //This might occur, for example, at application startup. 
            iCoeEnv->WsSession()->PurgePointerEvents();
            }
        }
       
        if(IsBackedUp())
        {
            DrawNow();
        }
     }
     //Some codes here....
     //RCoeDynamicDataStorage相关操作,这个类并没有任何资料,
     //所以关于这个类的相关操作,我们无从得知。
    }
   
    TInt ctrlCounts = CountComponentControls();
    TInt index = 0 ;
    while(index < ctrlCounts)
    {
      CCoeControl* subCtrlPtr = ComponentControl(index);
      subCtrlPtr->ActivateL();
      index++;
    }
}


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lxs_lover520/archive/2009/09/17/4563682.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值