Example #1
0
int click_menu(void) {
    switch (selected) {
        case 0:
            new_game();
        break;
        case 1:
            show_highscores(SCORE_NOMESSAGE);
        break;
        case 2:
            show_tutorial();
        break;
        case 3:
            show_credits();
        break;
        case 4:
            return 1;
        break;
    }
    return 0;
}
Example #2
0
int main (int argc, char **argv)
{
	axlError   * error;
	char      ** paths;
	int          iterator;

	/* init exarg library */
	exarg_install_arg ("version", "v", EXARG_NONE,
			   "Shows version info");
	exarg_install_arg ("out-dir", "o", EXARG_STRING, 
			   "Configures the output directory to place stub and skeletons generated. Default value, if not provided, is \"out\", starting from the current directory.");
	exarg_install_arg ("disable-autoconf", "a", EXARG_NONE,
			   "Disables autoconf files generation. By default, activated.");
	exarg_install_arg ("only-client", "c", EXARG_NONE,
			   "Only produces the client connector, the stub library used to interface with the XML-RPC component. By default, the client stub is generated.");
	exarg_install_arg ("only-server", "s", EXARG_NONE,
			   "Only produces the server stub, the XML-RPC component that is receiving the invocation. By default, the server stub is generated.");
	exarg_install_arg ("xdl-format", "x", EXARG_NONE,
			   "Instruct the tool to expect and process only XDL formated files. This option is useful because the tool fails into parse IDL format if XDL parsing fails, getting not proper errors if a XDL format was defined. This option is not compatible with --idl-format.");
	exarg_install_arg ("idl-format", "i", EXARG_NONE,
			   "Instruct the tool to expect and process only IDL formated files");
	exarg_install_arg ("out-server-dir", NULL, EXARG_STRING, "Allows to fully configure server output source code. This is not the same as --out-dir which is a directory where is placed both products.");
	exarg_install_arg ("out-stub-dir", NULL, EXARG_STRING, "Allows to fully configure stub output source code. This is not the same as --out-dir which is a directory where is placed both products.");
	exarg_install_arg ("disable-main-file", NULL, EXARG_NONE, "Server side component option. It allows to disable creating a main.c file, allowing to produce a custom one. This option is useful while trying to create XML-RPC components mixed with other profiles");
	exarg_install_arg ("to-xml", NULL, EXARG_NONE, "Makes the IDL input file to be translated into XML");

	exarg_install_arg ("add-search-path", NULL, EXARG_STRING, "Allows to configure a list of directories (separated by ;) that are added to the search path. This allows to locate DTD files required by the tool.");

	
	/* configure headers to be showed */
	exarg_add_usage_header  (HELP_HEADER);
	exarg_add_help_header   (HELP_HEADER);
	exarg_post_help_header  (POST_HEADER);
	exarg_post_usage_header (POST_HEADER);	

	/* init and parse arguments */
	exarg_parse (argc, argv);

	if (exarg_is_defined ("xdl-format") && 
	    exarg_is_defined ("idl-format")) {
		fprintf (stderr, "error: --xdl-format and --idl-format options are incompatible.");

		/* do nothing */
		return -1;
	}

	/* init vortex ctx */
	ctx = vortex_ctx_new ();
	vortex_support_init (ctx);

	/* do not use the add_search_path_ref version to force
	   xml-rpc-gen library to perform a local copy path */
	xml_rpc_support_add_search_path (".");

	/* add additional search path */
	if (exarg_is_defined ("add-search-path")) {
		paths    = axl_stream_split (exarg_get_string ("add-search-path"), 1, ";");
		iterator = 0;
		while (paths[iterator]) {
			/* log and add path */
			xml_rpc_report ("adding search path: %s", paths[iterator]);
			xml_rpc_support_add_search_path (paths[iterator]);
			
			/* update iterator */
			iterator++;
		} /* end while */

		/* free vstring */
		axl_freev (paths);
	} /* end if */

	/* install search paths */
	xml_rpc_support_add_search_path_ref (vortex_support_build_filename (INSTALL_DIR, NULL));

	/* init the axl library and load the DTD */
	axl_init ();
	
	/* load the DTD XML-RPC definition */
	dtd = axl_dtd_parse (XML_RPC_DTD, -1, &error);
	if (dtd == NULL) {
		/* show error found */
		fprintf (stderr, "error: unable to load dtd file '%s', check your installation, \n%s\n",
			 "xml-rpc.dtd", axl_error_get (error));
		axl_error_free (error);

		/* terminate xml-rpc-gen tool */
		xml_rpc_gen_finish ();
		return -1;
	}
	
	/* check and show program version */
	if (exarg_is_defined ("version")) {
		/* show current version */
		show_version ();

		/* terminate xml-rpc-gen tool */
		xml_rpc_gen_finish ();
		return 0;
	}

	/* check the number of parameters */
	if (exarg_get_params_num () > 0) {
		/* a xdl file was received */
		xml_rpc_gen_compile ();

		/* terminate the xml-rpc-gen tool */
		xml_rpc_gen_finish ();
		return 0;
	}

	/* show mini tutorial */
	show_tutorial ();

	/* terminate xml-rpc-gen tool */
	xml_rpc_gen_finish ();
	return 0;
}
Example #3
0
void
on_start_but_tutorial_clicked (GtkButton * button, gpointer user_data)
{
  show_tutorial ();
  on_start_but_close_clicked (button, NULL);
}
Example #4
0
void
on_assembler_tutorial1_activate (GtkMenuItem * menuitem, gpointer user_data)
{
  show_tutorial ();
}