public void ProcessSingleSource(BindingForm form) { //Initialize the stream for the current class form.SourceCodeStream = new MemoryStream(); // Initialize the IOManager for current Form form IOManager = new StreamIOManager(form.SourceCodeStream); // Constructor WriteConstructors(form); // InitComponents WriteInitComponents(form); // Show function WriteText(form.Class + "::" + "Show() {"); WriteText(Utils.Tabs(1) + "window->show();"); WriteText("}\n"); // Close function WriteText(form.Class + "::" + "Close() {"); WriteText(Utils.Tabs(1) + "window->close();"); WriteText("}\n"); // Hide function WriteText(form.Class + "::" + "Hide() {"); WriteText(Utils.Tabs(1) + "window->hide();"); WriteText("}\n"); // Signal callbacks WriteSignalsCallback(form); // Write to file IOManager.StreamToFile(SourcePath + CurrentForm.Class + ".cpp"); }
private void BuildHeader(BindingForm form) { //Initialize the stream for the current class form.HeaderCodeStream = new MemoryStream(); // Initialize the IOManager for current Form form IOManager = new StreamIOManager(form.HeaderCodeStream); // Head WriteHead(CurrentForm.Class); // Public methods and vars WriteConstructor(form.Class); WriteConstructor(form.Class, "Glib::Dispatcher *dispatcher"); WriteVariable(new Utils.CppVariable("Gtk::Window", "window", true)); WritePrototype("void", "Show"); WritePrototype("void", "Hide"); WritePrototype("void", "Close"); // Private members WriteText(Utils.Tabs(1) + "private:"); //Widgets WriteWidgetStruct(); WritePrototype("void", "Init"); //TODO CALLBACKS SIGNAL WriteSignalsCallback(form); // Write to file IOManager.StreamToFile(SourcePath + CurrentForm.Class + ".h"); }