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

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:

[BREWcppapp

Description: 封装的http和文件存取的c++类例子--C++ class example of encapsulated http and file access
Platform: | Size: 288768 | Author: 站长 | Hits:

[BREWBREW Browser v2.0.0

Description: BREW开发的一个浏览器实例-A web browser sample by BREW
Platform: | Size: 365568 | Author: 张帆 | Hits:

[BREWfstest

Description: 用于测试文件处于最大处或者没有空间时的程序运行情况的源代码。代有DLL和MOD文件。-for testing at the biggest Office documents or no space for the running of the source code. Substituting a DLL file and the MOD.
Platform: | Size: 73728 | Author: 将军 | Hits:

[Other Gamesfruitescape

Description: 这是一款BREW手机游戏,是关于水果的,很有创意的一部游戏,强烈推荐大家下载-This a BREW mobile gaming is on the fruit, a very creative game, we strongly recommend downloading. .
Platform: | Size: 1065984 | Author: 邵永刚 | Hits:

[BREWfileexample

Description: 一个BREW文件操作源程序,实用于初学者-a source file manipulation, applied to beginners
Platform: | Size: 306176 | Author: 刘君 | Hits:

[BREWifile

Description: 事例介绍brew中文件接口的操作,包括读文件、写文件、以及对文件的操作。适合初学者。-stories on File Interface brew operation, including a document reading, writing paper and the paper's operation. For beginners.
Platform: | Size: 599040 | Author: yilin | Hits:

[BREWifile

Description: 基于Brew平台的C语言的文件操作示例代码-Brew platform based on C language sample code file operations
Platform: | Size: 78848 | Author: liang | Hits:

[BREWbrew

Description: brew的开发:brew的组成,mif文件,applet的介绍,brew 应用程序的建立-brew Development: brew composition, mif file, applet
Platform: | Size: 843776 | Author: cloud | Hits:

[Other Embeded programiweb

Description: BREW平台的iweb+imedia实现文件http流下载和实时播放程序-BREW platform iweb+ Imedia file http streaming and real-time player download
Platform: | Size: 1035264 | Author: 韩云锋 | Hits:

[BREWMFileMgr

Description: brew 文件浏览器实现,是纯c编写的,有框架的。-file manager of brew platform.
Platform: | Size: 186368 | Author: lido | Hits:

[BREWifile_brew

Description: 这是一个关于brew 文件操作的小例子,这是一个关于brew 文件操作的小例子-This is a brew file operations on a small example, this is a brew file operations on a small example of
Platform: | Size: 23552 | Author: lihaorui | Hits:

[BREWtest2009

Description: This is a test sig file valid for 2009 year to upload and run brew applications on the phone
Platform: | Size: 2048 | Author: dedKalash | Hits:

[Communication-MobileBREW

Description: BREW平台 以及与之相关的补丁 先装源文件 再装data1 2 4-BREW platform and the associated patches installed before re-loading the source file data1 2 4
Platform: | Size: 45389824 | Author: 帅曦 | Hits:

[Other Embeded programSchedulerApp

Description: Brew开发QSC1110日程表,数据存储采用文件系统,同时有闹钟提醒-Brew development QSC1110 calendar, data storage using file system, at the same time the alarm to remind
Platform: | Size: 46080 | Author: feng | Hits:

[BREWIMenudemo

Description: 手机编程brew的一个列表演示,包含可执行文件-Cell phone programming brew a list of presentations, contains an executable file
Platform: | Size: 54272 | Author: 梦晨 | Hits:

[BREWBREWSDK315SP02

Description: Qualcomm Brew SDK 3.1.5 SP2 install file
Platform: | Size: 20439040 | Author: Se-Hee Whang | Hits:

[OtherBrewResourceManager

Description: This code takes an xml with the file information and generates the brx file to compile brew resources.
Platform: | Size: 15360 | Author: Omoikane | Hits:

[BREWfile

Description: Brew IFile的一般简单应用, Brew IFile的一般简单应用,Brew IFile的一般简单应用-Brew IFile general simple application, Brew IFile general simple application, Brew IFile general simple application, Brew IFile simple application of the general
Platform: | Size: 283648 | Author: 谢鹏 | Hits:

[BREWfs

Description: Brew 文件系统的源代码, 对文件操作有很好的帮助-Brew file system source code, to have a good help file operations
Platform: | Size: 172032 | Author: wang | Hits:
« 12 3 »

CodeBus www.codebus.net