# HG changeset patch # User wycc # Date 1238796730 -28800 # Node ID 7d244a85dd68f4ad7725a881bcafb6b27eb3770a # Parent 3d21115297ba0bbd15658141a94af39433f1f38e Change the screen layout to make it more like an usual IDE. diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/MBServer.py --- a/inkscape/firefox/MBServer.py Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/MBServer.py Sat Apr 04 06:12:10 2009 +0800 @@ -472,7 +472,13 @@ def soap_GETDOC(self): try: self.target.generate() - return etree.tostring(self.target.document) + newdoc = deepcopy(self.target.document) + root = newdoc.getroot() + for id,node in self.target.selected.iteritems(): + select = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}select') + select.set('ref', id) + root.append(select) + return etree.tostring(newdoc) except: return traceback.format_exc() import os diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/active-fill.png Binary file inkscape/firefox/content/active-fill.png has changed diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/active-fill.svg --- a/inkscape/firefox/content/active-fill.svg Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/active-fill.svg Sat Apr 04 06:12:10 2009 +0800 @@ -64,18 +64,14 @@ inkscape:groupmode="layer" id="layer1"> - + y="80.543571" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/active-fill.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/active-start.png Binary file inkscape/firefox/content/active-start.png has changed diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/active-start.svg --- a/inkscape/firefox/content/active-start.svg Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/active-start.svg Sat Apr 04 06:12:10 2009 +0800 @@ -72,20 +72,19 @@ sodipodi:rx="14.285714" sodipodi:ry="14.285714" d="M 128.57143,123.79076 A 14.285714,14.285714 0 1 1 99.999999,123.79076 A 14.285714,14.285714 0 1 1 128.57143,123.79076 z" - transform="matrix(0.7,0,0,0.7,14.342634,-4.5390011)" /> - + transform="matrix(0.7,0,0,0.7,14.342634,-4.5390011)" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/active-start.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> + y="80.090363" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/active-start.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/fill.png Binary file inkscape/firefox/content/fill.png has changed diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/fill.svg --- a/inkscape/firefox/content/fill.svg Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/fill.svg Sat Apr 04 06:12:10 2009 +0800 @@ -64,18 +64,14 @@ inkscape:groupmode="layer" id="layer1"> - + y="80.543571" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/fill.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/inkscape.js --- a/inkscape/firefox/content/inkscape.js Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/inkscape.js Sat Apr 04 06:12:10 2009 +0800 @@ -70,7 +70,7 @@ function TextEditor(file) { var editor = document.getElementById('inkscape'); - editor.innerHTML = ""; + editor.innerHTML = ""; this.isInProgress = 0; } @@ -81,8 +81,9 @@ function Inkscape(file) { var ink = document.getElementById('inkscape'); - ink.innerHTML = ""; + ink.innerHTML = ""; this.isInProgress = 0; + this.callback = null; setTimeout("inkscape.fetchDocument()",4000); } @@ -122,6 +123,8 @@ { mbsvg = new MBSVGString(resp.Body[0].GETDOCResponse[0].Result[0].Text); mbsvg.renderUI(); + if (this.callback) + this.callback(mbsvg); var soapBody = new SOAPObject("PUBLISH"); var sr = new SOAPRequest("PUBLISH", soapBody); @@ -215,16 +218,67 @@ SOAPClient.SendRequest(sr, function (resp,arg) {arg.refreshDocument(resp);},this); } -Inkscape.prototype.fetchDocument = function() +Inkscape.prototype.fetchDocument = function(callback) { var soapBody = new SOAPObject("START"); + this.callback = callback var sr = new SOAPRequest("START", soapBody); SOAPClient.Proxy = "http://localhost:19192/"; SOAPClient.SendRequest(sr,function(resp,arg) {arg.refreshDocument(resp);},this); this.isInProgress++; } +/* + * This module is used to define a symbol for the MadButterfly. This function will search for symbol which is defined in the current select object. We will list all SVG elements + * in the left side, multiple variables can be defined at one time. When any element is selected, the defined symbol will be listed in the right side. + * + */ +Inkscape.prototype.MakeSymbol=function() +{ + function callback(mbsvg) { + this.loadSymbolScreen(mbsvg); + } + inkscape.fetchDocument(callback); +} + +Inkscape.prototype.loadSymbolScreen=function (mbsvg) { + // Swap the left side to be the SVG element tree. + var i,l; + + symboldialog.dialog('open'); + l = mbsvg.selected_objects.length; + var jsonobj = [] + for(i=0;i"); + symboldialog.append("
"); + }); function MBSVG(file) { @@ -271,7 +325,7 @@ ss.layer = null; scenes.push(ss); } - if (max < 20) max = 20; + if (max < 20) max = 30; // Collect all layers var nodes = xmlDoc.getElementsByTagNameNS("http://www.w3.org/2000/svg","svg")[0].childNodes; var layers = new Array(); @@ -292,9 +346,17 @@ layers.push(nodes[i]); } } + var select = xmlDoc.getElementsByTagNameNS("http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd","select"); + len = select.length; + selectobjs = []; + for(i=0;i"; for(var j=1;j<=max;j++) cmd = cmd + ""+j+""; @@ -320,17 +382,17 @@ for(var k=0;k"; + cmd = cmd + ""; empty = 0; break; } else if ((n>scenes[k].start)&&(n <= scenes[k].end)) { - cmd = cmd + ""; + cmd = cmd + ""; empty = 0; break; } } if (empty) { - cmd = cmd + ""; + cmd = cmd + ""; } } @@ -389,8 +451,16 @@ } else if (id == 'DeleteScene') { if (inkscape.isInProgress != 0) return; inkscape.deleteScene(currentScene); + } else if (id == 'MakeSymbol') { + if (inkscape.isInProgress != 0) return; + inkscape.MakeSymbol(); } else if (id == 'Save') { project_save(); + } else if (id == 'Test') { + if (project_compile()) { + project_run(); + } else { + } } else { alert(id+' has not been implemented yet'); } @@ -458,6 +528,10 @@ } +function project_compile() +{ +} + function project_showFile(node) { @@ -807,4 +881,7 @@ filedialog.dialog("open"); }); - +$('#frame').draggable(); +$('#btns').draggable({cursor:'crosshair'}); +$('#list').tabs(); +$('#display').tabs(); diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/madbuilder.html --- a/inkscape/firefox/content/madbuilder.html Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/madbuilder.html Sat Apr 04 06:12:10 2009 +0800 @@ -46,13 +46,16 @@ color: blue; padding: 6px 0 4px 18px; /* push text down 1px */ } + .filepanel { + height:700px + } -
+
-
+

Jump Insert @@ -67,9 +70,38 @@

- - -
+ + + + +
+
+ + + +
+
+
+ +
+
+
+
+
+
+
+
+ + +
diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/start.png Binary file inkscape/firefox/content/start.png has changed diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/content/start.svg --- a/inkscape/firefox/content/start.svg Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/content/start.svg Sat Apr 04 06:12:10 2009 +0800 @@ -72,20 +72,19 @@ sodipodi:rx="14.285714" sodipodi:ry="14.285714" d="M 128.57143,123.79076 A 14.285714,14.285714 0 1 1 99.999999,123.79076 A 14.285714,14.285714 0 1 1 128.57143,123.79076 z" - transform="matrix(0.7,0,0,0.7,14.342634,-4.5390011)" /> - + transform="matrix(0.7,0,0,0.7,14.342634,-4.5390011)" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/start.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> + y="80.090363" + inkscape:export-filename="/home/wycc/devel/test/main/MadButterfly/inkscape/firefox/content/start.png" + inkscape:export-xdpi="86.949997" + inkscape:export-ydpi="86.949997" /> diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/template/textmenu/Makefile --- a/inkscape/firefox/template/textmenu/Makefile Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/template/textmenu/Makefile Sat Apr 04 06:12:10 2009 +0800 @@ -1,4 +1,4 @@ -SRC=main.c %f.c +SRC=main.c %n.c OBJ=$(SRC:.c=.o) CFLAGS+=`pkg-config --cflags libmbfly` `pkg-config --cflags pangocairo` LDFLAGS=`pkg-config --libs libmbfly` diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/template/textmenu/app.c --- a/inkscape/firefox/template/textmenu/app.c Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/template/textmenu/app.c Sat Apr 04 06:12:10 2009 +0800 @@ -2,7 +2,7 @@ #include #include "mbapp.h" #include "animated_menu.h" -#include "app.h" +#include "%n.h" void myselect_callback(mb_animated_menu_t *m, int select) { diff -r 3d21115297ba -r 7d244a85dd68 inkscape/firefox/template/textmenu/main.c --- a/inkscape/firefox/template/textmenu/main.c Tue Mar 17 08:31:04 2009 +0800 +++ b/inkscape/firefox/template/textmenu/main.c Sat Apr 04 06:12:10 2009 +0800 @@ -4,7 +4,7 @@ //#include "menu.h" #include "mbapp.h" #include "animated_menu.h" -#include "app.h" +#include "%n.h" char *menus[] = {