Beispiel #1
0
        static void Main(string[] args)
        {
            Globals.NativeNamespace  = "Ogre";
            Globals.ManagedNamespace = "Mogre";

            MetaDefinition meta = new MetaDefinition(@"..\..\..\cpp2java\build\meta.xml", "Mogre");

            meta.AddAttributes(@"..\..\Attributes.xml");

            //check if auto directories exists, and create it if needed
            if (!Directory.Exists(@"..\..\..\..\Main\include\auto"))
            {
                Directory.CreateDirectory(@"..\..\..\..\Main\include\auto");
            }

            if (!Directory.Exists(@"..\..\..\..\Main\src\auto"))
            {
                Directory.CreateDirectory(@"..\..\..\..\Main\src\auto");
            }


            Wrapper wrapper = new Wrapper(meta, @"..\..\..\..\Main\include\auto", @"..\..\..\..\Main\src\auto", "Mogre", "Ogre");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(wrapper));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Globals.NativeNamespace  = "Ogre";
            Globals.ManagedNamespace = "Mogre";

            MetaDefinition meta = new MetaDefinition(@"..\..\..\cpp2java\build\meta.xml", "Mogre");

            meta.AddAttributes(@"..\..\Attributes.xml");

            Wrapper wrapper = new Wrapper(meta, @"..\..\..\Mogre\include\auto", @"..\..\..\Mogre\src\auto", "Mogre", "Ogre");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(wrapper));
        }
Beispiel #3
0
        public Form1()
        {
            InitializeComponent();

            Globals.NativeNamespace  = "OIS";
            Globals.ManagedNamespace = "MOIS";

            MetaDefinition meta = new MetaDefinition("../../../cpp2java/build/meta.xml", "MOIS");

            meta.AddAttributes("../../Attributes.xml");

            _wrapper = new Wrapper(meta, "../../../../include/auto", "../../../../src/auto", "MOIS", "OIS");

            for (int i = 0; i < _wrapper.IncludeFiles.Count; i++)
            {
                lstTypes.Items.Add(_wrapper.IncludeFiles.Keys[i]);
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            if (!File.Exists(META_XML_FILE))
            {
                MessageBox.Show("The file \"Meta.xml\" doesn't exist. You need to run \"cpp2java\" to create it first.", "Error");
                return;
            }

            MetaDefinition meta = new MetaDefinition(META_XML_FILE, "Ogre", "Mogre",
                                                     new MogreConstructFactory(), new MogreCodeStyleDef());

            try
            {
                meta.AddAttributes(ATTRIBUTES_FILE);
            }
            catch (InvalidAttributeException e)
            {
                MessageBox.Show("Invalid attribute found: " + e.Message, "Error");
                return;
            }

            //check if auto directories exists, and create it if needed
            if (!Directory.Exists(INCLUDES_DEST_DIR))
            {
                Directory.CreateDirectory(INCLUDES_DEST_DIR);
            }

            if (!Directory.Exists(SRC_DEST_DIR))
            {
                Directory.CreateDirectory(SRC_DEST_DIR);
            }


            Wrapper wrapper = new Wrapper(meta, INCLUDES_DEST_DIR, SRC_DEST_DIR);

            if (args.Length > 0)
            {
                // Command line mode - parse arguments.
                if (args.Length == 1 && args[0] == "produce")
                {
                    wrapper.IncludeFileWrapped += delegate(object sender, IncludeFileWrapEventArgs e)
                    {
                        Console.WriteLine(e.IncludeFile);
                    };
                    wrapper.GenerateCodeFiles();
                }
                else
                {
                    Console.Write(
                        "Invalid command\n\n" +
                        "Usage: AutoWrap.exe <command>\n\n" +
                        "Supported Commands\n" +
                        "==================\n\n" +
                        "    produce    Produces Mogre auto-generated files (equivalent to pressing the \"Produce\" button in the GUI).\n" +
                        "\n"
                        );
                }
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new AutoWrap(wrapper));
            }
        }