<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Ok, so we have:<br>
    1) default widgetbehavior external: binary compatible<br>
    <br>
    2) custom widgetbehavior external, compiled against Pd-l2ork and
    used in Vanilla: big problems when external tries to initialize
    extra member of struct<br>
    <br>
    3) custom widgetbehavior external, compiled against Vanilla and used
    in Pd-l2ork: the last member of the widgetbehavior will initialize
    to 0 (or NULL, can't remember which).  Pd-l2ork checks for that and
    will fall back to the old displacefn callback, not only avoiding a
    crash but also successfully displacing the object.<br>
    <br>
    So, technically, Pd-l2ork is binary incompatible with Pd Vanilla. 
    Yet this has no consequence for objects that inherit widgetbehavior
    from t_text, which is the vast majority of external objects.<br>
    <br>
    Additionally, Pd Vanilla's API for defining custom widget behaviors
    is so woefully inadequate that externals like Toxy didn't even<br>
    survive the GUI refactoring.  And even simple GUI externals like
    pddplink must add their own custom interface because there's<br>
    no mouseover behavior defined in the core widgetbehaviors.  (Nor is
    there a standard way to define custom widgetbehaviors.)<br>
    <br>
    Additionally-- all those custom ways of bypassing the widgetbehavior
    callbacks inside externals _must_ be rewritten when<br>
    changing gui toolkits anyway.  Some do crazy things like writing a
    tcl proc in the c string, and I don't see any sensible way to<br>
    write a compatibility layer to handle that.<br>
    <br>
    Going forward there are only two options I see:<br>
    * Pd Vanilla gets rid of tcl strings in its C code and standardizes
    on my parameterized gui messaging interface<br>
    * Pd community standardizes on the HOA wrapper stuff for GUI
    externals (porting existing external GUI objects to use it), and
    Pd-l2ork writes a binding to make that wrapper work with the nw.js
    port.<br>
    <br>
    The latter makes the most sense to me.  I'll port the HOA wrapper to
    Pd-l2ork on the off chance the Pd community decides on<br>
    that as a standard for writing GUI externals.<br>
    <br>
    -Jonathan<br>
    <br>
    <blockquote
cite="mid:1007702446.4544443.1438117682637.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:16px">
        <div id="yui_3_16_0_1_1438115262035_3892" dir="ltr"><span><br>
          </span></div>
        <div id="yui_3_16_0_1_1438115262035_3892" dir="ltr"><span><br>
          </span></div>
        <br>
        <div class="qtdSeparateBR"><br>
          <br>
        </div>
        <div class="yahoo_quoted" style="display: block;">
          <div style="font-family: HelveticaNeue, Helvetica Neue,
            Helvetica, Arial, Lucida Grande, sans-serif; font-size:
            16px;">
            <div style="font-family: HelveticaNeue, Helvetica Neue,
              Helvetica, Arial, Lucida Grande, sans-serif; font-size:
              16px;">
              <div dir="ltr"> <font face="Arial" size="2"> On Tuesday,
                  July 28, 2015 4:13 PM, Ivica Ico Bukvic
                  <a class="moz-txt-link-rfc2396E" href="mailto:ico@vt.edu"><ico@vt.edu></a> wrote:<br>
                </font> </div>
              <br>
              <br>
              <div class="y_msg_container">On 07/27/2015 01:28 PM,
                Charles Z Henry wrote:
                <div class="yqt5073255200" id="yqtfd37915"><br
                    clear="none">
                  > On Mon, Jul 27, 2015 at 12:08 PM, Jonathan Wilkes
                  via Pd-list<br clear="none">
                  > <<a moz-do-not-send="true" shape="rect"
                    ymailto="mailto:pd-list@lists.iem.at"
                    href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>>
                  wrote:<br clear="none">
                  ><br clear="none">
                  >> Background info: Pd-l2ork has an extra member
                  at the _end_ of the<br clear="none">
                  >> t_widgetbehavior struct.  This member is used
                  to do accelerated displacing<br clear="none">
                  >> of a selection of objects in Pd.<br
                    clear="none">
                  > This type of modification isn't meant to be
                  binary compatible in both<br clear="none">
                  > directions.  Your Pd-Vanilla externals with the
                  Vanilla<br clear="none">
                  > t_widgetbehavior struct will not work in
                  Pd-l2ork, because the struct<br clear="none">
                  > is smaller.<br clear="none">
                  ><br clear="none">
                  > When Pd-l2ork tries to access those elements off
                  the end of the<br clear="none">
                  > t_widgetbehavior struct, it should seg fault.</div>
                <br clear="none">
                <br clear="none">
                Since pd-l2ork is compiled with a different
                widgetbehavior and assigns <br clear="none">
                all new objects by default a null value to additional
                widgetbehaviors, <br clear="none">
                unless 3rd-party external explicitly somehow overrides
                widgetbehavior, <br clear="none">
                this will not crash. The only situation where I think it
                may crash is if <br clear="none">
                a 3rd party external tries to copy an object and tries
                to allocate <br clear="none">
                memory for a specific widgetbehavior size, which seems
                questionable <br clear="none">
                since externals should not have to worry about
                widgetbehavior size and <br clear="none">
                IIRC this part is instantiated inside core pd routines.<br
                  clear="none">
                <br clear="none">
                Best,<br clear="none">
                <br clear="none">
                Ico<br clear="none">
                <br clear="none">
                ><br clear="none">
                > _______________________________________________<br
                  clear="none">
                > <a moz-do-not-send="true" shape="rect"
                  ymailto="mailto:Pd-list@lists.iem.at"
                  href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a>
                mailing list<br clear="none">
                > UNSUBSCRIBE and account-management -> <a
                  moz-do-not-send="true" shape="rect"
                  href="http://lists.puredata.info/listinfo/pd-list"
                  target="_blank"><a class="moz-txt-link-freetext" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a></a><br
                  clear="none">
                <br clear="none">
                <br clear="none">
                -- <br clear="none">
                Ivica Ico Bukvic, D.M.A.<br clear="none">
                Associate Professor<br clear="none">
                Computer Music<br clear="none">
                ICAT Senior Fellow<br clear="none">
                DISIS, L2Ork<br clear="none">
                Virginia Tech<br clear="none">
                School of Performing Arts - 0141<br clear="none">
                Blacksburg, VA 24061<br clear="none">
                (540) 231-6139<br clear="none">
                <a moz-do-not-send="true" shape="rect"
                  ymailto="mailto:ico@vt.edu" href="mailto:ico@vt.edu">ico@vt.edu</a><br
                  clear="none">
                <a class="moz-txt-link-abbreviated" href="http://www.performingarts.vt.edu">www.performingarts.vt.edu</a><br clear="none">
                disis.music.vt.edu<br clear="none">
                l2ork.music.vt.edu
                <div class="yqt5073255200" id="yqtfd77994"><br
                    clear="none">
                  <br clear="none">
                </div>
                <br>
                <br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>