Getting an NSwindow from Air extension - macos

Is there a way to get an NSWindow reference from its id from an AIR extension?
I am making an Adobe Air app which is supposed to stay always on top. It is for kids so you can give a computer to them and they can't exit the app. The problem is that the default "alwaysOnTop" property of air applications doesn't work. What I am planning to do is use a native extension to get the Air window id and then try and set the level. I've already checked with the accessibility API but apparently there is no way of doing it that way. I could be wrong, though.

I found a way. Just use the global NSapp variable to get the main window from inside an Air native extension. Then call setLevel on that window and that's it.

Related

How can you modify the styling of a compiled macOS app without the Xcode project and without additional apps?

Does anybody know, how to change the appearance of the title bar and/or toolbar of a simple & small one-window cocoa macOS application without accessing the Xcode or installing third party applications? It's for a screen recording video project, I want to do.
I know, that there are possibilities within the applications info.plist (for example changing the app title inside the top macOS Menu Bar) but I would like to be able to change the apps window title itself and/or colors and/or fonts inside the window title bar or toolbar if possible.
Opening the app in another container window or via terminal or Applescript and adding custom parameters or even an overlay in the right position to change the styling would be okay if this is possible?
Can somebody point me in the right direction?
Thank you very much!
in short: Nibs
Nib File Viewer works until Xcode 10
saving, recompiling if possible
good luck

How to get specific window ID in the browser on Mac

I have a project using FireBreath and Gstreamer to build my own plugin on Mac.
My plugin chooses Core Graphics to show my video from Gstreamer, and my situation is that Gstreamer opens the other new openGL window to show my video.
This window should be embedded in the browser.
There is a Gst_video_overlay function in Gstreamer, and I could pass the window ID to make my video on specific window. but I have no idea how to get the specific window ID in the browser?
I'll give you the short answer: You can't.
The Window ID belongs to a different process, so it's not something you can use anyway.
The only way you can use OpenGL in a NPAPI plugin on Mac (at least since carbon went away and it switched to cocoa) is to use CoreAnimation and use a OpenGLCALayer

How to make a Cocoa Document-Based App launch with multiple different windows?

I have a document based app in cocoa with three xibs for different toolbox windows. At app launch I would like the toolboxes to be visible very similar to Adobe Illustrator where the toolboxes are visible on either side. To do this would I need to implement my own NSApplication?
No, when the document spawns, in its controller class (or the app delegate, dependent on who owns the toolbox windows) call makeKeyAndOrderFront: on each of the windows that you want to bring forward.

Minimize-in-place - Do I need a custom framework

I want to create a system wide minimize-in-place feature that occurs when double-clicking the title bar of any visible window in layer 0.
It seems that this would be a really simple feature to re-implement... When a title-bar is double-clicked, just draw the title bar only. That's it. The problem is implimenting it in all applications. I think it requires writting a custom framework to override the behavior in AppKit? Maybe NSApplication, NSWindow or NSView?
How can I recreate minimize-in-place?
Is a framework my only choice? If I create a framework, can I replace the behavior of minimize in 3rd party apps?
Which framework do I need to override in order to intercept and recreate the default behavior of the minimize button?
More about minimize-in-place:
I am familiar with WindowShade by Unsanity, this is exactly what I want to create. Supposedly unsanity is working on a Lion version, but their track record is bismal. Minimize-in-place was a system feature way back in the days of OS 7 or 8. I have tried other utilities that try to replace this feature, and there aren't any that do minimize-in-place at a core system level like it needs to be done. Please don't offer utitlity suggestions, I am going to build my own.
I have built an Application that recreates minimize-in-place, but it's not good enough.
My Application semi-successfully recreates minimize-in-place by putting "placeholder" windows (belonging to my app) in place of the 3rd party windows when they get minimized to dock. When my window (title bar only) gets double-clicked, I close my window and restore the real window from the dock.
My custom app works perfectly, but there is a lot of application switching going on. I have optimized the switching between apps to be nearly seamless, but the fact remains that there is application switching going on every time a window title bar is double-clicked. The result of application switching is that menu bars switch back and forth, pallets of 3rd party apps hide themselves when my app takes focus, and the list goes on.
So, although I've built a concept app, this method isn't going to work as I'd like it to. Minimize-in-place needs to be implemented using some other method than building an Application, and I need help understanding how to do it.
What I know think I need to do. Suggestions and assistance welcome.
I think I need to write a custom framework that replaces AppKit? This seems overwhelming even though I only need a super-tiny portion of the code to be overridden? i.e. the core _minimize function whatever that may be.
When a title-bar of 3rd party window is double-clicked, just clip to the title bar and let the rest of the system function as normal. On un-minimize (double click 2nd time), set clip back to full window.
Simple right?
Thanks for any assistance/suggestions,
Chris

Mac - iTunes status indicator thing

I don't know what to call it, but you know that greenish thing covering most of the middle of the top of the iTunes window, that shows the apple symbol or shows the music slider or the status etc., what is it? I've seen several other applications using it -- how do you get it? I couldn't find it in Interface Builder.
Thanks.
It's not available as a standard component (yet). iTunes is not even a Cocoa app (well, some part of it is Cocoa, but not much.). A few other Apple apps have similar interface element, so let's hope it'll become available in the next version.

Resources