Alchemy - The Window Manager
From OpenAlchemy.org
Once the Amida is powered on, the blob is loaded followed by the kernel. After the initialization of the hardware is done by the kernel, the cramfs is loaded followed by the X server. Upon successful start of the X server, Alchemy, the window manager for Amida is started.
Contents |
What is Alchemy?
Virtually everything that appears on screen in X Windows is a window. A Window Manager is one that manages windows and, Alchemy is the window manager for the Amida. Alchemy has been designed and developed completely in-house at PicoPeta Simputers Pvt Ltd. Alchemy has been designed with the following goals in mind.
- The look and feel of Amida’s user interface must be simple and elegant.
- APIs (Application Programmers Interface) must be simple and straight forward.
- APIs for X application as well as Tcl/Tk application must be available.
- Alchemy as a window manager must be themeable.
- Most importantly, the conventions mentioned in the Inter-Client Communication Conventions Manual(ICCCM) are must be adhered to.
Alchemy provides all the above features. In addition, Alchemy is very responsive to the user inputs. The look and feel of Alchemy’s user interface is described in detail in the user manual of the device. This chapter essentially focusses on the APIs provided by Alchemy to the developer community. Theming of Alchemy is described in a separate chapter.
Initialization
All applications in X should call the following function after creating their window, but before mapping it.
- ac_init_app(Display *dpy, Window win);
Building
All X applications should include acctrl.h and link to libacctl.so, i.e, use the flag -lacctl while linking the application. Tk applications are exempted from this.
WM commands
Alchmey commands for X Application
In an X application using ’C’ langauge, all the Window Manager (Alchemy) commands are accessed through ac_control_win as given below.
- void ac control win(int cmd id, char *data, Display *dpy, Window win);
- dpy is a pointer to a display that has already been opened and initialized.
- data is a parameter that certain commands require as described below.
- cmd id is one of the following set of commands available for manipulation of the status bar.
- win is the window ID of self.
| cmd id | C/Tk Command | Description |
|---|---|---|
| 1 | AC_CMD_SET_THEME alchemy theme <themepath> | Dynamically change the theme used by the alchemy window manager. Data should be set to the complete directory path where the new theme can be found. |
| 2 | AC_CMD_EXIT alchemy do exit | Exit alchemy. Probably useful only for debugging. |
| 3 | AC_CMD_PREV alchemy window prev | Switch to previous application in the list of main applications. Tool-bars are not part of this list. |
| 4 | AC_CMD_NEXT alchemy window next | Switch to next application in the list of main applications. Tool-bars are not part of this list. |
| 5 | AC_CMD_SET_FLAGS Not Applicable | Set visibility of various flags |
| 6 | AC_CMD_LAUNCH_APP alchemy launch <appid, launchername, commandline> | Launch the specified appid, application. If already present, shift to that window. |
| 7 | AC_CMD_SET_TITLE_FONT alchmey title_font | Set the font to be used for window title. |
| 8 | AC_CMD_SET_TITLE_JUSTIFY alchmey title_justify <left or right or center> | Set the justification for title label. |
| 9 | AC_CMD_SET_STATUS_MSG alchemy status_msg <status message> | Set the status message to be displayed. |
| 10 | AC_CMD_SET_STATUS_FONT alchemy status_font <page number> | Set the font to be used for status messages. |
| 11 | AC_CMD_STATUS_JUSTIFY alchemy status_justify <page number> | Application preference to change justification of alchemy status message which is set in AC_CMD_SET_STATUS_MSG. |
| 12 | AC_CMD_SET_PAGE_NUM alchemy pagenum <page number > | Set the page number to be displayed in the page number display area. This area is displayed only if the page navigation buttons are enabled. |
| 13 | AC_CMD_SET_PAGE_NUM_FONT alchemy pagenum_font <page num> | Set the font for the page number to be displayed. |
| 14 | AC_CMD_SET_PAGE_NUM_JUSTIFY alchemy pagenum_justify <page num> | Set the justification for the page number to be displayed. |
| 15 | AC_CMD_SET_KEYBOARD_LAYOUT alchemy change_layout <layout> | Change the keyboard layout for the current application. E.g., it can be just a numeric keyboard by default instead of QWERTY |
| 16 | AC_CMD_SET_KEYBOARD_CATEGORY alchemy change_keyboard <category_name> | Change the category of the keyboards. For example, we can have a Hindi or Kannada instead of default English category |
| 17 | AC_CMD_SET_ANNOTATE_KEY alchemy annotatekey <annotation key> | Sets the annotation key, which in conjunction with the annotation template is used to derive the unique key for the annotation file name. |
| 18 | AC_CMD_SET_HELP_KEY alchemy helpkey <help key> | Can set the help page from the help templare by using the help key for the application in use. |
| 19 | AC_CMD_SET_EMAIL_FILE alchemy emailfile <path of the name to email> | Launches the email client, with the specified file as an attachment. |
| 20 | AC_CMD_DEL_ANNOTATION alchemy delete_annotate <annotation key> | Delete annotations referred by the key |
| 30 | AC_CMD_LAYER_NEXT_APP alchemy layer application | Place the next application that is launched in a layer above me |
| 31 | AC_CMD_LAYER_THIS_WIN alchemy layer <window id> (id of window is got from winfo id <path>) | Place a particular window in a layer above me |
| 51 | AC_CMD_SHOW_INPUT alchemy input on | Gets the keyboard icon in the bottom toolbar along with the input method chooser button. |
| 52 | AC_CMD_HIDE_INPUT alchemy input off | Disables the input method launcher button, and the input method chooser button. |
| 53 | AC_CMD_SHOW_ANNOTATE alchemy annotate on | Enables Annotation icon. |
| 54 | AC_CMD_HIDE_ANNOTATE alchemy annotate off | Disables the annotation icon. |
| 55 | AC_CMD_SHOW_EMAIL alchemy email on | Enables visibility of email and one tap buttons. |
| 56 | AC_CMD_HIDE_EMAIL alchemy email off | Disables the email and onetap buttons. |
| 57 | AC_CMD_SHOW_PRINTER alchemy printer on | Shows the printer icon if printer is availible. |
| 58 | AC_CMD_HIDE_PRINTER alchemy printer off | Hides the printer icon. |
| 59 | AC_CMD_SHOW_PAGE_NAV alchemy pagenav on | Shows the page number display area and buttons. |
| 60 | AC_CMD_HIDE_PAGE_NAV alchemy pagenav on | Disables the page navigation buttons and page number display area. |
| 61 | AC_CMD_ENABLE_PAGE_NEXT alchemy enable pagenext | Enable clicking/tapping on the next page button. |
| 62 | AC_CMD_DISABLE_PAGE_NEXT alchemy disable pagenext | Disable clicking/tapping on the next page button. |
| 63 | AC_CMD_ENABLE_PAGE_PREV alchemy enable pageprev | Enable clicking/tapping on the prev page button. |
| 64 | AC_CMD_DISABLE_PAGE_PREV alchemy disable pageprev | Disable clicking/tapping on the prev page button. |
| 65 | AC_CMD_SHOW_RETRACTBAR alchemy retractbar on | Enables the button for the retractable bottom toolbar. |
| 66 | AC_CMD_HIDE_RETRACTBAR alchemy retractbar off | Disables the button for the retractable bottom toolbar. |
| 67 | AC_CMD_SHOW_KEYBOARD alchemy keyboard on | Launches the keyboard in the application. By default it is the QWERTY keyboard |
| 68 | AC_CMD_HIDE_KEYBOARD alchemy keyboard off | Hides the input method |
| 69 | AC_CMD_SHOW_STATUS alchemy status on | Enables the status button |
| 70 | AC_CMD_HIDE_STATUS alchemy status off | Disables the status button |
| 71 | AC_CMD_SWAP_CLOSE_UP alchemy do swapcloseup | Swaps the close button with the up button, and vice-versa. |
| 72 | AC_CMD_SHOW_CLOSE alchemy do showclose | Shows close, disables up |
| 73 | AC_CMD_SHOW_UP alchemy do showup | Shows up, disables close |
| 74 | AC_CMD_PRINTER_STATUS No Tk Equivalent | Inform alchemy that a printer connected or disconnected |
| 75 | AC_CMD_SHOW_SPEAKER alchemy speaker on | Enables display of the flite TTS engine speaker. Flite must have been installed. |
| 76 | AC_CMD_HIDE_SPEAKER alchemy speaker off | Disables display of the flite TTS engine speaker. |
| 77 | AC_CMD_SHOW_VOICE alchemy voice on | Enables display of the voice recorder icon. |
| 78 | AC_CMD_HIDE_VOICE alchemy voice off | Disables display of the voice recorder icon. |
| 79 | AC_CMD_APP_SPEAKS alchemy speaker application | This gives an event for text to speech mechanism and the application has to handle. |
| 80 | AC_CMD_AC_SPEAKS alchemy speaker alchemy | Alchemy handles the text to speech using flite |
| 81 | AC_CMD_SHOW_TICK alchemy do showtick | Shows tick, Disables up and close. |
| 82 | AC_CMD_SHOW_HELP alchemy help on | Shows help icon. |
| 83 | AC_CMD_HIDE_HELP alchemy help off | Hides help icon. |
| 84 | AC_CMD_GRAB_ON alchemy grab on | Grabs background image for annotattion (default). |
| 85 | AC_CMD_GRAB_OFF alchemy grab off | Disables background image grabbing. |
| ewmh_command alchemy window togglefullscreen | Gets the current window into full screen. |
Alchemy commands for Tcl/Tk Applications
Tk API for the above mentioned alchemy commands:
alchemy <command> <parameter> [target window id]
