Commit c095eeae authored by Kjell Ahlstedt's avatar Kjell Ahlstedt

Put _WRAP_VFUNC in protected sections

parent 78101fa7
......@@ -202,6 +202,7 @@ public:
_WRAP_PROPERTY("state", Glib::VariantBase)
_WRAP_PROPERTY("state-type", Glib::VariantType)
protected:
#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
_WRAP_VFUNC(Glib::ustring get_name() const, "get_name", keep_return)
......
......@@ -136,6 +136,7 @@ public:
_WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed", detail_name action_name)
protected:
_WRAP_VFUNC(bool has_action(const Glib::ustring& name) const, "has_action")
#m4 _CONVERSION(`std::vector<Glib::ustring>',`gchar**',`g_strdupv(const_cast<gchar**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data()))')
......
......@@ -182,7 +182,7 @@ public:
*/
Glib::RefPtr<SimpleAction> add_action_radio_integer(const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state);
protected:
#m4 _CONVERSION(`Glib::RefPtr<Action>', `GAction*', `Glib::unwrap($3)')
_WRAP_VFUNC(Glib::RefPtr<Action> lookup_action(const Glib::ustring& name) const, "lookup_action", refreturn)
......
......@@ -113,6 +113,7 @@ public:
_WRAP_METHOD(bool is_tagged(gpointer source_tag) const, g_async_result_is_tagged)
protected:
// The compiler cannot find an unwrap() for ObjectBase, because
// ObjectBase::BaseObjectType is not declared.
//#m4 _CONVERSION(`Glib::RefPtr<Glib::ObjectBase>',`GObject*',__CONVERT_REFPTR_TO_P)
......
......@@ -48,6 +48,7 @@ public:
_WRAP_METHOD(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags flags, gsize& bytes_read, gsize& bytes_written), g_converter_convert, errthrow)
_WRAP_METHOD(void reset(), g_converter_reset)
protected:
#m4 _CONVERSION(`gsize*',`gsize&',`*($3)')
_WRAP_VFUNC(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags flags, gsize& bytes_read, gsize& bytes_written), "convert", errthrow)
......
......@@ -57,6 +57,7 @@ public:
_WRAP_METHOD(void set_object(const Glib::RefPtr<Gio::DBus::Object>& object), g_dbus_interface_set_object)
protected:
_WRAP_VFUNC(Glib::RefPtr<InterfaceInfo> get_info() const, "get_info")
_WRAP_VFUNC(Glib::RefPtr<Gio::DBus::Object> get_object() const, "get_object")
......
......@@ -65,6 +65,7 @@ public:
_WRAP_SIGNAL(void interface_added(const Glib::RefPtr<Gio::DBus::Interface>& iface), "interface_added")
_WRAP_SIGNAL(void interface_removed(const Glib::RefPtr<Gio::DBus::Interface>& iface), "interface_removed")
protected:
#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
_WRAP_VFUNC(Glib::ustring get_object_path() const, "get_object_path", keep_return)
......
......@@ -156,6 +156,7 @@ public:
_WRAP_SIGNAL(void eject_button(), eject_button, newin "2,20")
_WRAP_SIGNAL(void stop_button(), stop_button)
protected:
//_WRAP_VFUNC(Glib::ustring get_name() const, get_name)
//Careful of ref-counting: //_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, get_icon)
//_WRAP_VFUNC(bool has_volumes() const, has_volumes)
......
......@@ -2398,9 +2398,9 @@ public:
_IGNORE(g_file_replace_contents_async)
_WRAP_METHOD(bool supports_thread_contexts() const, g_file_supports_thread_contexts)
protected:
// *** vfuncs ***
//_WRAP_VFUNC(Glib::RefPtr<File> dup() const, "dup")
......
......@@ -55,10 +55,11 @@ public:
#m4 _CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, Event event_type), "changed")
//_WRAP_VFUNC(bool cancel(), cancel);
_WRAP_PROPERTY("rate-limit", int)
_WRAP_PROPERTY("cancelled", bool)
protected:
//_WRAP_VFUNC(bool cancel(), cancel);
};
} // namespace Gio
......
......@@ -77,6 +77,7 @@ public:
_WRAP_METHOD(Glib::VariantBase serialize() const, g_icon_serialize, newin "2,48")
_WRAP_METHOD(static Glib::RefPtr<Icon> deserialize(const Glib::VariantBase& value), g_icon_deserialize, newin "2,48")
protected:
//_WRAP_VFUNC(guint hash() const, "hash")
// TODO: also kind of related to equal() being virtual or not,
......
......@@ -56,6 +56,7 @@ protected:
_WRAP_METHOD(void init(const Glib::RefPtr<Cancellable>& cancellable{?}),
g_initable_init, errthrow)
protected:
_WRAP_VFUNC(bool init(const Glib::RefPtr<Cancellable>& cancellable, GError** error), "init")
};
......
......@@ -93,6 +93,7 @@ public:
_WRAP_SIGNAL(void items_changed(guint position, guint removed, guint added), "items-changed", no_default_handler, newin "2,50")
protected:
_WRAP_VFUNC(GType get_item_type(), "get_item_type")
_WRAP_VFUNC(guint get_n_items(), "get_n_items")
_WRAP_VFUNC(gpointer get_item(guint position), "get_item")
......
......@@ -54,6 +54,7 @@ public:
_WRAP_METHOD(gssize read_nonblocking(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}), g_pollable_input_stream_read_nonblocking, errthrow)
protected:
_WRAP_VFUNC(bool can_poll() const, "can_poll")
_WRAP_VFUNC(bool is_readable() const, "is_readable")
......
......@@ -55,6 +55,7 @@ public:
_WRAP_METHOD(gssize write_nonblocking(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}), g_pollable_output_stream_write_nonblocking, errthrow)
protected:
_WRAP_VFUNC(bool can_poll() const, "can_poll")
_WRAP_VFUNC(bool is_writable() const, "is_writable")
......
......@@ -56,8 +56,8 @@ public:
_WRAP_METHOD(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), g_remote_action_group_activate_action_full)
_WRAP_METHOD(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), g_remote_action_group_change_action_state_full)
protected:
#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)')
_WRAP_VFUNC(void activate_action_full(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), "activate_action_full")
_WRAP_VFUNC(void change_action_state_full(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), "change_action_state_full")
};
......
......@@ -59,6 +59,7 @@ public:
//TODO: Document the exception in the C API: https://bugzilla.gnome.org/show_bug.cgi?id=509990#c1
protected:
//_WRAP_VFUNC(goffset tell() const, tell)
//_WRAP_VFUNC(goffset can_seek() const, can_seek)
//_WRAP_VFUNC(goffset seek(goffset offset, Glib::SeekType type, const Glib::RefPtr<Cancellable>& cancellable, GError** error), seek)
......
......@@ -59,6 +59,7 @@ public:
_WRAP_METHOD(gsize get_size() const, g_socket_control_message_get_size)
_WRAP_METHOD(void serialize(gpointer data), g_socket_control_message_serialize)
protected:
//TODO: The deserialize vfunc does not have a GSocketControlMessage for its
//first parameter so it is difficult to wrap.
//_WRAP_VFUNC(Glib::RefPtr<SocketControlMessage> deserialize(int level, int type, gsize size, gpointer data), "deserialize")
......
......@@ -79,6 +79,7 @@ public:
// Write-only and construct-only
//_WRAP_PROPERTY("private-key-pem", std::string)
protected:
#m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr<const SocketConnectable>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
_WRAP_VFUNC(TlsCertificateFlags verify(const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<const TlsCertificate>& trusted_ca) const, "verify")
......
......@@ -90,6 +90,7 @@ public:
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(bool accept_certificate(const Glib::RefPtr<const TlsCertificate>& peer_cert, TlsCertificateFlags errors), "accept_certificate")
protected:
_WRAP_VFUNC(bool handshake(const Glib::RefPtr<Cancellable>& cancellable), "handshake", errthrow)
_WRAP_VFUNC(void handshake_async(const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}, int io_priority{.} = Glib::PRIORITY_DEFAULT), "handshake_async", slot_name slot, slot_callback SignalProxy_async_callback)
......
......@@ -87,6 +87,7 @@ public:
_WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificate_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_for_handle_finish, errthrow)
protected:
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<TlsCertificate>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr<const SocketConnectable>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GTlsInteraction*',`const Glib::RefPtr<TlsInteraction>&',`Glib::wrap($3, true)')
......
......@@ -66,8 +66,6 @@ public:
_WRAP_METHOD(TlsInteractionResult ask_password_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_interaction_ask_password_finish, errthrow)
_WRAP_METHOD(TlsInteractionResult invoke_ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_ask_password, errthrow)
_WRAP_METHOD(TlsInteractionResult invoke_request_certificate(const Glib::RefPtr<TlsConnection>& connection, TlsCertificateRequestFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_invoke_request_certificate, errthrow)
_WRAP_METHOD(TlsInteractionResult request_certificate(const Glib::RefPtr<TlsConnection>& connection, TlsCertificateRequestFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}), g_tls_interaction_request_certificate, errthrow)
......@@ -76,7 +74,7 @@ public:
_WRAP_METHOD(TlsInteractionResult request_certificate_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_interaction_request_certificate_finish, errthrow)
protected:
#m4 _CONVERSION(`GTlsPassword*',`const Glib::RefPtr<TlsPassword>&',`Glib::wrap($3, true)')
_WRAP_VFUNC(TlsInteractionResult ask_password(const Glib::RefPtr<TlsPassword>& password, const Glib::RefPtr<Cancellable>& cancellable), "ask_password", errthrow)
_WRAP_VFUNC(void ask_password_async(const Glib::RefPtr<TlsPassword>& password, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.}), "ask_password_async", slot_name slot, slot_callback SignalProxy_async_callback)
......
......@@ -62,6 +62,7 @@ public:
_WRAP_PROPERTY("flags", Flags)
_WRAP_PROPERTY("warning", Glib::ustring)
protected:
#m4 _CONVERSION(`gsize*', `gsize&', `*($3)')
_WRAP_VFUNC(const guchar* get_value(gsize& length) const, "get_value")
......
......@@ -156,6 +156,7 @@ public:
_WRAP_SIGNAL(void changed(), changed)
_WRAP_SIGNAL(void removed(), removed)
protected:
//_WRAP_VFUNC(std::string get_name(), get_name)
//_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon(), get_icon)
//_WRAP_VFUNC(std::string get_uuid(), get_uuid)
......
......@@ -75,7 +75,8 @@ public:
_WRAP_SIGNAL(void drive_eject_button(const Glib::RefPtr<Drive>& drive), drive_eject_button)
_WRAP_SIGNAL(void drive_stop_button(const Glib::RefPtr<Drive>& drive), drive_stop_button)
//TODO: Use ListHandle?
protected:
//TODO: Use ListHandler?
//_WRAP_VFUNC(GList* get_volumes(), get_volumes)
//_WRAP_VFUNC(GList* get_mounts(), get_mounts)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment