how to include size information in SVG_G_ELEMENT

Hi guys,
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen below: <g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to get some feedback from you; I'm hoping that you can give me some directions or offer me solutions.
Thanks!!
-- V. Ogla Sungutay, UI programmer www.lyciasoft.com skype:oglasungutay

On Sep 27, 2010, at 2:50 PM, Ogla Sungutay wrote:
Hi guys,
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen below: <g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to get some feedback from you; I'm hoping that you can give me some directions or offer me solutions.
Thanks!!
Hmmm... the first question is to why you want to do that?
Off hand it sounds like a very complex thing, and most likely not as useful as one might think.

Hi Jon,
I would like to use Inkscape as a GUI builder for Intel's Clutter library. It is not that difficult really, because we can use cairo surfaces as UI elements. The only catch is clutter needs the size of the allocation box BEFORE it does create the cairo handle to be used in drawing.
In the Inkscape UI, when you select a group, the width and height values are shown in the selection toolbox, am I mistaken? So inkscape actually computes the size. I thought with some indirection I can update the Group element with what I need.
On Tue, Sep 28, 2010 at 5:07 AM, Jon Cruz <jon@...18...> wrote:
On Sep 27, 2010, at 2:50 PM, Ogla Sungutay wrote:
Hi guys,
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen
below:
<g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to
get some feedback from you; I'm hoping that you can give me some directions
or offer me solutions.
Thanks!!
Hmmm... the first question is to why you want to do that?
Off hand it sounds like a very complex thing, and most likely not as useful as one might think.

On Tue, 28 Sep 2010 00:50:55 +0300 Ogla Sungutay <ogla@...2470...> wrote:
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen below: <g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to get some feedback from you; I'm hoping that you can give me some directions or offer me solutions.
note that
inkscape --without-gui --query-all somefile.svg
"Lists id,x,y,w,h for all objects" - and it can be invoked from within other programs via the appropriate system() type call quite effectively, it's much faster than actually running inkscape with the GUI. You get text on stdout like:
g5546,195.75278,264.30257,352.58904,352.58905 path5548,195.75278,264.30258,352.58904,352.58904 g5550,195.75278,264.30257,352.58904,352.58904 path5552,195.75278,264.30257,352.58904,352.58904 path5554,233.61326,302.13289,276.91928,276.91926 text5556,203.3647,277.76946,332.10138,329.30381
so it does include groups (gXXXX is a group).
You can even use it from an inkscape python extension :-)
Might not be relevant, but just pointing it out.
Cheers -Terry

Hi Terry,
This is incredibly helpful, it gives me everything I need!!
inkscape --without-gui --query-all somefile.svg
On Tue, Sep 28, 2010 at 12:50 AM, Ogla Sungutay <ogla@...2470...> wrote:
Hi guys,
I need to add the size of the SVG_G_ELEMENT in a custom namespace as seen below: <g inkscape:label="baz" id="foo" myNamespace:width="647" myNamespace:height="400"
This will require some hacking, so before I go into the code, I wanted to get some feedback from you; I'm hoping that you can give me some directions or offer me solutions.
Thanks!!
-- V. Ogla Sungutay, UI programmer www.lyciasoft.com skype:oglasungutay
participants (3)
-
Jon Cruz
-
Ogla Sungutay
-
Terry Brown