Can I provide a custom icon for my custom LINQPad data context driver? - linqpad

I recently started writing LINQPad data context drivers for accessing various types of systems. Unfortunately every driver I write, uses the same "cog wheel" icon. This makes it harder to discern their type than if they'd have a type-specific icon.
Is there a way to provide a custom icon for a driver?

Joe wasn't kidding in his comment. The release notes for LINQPad Beta version 4.42.10 contain this:
You can now specify a custom icon when writing Data Context drivers. Just include two files in your .lpx package: Connection.png and FailedConnection.png (the latter is applied if a data context is unable to load).
What the release notes don't mention (but is obvious once you check the existing icons) is that the icons needs to be 16x16 pixels.

Related

Vulkan and transparent windows

I'm currently adapting my personal engine to Vulkan and I want to reimplement transparent windows, which I already had with OpenGL.
I thought that all I need to do is to select the correct color format ( with alpha channel ) and to set the compositeAlpha property of VkSwapchainCreateInfoKHRto VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR.
However clearing the window with a full transparent color doesn't provide the expected results. It's fully opaque.
Of course my window system, which didn't change since I had OpenGL, supports it and when I just disable the rendering I also can't click through at the supposed position of the window, this tells me that it's there.
Are there any other required changes to make this work?
Some infos
The image format is VK_FORMAT_B8G8R8A8_UNORM and I oriented the vulkan setup as found in Sascha Willems examples.
That capability (as most others) have to be queried before usage about whether it is supported. Otherwise it is invalid to use it.
This particular feature is queried by vkGetPhysicalDeviceSurfaceCapabilitiesKHR as pSurfaceCapabilities->supportedCompositeAlpha. It is a bitfield/flag-set, so more than one mode or none can be supported.
I think the result/feature support may be influenced by the VkSurface. That is, how the platform window was created. Or maybe the driver maker simply did not implement it yet (despite that feature being supportable).
Since it worked for you before in OGL, the later is more likely. But couldn't hurt to play with the platform window creation parameters...
Dunno if this is still relevant, but I got it working with transparent windows through GLFW. (If you are not using GLFW you may dismiss this answer!)
As stated here, there are two ways of obtaining window transparency: framebuffer transparency (alpha bit), and window transparency.
For window transparency it is sufficient to call glfwSetWindowOpacicity(GLFWwindow*, float), where the opacity value should be in the range (0, 1].
NOTE: Since GLFW does not support using both transparency methods at the same time, we must still use VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR in the compositeAlpha field of the VkSwapchainCreateInfoKHR object.
Window transparency may not be supported on all systems, which is why GLFW provides us with a function glfwGetWindowOpacity(GLFWwindow*), to check if calling the first methods was successful.

How can I create a menu in levelhelper?

I want to create game with Spritehelper and Levelhelper. I wanted to know, how to create the menu with levelhelper.
How can I achieve this?
Look through this tutorial(http://www.raywenderlich.com/4622/how-to-use-spritehelper-and-levelhelper-tutorial), they provide detailed information and have LevelHelper/SpriteHelper tutorials provided by the developer himself.
After some research of instruments for new game I came to this conclusion:
Level Helper 2:
good levels editing
SpriteHelper support
no UI editor (no UI controls)
own class stack inherited from standard cocos2d classes (no way to create other nodes, not inherited from LHxxxx)
animations editor
physics editor
CocosBuilder
is not supported by developers (last update 2 years ago)
is universal: you can create UI and levels in it
has some bugs, but is open source, so you can easily fix some issues
uses default cocos2d class stack. You can instantiate any class inherited from Node
supports relative node positioning (in percents relative to parent size)
built in support of sprite sheets
animations editor
SpriteBuilder
new editor, based on idea of CocosBuilder (very similar to it)
is under active development by cocos2d developers
is universal (UI and levels)
very good layout features
supports only cocos2d-swift :-(
there is some 3rd party cocos2d-x loaders of SpriteBuilder scenes, but they are not always compatible with new versions of SpriteBuilder
animations editor
physics editor
Cocos Studio 1.x, 2.1
troubles with loading scenes from v1 in cocos2d-x v3 and above
new version of CocoStudio (2.1 for now) is still not ready for production and doesn't support many features from v1
supports relative node positioning (in percents relative to parent size)
animations editor

Identify the monitor with the browser window in FireBreath

I am using FireBreath to create a cross browser plugin which makes use of some native libraries for the respective platform (some .NET based DLLs for Windows and Objective-C based dylibs/frameworks for Mac). Native libraries display UI screens. In order to improve usability, if the user has a multi/extended monitor setup, i would like the native UIs to appear on the same screen as the browser window is currently on.
If an identifier to the monitor with the browser window can be retrieved, that can be passed down to the native components which can be configured to display their UIs on that monitor. I have used FireBreath's getWindowPosition() method to get the rect coordinates of the plugin and used that info to identify the correct monitor in the Windows platform.
However, the coordinates returned in Mac seems to be always 0 (or 1) irrespective of monitor on which the browser window currently resides. I understand that we have to configure an event model and a drawing model in order for this to work in Mac. I have tried following event/drawing model combinations without much success.
1) Cocoa/CoreGraphics
2) Carbon/CoreGraphics
Any help in this regard is much appreciated. Also please do share if there are other approaches to achieve the same. What i want to achieve is to identify the monitor on which the current active browser window resides in Mac. I am unsure at this point, but it maybe possible to achieve this at Objective-C level (without any changes at FireBreath level). Also please note that i want to support Safari, Firefox and Chrome browsers.
You won't like this answer, but simply put you can't do that on Mac. The problem is that with CoreGraphics you are only given a CGContextRef to work with, and it doesn't know where it will be drawn. It was technically possible in older browsers to get an NSWindow by exploiting some internal implementation details, but many browsers that's no longer possible and it was never supported.
Other drawing models are the same; CoreAnimation you have a CALayer but it doesn't know which screen or monitor it is drawn to. I personally think it's a bit annoying as well, but I do not know of any way to find out which monitor your plugin is rendered to, particularly since most of them actually copy the buffer to something else and render in a different process.
I did manage to come up with a workaround and i am just replying here for the completeness of the thread. As #taxilian explained, it is not possible to retrieve plugin coordinates using the window reference. As an alternative approach, Javascript 'Window' object has 2 properties called 'screenX' and 'screenY' that return X and Y coordinates of the browser window relative to the screen. If the user has an extended monitor setup, these are the absolute coordinates with respect to the full extended screen. We can use these values to determine the monitor with the browser window (if the X coordinate is outside the bounds of the primary monitor's width, then the browser should essentially be on the extended monitor). We can retrieve DOM properties from Firebreath as explained in the following link:
http://www.firebreath.org/display/documentation/Invoking+methods+on+the+DOM

Library or API for file browser view?

I would like to implement a file browser view in my application so users can open files using a side panel similar to the browsers in XCode, Text Wrangler and some other programs.
Before I go off implementing another one of those browsers from scratch, does anyone know if there are existing libraries or APIs that already does this?
Google doesn't turn up with much and most of the searches point me to NSOpenPanel which I believe doesn't do what I want.
Thanks in advance.
The Cocoa class that is used to display hierarchical lists is called NSOutlineView.
Outline views provide several configuration options to adjust the appearance.
The content can be provided by implementing a data source protocol or via Cocoa bindings.
Apple has some sample code online that should get you started (it's a file browser - so maybe you can use larger parts of that sample):
https://developer.apple.com/library/mac/#samplecode/SourceView/Introduction/Intro.html

"Loading Checklog" error while loading quartz composition using Quartz Composer Patch Controller

I've created a composition in Quartz Composer, and am following the examples on "Quartz Composer Programming Guide" on Apple's website for connecting it to a XIB.
My goal is to be able to bind inputs in my Quartz Composition with UI controls (sliders, keyboard input, etc.) within my Cocoa application. It seems that this tutorial is sufficient for what I want to do.
However, I can't get the Quartz Composer Patch Controller to load my composition. I add the Patch Controller to my XIB document window, then I go to "Load Composition".
Every time I click "Load Composition", I choose my file and it gives me an error message box that says "Loading Failed: Loading CheckLog".
Here's what may be interesting: I can view my composition if I load it with a QCView object, but can't load it in the Patch Controller.
I've tried loading other compositions, I get the same error. I tried in a different computer, on a new project, same XCode version (4.0.1), and I still get the error.
I've only done the steps outlined in the tutorial, and I am referencing the Quartz framework in my project. My first thought is that there might be some procedures that are not outlined in the programming guide that I may be skipping.
So how do I resolve this error? Please help!
I assume the “CheckLog” bit means that there’s something in the system log (open /Applications/Utilities/Console.app and look under Console Log). There might also be something in ~/Library/Logs/. (Shamefully bad UI in any case, of course.)
I had this problem - solved it by making sure that I was using the corresponding version of quartz composer and xcode since I have multiple versions of developer tools installed. (use both applications contained within the same developer folder).