Abstract:
Methods and systems for graphical user interface (GUI) presentation. First, an application comprising a GUI is executed. The application triggers an analyzer analyzing a description file depicting attributes of components of the GUI. The analyzer provides and stores the attributes in a data structure. When a GUI component is to be displayed, the application utilizes a standardized control interface independent of various display drivers to display the GUI component according to the stored attributes.

Description:
BACKGROUND  
       [0001]     The invention relates to computer techniques, and in particular, to methods and computers for presenting graphical user interface.  
         [0002]     In programming, a graphical user interface (GUI) is typically composed by combining an application program interface (API) of an operating system (OS) with text data. The combination of GUI attributes and different language text into computer programs may affect program runtime efficiency and readability, and make maintenance thereof difficult. For example, after a program is compiled, any change of text data therein requires compiling the program again, which is very inconvenient. Additionally, different OSs provide different APIs, so GUI code executable on one OS may not be compatible with another OS, thus, requiring modification to conforming to the API of the latter OS.  
       SUMMARY  
       [0003]     Accordingly, methods and systems of graphical user interface presentation are provided.  
         [0004]     An exemplary embodiment of a method of graphical user interface (GUI) presentation is implemented in an embedded system comprising a display, a driver controlling the display, an application, an analyzer, a description file, and a portable layer providing a standard interface for different display drivers. The application comprising a GUI is executed. The application triggers the analyzer analyzing the description file depicting attributes of components of the GUI. The analyzer provides the attributes subsequently stored in a data structure. When a GUI component is to be displayed, the application issues a first instruction conforming to the standard interface for displaying the GUI component according to the stored attributes. The portable layer provides a second instruction conforming to the driver of the display according to the first instruction. The driver displays the GUI component on the display according to the second instruction and attributes of the GUI component.  
         [0005]     An exemplary embodiment of an embedded system comprises a display, a driver controlling the display, an application, a description file, an analyzer, and a portable layer. The application comprises a GUI. The description file depicts attributes of components of the GUI. The application triggers the analyzer analyzing the description file to provide the attributes subsequently stored in a data structure. When a GUI component is to be displayed, the application provides a first instruction conforming to a standard interface for displaying the GUI component according to the stored attributes. The portable layer provides the standard interface for different display drivers and issues a second instruction conforming to the driver of the display according to the first instruction. The driver displays the GUI component on the display according to the second instruction and attributes of the GUI component.  
     
    
     DESCRIPTION OF THE DRAWINGS  
       [0006]     The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:  
         [0007]      FIG. 1  is a block diagram of an exemplary embodiment of an embedded system;  
         [0008]      FIG. 2  is flowchart of an exemplary embodiment of a method for Graphical User Interface;  
         [0009]      FIG. 3  is a schematic diagram of a description file;  
         [0010]      FIG. 4  is a schematic diagram of a language file;  
         [0011]      FIG. 5  is a schematic view of GUI components displayed on a display based on attributes of the description file in  FIG. 3  and the language file in  FIG. 4 ;  
         [0012]      FIG. 6  is a schematic diagram of a description file;  
         [0013]      FIG. 7  is a schematic diagram of a language file; and  
         [0014]      FIG. 8  is a schematic view of GUI components displayed on a display based on attributes of the description file in  FIG. 6  and the language file in  FIG. 7 . 
     
    
     DETAILED DESCRIPTION  
       [0015]     Methods and systems of graphical user interface presentation are provided. The methods for graphical user interface can be implemented in embedded systems, such as mobile phones, Personal Digital Assistants (PDAs), and video game consoles.  
         [0016]     In  FIG. 1 , a method for graphical user interface is implemented in embedded system  10 . Portable layer  2 , driver  3  controlling display  5 , and analyzer  9  may be implemented by computer programs or electrical circuits. Application  12  comprising GUI  11  can generate components of GUI  11  in various execution statuses and reflect operations on the GUI components. Generation of GUI components is described later.  
         [0017]     Description file  6  and language file  7  are two different files external to application  12  and may conform to extensible markup language (XML) or other formats analyzable by analyzer  9 . Description file  6  depicts attributes of components of GUI  11 . Portable layer  2  provides a standard interface for different display drivers.  
         [0018]     With reference to  FIG. 2 , a processor of embedded system  10  executes application  12  (step S 2 ). Application  12  registers essential callback function for subsequent invocation by analyzer  9  and initiates analyzer  9  (step S 4 ).  
         [0019]     Analyzer  9  analyzes description file  6  to provide attributes of the GUI components (step S 8 ). The attributes are subsequently stored in data structure  8  which may comprise a tree data structure. Description file  6  comprises default text of the GUI components, such as “Country”, “China”, “Japan”, “U.S.”, “OK”, and “Cancel” enclosed by tags in  FIG. 3 . Language file  7  comprises text for substituting the default text, such as Chinese characters in  FIG. 4 . The text in language file  7  and the default text may respectively belong to different languages.  
         [0020]      FIGS. 3 and 4  show a description file and a language file conforming to XML, wherein the tags therein are defined in advance. In row L 9 , &lt;meta&gt; depicts common attributes of description file  6 . For example, [charset=“UTF-8”] states that the description file is encoded with Universal Transformation Format 8 bit (UTF-8) encoding scheme. [lang-src=“Chinese.lang”] represents that content, Chinese.lang of  FIG. 4 , is to be imported. The font type, size, and text color of the GUI components are to conform to the definition in row L 10 , except for those individually defined in the description file. The &lt;display&gt; tag in row L 12  depicts attributes of the GUI components. For example, configuration attributes [xBeg=“50” yBeg=“50” xEnd=“100” yEnd=“100”] indicate boundary coordinates of the GUI components, which may be relative or absolute coordinates. The &lt;text&gt;, &lt;select&gt;, and &lt;button&gt; tags respectively depict text, list, and button components, wherein configuration attributes thereof may be included. For example, a &lt;text&gt; tag comprises [xBeg=“10” yBeg=“10”]; a &lt;select&gt; tag comprises [style=“3” maxlist=“3”] indicating a list style and the number of options in a list.  
         [0021]     The &lt;language&gt; tag in  FIG. 4  indicates a language type. Analyzer  9  determines whether to load language file  7  (step S 10 ). If so, analyzer  9  analyzes language file  7  (step S 12 ) and substitutes the default text with the text analyzed (step S 14 ). For example, analyzer  9  can locate text of other language in language file  7  to substitute for the default text in description file  6  according to [id] in  FIGS. 3 and 4 . If not, analyzer  9  analyzes language file  7  (step S 11 ) and description file  6  continuously. When the analysis is complete, analyzer  9  stores the analysis results in data structure  8  and may invoke the register callback functions to provide essential data and initialize GUI components (step S 20 ). For example, attributes of list U 2  in  FIG. 5  are described in row L 14 -L 18  of  FIG. 3  and row L 24 -L 29  in  FIG. 4  and stored as attributes  81  in data structure  8 .  
         [0022]     When a GUI component (such as list U 2 ) of application  12  is to be displayed, application  12  provides a first instruction conforming to the standard interface for displaying the GUI component according to the stored attributes (such as attributes  81  corresponding to row L 14 -L 18  of  FIG. 3  and row L 24 -L 29  in  FIG. 4 ) (step S 22 ).  
         [0023]     Portable layer  2  provides a second instruction conforming to a format required by the driver  3  according to the first instruction (step S 24 ). Since portable layer  2  provides a standard interface for different display drivers, the GUI codes of application  12  for displaying GUI  11  are compatible with those of different display drivers.  
         [0024]     After receiving the second instruction, driver  3  displays the GUI component (such as list U 2 ) on display  5  according to the second instruction and the attributes (such as attributes  81 ) of the GUI component (step S 26 ).  
         [0025]     As shown in  FIG. 5 , GUI components are displayed on display  5  based on attributes of the description file in  FIG. 3  and the language file in  FIG. 4 . Text component U 1  corresponds to &lt;text&gt; tags with [id] attributes of “country” in the description file in  FIG. 3  and the language file in  FIG. 4  (in rows L 13  and L 24 ), and the default text “Country” of text component U 1  has been replaced by Chinese characters. GUI components U 1 -U 4  are respectively text, list, and two button components, the layout attributes of which are based on corresponding tags (in rows L 13 -L 20 ), and the default text of which is replaced by text in the corresponding tags (in rows L 24 -L 31 ).  
         [0026]     The layout of GUI components may be adjusted according to the selected country without re-compiling application  12 . When the description file of  FIG. 3  is modified to  FIG. 6 , GUI components are displayed on display  5  based on attributes of the description file in  FIG. 6  and the language file of  FIG. 7 , as shown in  FIG. 8 . In  FIG. 6 , [lang-src=“English.lang”] in row L 33  indicates that English.lang of  FIG. 7  is to be imported. The layout of GUI components U 5 -U 8  is based on corresponding tags (in rows L 37 -L 44 ), the default text of which is replaced by text in the corresponding tags (in rows L 48 -L 55 ). The order of options (rows L 49 -L 53 ) following the &lt;select&gt; tag in  FIG. 7  (the language file) is different from the order of options (rows L 38 -L 42 ) following the &lt;select&gt; tag in  FIG. 6  (the description file). Thus, after the options and the text in the language file replace the options and the text in the description file, GUI component U 6  is displayed based on the option order in the language file, the text of which is English.  
         [0027]     Thus, a description file can be modified to change appearance of GUI components without re-compiling an application program. Moreover, a portable layer can be modified to enable execution of the application on different OSs without rewriting.  
         [0028]     While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.