From 33422a5ecf856f94dad9de48d787f0b64e1a48f9 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 27 Feb 2021 00:30:05 +0100 Subject: bindings/mono: Drop custom extension and use partial class in ApplicationIndicatorCustom.cs --- bindings/mono/ApplicationIndicator.custom | 26 ------------------- bindings/mono/ApplicationIndicatorCustom.cs | 40 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 26 deletions(-) delete mode 100644 bindings/mono/ApplicationIndicator.custom create mode 100644 bindings/mono/ApplicationIndicatorCustom.cs (limited to 'bindings') diff --git a/bindings/mono/ApplicationIndicator.custom b/bindings/mono/ApplicationIndicator.custom deleted file mode 100644 index 4992c08..0000000 --- a/bindings/mono/ApplicationIndicator.custom +++ /dev/null @@ -1,26 +0,0 @@ -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_status (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern int app_indicator_get_category (IntPtr i); - -[DllImport ("ayatana-appindicator.dll")] -static extern void app_indicator_set_status (IntPtr i, int s); - - [GLib.Property ("status")] - public AppIndicatorStatus AppIndicatorStatus { - get { - return (AppIndicatorStatus) app_indicator_get_status (Handle); - } - - set { - app_indicator_set_status (Handle, (int) value); - } - } - - [GLib.Property ("category")] - public AppIndicatorCategory AppIndicatorCategory { - get { - return (AppIndicatorCategory) app_indicator_get_category (Handle); - } - } diff --git a/bindings/mono/ApplicationIndicatorCustom.cs b/bindings/mono/ApplicationIndicatorCustom.cs new file mode 100644 index 0000000..372b1c1 --- /dev/null +++ b/bindings/mono/ApplicationIndicatorCustom.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; + +namespace AyatanaAppIndicator +{ + public partial class ApplicationIndicator : GLib.Object + { + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_status (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern int app_indicator_get_category (IntPtr i); + + [DllImport ("ayatana-appindicator.dll")] + static extern void app_indicator_set_status (IntPtr i, int s); + + [GLib.Property ("status")] + public AppIndicatorStatus AppIndicatorStatus + { + get + { + return (AppIndicatorStatus) app_indicator_get_status (Handle); + } + + set + { + app_indicator_set_status (Handle, (int) value); + } + } + + [GLib.Property ("category")] + public AppIndicatorCategory AppIndicatorCategory + { + get + { + return (AppIndicatorCategory) app_indicator_get_category (Handle); + } + } + } +} -- cgit v1.2.3