Valac think that getters are always owned by the struct

This commit is contained in:
LAGonauta 2021-03-02 07:30:47 -03:00
parent 8856fcbceb
commit 3d9dcbcf87
3 changed files with 15 additions and 12 deletions

View file

@ -34,11 +34,11 @@ winrtWindowsUINotificationsToastNotification* winrt_windows_ui_notifications_toa
void winrt_windows_ui_notifications_toast_notification_set_ExpiresOnReboot(winrtWindowsUINotificationsToastNotification* self, gboolean value);
gboolean winrt_windows_ui_notifications_toast_notification_get_ExpiresOnReboot(winrtWindowsUINotificationsToastNotification* self);
void winrt_windows_ui_notifications_toast_notification_set_Tag(winrtWindowsUINotificationsToastNotification* self, const gchar* value);
gchar* winrt_windows_ui_notifications_toast_notification_get_Tag(winrtWindowsUINotificationsToastNotification* self);
void winrt_windows_ui_notifications_toast_notification_SetTag(winrtWindowsUINotificationsToastNotification* self, const gchar* value);
gchar* winrt_windows_ui_notifications_toast_notification_GetTag(winrtWindowsUINotificationsToastNotification* self);
void winrt_windows_ui_notifications_toast_notification_set_Group(winrtWindowsUINotificationsToastNotification* self, const gchar* value);
gchar* winrt_windows_ui_notifications_toast_notification_get_Group(winrtWindowsUINotificationsToastNotification* self);
void winrt_windows_ui_notifications_toast_notification_SetGroup(winrtWindowsUINotificationsToastNotification* self, const gchar* value);
gchar* winrt_windows_ui_notifications_toast_notification_GetGroup(winrtWindowsUINotificationsToastNotification* self);
winrtEventToken* winrt_windows_ui_notifications_toast_notification_Activated(winrtWindowsUINotificationsToastNotification* self, NotificationCallbackActivated callback, void* context, void(*free)(void*));
void winrt_windows_ui_notifications_toast_notification_RemoveActivated(winrtWindowsUINotificationsToastNotification* self, winrtEventToken* token);

View file

@ -194,7 +194,7 @@ gboolean winrt_windows_ui_notifications_toast_notification_get_ExpiresOnReboot(w
return winrt_windows_ui_notifications_toast_notification_get_internal(self)->ExpiresOnReboot();
}
void winrt_windows_ui_notifications_toast_notification_set_Tag(winrtWindowsUINotificationsToastNotification* self, const char* value)
void winrt_windows_ui_notifications_toast_notification_SetTag(winrtWindowsUINotificationsToastNotification* self, const char* value)
{
g_return_if_fail (WINRT_IS_WINDOWS_UI_NOTIFICATIONS_TOAST_NOTIFICATION (self));
@ -202,21 +202,21 @@ void winrt_windows_ui_notifications_toast_notification_set_Tag(winrtWindowsUINot
}
/**
* winrt_windows_ui_notifications_toast_notification_get_Tag:
* winrt_windows_ui_notifications_toast_notification_GetTag:
* @manager: a #winrtWindowsUINotificationsToastNotification
*
* Returns the value of the tag
*
* Returns: (transfer full): the value
*/
char* winrt_windows_ui_notifications_toast_notification_get_Tag(winrtWindowsUINotificationsToastNotification* self)
char* winrt_windows_ui_notifications_toast_notification_GetTag(winrtWindowsUINotificationsToastNotification* self)
{
g_return_val_if_fail (WINRT_IS_WINDOWS_UI_NOTIFICATIONS_TOAST_NOTIFICATION (self), FALSE);
return wsview_to_char(winrt_windows_ui_notifications_toast_notification_get_internal(self)->Tag());
}
void winrt_windows_ui_notifications_toast_notification_set_Group(winrtWindowsUINotificationsToastNotification* self, const char* value)
void winrt_windows_ui_notifications_toast_notification_SetGroup(winrtWindowsUINotificationsToastNotification* self, const char* value)
{
g_return_if_fail (WINRT_IS_WINDOWS_UI_NOTIFICATIONS_TOAST_NOTIFICATION (self));
@ -224,14 +224,14 @@ void winrt_windows_ui_notifications_toast_notification_set_Group(winrtWindowsUIN
}
/**
* winrt_windows_ui_notifications_toast_notification_get_Group:
* winrt_windows_ui_notifications_toast_notification_GetGroup:
* @manager: a #winrtWindowsUINotificationsToastNotification
*
* Returns the value of the group
*
* Returns: (transfer full): the value
*/
char* winrt_windows_ui_notifications_toast_notification_get_Group(winrtWindowsUINotificationsToastNotification* self)
char* winrt_windows_ui_notifications_toast_notification_GetGroup(winrtWindowsUINotificationsToastNotification* self)
{
g_return_val_if_fail (WINRT_IS_WINDOWS_UI_NOTIFICATIONS_TOAST_NOTIFICATION (self), FALSE);

View file

@ -37,8 +37,6 @@ namespace winrt.Windows.UI.Notifications {
public class ToastNotification : GLib.Object {
public ToastNotification(string doc);
public bool ExpiresOnReboot { get; set; }
public string Tag { get; set; } // TODO: check if valac is cleaning this string
public string Group { get; set; }
public EventToken Activated(owned NotificationCallbackActivated handler);
public void RemoveActivated(EventToken token);
@ -48,6 +46,11 @@ namespace winrt.Windows.UI.Notifications {
public EventToken Dismissed(owned NotificationCallbackDismissed handler);
public void RemoveDismissed(EventToken token);
public string GetTag();
public void SetTag(string tag);
public string GetGroup();
public void SetGroup(string group);
}
[CCode (type_id = "winrt_windows_ui_notifications_toast_notifier_get_type ()")]