builder: Clarify default "swapped" value when "object" is set for signals
authorvanadiae <vanadiae35@gmail.com>
Thu, 24 Feb 2022 22:04:20 +0000 (23:04 +0100)
committervanadiae <vanadiae35@gmail.com>
Thu, 24 Feb 2022 22:04:20 +0000 (23:04 +0100)
I encountered this issue where I casted user_data to my self type, but it
showed me they were actually swapped when I set the "object" signal attribute.
After checking the source code which confirms this, it is a good idea to
properly document that convenient behaviour.

gtk/gtkbuilder.c

index 545699c45c39666df3ab62c71d13d1739a77e35d..8b29eff605bfef47f74a9acf5cd5488688f3f7be 100644 (file)
  * specifies the function to connect to the signal.
  * The remaining attributes, “after”, “swapped” and “object”, have the
  * same meaning as the corresponding parameters of the
- * g_signal_connect_object() or g_signal_connect_data() functions. A
- * “last_modification_time” attribute is also allowed, but it does not
- * have a meaning to the builder.
+ * g_signal_connect_object() or g_signal_connect_data() functions. By
+ * default "swapped" will be set to "yes" if not specified otherwise, in the
+ * case where "object" is set, for convenience. A “last_modification_time”
+ * attribute is also allowed, but it does not have a meaning to the builder.
  *
  * If you rely on `GModule` support to lookup callbacks in the symbol table,
  * the following details should be noted: