<br><br><div class="gmail_quote">On Fri, Nov 13, 2009 at 11:20 PM, Deepayan Sarkar <span dir="ltr"><<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Nov 13, 2009 at 1:04 PM, Michael Lawrence <<a href="mailto:lawremi@gmail.com">lawremi@gmail.com</a>> wrote:<br>
<br>
>> It would also be useful to have an existing C++ class wrapped<br>
>> directly, as with the Qt classes. How much work is involved in having<br>
>> that set up? This must be a common enough problem.<br>
>><br>
><br>
> This is a problem and is a major hang-up for qtpaint. Essentially, we need<br>
> to generate the smoke metadata/bindings for every class we define in C++.<br>
> Otherwise, instances of the class are not compatible with Smoke (which is<br>
> usually important when you are extending a Qt class).<br>
<br>
</div>So basically, there's some manual work that needs to be done for each<br>
new class to be made available. Do you have a sense of how much work<br>
it would be to:<br>
<br>
(1) Create a new package with smoke bindings (say that produces a new<br>
"module" like Qt)<br>
<br></blockquote><div><br>With qtpaint, I'm trying to figure out the minimal amount of work necessary. It won't be that bad, if it's well documented. Just need to copy over a lot of boilerplate and modify the right files. I'd like to do more sharing, especially with qtbase, but R does not make it so easy. For example, we'd have to compile the smokegenerator separately for each package. If I could find that within some 'bin' directory in qtbase it would be a lot cleaner. <br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(2) Add a new class to that package.<br>
<div></div></blockquote><div><br>This would only require adding a single element to an XML file.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div> <br></div></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
> For qtpaint, I'm working on getting the infrastructure in place for<br>
> generating Smoke for some of the classes (like Layer), though I think I'll<br>
> still just directly bind the painting interface, since Painter just derives<br>
> from QObject, and we do not need those methods.<br>
<br>
</div>Sounds good.<br>
<div class="im"><br>
>> >> o Related question: Let's say I want to manipulate a QWidget in<br>
>> >> native code; e.g.<br>
>> >><br>
>> >> In R:<br>
>> >><br>
>> >> edit <- Qt$QTextEdit()<br>
>> >><br>
>> >> The in C++:<br>
>> >><br>
>> >> QTextEdit *editor = getPointer(edit);<br>
>> >> RSyntaxHighlighter *highlighter =<br>
>> >> new RSyntaxHighlighter(editor->document());<br>
>> >><br>
>> >> unwrapQWidget() doesn't work obviously, as it uses the old model.<br>
>> >> What would be the equivalent in the new world? If this is<br>
>> >> available, then we probably get some flexibility in using both the<br>
>> >> old and new models together, even if we can't easily make new C++<br>
>> >> classes available in R.<br>
>> >><br>
>> >><br>
>> ><br>
>> > This would be unwrapSmoke().<br>
<br>
</div>This seems to work. I've checked in a few changes in qtbase to export<br>
this, please take a look and make sure I haven't screwed anything up<br>
(or added unnecessary things).<br>
<font color="#888888"><br></font></blockquote><div><br>Looks good.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font color="#888888">
-Deepayan<br>
</font></blockquote></div><br>