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

news/2024/7/8 3:44:21

 收藏
转自: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


http://www.niftyadmin.cn/n/1990972.html

相关文章

Task23——不同的二叉搜索树 II(带更新)

题目&#xff1a; 给定一个整数 n&#xff0c;生成所有由 1 ... n 为节点所组成的二叉搜索树。 示例: 输入: 3 输出: [ [1,null,3,2], [3,2,null,1], [3,1,null,null,2], [2,1,3], [1,null,2,null,3] ] 解释: 以上的输出对应以下 5 种不同结构的二叉搜索树&#x…

Task24——恢复二叉树(待更新)

题目&#xff1a; 二叉搜索树中的两个节点被错误地交换。 请在不改变其结构的情况下&#xff0c;恢复这棵树。 示例 1: 输入: [1,3,null,null,2] 1 / 3 \ 2 输出: [3,1,null,null,2] 3 / 1 \ 2 示例 2: 输入: [3,1,4,null,null,2] 3 / \ 1 4 / …

C++编程杂谈之二:面向对象

C编程杂谈之二&#xff1a;面向对象作者/xulion 软件开发是一个极其复杂的过程&#xff0c;一段小的代码我们可以快速、准确的完成&#xff0c;但是当你面对的是一个庞大的软件系统的时候&#xff0c;你是否有不知所措的感觉呢&#xff1f;在我们使用C的年代里面&#xff0c;编…

使用 Animation dll 捕获按键

Capturing key events using Animation dll使用 Animation dll 捕获按键Platform -----------------------------------S60 3rd Edition, FP1S60 3rd Edition, FP2S60 5th Edition Tested on devices-----------------------------------Tested on Nokia N95,Navi 6210,Nok…

C++编程杂谈之一:编译器

C编程杂谈之一&#xff1a;编译器作者/xulion 网上有很多各种编译器的优劣比较的东西&#xff0c;我写这些东西并不是想支持或否定某些东西&#xff0c;因为我始终认为在编程的领域中&#xff0c;我只是一个初学者&#xff0c;并没有资格来评判什么&#xff08;况且我也不…

Task25——买卖股票的最佳时机

题目&#xff1a; 给定一个数组&#xff0c;它的第 i 个元素是一支给定股票第 i 天的价格。 设计一个算法来计算你所能获取的最大利润。你可以尽可能地完成更多的交易&#xff08;多次买卖一支股票&#xff09;。 注意&#xff1a;你不能同时参与多笔交易&#xff08;你必须…

Nokia论坛技术资料汇

http://discussion.forum.nokia.com/forum/showthread.php?t60202&page40

Task26——判断子序列

题目&#xff1a; 给定字符串 s 和 t &#xff0c;判断 s 是否为 t 的子序列。 你可以认为 s 和 t 中仅包含英文小写字母。字符串 t 可能会很长&#xff08;长度 ~ 500,000&#xff09;&#xff0c;而 s 是个短字符串&#xff08;长度 <100&#xff09;。 字符串的一个子…