How to create a display for OS X? - macos

I need to write what I think is a display driver for OS X. It's like those "Use your iPad as a second monitor!" apps, but I need to write the OS X software that will register another display with OS X, and give me the pixel data so I can use it for my various needs.
Where do I get started? I've read about IOKit, but I don't quite understand what I need to do to tell OS X that I'm a monitor, and then what the pixel data is going to look like.
A few links to the classes/headers/etc that I'm going to have to read through would be fine as well, but if anyone has done this and knows the particulars it would be very helpful.
Also, will this have to be a kernel extension, or is it possible to write a userspace IOKit driver that gives a second monitor to OS X?
Lastly, to be clear, I just want the pixel data that would be sent to a second monitor (either mirrored or extended) - I'm not actually attaching a monitor on, or an I/O device.

you could take a look at:
http://code.google.com/p/ioproxyvideofamily/
maybe as a starting point.

CoreGraphics. Display Services
and you probably want to look at the Quartz Display Services Reference

Related

Managing Mac OS Windows from Script

I am trying to find the best way to handle application windows on Mac OS from a script. I am open to any language, but I want it to have the following capabilities
Get list of open applications
Get location of specific application
Change focus, position, and size of specific application
Send key events to only specific application
I have managed to get a list of applications using JNA, Apple's Core Graphics library, and some code from this question, but the capabilities seem to be limited. Is there a way to implement the functionality I am looking for, or is Mac OS too closed down for this? Like I said, I am open to all languages.
Thanks so much!

Make microcontroller connect to OS X as mouse

I have just begun a new project. I'd like to make my own simplistic computer mouse, since i'd like to learn how to program hardwear drivers and understand the protocols the hardwear uses. I have experience in both desktop and microcontroller programming. However, I haven't got a clue about how to write drivers. I'm working on a mac with OS X and the mouse only needs to be able to talk with OS X. I expect to use a MSP430 microcontroller from TI. I intend to connect my mouse via USB. I simply want to be directed in the right direction not specific help with the coding, yet. :)
I therefor have a couple of questions:
Should I write my own driver or is it possible to use a standard one?
If yes, what kind of driver should be written and where do you begin?
What kind of data should be sent to the mac to say, "Hey, I'm a computer mouse"?
Which protocols should I read about?
You can check USB HID articles for OSX side and if there exists for MSP430.
I think that you can use any other driver, if you emulate same behavior of the target device on your MSP side.

How to programatically create custom input/output devices?

How do i create a custom media input/output device like a speaker or microphone that i can select from a program like Skype. For example i could make a GreyScale webcam that reads the webcam and makes it greyscale or a custom Beep Speaker that takes anything a program sends to the speaker and adds a beep after 3 seconds etc. An example would be this:
http://www.videohelp.com/tools/UScreenCapture
I just need help on how to create the actual (virtual?) device, not how to make it greyscale etc. I can figure that out later.
Where do i even begin to search for tutorials/readings on this? As per the tags, i prefer qt/c++ related but it doesn't necessarily have to be that. Just a nudge in the right direction to get me started would be fine.
You need to create a device driver. What that entails depends entirely on the platform and the type of device you want to emulate.
Start with the documentation of your operating system and look up references as if you were developing a new hardware device. But you'll just skip any actual hardware interfaces.
Nevertheless this is likely to require kernel programming, so Qt is likely to be inappropriate.

Counting printed pages in OSX

I'm developing an app for the Mac OS X that provides various system statistics. I have a little problem with the printer because I have never worked with it before. Is there any way to listen to the printer and count pages printed in color and in b&w?
Edit: I remember that I was using a Mac OS X kiosk machine once and it offered color and b&w prints priced per page, so there must be a way to do this. Also, I develop this app for my own needs and for practice so the solution doesn't have to be universal.
I'm pretty sure access to this information is specific to individual printer models. I don't believe there's a system API that will help you here as it would require querying individual printer drivers or utilities.
The Core Printing Reference which is the documentation for the Mac OS X printing API doesn't appear to contain any calls that would allow you to extract this information from a printer.

Help writing a DVB driver for OS X

I'm looking at options to access DVB data on OS X. Initially I want to support the EyeTV DTT USB device, but in the long-run I'd like to support a number of popular devices. The problem I have is that there is no standard way of controlling such devices.
All the applications I know of that use them either hide the driver code within the application (for example EyeTV itself, all it's drivers are implemented totally in userspace and are not accessible to external apps), or they use the seemingly defunkt MMInputFamily driver (no source code availible any more, author gone walkabouts).
I've done some research and found that a number of the devices I want to support are supported within the Linux DVB project. Further research indicates that some years ago there was an attempt to abstract the linux implementation so that it could potentially be recompiled on other platforms. The idea being that efforts to support devices should be pooled and the best way to do that would be to make the current open source implementation work on multiple platforms: it seems in the end to have amounted to little however.
The idea of compiling linux drivers against other *nix type platforms has also been taken up elsewhere with some success. The approach the author took is detailed on the page I linked, it seems potentially viable on OS X as well.
At any rate, there seem to be a number of options, but no clear winner:
Find the source code for the MMInputFamily driver, try to get it working on OS X 10.6 and add support for the devices I require, referrencing the linux source code for pointers. Problem: the source code is nowhere to be found, nor is the author. Additionally it seems the author might perhaps have gone down another route had he fully appreciated the previous efforts to port the linux drivers to OS X.
Attempt to port the linux drivers to OS X in a manner similar to the FreeBSD project I linked. Problem: this is very low-level work and work in this layer is not recommended by Apple if it can be avoided.
Write a driver with OS X's IOKit: this is the preferred method for implementing drivers but I would have to do everything from scratch, clearly not a small job.
If I could I would really like to use the Linux source code, but I'm unsure if such a thing is really viable. Does anyone have any advice or ideas on the best way to proceed with this task?

Resources