Skip to content

Commit

Permalink
Add NSMenuToolbarItem skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed May 3, 2024
1 parent 82dce67 commit bd4e093
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 1 deletion.
1 change: 1 addition & 0 deletions Headers/AppKit/AppKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSMenuToolbarItem.h>
#import <AppKit/NSMenuView.h>
#import <AppKit/NSNibLoading.h>
#import <AppKit/NSOpenPanel.h>
Expand Down
65 changes: 65 additions & 0 deletions Headers/AppKit/NSMenuToolbarItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* Definition of class NSMenuToolbarItem
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 03-05-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/

#ifndef _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE
#define _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE

#import <AppKit/NSToolbarItem.h>
#import <AppKit/AppKitDefines.h>

#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)

#if defined(__cplusplus)
extern "C" {
#endif

@class NSMenu;

APPKIT_EXPORT_CLASS
@interface NSMenuToolbarItem : NSToolbarItem
{
BOOL _showsIndicator;
NSMenu *_menu;
NSMenu *_itemMenu;
}

- (BOOL) showsIndicator;
- (void) setShowsIndicator: (BOOL)flag;

- (NSMenu *) menu;
- (void) setMenu: (NSMenu *)menu;

- (NSMenu *) itemMenu;
- (void) setItemMenu: (NSMenu *)itemMenu;

@end

#if defined(__cplusplus)
}
#endif

#endif /* GS_API_MACOSX */

#endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */

1 change: 0 additions & 1 deletion MISSING
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ MISSING HEADERS ( * = difficult, - = quick, + = placeholder, x = won't do )
> NSFilePromiseProvider.h -
> NSFilePromiseReceiver.h -
> NSItemProvider.h +
> NSMenuToolbarItem.h -
> NSOpenGLLayer.h +
> NSTypesetter.h +
> NSUserActivity.h -
Expand Down
2 changes: 2 additions & 0 deletions Source/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ NSStoryboardSegue.m \
NSMagnificationGestureRecognizer.m \
NSMatrix.m \
NSMenu.m \
NSMenuToolbarItem.m \
NSMenuView.m \
NSMenuItem.m \
NSMenuItemCell.m \
Expand Down Expand Up @@ -496,6 +497,7 @@ NSMediaLibraryBrowserController.h \
NSMenu.h \
NSMenuItem.h \
NSMenuItemCell.h \
NSMenuToolbarItem.h \
NSMenuView.h \
NSMovie.h \
NSMovieView.h \
Expand Down
68 changes: 68 additions & 0 deletions Source/NSMenuToolbarItem.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Implementation of class NSMenuToolbarItem
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 03-05-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/

#import "AppKit/NSMenuToolbarItem.h"
#import "AppKit/NSMenu.h"

@implementation NSMenuToolbarItem

- (void) dealloc
{
RELEASE(_menu);
RELEASE(_itemMenu);
[super dealloc];
}

- (BOOL) showsIndicator
{
return _showsIndicator;
}

- (void) setShowsIndicator: (BOOL)flag
{
_showsIndicator = flag;
}

- (NSMenu *) menu
{
return _menu;
}

- (void) setMenu: (NSMenu *)menu
{
ASSIGN(_menu, menu);
}

- (NSMenu *) itemMenu
{
return _itemMenu;
}

- (void) setItemMenu: (NSMenu *)itemMenu
{
ASSIGN(_itemMenu, itemMenu);
}

@end

0 comments on commit bd4e093

Please sign in to comment.