@@ -20,6 +20,7 @@ public struct DataUnion
2020 [ FieldOffset ( 0 ) ] public ExitingData exiting ;
2121 [ FieldOffset ( 0 ) ] public QuitRequestedData quit_requested ;
2222 [ FieldOffset ( 0 ) ] public SystemBrightnessChangedData system_brightness_changed ;
23+ [ FieldOffset ( 0 ) ] public SecondInstanceData second_instance ;
2324 }
2425
2526 [ StructLayout ( LayoutKind . Sequential ) ]
@@ -39,13 +40,24 @@ public struct SystemBrightnessChangedData
3940 {
4041 public int brightness ;
4142 }
43+
44+ [ StructLayout ( LayoutKind . Sequential ) ]
45+ public struct SecondInstanceData
46+ {
47+ public native_string_list_t arguments ;
48+ public IntPtr working_directory ;
49+ }
4250}
4351
4452[ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
4553public delegate void ApplicationEventNativeCallback ( IntPtr evt , IntPtr userData ) ;
4654
4755public static partial class Interop
4856{
57+ [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
58+ [ return : MarshalAs ( UnmanagedType . I1 ) ]
59+ public static extern bool native_application_has_single_instance_lock ( ) ;
60+
4961 [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
5062 [ return : MarshalAs ( UnmanagedType . I1 ) ]
5163 public static extern bool native_application_hide ( ) ;
@@ -66,6 +78,10 @@ public static partial class Interop
6678 [ return : MarshalAs ( UnmanagedType . I1 ) ]
6779 public static extern bool native_application_remove_listener ( ulong listenerId ) ;
6880
81+ [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
82+ [ return : MarshalAs ( UnmanagedType . I1 ) ]
83+ public static extern bool native_application_request_single_instance_lock ( [ MarshalAs ( UnmanagedType . LPUTF8Str ) ] string ? identifier , native_string_list_t arguments ) ;
84+
6985 [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
7086 [ return : MarshalAs ( UnmanagedType . I1 ) ]
7187 public static extern bool native_application_set_badge_label ( [ MarshalAs ( UnmanagedType . LPUTF8Str ) ] string ? label ) ;
@@ -115,6 +131,9 @@ public static partial class Interop
115131 [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
116132 public static extern void native_application_quit ( int exitCode ) ;
117133
134+ [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
135+ public static extern void native_application_release_single_instance_lock ( ) ;
136+
118137 [ DllImport ( Libraries . NativeApi , CallingConvention = CallingConvention . Cdecl ) ]
119138 public static extern void native_application_set_primary_window ( ulong window ) ;
120139}
0 commit comments