]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/gui/gtk/OFObject+GLibThread.h
Add and use -[OFObject performSelectorOnGLibThread:]
[jubjub.git] / src / gui / gtk / OFObject+GLibThread.h
diff --git a/src/gui/gtk/OFObject+GLibThread.h b/src/gui/gtk/OFObject+GLibThread.h
new file mode 100644 (file)
index 0000000..00098af
--- /dev/null
@@ -0,0 +1,47 @@
+#import <ObjFW/OFObject.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int _OFObject_JubGlibThread_reference;
+#ifdef __cplusplus
+}
+#endif
+
+/**
+ * @brief A category that provides methods for running selectors
+ *       on the GLib Thread
+ */
+@interface OFObject (JubGLibThread)
+/**
+ * @brief Performs the specified selector on the GLib thread.
+ *
+ * @param selector The selector to perform
+ */
+- (void)performSelectorOnGLibThread: (SEL)selector;
+
+/**
+ * @brief Performs the specified selector on the GLib thread with the specified
+ *       object.
+ *
+ * @param selector The selector to perform
+ * @param object The object that is passed to the method specified by the
+ *              selector
+ */
+- (void)performSelectorOnGLibThread: (SEL)selector
+                        withObject: (id)object;
+
+/**
+ * @brief Performs the specified selector on the GLib thread with the specified
+ *       objects.
+ *
+ * @param selector The selector to perform
+ * @param object1 The first object that is passed to the method specified by the
+ *              selector
+ * @param object2 The second object that is passed to the method specified by
+ *               the selector
+ */
+- (void)performSelectorOnGLibThread: (SEL)selector
+                        withObject: (id)object1
+                        withObject: (id)object2;
+@end