Mobile interface toolkit

8 views
Skip to first unread message

Sergey Basalaev

unread,
Oct 4, 2013, 1:41:17 PM10/4/13
to Alchemy OS
Mobile interface toolkit (Mint for short) is a successor to libdialog, which provides many common features for graphical applications.
I intend to port all core programs to this library. Brief description of features:
1) Shared appearance settings (themes)
2) Stock of standard icons
3) New and restyled dialogs
4) Event loops
5) Easily implemented fancy menus

Library is already available for downloading [1] [2], documentation is prepared in HTML and PDF formats [3].
[1] Mint library: http://alchemy-os.org/packagedb/2.1/libmint1.html
[3] Documentation: http://alchemy-os.org/docs/api/2.1/

So, details about library

1) It is themeable
I learned that to look good on different phones programs need to use different fonts and icon sizes. Well, now this is configurable! Mint provides convenient access to the global settings program can use. Currently there are only 4 settings, others can be added on demand. These settings are:
* dialog font
* dialog icon size
* list icon size
* icon theme

To change this settings you can edit /cfg/mintprefs or better install graphical tool mintconfig.
You may have noticed that most of these settings are devoted to icons. Which brings us to the second feature:

2) Icon themes
libmint provides a pool of standard icons which you can use in your programs. Currently there are 66 of them. Well, since phones may be limited on memory and storage there are NO icons by default. To get real icons you need to install one or more icon themes. The package archive currently contains one icon theme in three sizes. While installing them be aware of sizes (RMS file system may be very short of space, you've been warned). These are the packages:

icons-oxygen-16 (~40 kB)
icons-oxygen-24 (~60 kB)
icons-oxygen-32 (~100 kB)

Loading needed icon in a program then is a cake:

// reading "file-new" icon of size 16 or closest
themeIcon(FILE_NEW, 16)
// reading "folder" icon in default dialog icon size
themeIcon(FOLDER, SIZE_DIALOG)

3) Dialogs
Mint provides new and restyled dialogs from libdialog. These dialogs also respect settings mentioned above.
Color dialog was rewritten and now should be more convenient.
New Font dialog, obviously, allows to choose font.
File dialog was split in two: OpenFileDialog and SaveFileDialog.
The first only allows to choose existing files while the latter allows to create files and asks confirmation if you try to rewrite existing file.
There's also a set of message dialogs that can be shown using on of showInfo, showError, showWarning - these will not only present text but also a suitable icon.

4) Event loop
Tired of writing loops for ui_wait_event()? Let EventLoop do that for you!
You need just to add functions for desired actions using onShow(), onMenu() and to start it.
Example:

/* MINT hello world. */
use "mint/eventloop"
use "stdscreens"
use "ui"

def main(args: [String]) {
  // create screen
  var msgbox = new MsgBox("Hello, world!")
  // create event loop for it
  var loop = new EventLoop(msgbox)
  // add menu item to exit
  loop.onMenu(new Menu("Ok", 1), loop.quit)
  // start processing of events
  loop.start()
}
5) ActionLists.
ActionList is both a dialog and an event loop in one. Just put into it pairs of string
and function. Then run it. You will see a menu and choosing item in it automatically
calls corresponding function.

Kyle Alexander Buan

unread,
Oct 5, 2013, 10:17:55 PM10/5/13
to alche...@googlegroups.com
Awesome! AlchemyOS is the BEST! Thanks for this lib, Sergey!
> graphical tool *mintconfig*.
> You may have noticed that most of these settings are devoted to icons.
> Which brings us to the second feature:
>
> 2) Icon themes
> libmint provides a pool of standard icons which you can use in your
> programs. Currently there are 66 of them. Well, since phones may be limited
> on memory and storage there are NO icons by default. To get real icons you
> need to install one or more icon themes. The package archive currently
> contains one icon theme in three sizes. While installing them be aware of
> sizes (RMS file system may be very short of space, you've been warned).
> These are the packages:
>
> *icons-oxygen-16* (~40 kB)
> *icons-oxygen-24* (~60 kB)*
> *
> *icons-oxygen-32* (~100 kB)
>
> Loading needed icon in a program then is a cake:
> *
> *
> // reading "file-new" icon of size 16 or closest
> themeIcon(FILE_NEW, 16)
> // reading "folder" icon in default dialog icon size
> themeIcon(FOLDER, SIZE_DIALOG)
>
> 3) Dialogs
> Mint provides new and restyled dialogs from libdialog. These dialogs also
> respect settings mentioned above.
> Color dialog was rewritten and now should be more convenient.
> New Font dialog, obviously, allows to choose font.
> File dialog was split in two: OpenFileDialog and SaveFileDialog.
> The first only allows to choose existing files while the latter allows to
> create files and asks confirmation if you try to rewrite existing file.
> There's also a set of message dialogs that can be shown using on of
> showInfo, showError, showWarning - these will not only present text but
> also a suitable icon.
>
> 4) Event loop
> Tired of writing loops for ui_wait_event()? Let EventLoop do that for you!
> You need just to add functions for desired actions using onShow(), onMenu()
> and to start it.
> Example:
>
> /* MINT hello world. */use "mint/eventloop"use "stdscreens"use "ui"
> def main(args: [String
> <http://alchemy-os.org/docs/api/2.1/libcore/builtins.html#String>]) {
> // create screen
> var msgbox = new MsgBox
> <http://alchemy-os.org/docs/api/2.1/libui/stdscreens.eh.html#MsgBox.new>("Hello,
> world!")
> // create event loop for it
> var loop = new EventLoop
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.new>(msgbox)
> // add menu item to exit
> loop.onMenu
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.onMenu>(new
> Menu <http://alchemy-os.org/docs/api/2.1/libui/ui.eh.html#Menu.new>("Ok",
> 1), loop.quit
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.quit>)
> // start processing of events
> loop.start
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.start>()
> }
>
> 5) ActionLists.
> ActionList is both a dialog and an event loop in one. Just put into it
> pairs of string
> and function. Then run it. You will see a menu and choosing item in it
> automatically
> calls corresponding function.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Alchemy OS discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to alchemy-os+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

Jack_5

unread,
Oct 7, 2013, 4:09:08 AM10/7/13
to alche...@googlegroups.com
How's about using multiple RMS files instead of just one to save data?
According to my knowledge, there is no limit on how much data you can store in RMS, but in one RMS file you can store only 255 kb of data...

Sergey Basalaev

unread,
Oct 8, 2013, 7:21:11 AM10/8/13
to Alchemy OS
2013/10/7 Jack_5 <jac...@asia.com>
How's about using multiple RMS files instead of just one to save data?
According to my knowledge, there is no limit on how much data you can store in RMS, but in one RMS file you can store only 255 kb of data...

Hmm... we could use multiple RMS files as one filesystem but this will require
rewrite of the whole RMS driver (making it incompatible with previous versions).
Alternatively, we can just mount several RMS file systems like one RMS for /res,
one RMS for /bin etc.That way we can gain some extra space for /res but all
icons still will be stored on one RMS.

Jack_5

unread,
Oct 8, 2013, 2:08:37 PM10/8/13
to alche...@googlegroups.com
I think its better to use multiple RMS files. It will allow to save more data.

Because if one rms is used for bin/ directory and one for home/ and so on, then it put limitation on amount of data to be saved in one directory.

Justice Budeli

unread,
Nov 11, 2013, 2:26:31 AM11/11/13
to alche...@googlegroups.com
Is it possible to add javascript rockscript interpretor,so that
alchemy can run javascripts files.
It would be great to run javascripts with alchemy functions.
Its open source,just google rockscript.want to make a bluetooth post
box and bluetooth reverse internet tethering for old phones.

On 10/5/13, Sergey Basalaev <sbas...@gmail.com> wrote:
> graphical tool *mintconfig*.
> You may have noticed that most of these settings are devoted to icons.
> Which brings us to the second feature:
>
> 2) Icon themes
> libmint provides a pool of standard icons which you can use in your
> programs. Currently there are 66 of them. Well, since phones may be limited
> on memory and storage there are NO icons by default. To get real icons you
> need to install one or more icon themes. The package archive currently
> contains one icon theme in three sizes. While installing them be aware of
> sizes (RMS file system may be very short of space, you've been warned).
> These are the packages:
>
> *icons-oxygen-16* (~40 kB)
> *icons-oxygen-24* (~60 kB)*
> *
> *icons-oxygen-32* (~100 kB)
>
> Loading needed icon in a program then is a cake:
> *
> *
> // reading "file-new" icon of size 16 or closest
> themeIcon(FILE_NEW, 16)
> // reading "folder" icon in default dialog icon size
> themeIcon(FOLDER, SIZE_DIALOG)
>
> 3) Dialogs
> Mint provides new and restyled dialogs from libdialog. These dialogs also
> respect settings mentioned above.
> Color dialog was rewritten and now should be more convenient.
> New Font dialog, obviously, allows to choose font.
> File dialog was split in two: OpenFileDialog and SaveFileDialog.
> The first only allows to choose existing files while the latter allows to
> create files and asks confirmation if you try to rewrite existing file.
> There's also a set of message dialogs that can be shown using on of
> showInfo, showError, showWarning - these will not only present text but
> also a suitable icon.
>
> 4) Event loop
> Tired of writing loops for ui_wait_event()? Let EventLoop do that for you!
> You need just to add functions for desired actions using onShow(), onMenu()
> and to start it.
> Example:
>
> /* MINT hello world. */use "mint/eventloop"use "stdscreens"use "ui"
> def main(args: [String
> <http://alchemy-os.org/docs/api/2.1/libcore/builtins.html#String>]) {
> // create screen
> var msgbox = new MsgBox
> <http://alchemy-os.org/docs/api/2.1/libui/stdscreens.eh.html#MsgBox.new>("Hello,
> world!")
> // create event loop for it
> var loop = new EventLoop
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.new>(msgbox)
> // add menu item to exit
> // start processing of events
> loop.start
> <http://alchemy-os.org/docs/api/2.1/mint/mint/eventloop.eh.html#EventLoop.start>()
> }
>
> 5) ActionLists.
> ActionList is both a dialog and an event loop in one. Just put into it
> pairs of string
> and function. Then run it. You will see a menu and choosing item in it
> automatically
> calls corresponding function.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Alchemy OS discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to alchemy-os+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
Sent from my mobile device

Jabnakar Thrall

unread,
Nov 11, 2013, 6:30:17 AM11/11/13
to alche...@googlegroups.com
That would be great. Maybe just port the language? implement it on AlchemyOS binary hehe

wiktorek140

unread,
Nov 11, 2013, 11:27:31 AM11/11/13
to alche...@googlegroups.com
I found a project of js (http://sourceforge.net/projects/rockscript), work correctly on emulator. I think it should be easy to include it into alchemy. I think this should be a lib. When i found a little of time, i try add it into alchemy.

Sergey Basalaev

unread,
Nov 11, 2013, 3:55:12 PM11/11/13
to Alchemy OS

2013/11/11 Justice Budeli <tech1...@gmail.com>

Is it possible to add javascript rockscript interpretor,so that
alchemy can run javascripts files.
It would be great to run javascripts with alchemy functions.
Its open source,just google rockscript.want to make a bluetooth post
box and bluetooth reverse internet tethering for old phones.

Of course it would be great to support more languages in Alchemy, and
even greater to have support for scripting languages like js, lua or python.
But instead of including interpreter at java level I'd prefer porting it to Ether
and making a regular application. Reasons for that:

1) This will make it easier to install/update/bugfix - no need to create new
version of Alchemy OS, just update the corresponding package.

2) You most likely want not only the pure javascript but also bindings
to the external features like file access, graphics, etc... So one should
be able to write extensions for it in both JS and Ether.

Ideally, I do not want to include any external interpreters or third party libraries
in the Java core, on the opposite I want the core midlet to be just code executor
and system functions, everything else being end-user code.

Jabnakar Thrall

unread,
Nov 11, 2013, 8:37:20 PM11/11/13
to alche...@googlegroups.com
thats what I thought, XP.... adding another interpreter would make AlchemyOS "heavier". 


--
Reply all
Reply to author
Forward
0 new messages