@@ -99,6 +99,19 @@ external int native_application_add_listener_async(
9999@ffi .Native <native_window_list_t Function ()>()
100100external native_window_list_t native_application_get_all_windows ();
101101
102+ /// Caller owns the returned string; free it with free_c_str().
103+ @ffi .Native <ffi.Pointer <ffi.Char > Function ()>()
104+ external ffi.Pointer <ffi.Char > native_application_get_log_file ();
105+
106+ @ffi .Native <ffi.UnsignedInt Function ()>(
107+ symbol: 'native_application_get_log_level' ,
108+ )
109+ external int _native_application_get_log_level ();
110+
111+ native_log_level_t native_application_get_log_level () {
112+ return native_log_level_t.fromValue (_native_application_get_log_level ());
113+ }
114+
102115/// Caller owns the returned handle; release it with native_window_free().
103116@ffi .Native <native_window_t Function ()>()
104117external int native_application_get_primary_window ();
@@ -169,6 +182,18 @@ external bool native_application_set_dock_icon_visible(bool visible);
169182@ffi .Native <ffi.Bool Function (ffi.Pointer <ffi.Char >)>()
170183external bool native_application_set_icon (ffi.Pointer <ffi.Char > icon_path);
171184
185+ @ffi .Native <ffi.Bool Function (ffi.Pointer <ffi.Char >)>()
186+ external bool native_application_set_log_file (ffi.Pointer <ffi.Char > path);
187+
188+ @ffi .Native <ffi.Void Function (ffi.UnsignedInt )>(
189+ symbol: 'native_application_set_log_level' ,
190+ )
191+ external void _native_application_set_log_level (int level);
192+
193+ void native_application_set_log_level (native_log_level_t level) {
194+ return _native_application_set_log_level (level.value);
195+ }
196+
172197@ffi .Native <ffi.Bool Function (native_menu_t)>()
173198external bool native_application_set_menu_bar (int menu);
174199
@@ -5858,6 +5883,28 @@ typedef Dartnative_launch_at_login_t = int;
58585883typedef native_listener_id_t = ffi.Uint64 ;
58595884typedef Dartnative_listener_id_t = int ;
58605885
5886+ enum native_log_level_t {
5887+ NATIVE_LOG_LEVEL_OFF (0 ),
5888+ NATIVE_LOG_LEVEL_ERROR (1 ),
5889+ NATIVE_LOG_LEVEL_WARNING (2 ),
5890+ NATIVE_LOG_LEVEL_INFO (3 ),
5891+ NATIVE_LOG_LEVEL_DEBUG (4 ),
5892+ NATIVE_LOG_LEVEL_TRACE (5 );
5893+
5894+ final int value;
5895+ const native_log_level_t (this .value);
5896+
5897+ static native_log_level_t fromValue (int value) => switch (value) {
5898+ 0 => NATIVE_LOG_LEVEL_OFF ,
5899+ 1 => NATIVE_LOG_LEVEL_ERROR ,
5900+ 2 => NATIVE_LOG_LEVEL_WARNING ,
5901+ 3 => NATIVE_LOG_LEVEL_INFO ,
5902+ 4 => NATIVE_LOG_LEVEL_DEBUG ,
5903+ 5 => NATIVE_LOG_LEVEL_TRACE ,
5904+ _ => throw ArgumentError ('Unknown value for native_log_level_t: $value ' ),
5905+ };
5906+ }
5907+
58615908enum native_menu_backend_t {
58625909 NATIVE_MENU_BACKEND_NATIVE (0 ),
58635910 NATIVE_MENU_BACKEND_WIN_UI3 (1 );
0 commit comments