1. 17 Dec, 2018 1 commit
    • Benjamin Berg's avatar
      binding: Clarify the use of g_object_unref() to remove a binding · f5e1e169
      Benjamin Berg authored
      Conceptually the binding is kept alive as long as both the source and
      target exist. This means that an API user needs to take some care to
      either hold a reference or only use a pointer to the binding as long as
      also holding references to both objects.
      
      Clarify the documentation a bit.
      f5e1e169
  2. 16 Aug, 2018 1 commit
    • Christoph Reiter's avatar
      g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373 · 0319dac0
      Christoph Reiter authored
      g_object_bind_property() (transfer none) returns a GBinding with an existing internal
      reference which is active as long as the "binding" is. This allows to optionally use
      the binding without any memory management, as it will remove itself when it is no longer
      needed.
      
      There are currently three ways to remove the "binding" and as a result the reference:
      
      1) Either the source or target dies and we get notified by a weakref callback
      2) The user unrefs the binding until it is destroyed (which is semi-legal,
         but worked and is used in the test suite)
      3) The user calls g_binding_unbind()
      
      In case (3) the problem was that it always calls unref even if the "binding" is already
      gone, leading to crashes when called from bindings multiple times.
      In #1373 and !197 it was noticed that a function always unrefs which would be a
      "transfer full" annotation, but the problem here is that it should only remove the
      ref when removing the "binding" and the annotation should stay "transfer none".
      
      As a side effect of this fix it is now also possible to call g_binding_unbind() multiple
      times where every call after the first is a no-op.
      
      This also adds explicit tests for case (1) and (3) - only case (3) is affected by this change.
      0319dac0
  3. 25 Jul, 2018 1 commit
  4. 01 Jan, 2018 1 commit
  5. 24 May, 2017 1 commit
  6. 10 Apr, 2017 1 commit
  7. 22 Nov, 2016 1 commit
  8. 04 Jun, 2015 3 commits
  9. 14 May, 2015 2 commits
  10. 12 Mar, 2015 1 commit
  11. 17 Mar, 2014 1 commit
  12. 20 Feb, 2014 1 commit
  13. 01 Feb, 2014 2 commits
  14. 31 Jan, 2014 2 commits
  15. 06 Oct, 2013 1 commit
    • Dan Winship's avatar
      Fix overloading of "source" and "target" terminology in GBinding · 8e17040c
      Dan Winship authored
      GBindingTransformFunc called its arguments "source_value" and
      "target_value", but in the transform_from function of a bidirectional
      binding, "source_value" comes from the target object, and
      "target_value" comes from the source object, which quickly gets
      confusing if you need to use g_binding_get_source(), etc, in the
      function.
      
      Of course developers can call their transform function arguments
      whatever they want, but many will copy from the headers/docs to start
      out, so use less confusing names here ("from_value" and "to_value").
      
      Also, fix the documentation to describe the bidirectional case
      correctly.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=709440
      8e17040c
  16. 12 Jun, 2013 2 commits
  17. 02 May, 2013 1 commit
  18. 05 Mar, 2012 1 commit
  19. 18 Oct, 2011 1 commit
  20. 22 Sep, 2011 1 commit
  21. 09 Jun, 2011 2 commits
  22. 08 Jun, 2011 1 commit
  23. 15 Mar, 2011 2 commits
  24. 04 Aug, 2010 1 commit
    • Emmanuele Bassi's avatar
      binding: Add a default marshaller for the closure API · 4bc9654c
      Emmanuele Bassi authored
      The g_object_bind_property_with_closures() function should set a
      marshaller if the two GClosures don't have one already. This simplifies
      the caller code and avoids duplication.
      
      We need to add a new marshaller to the gmarshal.list matching the
      signature of the GBindingTransformFunc function.
      4bc9654c
  25. 03 Aug, 2010 3 commits
  26. 07 Jul, 2010 1 commit
  27. 06 Jul, 2010 1 commit
  28. 23 Jun, 2010 1 commit
  29. 16 Jun, 2010 1 commit
    • Emmanuele Bassi's avatar
      binding: Use a hash table · 33aa4b4c
      Emmanuele Bassi authored
      Since an object instance might have a lot of bindings, using a list
      might become a performance issue when removing them. Using a simple
      hash table guarantees constant time lookup, which is the most common
      operation.
      33aa4b4c
  30. 15 Jun, 2010 1 commit