wiki:pjwin_idea

Version 1 (modified by bennylp, 10 years ago) (diff)

--

PJWIN - Portable Mobile Windowing Toolkit

Objective

Develop a simple, small-footprint GUI toolkit to build simple applications that are portable across platforms, especially mobile platforms.

The exact same GUI source code should be portable across these platforms:

  • Windows
  • Windows Mobile Professional/PocketPC platform (i.e. with touch interface)
  • Windows Mobile Standard/Smartphone? platform (i.e. without touch)
  • Symbian/S60 3rd edition
  • (optional) console application
  • (optional) Qt application

Basic idea

The basic idea is to use XUL-like interface (see XUL, and XUL tutorial), but much more simplified.

Sample interactions:

  1. Describe the window using XUL-like syntax (the code below is all over the place but hopefully you get the idea):
    const char *xml = 
       "<?xml version="1.0"?>
        <window id="mainwnd"
                title="Hello world">
          <label value="Press the button to exit"/>
          <button id="btn_quit" value="Quit"/>
        </window>";
    
  2. Create the window using the XUL XML description:
    window *wnd = create_window(xml);
    
  3. For modal dialog, start the dialog, giving it callback function to receive events from the window:
    do_modal(wnd, &event_handler);
    
  4. Do some code in the event handler:
    void event_handler(window *wnd, const pj_str_t *element, event *event)
    {
       if (pj_strcmp2(element, "btn_quit")==0)
          end_dialog(wnd);
    }
    
  5. And that's it!

The GUI elements

Supported elements:

  • window
  • hbox and vbox
  • spacer
  • label (static text)
  • command bar (will be translated into buttons or menu on interface with touch capability, or into menu on the rest)
  • edit/input control
  • combo box control (advanced)
  • list control (advanced)

Unsupported elements:

  • button (it's only most usable with touch interface)