Editing Documentation/Maemo 5 Developer Guide/Using Multimedia Components/Using Games Start-up Screen

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
The <code>osso-games-startup</code> application is a generic game start-up interface, providing a common [[hildon|hildonized]] user interface view for game start-up control and configuration.
+
The <code>osso-games-startup</code> application is a generic game start-up interface, providing a common hildonized user interface view for game start-up control and configuration.
==Application Functionality ==
==Application Functionality ==
Line 5: Line 5:
To execute the game, the <code>osso-games-startup</code> application needs to be called. The game configuration file must be passed as an argument. Once loaded, <code>osso-games-startup</code> creates a common interface for all games and, if needed, loads a specific plug-in for each game. Games are activated through an auto-activating D-Bus message, which tells the game either to start, restart or to continue. In cases where no clean-up routine within the plug-in exists, it can also start the game to clean its state data. In these cases, the game usually does not open its own window, but kills the state data in the background instead.
To execute the game, the <code>osso-games-startup</code> application needs to be called. The game configuration file must be passed as an argument. Once loaded, <code>osso-games-startup</code> creates a common interface for all games and, if needed, loads a specific plug-in for each game. Games are activated through an auto-activating D-Bus message, which tells the game either to start, restart or to continue. In cases where no clean-up routine within the plug-in exists, it can also start the game to clean its state data. In these cases, the game usually does not open its own window, but kills the state data in the background instead.
-
When the Play button is pressed, the D-Bus service defined in the configuration file is executed. Games that do not use the glib mainloop must integrate some functionality to their mainloop (for more information about games without a GLib mainloop see section [[#Integrating non-GTK+ Games]]).
+
When the Play button is pressed, the D-Bus service defined in the configuration file is executed. Games that do not use the glib mainloop must integrate some functionality to their mainloop (for more information about games without a glib mainloop see section [[#Integrating non-GTK+ Games]]).
The service is called every time any communication between <code>osso-games-startup</code> and the game is needed.
The service is called every time any communication between <code>osso-games-startup</code> and the game is needed.
Line 125: Line 125:
The following code examples illustrate how the Games Start-up screen works, but the best way to learn to use it is to tinker with the game itself. The source code can be used as desired: as a basic skeleton for the game, or simply to gain a better understanding of the game start-up.
The following code examples illustrate how the Games Start-up screen works, but the best way to learn to use it is to tinker with the game itself. The source code can be used as desired: as a basic skeleton for the game, or simply to gain a better understanding of the game start-up.
-
Because the plug-in and osso-games-startup are written with GTK+-2.0, they must include <code>startup_plugin.h</code> from <code>osso-games-startup</code>. In addition, GConf is used to save the user settings. [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
Because the plug-in and osso-games-startup are written with GTK+-2.0, they must include <code>startup_plugin.h</code> from <code>osso-games-startup</code>. In addition, GConf is used to save the user settings. crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 136: Line 136:
</source>
</source>
-
The following example illustrates the labels for retrieving information at GConf: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the labels for retrieving information at GConf: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 156: Line 156:
</source>
</source>
-
The following example illustrates some global variables: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates some global variables: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 185: Line 185:
</source>
</source>
-
The implemented functions of the plug-in must be sent to osso-games-startup: in this case, a <code>GTK_SPIN_BUTTON</code> and a <code>GTK_CHECK_ITEM</code>. If the plug-in has no specific menu, <code>load_menu</code> and <code>update_menu</code> must be <code>NULL</code> [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The implemented functions of the plug-in must be sent to osso-games-startup: in this case, a <code>GTK_SPIN_BUTTON</code> and a <code>GTK_CHECK_ITEM</code>. If the plug-in has no specific menu, <code>load_menu</code> and <code>update_menu</code> must be <code>NULL</code> crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 198: Line 198:
</source>
</source>
-
The following example illustrates the initializing plug-in that informs the application that there is a plug-in: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the initializing plug-in that informs the application that there is a plug-in: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 204: Line 204:
</source>
</source>
-
The following example illustrates the function that initializes the widgets that localize the osso-games-startup standard buttons: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that initializes the widgets that localize the osso-games-startup standard buttons: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 262: Line 262:
</source>
</source>
-
The following example illustrates the function that is responsible for using GConf to store the user preferences (as is recommended, because the back-up application stores the GConf database): [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that is responsible for using GConf to store the user preferences (as is recommended, because the back-up application stores the GConf database): crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 277: Line 277:
</source>
</source>
-
The following example illustrates the function that initializes the game-specific plug-in menu, which is between the Game and Close submenus of osso-games-startup: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that initializes the game-specific plug-in menu, which is between the Game and Close submenus of osso-games-startup: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 328: Line 328:
</source>
</source>
-
The following example illustrates the function that is called when any configuration is performed in the menu. This function updates the <code>GTK_SPIN_BUTTON</code> (level change) or the <code>GTK_CHECK_MENU_ITEM</code> (sound change). [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that is called when any configuration is performed in the menu. This function updates the <code>GTK_SPIN_BUTTON</code> (level change) or the <code>GTK_CHECK_MENU_ITEM</code> (sound change). crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 346: Line 346:
</source>
</source>
-
The following example illustrates the function that is called to update the menu level option, when the user chooses the level using the <code>GTK_SPIN_BUTTON</code>: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that is called to update the menu level option, when the user chooses the level using the <code>GTK_SPIN_BUTTON</code>: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 372: Line 372:
</source>
</source>
-
The following example illustrates the function that handles changes to the sound setup: [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that handles changes to the sound setup: crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">
Line 387: Line 387:
</source>
</source>
-
The following example illustrates the function that is called by <code>osso-games-startup</code>, if necessary. [https://vcs.maemo.org/svn/maemoexamples/tags/maemo_5.0/crazyparking/src/plugin/plugin.c crazyparking/src/plugin/plugin.c]
+
The following example illustrates the function that is called by <code>osso-games-startup</code>, if necessary. crazyparking/src/plugin/plugin.c
<source lang="c">
<source lang="c">

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)