@@ -164,68 +164,6 @@ declare_class!(
164164 Retained :: <NSMenu >:: autorelease_return( menubar)
165165 }
166166
167- #[ method( rioCreateWindow: ) ]
168- fn create_window(
169- & self ,
170- _sender: Option <& AnyObject >,
171- ) {
172- if self . is_launched( ) {
173- self . dispatch_create_window_event( ) ;
174- }
175- }
176-
177- #[ method( copy: ) ]
178- fn copy( & self , _sender: Option <& AnyObject >) {
179- if self . is_launched( ) {
180- self . dispatch_hook( Hook :: Copy ) ;
181- }
182- }
183-
184- #[ method( paste: ) ]
185- fn paste( & self , _sender: Option <& AnyObject >) {
186- if self . is_launched( ) {
187- self . dispatch_hook( Hook :: Paste ) ;
188- }
189- }
190-
191- #[ method( rioCreateTab: ) ]
192- fn create_tab( & self , _sender: Option <& AnyObject >) {
193- if self . is_launched( ) {
194- self . dispatch_hook( Hook :: CreateTab ) ;
195- }
196- }
197-
198- #[ method( rioClose: ) ]
199- fn close_tab( & self , _sender: Option <& AnyObject >) {
200- if self . is_launched( ) {
201- self . dispatch_hook( Hook :: Close ) ;
202- }
203- }
204-
205- #[ method( rioSplitDown: ) ]
206- fn split_down( & self , _sender: Option <& AnyObject >) {
207- if self . is_launched( ) {
208- self . dispatch_hook( Hook :: SplitDown ) ;
209- }
210- }
211-
212- #[ method( rioSplitRight: ) ]
213- fn split_right( & self , _sender: Option <& AnyObject >) {
214- if self . is_launched( ) {
215- self . dispatch_hook( Hook :: SplitRight ) ;
216- }
217- }
218-
219- #[ method( openConfig: ) ]
220- fn open_configuration(
221- & self ,
222- _sender: Option <& AnyObject >,
223- ) {
224- if self . is_launched( ) {
225- self . dispatch_open_configuration( ) ;
226- }
227- }
228-
229167 #[ method( applicationShouldHandleReopen: hasVisibleWindows: ) ]
230168 fn should_handle_reopen( & self ,
231169 _sender: Option <& AnyObject >,
@@ -313,6 +251,65 @@ declare_class!(
313251 trace_scope!( "Completed `application:openURLs:`" ) ;
314252 }
315253 }
254+
255+ // Custom methods for menu actions
256+ unsafe impl ApplicationDelegate {
257+ #[ method( rioCreateWindow: ) ]
258+ fn create_window( & self , _sender: Option <& AnyObject >) {
259+ if self . is_launched( ) {
260+ self . dispatch_create_window_event( ) ;
261+ }
262+ }
263+
264+ #[ method( copy: ) ]
265+ fn copy( & self , _sender: Option <& AnyObject >) {
266+ if self . is_launched( ) {
267+ self . dispatch_hook( Hook :: Copy ) ;
268+ }
269+ }
270+
271+ #[ method( paste: ) ]
272+ fn paste( & self , _sender: Option <& AnyObject >) {
273+ if self . is_launched( ) {
274+ self . dispatch_hook( Hook :: Paste ) ;
275+ }
276+ }
277+
278+ #[ method( rioCreateTab: ) ]
279+ fn create_tab( & self , _sender: Option <& AnyObject >) {
280+ if self . is_launched( ) {
281+ self . dispatch_hook( Hook :: CreateTab ) ;
282+ }
283+ }
284+
285+ #[ method( rioClose: ) ]
286+ fn close_tab( & self , _sender: Option <& AnyObject >) {
287+ if self . is_launched( ) {
288+ self . dispatch_hook( Hook :: Close ) ;
289+ }
290+ }
291+
292+ #[ method( rioSplitDown: ) ]
293+ fn split_down( & self , _sender: Option <& AnyObject >) {
294+ if self . is_launched( ) {
295+ self . dispatch_hook( Hook :: SplitDown ) ;
296+ }
297+ }
298+
299+ #[ method( rioSplitRight: ) ]
300+ fn split_right( & self , _sender: Option <& AnyObject >) {
301+ if self . is_launched( ) {
302+ self . dispatch_hook( Hook :: SplitRight ) ;
303+ }
304+ }
305+
306+ #[ method( openConfig: ) ]
307+ fn open_configuration( & self , _sender: Option <& AnyObject >) {
308+ if self . is_launched( ) {
309+ self . dispatch_open_configuration( ) ;
310+ }
311+ }
312+ }
316313) ;
317314
318315impl ApplicationDelegate {
0 commit comments