CTrayIcon.m revision 4644
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#import <AppKit/AppKit.h>
#import "CTrayIcon.h"
#import "ThreadUtilities.h"
#include "GeomUtilities.h"
/**
* If the image of the specified size won't fit into the status bar,
* then scale it down proprtionally. Otherwise, leave it as is.
*/
// There is a black line at the bottom of the status bar
// that we don't want to cover with image pixels.
}
return self;
}
-(void) dealloc {
// Its a bad idea to force the item to release our view by setting
// the item's view to nil: it can lead to a crash in some scenarios.
// The item will release the view later on, so just set the view's image
// to nil since we are done with it.
[super dealloc];
}
}
-(NSStatusItem *) theItem{
return theItem;
}
return peer;
}
}
}
- (NSPoint) getLocationOnScreen {
}
@end //AWTTrayIcon
//================================================
isHighlighted = NO;
return self;
}
-(void) dealloc {
[super dealloc];
}
{
if (isHighlighted != aFlag) {
}
}
}
}
{
}
{
}
{
return;
}
// don't cover bottom pixels of the status bar with the image
}
fraction:1.0
];
}
//find CTrayIcon.getPopupMenuModel method and call it to get popup menu ptr.
if (res != 0) {
} else {
}
}
- (void) rightMouseDown:(NSEvent *)e {
// Call CTrayIcon.performAction() method on right mouse press
}
@end //AWTTrayIconView
//================================================
/*
* Class: sun_lwawt_macosx_CTrayIcon
* Method: nativeCreate
* Signature: ()J
*/
}];
return ptr_to_jlong(trayIcon);
}
/*
* Class: java_awt_TrayIcon
* Method: initIDs
* Signature: ()V
*/
//Do nothing.
}
/*
* Class: sun_lwawt_macosx_CTrayIcon
* Method: nativeSetToolTip
*/
}];
}
/*
* Class: sun_lwawt_macosx_CTrayIcon
* Method: setNativeImage
* Signature: (JJZ)V
*/
}];
}
}];
return jpt;
}