touchbar: code cleanup

This commit is contained in:
Artem Bochkarev
2019-03-06 13:59:58 +03:00
parent 768fcde6f1
commit e03ccd53a4
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -377,8 +377,8 @@ void updateButton(
const char *raster4ByteRGBA, int w, int h,
execute jaction
) {
NSCustomTouchBarItem *container = buttObj; // TODO: check types
NSButtonJAction *button = (container).view; // TODO: check types
NSCustomTouchBarItem *container = buttObj;
NSButtonJAction *button = (container).view;
NSAutoreleasePool *edtPool = [NSAutoreleasePool new];
NSImage *img = createImgFrom4ByteRGBA((const unsigned char *) raster4ByteRGBA, w, h);
@@ -401,8 +401,8 @@ void updateButton(
// NOTE: now is called from AppKit-thread (creation when TB becomes visible), but can be called from EDT (when update UI)
void setArrowImage(id buttObj, const char *raster4ByteRGBA, int w, int h) {
NSCustomTouchBarItem *container = buttObj; // TODO: check types
NSButtonJAction *button = (container).view; // TODO: check types
NSCustomTouchBarItem *container = buttObj;
NSButtonJAction *button = (container).view;
NSAutoreleasePool *edtPool = [NSAutoreleasePool new];
NSImage *img = nil;
+1 -1
View File
@@ -27,7 +27,7 @@ id createPopover(const char * uid, int itemWidth, const char * text, const char
// NOTE: called from EDT (when update UI)
void updatePopover(id popoverObj, int itemWidth, const char * text, const char * raster4ByteRGBA, int w, int h, id tbObjExpand, id tbObjTapAndHold) {
NSPopoverTouchBarItem * popoverItem = popoverObj; // TODO: check types
NSPopoverTouchBarItem * popoverItem = popoverObj;
nstrace(@"async update popover [%@] (thread: %@)", popoverItem.identifier, [NSThread currentThread]);
NSAutoreleasePool * edtPool = [[NSAutoreleasePool alloc] init];
NSImage * img = createImgFrom4ByteRGBA((const unsigned char *)raster4ByteRGBA, w, h);
+2 -2
View File
@@ -59,7 +59,7 @@ void selectItemsToShow(id touchBar, const char** ppIds, int count) {
[all addObject:nsId];
}
TouchBar * tb = (TouchBar *)touchBar; // TODO: check types
TouchBar * tb = (TouchBar *)touchBar;
dispatch_async(dispatch_get_main_queue(), ^{
[tb.touchBar setDefaultItemIdentifiers:all];
});
@@ -76,7 +76,7 @@ id createTouchBar(const char * name, createItem jcreator, const char * escId) {
void setPrincipal(id tbobj, const char * uid) {
NSAutoreleasePool * edtPool = [[NSAutoreleasePool alloc] init];
TouchBar * tb = (TouchBar *)tbobj; // TODO: check types
TouchBar * tb = (TouchBar *)tbobj;
[tb.touchBar setPrincipalItemIdentifier:createStringFromUTF8(uid)];
[edtPool release];
}