MiniGUI HOWTO

by Wang Shouyan and Lu Gaofeng

Introduction

MiniGUI is a GPLed free software project, led and maitained by Feynman Software (Beijing Feynman Software Technology Co., Ltd.).

It aims to provide a fast, stable, and lightweight Graphics User Interface support system, which is especially fit for real-time embedded systems based-on Linux.

  1. What is MiniGUI?
  2. MiniGUI is a Graphics User Interface support system which runs on Linux or other UNIX-like system. It defines a set of light windowing and GDI (Grahpics Device Interface) APIs for applications. By using them, an application can create multiple windows and/or controls, and can draw in these windows/controls without interfering the others.

    MiniGUI is composed of three libiraries: libminigui (source is in src/), libmgext (ext/), and libvcongui (vcongui/). Libminigui is the core library, which provides windowing and graphics interfaces as well as standard controls. Libmgext is an extension library of libminigui and provides some useful controls and convenient user interface functions, such as `Open File Dialog Box'. Libvcongui provides a virtual console window in which you can run programs in character mode.

    You can configure and compile MiniGUI as one of three run-time modes:

    • "MiniGUI-Threads": A program running on MiniGUI-Threads can create multiple cascaded windows in different threads, and all the windows belong to a single process. MiniGUI-Threads is fit for some real-time systems with simple functionality.
    • "MiniGUI-Lite": A program running on MiniGUI-Lite is an independent process, which can also create multiple windows. MiniGUI-Lite is fit for some complex embedded systems, such as PDAs, Thin-Clients or STBs.
    • "MiniGUI-Standalone": A single process version of MiniGUI.

    Currently, the latest stable version of MiniGUI is version 1.3.0. You can find latest information about MiniGUI and download the source from our home page: http://www.minigui.com

  3. Feature of curren version
  4. MiniGUI version 1.3 offers the following new features:

    • You can compile the resources (bitmaps, icons, and fonts) into the library (libminigui), and there is no need to read the resource configuration information from MiniGUI.cfg.
    • You can compile MiniGUI-Standalone version.
    • We optimized MiniGUI for uClinux.
    • You can configure MiniGUI by using "make menuconfig" command, which gives you a very easy-to-use interface to configure MiniGUI.

Quick Start

Suppose you are the first to install MiniGUI, this section will guide you to download, install and run MiniGUI demo.

  1. Configure MiniGUI running environment
  2. Suppose your linux kernel version is 2.2.xx or 2.4.xx, for running Minigui, you should compile framebuffer support into kernel. For most VESA compatible graphic card, you can do it as following:

    Make sure your graphic card is VESA compatible. Most graphic card is VESA compatible, but some cards integrated onto motherboard may be not, e.g. Intel i810. If it is ,you can use VESA framebuffer driver in the kernel.

    Make sure your kernel have had framebuffer included, and also VESA framebuffer driver.

    If you are using lilo, you should modify /etc/lilo.conf. Insert following line:

    vga=0x0317

    so when linux kernel boot, it will set resolution to 1024x768x16bpp. If your monitor can not reach such a resolution, you can set vga=0x0314, which represent 800x600x16bpp, modified /etc/lilo.conf is like this:

    		boot=/dev/had
                      map=/boot/map
                      install=/boot/boot.b
                      prompt
                      timeout=50
                      linear
                      default=linux
                      image=/boot/vmlinux-2.4.20
                              vga=0x0317
                              label=linux
                              read-only
                              root=/dev/hda6
    
          Run lilo, apply modification, reboot:
    
                 #lilo
                 #reboot
    		

    If you are using grub, should have some differences to set framebuffer support: First, to active framebuffer, you should modify /boot/grup/menu.lst, and add vga=0x3017 to the line which head with "kernel", just like this:

                         default=0
                         timeout=10
                         splashimage=(hd0,0)/boot/grub/splash.xpm.gz
                         title linux-2.4.20(FrameBuffer)
                                 root(hd0,0)
                                 kernel /boot/vmlinux-2.4.20 ro root=/dev/hda1 vga=0x0317
                                 initrd /boot/initrd-2.4.20.img
    		

    Second, reboot the system. After have made VESA FrameBuffer device driver work properly, we can start to install and run MiniGUI. If for any reason you can't use frambuffer, read "How to run MiniGUI on X Window".

  3. Download MiniGUI
  4. Please download the newest vesion of MiniGUI from:http://www.minigui.com

    Libminigui-1.3.0.tar.gz: MiniGUI library sourcecode, include libminigui, libmgext and libvcongui. Minigui-res-1.3.0.tar.gz: MiniGUI resource file, include basic font, icon, bitmap and mouse cursor.

    Mde-1.3.0.tar.gz: MiniGUI demo.

  5. Install resource file
  6. First install resource file, please do it as following:

    • Uncompress minigui-res-1.3.0.tar.gz:
    • 		$ tar xzvf minigui-res-1.3.0.tar.gz
      		
    • It will create minigui-res-1.3.0/ directory. Enter this directory, and run make install as root:
    		              $ su -c 'make install'
                      or
                      $ su
                      $ make install
    		
  7. Configure and compile MiniGUI
    • Uncompress libminigui-1.3.0.tar.gz:
    • $ tar xzvf libninigui-1.3.0.tar.gz
    • Enter directory libminigui-1.3.0/, and run ./configure:
    • $ ./configure
    • Compile and install MiniGUI:
    • $ make; su -c 'make install'
    • By default, MiniGUI library will be installed to /usr/local/lib. You shold make sure this directory has been list in /etc/ld.so.conf, modify /etc/ld.so.conf, and insert /usr/local/lib into it. It should be like this:
    •  
                          /usr/lib
                          /usr/X11r6/lib
                          /usr/local/lib
                                
    • After having installed MiniGUI, run follow command to refresh share library cache:
    • $ su -c ldconfig
  8. Compile and run MiniGUI demo
  9. Having installed MiniGUI library, you are ready to Compile MiniGUI demo, and enjoy the excellent graphic.

    • Uncompress mde-1.3.0.tar.gz:
    • $ tar xzvf mde-1.3.0.tar.gz
    • Enter mde-1.3.0/, configure and compile it:
    • 		              $ cd mde-1.3.0
                        $ ./configure
                        $ make
      		
    • If encounter any error during compiling, go back to 2.4 and check it. If not , can enter mde-1.3.0/mginit and start server of MiniGUI-Lite:
    • 	                $ cd mginit
                        $ ./mginit	
      		

      It will start MiniGUI-Lite server process, and start a virtual console window, you can run common application, such as ls, vi. And also can switch to other directory to run applications of Mnigui. Such as:

       
                          $cd ../gdidemo
                          $ ./gdidemo
                                

      Ok, just enjoy what you have seen, and start your own hacking.

Graphic engine of MiniGUI

In current MiniGUI version, there are five engines available: graphic engine base on VESA FrameBuffer(we coall it NATIVE engine or FBCON engine), SVGALib engine, LibGGI engine, graphic engine base on QVFB and "dumb" graphic engine. NATIVE/FBCON engine has been included in the MinniGUI code, doesn't need extra dependent library, this is the graphic engine we recommend to use. But if install MiniGUI on linux kernel 2.0, you should use SVGALib or LibGGI.

Dependent library of MiniGUI

To install MiniGUI successfully, should know which library is needed. Before compoling MiniGUI, you should make sure have installed the dependent library. Besides using SVGALib and LibGGI need other library, MiniGUI also use some other libraries.

LibTTF and LibT1

This two library provide support for TrueType font and Adobe Type1 font, for MiniGUI ,these two library is optional. If needing support for TrueType and Adobe Type1 font, should install this to library first. The configure script of MiniGUI can check if these two library have been installed, otherwise it will disable support for TrueType and Adobe Type1 font.

LibJPEG, LibPNG and etc.

Other libraries include libjpeg for JPEG image support, libpng for PNG image support, libpthread for POSIX compatible thread support.

MiniGUI configuration options

Totally speaking, MiniGUI configurationg include two phases, the first phase is before compiling, and the second is before running.

  1. compiling configuration
  2. Enter libminigui-1.3.0/ and run this command:

    		 $ ./configure --help
    		

    you will see all configure options ,you can use this options customize your MiniGUI. For example, to disable SVGALib, GIF and TrueType font support, just run:

    		$ ./configure --disable-svgalib --disable-gifsupport --disable-ttfsupport
    		

    on the contrary, you can do it like:

    		$ ./configure --enable-svgalib
    		
    • Common options
    • * --prefix=PREFIX

      This option is to define install path of MiniGUI library, default path si /usr/local. If run: ./configure --prefix=/home/test after "make install", the library, head file and man page will be installed into /home/test/lib, /home/test/include, /home/test/man. This option and -build, --host and -target are very important for cross-compile.

      * --enable-static and --enable-shared

      These two options indicate creating dynamic or static library, if don't need the static library, use --disable-static. This could decrease compiling time.

    • Special options of MiniGUI
    • The following options are all similar to --disable-FEATURE and --enable-FEATURE, use --disable-FEATURE to disable certain functionality, or --enable-FEATURE to enable certain functionality. --disable-FEATURE and --enable-FEATURE are coexist.

                * --enable-lite
      
                This option is to indicate if have MiniGUI-Lite compiled, default is
                YES, also you can use --disable-lite to disable it.
      
                * --enable-micemoveable
      
                To enable using mouse to drag window, default is YES. To forbidden
                mouse dragging, use --disable-micemoveable.
      
                * --enable-flatstyle
      
                Use flat style as entire style of controls, default is NO, but three-
                dimensional style.
      
                * --enable-newgal
      
                Use NEWGAL and NEWGDI interface, default is YES. NEWGAL only support
                linear display model more than 8 bit color, but powerful, for such
                model less than 8 bit, not supported. If you need to support this
                display model, should use old GAL engine, to do it, use -disable-newgal.
      
                * --enable-ep7211ial
      
                --enable-ep7211ial, --enable-adsial, --enable-ipaqial, --enable-vr4181ial, 
              --enable-helioial and --enable-t800ial are different IAL engines for special 
              board, they are: EP7211, ADS Graphics Client (base on StrongARM SA110), 
              VR4181, Helio, T800. If your board isn't in the list, you should write you own 
              IAL engine.  And, you can also use the built-in DUMMY IAL engine to skip this temporarily.
      
                * --enable-textmode
      
                Enable test console in MiniGUI, default is YES, if don't need, disable it.
      
                * --enable-cursor
      
                If your system doesn't have mouse, touch screen, so doesn't need
                cursor support, just disable it, default is YES.
      
                * --enable-rbfsupport
      
                Enable Raw Bitmap Font (RBF) support, default is YES.
      
                * --enable-vbfsupport
      
                Enable Var Bitmap Font (VBF) support, default is YES.
      
                * --enable-qpfsupport
      
                Enable Qt/Embedded Prerendered Font (QPF) support, default is YES.
      
                * --enable-ttfsupport
      
                Enable TrueType font support, default is YES. MiniGUI use FreeType 1.3.x.
      
                * --enable-typelsupport
      
                Enable Adobe Type1 font support, default is YES. MiniGUI use t1for
                Type1 font support.
      
                * --enable-imegb2312
      
                Enable Chinese gb2312 input method support, default is YES. If don't
                need, disable it.
      
                * --enable-tinyscreen		
      

      If you hove a tiny screen , for example, less than 320x240, suggest open it, default is NO.

  3. Running configuration
  4. After running "make install", MiniGUI-3d.cfg is the default configuration, and is installed in /usr/local/etc as MiniGUI.cfg. MiniGUI.cfg includes different sections:

    • system
    • Section system define graphic engine(gal_engine), input engine(ial_engine), mouse device(mdev) and protocol type(mtype).

    • fbcon and qvfb
    • Key defaultmode in section fbcon defines default display mode when using FBCON graphic engine. defaultmode in section qvfb define default display mode when using qvfb engine. Display define which X window display is in use during running qvfb, default is 0.

    • systemfont
    • Section systemfont define MiniGUI system font, these are for menu, caption and control.

    • rawbitmapfonts, varbitmapfonts, qpf, truetypefonts and type1fonts
    • These sections define information for installed font.

    • mouse, event
    • These two sections are for system event disposing.

    • cursorinfo, iconinfo and bitmapinfo
    • Define cursor, icon and system bitmap information for MiniGUI.

    • bgpicture
    • This section define where the picture should be displayed on the background, it can be set to center, upleft, downleft, upright, downright, upcenter, downcenter, vcenterleft, vcenterright, none.

    • mainwinmetrics and windowelementcolors
    • Mainwinmetrics define default size of window element, window element colors define default color of window element.

    • imeinfo
    • This section define number and modules of input method for GB2312.

Applications on MiniGUI

  1. FHAS-EV
  2. FHAS-EV is A Feynman Handheld Application Suite Evaluation Version.

  3. Monqueror
  4. Monqueror is an HTML browser runing on MiniGUI version 1.2.6 or later. It is ported from Konqueror version 1.2, which is a famous browser on KDE. Monqueror provides support for HTTP, HTML, and CSS, but it is lack of support for FTP, SSL, the most important one, JavaScript, and so on.

    Monqueror is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.

  5. MGXine
  6. Mgxine is a multimedia player runing on MiniGUI version 1.2.3 or later. It is based on the famous multimedia player, xine, of version 0.9.12. You can use mgxine to play CD, VCD, DVD, and MP3 files.

    Mgxine is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for mgxine.

  7. FlashPlayer
  8. FlashFlayer is a set of source codes that allow to play Flash movies, capable of playing the Macromedia Flash File Format (SWF).

    FlashFlayer currently runs on most Linux based platforms with the MiniGUI. FlashFlayer was written by HeZhe (hz_1_2_3@sina.com) based on flash-0.4.9 written by Olivier Debon, and add the support of Soundstream character.

    FlashFlayer is released under the GNU Public Licence (GPL).

  9. Expanded KDevelop for MiniGUI
  10. The IDE is based on Kdevelop version 2.1.4, which is a famous C/C++ IDE on KDE. This IDE provides support for establishing, debuging, and mainteining MiniGUI projects. You can also edit the UI of dialogs with Qt designer, and then the IDE will add them into your project automatically.

    This IDE is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.

    You can visit http://www.minigui.com/download/cindex.shtml to download all above binary applications. Of course, you can download all sources from http://www.minigui.com/download/capp.shtml

    Enjoying it :)

FAQS

  1. Can I run MiniGUI on my PC box only with STD VGA 16-color mode supported?
  2. Yes, you can. But you should use MiniGUI version 1.1.0Pre2 or later, and choose the new GAL and GDI. Both MiniGUI-Lite and MiniGUI-Threads can run on our VGA16 GAL engine.

  3. Which engine should choose for my embedded system which is not x86-compliant?
  4. For a no x86-compliant embedded system, such as ARM, StrongARM, MIPS, or PowerPC based system, the only engine on which MiniGUI can run is Native engine. Porting SVGALib and LibGGI to such a system is a very difficult work -- do not try to do this.

  5. Does MiniGUI offer the support for grey LCD with 4bpp (bits per pixel)?
  6. Yes, it offers. It even offers the support for 1bpp and 2bpp LCD. However, you should use the old GAL and GDI, not the new GAL and GDI.

  7. Does MiniGUI support uClinux?
  8. Yes, MiniGUI version 1.3 supports uClinux and optimized for uClinux.

  9. When running a sample in mde, just show:
  10.          "AttachSharedResource: No such file or directory
             Error in step 6: Can not attach shared resource!
             Initialize minigui failure when using /etc/MiniGUI.cfg as cfg file."
    		

    If your MiniGUI is configured Lite version, you must first run mginit in path mde/mginit, then run mde-demos

  11. When running a sample of MiniGUI, just show:
  12.         "GAL ENGINE: Error when opening /dev/fb0: Permission denied. Please 
             check your kernel config......."		
    		

    Your os don't enable FrameBuffer supports. Please check your kernel config and enable it.

  13. When running mginit, computer told you:
  14.         "Error in step2: There is already an instance of minigui.
             Initialize minigui failure when using /usr/local/etc/MiniGUI.cfg as config file"		
    		

    Maybe you have already run mginit or your mginit didn't exit normally.

    If mginit didn't exit normally, please check /var/tmp/ directory, and remove minigui, mginit in /var/tmp, then run mginit again.

    If it doesn't work, reboot computer :P.

Getting help

In the end you might find yourself unable to solve your problems and need help from someone else. The most efficient way is either to ask someone local or in your nearest Linux user group, search the web for the nearest one. you can visit: http://www.minigui.org/cgi-bin/lb5000/leoboard.cgi

This is a forum about minigui, and join minigui mail-list:http://groups.yahoo.com/group/minigui-users/join

Another possibility is to ask on Usenet News in one of the many, many newsgroups available. The problem is that these have such a high volume and noise (called low signal-to-noise ratio) that your question can easily fall through unanswered.

No matter where you ask it is important to ask well or you will not be taken seriously. Saying just my disk does not work is not going to help you and instead the noise level is increased even further and if you are lucky someone will ask you to clarify.

Instead describe your problems in some detail that will enable people to help you.