模块化C语言编程(五)

2012-11-07 13:12:34 · 作者: · 浏览: 1323


    
    定义外部变量 static int a.是把a的作用域限制在本文件中。可以不同文件中有相同的外部变量名。
   
    外部变量都是静态存储的。
   
    #endif /* defined(__MMI_VUI_SHELL_APP__) */
   
    #endif /* IDLE_SHELL_H */
   
    idle_shell.c文件
   
    void mmi_idle_shell_update_idle_text(void)
   
    {
   
    /*----------------------------------------------------------------*/
   
    /* Local Variables                                                */
   
    /*----------------------------------------------------------------*/
   
    /*----------------------------------------------------------------*/
   
    /* Code Body                                                      */
   
    /*----------------------------------------------------------------*/
   
    /* Idle mode text and icon. */
   
    vadp_p2v_hs_set_idle_mode_text((U8 *)wgui_cat033_get_extra_text());
   
    vadp_p2v_hs_set_idle_mode_icon((U8 *)GetSATIdleIcon());
   
    }
   
    void mmi_idle_shell_on_init(mmi_idle_obj_struct *obj)
   
    {
   
    /*----------------------------------------------------------------*/
   
    /* Local Variables                                                */
   
    /*----------------------------------------------------------------*/
   
    mmi_idle_shell_struct *p;
   

    mmi_idle_capability_struct *capability;
   
    /*----------------------------------------------------------------*/
   
    /* Code Body                                                      */
   
    /*----------------------------------------------------------------*/
   
    mmi_idle_obj_on_init(obj);
   
    p = (mmi_idle_shell_struct *)obj;
   
    /* Member variable. */
   
    p->type = MMI_IDLE_TYPE_SHELL;
   
    /* Member function. */
   
    p->on_enter = mmi_idle_shell_on_enter;
   
    p->on_update_service_area = mmi_idle_shell_on_update_service_indication;
   
    /* Change the capabilities. */
   
    capability = &obj->capability;
   
    capability->enable_soft_key_area = MMI_FALSE;
   
    capability->enable_center_soft_key = MMI_FALSE;
   
    #if defined(__MMI_VUI_SHELL_MULTI_PAGE__)
   
    /*
   
    * Shell already has a touch button to lock the handset. No need to use END
   
    * key to lock the handset.
   
    */
   
    capability->enable_end_key = MMI_FALSE;
   
    #endif /* defined(__MMI_VUI_SHELL_MULTI_PAGE__) */
   
    }
   
    #endif /* defined(__MMI_VUI_SHELL_APP__) */