Welcome![Sign In][Sign Up]
Location:
Search - brew mp

Search list

[GUI Developbrew window manager

Description:

 

Objective
This topic describes how to create a windowed application that will share the display with other applications.
Brew® MP windowed applications need to be written differently than traditional Brew MP applications. Traditional Brew MP applications, when running in the foreground, occupy full screen space and can modify the display at any time. In the windowing framework, multiple applications share the display at the same time and are not allowed to modify the display arbitrarily. A windowed application also needs to create one or more widgets to be used to create the windows.
A windowed application needs to:
·                  Create and initialize one or more widgets to be passed to IWindowMgr_CreateWindow().
The application can implement its own IWidget, or it can make use of an existing IWidget.
·                  Handle the EVT_APP_START_WINDOW event (and create a window).
·                  Implement handlers for visibility changes, focus changes, and extent changes. The implementation of these handlers is dependent on the details of the application.
·                  Draw in two stages:
·                                  Tell the container that drawing is necessary (ICONTAINER_Invalidate()).
·                                  Draw only when told to draw by the container (IWIDGET_Draw()).
Note: A windowed application should not call any functions that modify IDisplay directly. This includes explicit IDisplay function calls or implicit updates, such as calls to IIMAGE_Draw() or ICONTROL_Redraw(). Drawing should happen only on demand, for example, when IWIDGET_Draw() is called for the widget used to create the window. Existing Widget based applications follow these guidelines and, with minor modifications, can be ported to the windowing framework.
Event handling
A windowed application must respond to these events:
EVT_APP_START_WINDOW and EVT_APP_START
A window-based application receives EVT_APP_START_WINDOW first. If the application returns TRUE for this event, the application does not receive EVT_APP_START. If an application needs to support both the environments (window based and non-window based), it should handle both events.
When the application receives EVT_APP_START_WINDOW, it should create one or more windows.
If creation of IWindowMgr0 fails while handling EVT_APP_START_WINDOW, the application should assume that the platform does not support window-based applications. In this case, the application should return FALSE and continue the application logic in the code for EVT_APP_START.
EVT_APP_SUSPEND and EVT_APP_RESUME
After an application returns TRUE for EVT_APP_START_WINDOW, it will not receive EVT_APP_SUSPEND and EVT_APP_RESUME as non-windowed Brew MP applications do. Instead, the application must check for window status events that are sent to the widget through EVT_WDG_SETPROPERTY events. For EVT_WDG_SETPROPERTY events, wParam indicates which property was set, and dwParam specifies the value of the property. When the AEEWindowMgrExt_PROPEX_STATE property has a value of AEEWindowMgrExt_STATE_VISIBLE, the window is visible.
EVT_WDG_WINDOWSTATUS
The EVT_WDG_WINDOWSTATUS event is sent to a widget to notify it about various window related status messages. AEEWindowStatus.h contains information on the meaning of various status messages.
Sample code location

ZIP filename
Location
Run app
hellowindowapp
Brew MP Library
·                       Download and extract the ZIP file.
·                       Compile the app.
·                       Run it on the Brew MP Simulator.

Example of a windowed application
In the hellowindowapp sample, HelloWindowApp_HandleEvent handles the EVT_APP_START_WINDOW event and creates soft key and pop-up windows:
   case EVT_APP_START_WINDOW:   
      DBGPRINTF("EVT_APP_START_WINDOW");
 
      // Create the softkey and popup windows
      HelloWindowApp_CreateSoftkey(pMe);
      HelloWindowApp_CreateOrActivatePopup(pMe);
 
      // Handling this event tells Brew that we are a windowing
      // application.
      return TRUE;  
HelloWindowApp_CreateSoftkey() creates the soft key widget, sets the color text of the widget, then calls HelloWindowApp_CreateWindow() to create the window.
   WidgetWindow *pWindow = &pMe->softkeyWindow;
  
   if (pWindow->piWindowWidget != NULL) return;
   pWindow->pszDbgName = "Softkey";
   pWindow->pMe = pMe;
  
   (void) ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_SoftkeyWidget,
            (void **) &pWindow->piWindowWidget);
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WidgetExtent extent = {0, HWA_SOFTKEY_HEIGHT};
      IWidget_SetExtent(pWindow->piWindowWidget, &extent);
   }
  
   (void) IWidget_SetBGColor(pWindow->piWindowWidget, MAKE_RGBA(200,200,200,255));
  
   // Now set the softkeys text
   {
      IWidget *piTextWidget = NULL;
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY1, &piTextWidget);
     
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Hover", TRUE);
      }
      RELEASEIF(piTextWidget);
 
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY2, &piTextWidget);
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Close", TRUE);
      }
      RELEASEIF(piTextWidget);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Softkey);  
HelloWindowApp_CreateWindow() creates the soft key window, as follows:
   int result;
   uint32 winId;
   AEEWindowProp propList[1];
  
   // Set custom window handler
   HANDLERDESC_Init(&pWindow->hdHandler, HelloWindowApp_WindowHandler, pWindow, NULL);
   IWIDGET_SetHandler(pWindow->piWindowWidget, &pWindow->hdHandler);
        
   propList[0].id = AEEWindowMgrExtProp_CLASS;
   propList[0].pbyLen = sizeof(winClass);
   propList[0].pby = (void *) &winClass;
     
   result = IWindowMgr_CreateWindow(pMe->piWindowMgr, (IQI*) (void *) pWindow->piWindowWidget,
      propList, ARR_SIZE(propList), &winId);
 
   if (result != SUCCESS) {
      DBGPRINTF("Window creation failed for %s: %d", pWindow->pszDbgName, result);
      HelloWindowApp_DestroyWindow(pWindow);
   } else {
      DBGPRINTF("Window %s created: id=%d", pWindow->pszDbgName, winId);
   }
HelloWindowApp_CreateOrActivatePopup() creates the widget for the pop-up window, then calls HelloWindowApp_CreateWindow() to create the pop-up window.
   pWindow->piWindowWidget = HelloWindowApp_CreateAndInitImageWidget(
                                pMe,
                                "popups.main" // Image as defined in appinfo.ini
                             );
 
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WExtent extent = {HWA_POPUP_WIDTH, HWA_POPUP_HEIGHT};
      IWIDGET_SetExtent(pWindow->piWindowWidget, &extent);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Popup);
Related information
·                  See Brew MP Widgets Technology Guide: Creating a Widgets application
·                  See Brew MP API Reference

Base version:
Brew MP 1.0
Tested version:
Brew MP 1.0
Phone tested:
No

 

Platform: | Size: 439828 | Author: bluecrest | Hits:

[DocumentsBREW MP电脑配置文档

Description: 想研究BREW MP手机的话,这个文档还是比较重要的。
Platform: | Size: 441570 | Author: suiyuanshizhe | Hits:

[Program docMigrating_Apps_BREW_To_BrewMP

Description: 从 BREW 到 Brew MP 的应用程序移植
Platform: | Size: 1278807 | Author: saloonatic | Hits:

[OtherSpinUI_Brew_MP_Extension_Reference_Documentation.r

Description: SpinUI Brew MP Extension 是一个BREW扩展的集合,用来帮助BREW应用开发者给自己的应用添加复杂的图像效果。-SpinUI Brew MP Extension is a collection of BREW extensions designed to help UI developers to add complex pixel-based graphic effects to their BREW applications, and to assist in basic bitmap operations.
Platform: | Size: 1650688 | Author: sky | Hits:

[BREWBUIW

Description: brew ui widget 2.0 中文开发文档,电子书。ui很漂亮。-brew ui widget 2.0 English developer documentation, e-books. ui very pretty. Very powerful feature
Platform: | Size: 2201600 | Author: 艰苦 | Hits:

[Othertestmenu

Description: It is a BREW MP application. Here a simple menu is created.The application is very simple and i think it will help to develop such kind of application. BR, Shahid
Platform: | Size: 1251328 | Author: Shahid | Hits:

[BREWc_ui_flashplayer

Description: 全新的brew MP平台。此代码在新的brew MP平台上实现了flash UI的播放,而且UI为widget实现。高通最新推出了BMP平台,区别于brew的是,此次提供了并非一个无线二进制环境,而是一个真正的系统。最为令人惊喜的是,居然支持了真机断点调试。-The new brew MP platform. This code in the new brew MP platform for a flash UI of the player, but also achieve the UI for the widget. Qualcomm' s new in BMP platform is different from the brew, this offer is not a wireless binary environment, but a real system. The most pleasant surprise is that actually support the real machine breakpoint debugging.
Platform: | Size: 1794048 | Author: eddy che | Hits:

[Software Engineeringc_visual_studio_primer

Description: brew平台下的工具安装指南,主要是vs2005和brew MP平台的关联-brew platform tools for installation guide, mainly vs2005 and brew MP platform, the association
Platform: | Size: 236544 | Author: jingling | Hits:

[BREWTrig_Application_Primer

Description: This primer is an introduction to Trig application development. A Trig is a Brew MP application whose UI is written in the TrigML markup language.
Platform: | Size: 281600 | Author: Hongmei | Hits:

[Communication-Mobilec_visual_studio_primer

Description: 介绍BREW MP开发流程的,步骤讲解很清晰-Introduction BREW MP development process, the steps are clearly explained. . .
Platform: | Size: 217088 | Author: youdehao | Hits:

[BREWDynamicNodesTree

Description: Very helpful for brew MP development.
Platform: | Size: 2304000 | Author: poppay | Hits:

[BREWMigrating_Apps_BREW_To_BrewMP

Description: this the document for understanding the brew developer how to convert the data from brew to brew mp-this is the document for understanding the brew developer how to convert the data from brew to brew mp
Platform: | Size: 1058816 | Author: poppay | Hits:

[BREWBrew_MP_Persistent_Data_80-DC003-4_A

Description: Brew MP 开发培训文档--持久数据-Brew MP™ Developer Training –Persistent Data
Platform: | Size: 351232 | Author: hopkin | Hits:

[BREWpim_contact

Description: Brew MP 开发实例代码,个人信息数据管理-Brew MP development instance code for PIM
Platform: | Size: 742400 | Author: hopkin | Hits:

[BREWc_vcardapp

Description: Brew MP 开发实例---vcard 访问-Brew MP development instance code-- accessing Vcard
Platform: | Size: 15360 | Author: hopkin | Hits:

[BREWc_dbcapp

Description: Brew MP 开发实例代码---数据库访问-Brew MP development instance---Database
Platform: | Size: 665600 | Author: hopkin | Hits:

[BREWc_persistentdataapp

Description: Brew MP 开发实例代码--持久数据-Brew MP development instance--Persistent data
Platform: | Size: 15360 | Author: hopkin | Hits:

[BREWUsing_SMS

Description: this file present how to use sms in brew mp
Platform: | Size: 126976 | Author: dhalia_2003 | Hits:

[BREWBest_Practices_Tech_Guide

Description: the file contains the best practice for developing brew mp applications
Platform: | Size: 386048 | Author: dhalia_2003 | Hits:

[BREWBrew-MP-Tech---Overview-Full

Description: Brew MP Tech - Overview Fu-Brew MP Tech- Overview Full
Platform: | Size: 5025792 | Author: brick | Hits:
« 12 »

CodeBus www.codebus.net