GithubHelp home page GithubHelp logo

Generate signals about gir HOT 10 CLOSED

gtk-rs avatar gtk-rs commented on August 28, 2024
Generate signals

from gir.

Comments (10)

gkoz avatar gkoz commented on August 28, 2024

I'm still undecided about where exactly the signals belong. If they are generated alongside other functions, perhaps xxxSignals traits are unnecessary, just put them into xxxExt?

Also we should probably fix callback_guard! to not require importing the struct.

from gir.

EPashkin avatar EPashkin commented on August 28, 2024

Currently signals trait implemented with bound IsA<ComboBox> + IsA<Object>.

from gir.

gkoz avatar gkoz commented on August 28, 2024

Yeah the IsA<Object> is required to get ToGlibPtr<*mut GObject> but it's harmless as a bound because all objects implement it.

from gir.

EPashkin avatar EPashkin commented on August 28, 2024

Other that bound don't see any problem with implementing in xxxExt or in same impl for childless class.

from gir.

gkoz avatar gkoz commented on August 28, 2024

Generating correct trampoline signatures might require finishing the ffi_ng branch. Eventually I'd like the trampoline signatures to match C exactly (no f: &Box<Fn(...)>, but rather cast user_data: gpointer to &Box<Fn(...)>).

from gir.

gkoz avatar gkoz commented on August 28, 2024

It's worse than that: signal definitions seem to routinely omit c:type attributes:

      <glib:signal name="accel-activate" detailed="1">
...
        <parameters>
          <parameter name="acceleratable" transfer-ownership="none">
            <doc xml:space="preserve">the object on which the accelerator was activated</doc>
            <type name="GObject.Object"/>
          </parameter>
          <parameter name="keyval" transfer-ownership="none">
            <doc xml:space="preserve">the accelerator keyval</doc>
            <type name="guint" c:type="guint"/>
          </parameter>
          <parameter name="modifier" transfer-ownership="none">
            <doc xml:space="preserve">the modifier combination of the accelerator</doc>
            <type name="Gdk.ModifierType"/>
          </parameter>
        </parameters>
      </glib:signal>

from gir.

EPashkin avatar EPashkin commented on August 28, 2024

If it omit only for glib-related types then its not big problem

from gir.

gkoz avatar gkoz commented on August 28, 2024

Speaking of signals, I'm yet again considering adding Borrow<T> and BorrowMut<T> wrappers, that forget their contents on destruction, and from_glib_borrow transfer mode so callback parameters could truly be borrowed without touching refcounts or copying boxed types (e.g. GdkEvent).

from gir.

EPashkin avatar EPashkin commented on August 28, 2024

Signals with no-recurse could take FnMut instead of Fn.

from gir.

EPashkin avatar EPashkin commented on August 28, 2024

All child issues was closed, so I also close this

from gir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.