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

Search list

[BREWvoicecall

Description: BREW打电话的例子,由Brew OEM开发商提供-called BREW example, OEM developers Brew
Platform: | Size: 314462 | Author: flj | Hits:

[BREWIThread example

Description:

brew中协作式编程的例子


Platform: | Size: 763204 | Author: bluecrest | Hits:

[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:

[BREWtextwin

Description: 一个输出文本的brew例子源码--An output text brew example source code
Platform: | Size: 18432 | Author: 站长 | Hits:

[BREWcppapp

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

[BREWIHtmlviewerdemo

Description: brew开发网页浏览器-Web Browser by Brew
Platform: | Size: 60416 | Author: 彭彭 | Hits:

[BREWcppapp

Description: 用C++进行BREW环境开发下的很好的一个实例。非常适用于初学者。-It is a good example code taht is developed by C++ at the environment of BREW.It is fit of the beginer.
Platform: | Size: 130048 | Author: 将军 | Hits:

[BREWbrew_sms

Description: brew2.0开发,测试示例,应该在开发的时候用的着!-It is an example about test that was made by the brew2.0.It is possible used at the time of developing.
Platform: | Size: 493568 | Author: 杨国冬 | Hits:

[BREWTraining_Code

Description: 高通培训使用的例子代码,对于希望从事brew相关开发的人员值得看看。-Qualcomm training in the use of the example code for the brew want to engage in the development of relevant staff should look at.
Platform: | Size: 148480 | Author: 江枫 | Hits:

[BREWAppleMove

Description: BREW手机平台下的实例,实现苹果的移动。 通过按键盘的 “UP”、“Down”、“Left”、“Right”使整个苹果可以在屏幕上自由移动(Step=1),通过按“*”使苹果回到初始位置(屏幕的中间) 1,苹果是由4个对象组合而成,移动的时候如何成为一个整体 2、作为key事件驱动区分各个按键动作 3、苹果的每一次移动都是以上一次苹果的位置为参考 -BREW mobile platform example, the realization of Apple mobile. According to the keyboard through the "UP", "Down", "Left" and "Right" so that the whole Apple can move freely on the screen (Step = 1), adopted by the "*" Apple back to the initial position (screen middle) 1, Apple is 4 objects combination, the mobile how to be an overall 2, as key distinction between event-driven buttons all three movements, each time Apple's been more than a mobile Apple's position as a reference
Platform: | Size: 411648 | Author: shang | Hits:

[BREWvoicecall

Description: BREW打电话的例子,由Brew OEM开发商提供-called BREW example, OEM developers Brew
Platform: | Size: 514048 | Author: flj | Hits:

[BREWOpenGL_ES_1.0.3_Sample

Description: 在brew上的3D开发的3个example,要在brew2.1上才可以运行...还要OpenGL_ES_extension_1.0.1-brew in the development of 3D three example, in brew2.1 can run on even OpenGL_ES_extension_1.0.1 ...
Platform: | Size: 662528 | Author: fantasy | Hits:

[BREWslider_Demo

Description: 高通brew平台上的BUIW控件中的slider的示例程序-Qualcomm brew on the platform of BUIW slider controls the sample program
Platform: | Size: 373760 | Author: 晏楚男 | Hits:

[BREWmenutext

Description: brew的menu实例,一个很简单的menu-brew the menu example, a very simple menu
Platform: | Size: 413696 | Author: ZZH | Hits:

[BREWBREW_UI_Widgets_1_2

Description: a ppt for brew user interface. very useful .can give you much help-ppt for a brew user interface. Very useful. can give you much help
Platform: | Size: 459776 | Author: 高蕾 | Hits:

[BREWBREW_Browser

Description: 在BREW上用的浏览器代码,很不错的入门的例子。比较简单。-BREW use in the browser code, it is a good example of entry. Relatively simple.
Platform: | Size: 502784 | Author: qq | Hits:

[BREWisms-brew

Description: 这是一个关于brew ISIM的操作的一个小例子,这是一个关于brew ISIM的操作的一个小例子-This is a brew ISIM operation on a small example, this is a brew ISIM operation on a small example of
Platform: | Size: 25600 | Author: lihaorui | Hits:

[BREWrscpooldemo-brew

Description: 这是一个关于brew rscpooldemo操作的小例子-This is a brew rscpooldemo operate on a small example of
Platform: | Size: 65536 | Author: lihaorui | Hits:

[SMSsms

Description: 这是一个在BREW上写的短信的例子,有兴趣的人可以看看。-This is a message written in BREW example, those who are interested can look at.
Platform: | Size: 1964032 | Author: sky | Hits:

[Other Embeded programBREW

Description: 还是Brew的资料,不过这个是基于BUIW开发的实例,计算器-Brew or information, but this is based on the example of the development of BUIW, calculator
Platform: | Size: 210944 | Author: feng | Hits:
« 12 3 4 5 6 »

CodeBus www.codebus.net