| 1 | = PJWIN - Portable Mobile Windowing Toolkit = |
| 2 | |
| 3 | == Objective == |
| 4 | |
| 5 | Develop a simple, small-footprint GUI toolkit to build simple applications that are portable across platforms, especially mobile platforms. |
| 6 | |
| 7 | The '''exact same''' GUI source code should be portable across these platforms: |
| 8 | - Windows |
| 9 | - Windows Mobile Professional/PocketPC platform (i.e. with touch interface) |
| 10 | - Windows Mobile Standard/Smartphone platform (i.e. without touch) |
| 11 | - Symbian/S60 3rd edition |
| 12 | - (optional) console application |
| 13 | - (optional) Qt application |
| 14 | |
| 15 | == Basic idea == |
| 16 | |
| 17 | The basic idea is to use XUL-like interface (see [http://www.mozilla.org/projects/xul/ XUL], and [https://developer.mozilla.org/en/XUL_Tutorial XUL tutorial]), but much more simplified. |
| 18 | |
| 19 | Sample interactions: |
| 20 | |
| 21 | 1. Describe the window using XUL-like syntax (the code below is all over the place but hopefully you get the idea): |
| 22 | {{{ |
| 23 | const char *xml = |
| 24 | "<?xml version="1.0"?> |
| 25 | <window id="mainwnd" |
| 26 | title="Hello world"> |
| 27 | <label value="Press the button to exit"/> |
| 28 | <button id="btn_quit" value="Quit"/> |
| 29 | </window>"; |
| 30 | }}} |
| 31 | 1. Create the window using the XUL XML description: |
| 32 | {{{ |
| 33 | window *wnd = create_window(xml); |
| 34 | }}} |
| 35 | 1. For modal dialog, start the dialog, giving it callback function to receive events from the window: |
| 36 | {{{ |
| 37 | do_modal(wnd, &event_handler); |
| 38 | }}} |
| 39 | 1. Do some code in the event handler: |
| 40 | {{{ |
| 41 | void event_handler(window *wnd, const pj_str_t *element, event *event) |
| 42 | { |
| 43 | if (pj_strcmp2(element, "btn_quit")==0) |
| 44 | end_dialog(wnd); |
| 45 | } |
| 46 | }}} |
| 47 | 1. And that's it! |
| 48 | |
| 49 | |
| 50 | == The GUI elements == |
| 51 | |
| 52 | Supported elements: |
| 53 | * window |
| 54 | * hbox and vbox |
| 55 | * spacer |
| 56 | * label (static text) |
| 57 | * command bar (will be translated into buttons or menu on interface with touch capability, or into menu on the rest) |
| 58 | * edit/input control |
| 59 | * combo box control (advanced) |
| 60 | * list control (advanced) |
| 61 | |
| 62 | Unsupported elements: |
| 63 | * button (it's only most usable with touch interface) |
| 64 | |
| 65 | |
| 66 | |