Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming Businesses Apple IT Technology

Hacking Quartz 298

Exposed writes "Meaty interview with Rich Wareham who is known to Linux users for his libdvdnav library which is used by Xine and other linux players. On OS X he created Desktop Manager, the GPL solution for VirtualDesktops on the Mac. Highlights are secret APIs in OS X for VirtualDesktops, who steals GPL source and why beginner programmers are at a disadvantage now."
This discussion has been archived. No new comments can be posted.

Hacking Quartz

Comments Filter:
  • by Nick of NSTime ( 597712 ) on Tuesday July 06, 2004 @03:43PM (#9624819)
    I was very interested by this interview, but the guys overabundance of parentheticals was very distracting. Sometimes I wondered if the editor was adding his own remarks to the interview, since the parentheticals were italicized.

    Regardless, I found the content to be very interesting, particularly the fact that Desktop Manager is the guy's first Mac application.

  • by SuperKendall ( 25149 ) * on Tuesday July 06, 2004 @03:52PM (#9624945)
    For me Expose works well enough as a virtual desktop - I have a lot of windows opened, but when I used to use a virtual desktop on UNIX most of the rooms would be pretty much one thing anyway - like a room for browsing. Now I can just hit F10 on a browser and see all the current browser Windows.

    I think Apple has just not focused any energy on an "Apple Way" to manipulate virtual desktops. It's a tricky UI problem and probably the work needed to keep programs in different rooms is too "virtual" for many people. Note that he did state Apple made changes that were seemingly very favorable to the writing of DesktopManager, so it would seem the folks at Apple are at least nuturing the concept - and if they ever do include such a program I don't think you'll see any sour grapes from this guy as he is already giving it away.

    I did like his idea for "Window Wells" (even though I think that was the interviewers term) a lot, so instead of virtual desktops being really virtual you have "clumps" of windows on screen (which are your virtual desktops) that you can click on like small expose'ed windows to expand the desktop. I'm still not sure of the best way to get windows in or out of these desktops.
  • by numbski ( 515011 ) * <numbski&hksilver,net> on Tuesday July 06, 2004 @03:58PM (#9625009) Homepage Journal
    Eh, I think you just have bad luck.

    Granted, no, this is 'not your dad's desktop manager' in the sense that you're used to in X, but it's still a far cry improvement from not having it at all, and if you look at the sources, his readme's, and heck, just this interview, he has some interesting improvements coming down the pipe.

    But if you want to cry instability, let's hear it:

    What's your hardware specs?
    What OS?
    What version of Desktop Manager?
  • by SuperKendall ( 25149 ) * on Tuesday July 06, 2004 @04:04PM (#9625064)
    Apple is not really about "One Way". They are about a "Crafted Way". That is, anything that Apple includes in the OS they like to have honed to a fine sheen before users can touch it.

    If Apple were about "One Way", you would not have the nice integration between the finder and Terminal. You can stick to the Finder to find documents or manipulate files - or you can just use the Terminal, or you can use a hybrid of the two and drag files into the Termainl from the finder and get a full path expanded for you in the middle of some command.

    Note in the article that he mentions Apple made some API changes which were very favorible to Desktop Manager. They could have switched stuff around to crush him like a bug. But they instead made changes that helped - does that sound like a company bent on the "One Way" to do everything?

    As I've said before I really think Apple and virtual desktops is not so much an issue that they do not want it, as they have not invested the mental energy to solve the UI problem of the user maintenience of virtusl desktops - moving windows between, making sure the right windows wind up in the right desktops, etc. If anything I think virtual desktops will arise in OS X through an evolution of Expose, though in the end it may not be quite virtual desktops as we know them today.
  • by Jeremy Erwin ( 2054 ) on Tuesday July 06, 2004 @04:05PM (#9625071) Journal
    If an operating system supports two different methods of organizing the desktop, then some inexperienced programmer will find some method of supporting only one.

    "Yeah, our App tends to crash Expose. Use Virtual Desktops instead."

  • by SuperKendall ( 25149 ) * on Tuesday July 06, 2004 @04:11PM (#9625124)
    But how many computers ship with VB, and a manual which shows you how to write cool little programs in VB? I really can't think of ANY!!

    Even OS X, which does at least ship with developer tools in every box really makes no mention of them.

    The thing about computers before was that it was super easy to just write ten lines of code and have something happen. Now you have to hunt down an IDE or an editor, and chances are you're writing a lot more than ten lines even for Hello World! The computers now have (as he said) a much higher barrier to entry of manipulation, though of course you can do a million times more if you do break that barrier - so I'd say the only hope is that the rewards of crossing that barrier are enough to lure people over.

    I agree with him that this is a real problem, far fewer people are exposed to the manipulation of computers at a young age and instead computers are treated as black boxes, not to be touched. Cars are headed the same way to some extent but there already was a much more powerful and widespread culture built up around people and engines, so it's a lot harder for that to vanish. I wish that more people would be able to think of computers as more like cars and less like toasters.
  • Re:Or not... (Score:2, Interesting)

    by Short Circuit ( 52384 ) <mikemol@gmail.com> on Tuesday July 06, 2004 @04:13PM (#9625136) Homepage Journal
    Maybe I'm just not good at VB, but I got less flicker making my own animated screensavers on my old 286+QBASIC than I get with VB. (VB does make some of the job easier, though.)

    Unfortunately, VB so spoiled me in elementary and middle school that I still can't sit down long enough to learn to combine C and GTK, or C++ and QT, or Perl and Tk. I have managed to do some stuff with C and SDL, though.
  • by SandSpider ( 60727 ) on Tuesday July 06, 2004 @04:15PM (#9625174) Homepage Journal
    He mentions that it's more difficult for beginning programmers to get a start, as compared to the old days. Partially because software companies have tried to hide everything, and partially because it's so much more difficult to write a small amount of code that will do something exciting.

    I disagree. Those points were more true a few years ago, but, at least with OS X, you have plenty of potential. First of all, there's Applescript and Applescript Studio. It's really easy to get a program started that does far more than in the old days, since most of your basic user interface work is done for you, and you can draw on the power of every installed application on your computer. Mind you, learning how to program Applescript is not like learning to program most languages, but it's a really good test of your problem-solving skills.

    The other part is web programming. Nowadays, if you can get a computer that's visible to the internet, or an account on a web server that allows custom CGIs, you can make custom programs that will not only be cool to you, but potentially cool to the entire world. That's a lot more incentive than you had in the old days, or at least a different kind of incentive. It might even make for more solid coders in the future, since hobbyist and learning programmers nowadays get to see people trashing their programs repeatedly, so there's good reason to make them work properly.

    No, it's not the same, and it's may not be particularly easy to get started in the windows world, but for the rest of us, there are plenty of good opportunities for the beginning programmers.

    =Brian
  • by Anonymous Coward on Tuesday July 06, 2004 @04:18PM (#9625213)
    If apple's apps then call these APIs. It is possible that these APIs are incomplete, experimental, or internal to the OS. If Apple documents these APIs, that means they're obligated to support them and keep them relatively stable between OS releases, etc...

    This isn't quite like the Windows situation for two reasons.

    One, the problem in Windows is mostly that MS's hidden APIs are for (1) very important and basic things and (2) used extensively by MS's in-house apps.

    Two, Apple's been very good not just about keeping competitors on a level API playing field with Apple's apps, they've been very good about actually moving functionality OUT of Apple's inhouse apps and into public APIs. Witness searchlight services, or CoreGraphics. These were functionalities in Apple inhouse apps that Apple decided would be useful to other people, so they sucked it into the OS and made a public API for it...
  • by larkost ( 79011 ) on Tuesday July 06, 2004 @04:20PM (#9625235)
    While it has become harder to draw a black triangle on the screen programatically, it has become fire simpler to use an IDE to make a window that has a black triangle on it, and then draws "hello world" and asks you for your name, all well within ten lines of code (and 3 minutes of work).

    With XCode and InterfaceBuilder (the IDE tools that ship with MacOS X) I can whip up a text editor with support for rich text (fonts, formatting, colors, embedded images, etc) in under 20 lines of code (half of which are written for me), and a few minutes.

    I would say that it has become far easier to get complex things done in programming, and for a lot of tasks the entry level has gone down, but of course our expectations have increased enormously.
  • by Anonymous Coward on Tuesday July 06, 2004 @04:20PM (#9625245)
    Note in the article that he mentions Apple made some API changes which were very favorible to Desktop Manager. They could have switched stuff around to crush him like a bug. But they instead made changes that helped - does that sound like a company bent on the "One Way" to do everything?
    Note also that he had to reverse engineer all this stuff. Apple does not seem as helpful as you suggest.
  • I would be more concerned about the fact that "secret" code is subject to change without notice. Objective-C doesn't support private methods, but leaving prototypes out of the header file makes it "pseudo-private." Aqua does have a few other unimplemented capabilities, like theoretical support for tear-off menus. Then again, we might see things like this in the future--it used to be that changing key bindings for menu items at runtime was partially coded but unsupported, but it was added as a feature to Panther.
  • Steals GPL source??? (Score:5, Interesting)

    by nacturation ( 646836 ) <nacturation AT gmail DOT com> on Tuesday July 06, 2004 @04:41PM (#9625556) Journal
    Highlights are secret APIs in OS X for VirtualDesktops, who steals GPL source...

    Where is this in the article? I read the whole thing, then went back and searched for every occurrence of "steal" (zero results) and "GPL". The only part that mentions Virtual Desktops is that CodeTek can't use the Desktop Manager source in their closed source app because it's GPLed. The relevant section is:

    "I still get some emails accusing me of being petty and small minded for GPL-ing Desktop Manager since CodeTek can't easily use my code. That is silly since they are quite capable of re-implementing Desktop Manager in a far better way using my techniques. I haven't tried (nor could I probably) claim control over how people use the APIs I discovered."

    Nowhere does this claim that Virtual Desktops is using, let alone stealing, anything from his source. Unless I missed something here, I fail to see how such a statement is anything more than libel.
  • by Anonymous Coward on Tuesday July 06, 2004 @04:43PM (#9625586)
    Why doesn't Apple support multiple virtual desktops?

    Because that would be confusing as there are real multiple desktops. You can have multiple desktops active at the same time. Say one for surfing and loading trojans by accident and another for online banking and you know that they are safely separated from each other.

    It's called Fast User Switching, but realise that they are all active at the same time. Adding virtual desktops which are not separate would confuse the user and water down simple secure separation of tasks functionality.

    Oops, I thought I did my finacnes on another desktop but I guess I've accidentally shared it with this guy who send me a funny application via mail or chat, because the separation was virtual/visual only.

    You can have separate desktops on Mac OS X and they are really separate, that is a major plus!

    Sure I would like multiple desktops within one user account but they should be separate and only have user permitted information exchange, nothing automatically allowed. Yes, that would be called sandboxing and I advocated sandboxes [quicknet.nl] for Mac OS 10.3. I hope they will be in 10.4 as a 2005 surprise because it would stop trojan applications and even protect against a bug in the webbrowser or email applications if those would run inside their own sandbox.

    Yes, you can still ask Apple for Sandboxes as they have introduced the basic technology in 10.3 and still have many months before 10.4 is ready.

    Dennis SCP
  • by SandSpider ( 60727 ) on Tuesday July 06, 2004 @04:51PM (#9625705) Homepage Journal
    I don't think the hurdle is as high as you make it out to be. I'll grant you, nobody's spoon-feeding every kid with a computer on how to program it, as it was in my day. On the other hand, there are far more kids who are using computers than did in the old days.

    I suspect a larger problem, if you want to call it that, is that computers do so much more than they used to. It's harder to find something that isn't already written, at least for the beginning programmer. On the other hand, the people who want to program computers tend to have a greater calling to it than just the users. They see the box, they see the potential, and they want to reach out and use that potential. That's what really drew me into programming, not the fact that there was BASIC right there, but that I saw the potential and wanted to exploit it.

    Okay, let's take an example. AIM bots. Kids these days will chat with people over AIM, and they'll run across a bot. Some kids will get annoyed, some won't realize they're talking to a bot, and some will see the limitations of the bot and want to make their own. Once you see that a bot can be made and used by normal people, then the people who are going to want to program them will figure it out. They'll hit google and type "how to program aim bot" or simialar, and poof! The world is their mollusc.

    Parents are also likely to help with this, hopefully. All the parents have to do is say, "You know, you could write programs, too." Even if the parents don't know how, I would be very surprised if some quick work on Google won't reveal answers. I'd also be surprised if kids today don't look up most of their facts on Google. It's easy, it's everywhere, and it's something they are growing up with.

    As for hosting web apps, though it's not a perfect solution, and not as easy to show the entire world as I made out before, it's really easy to do out of the box in OS X. Turn on personal web hosting, drop in some CGI, and play around.

    So: not the same, absolutely, but it's not a wasteland for potential programmers. The soil is fertile, the seeds just need to be dropped in.

    =Brian
  • Re:Big Brick Walls (Score:5, Interesting)

    by sparrow_hawk ( 552508 ) on Tuesday July 06, 2004 @04:55PM (#9625748)
    Umm... I'm not sure what version of SDL you're using, but all you need to throw up a black screen in SDL (in C) is the following:
    #include <stdio.h>
    #include <stdlib.h>

    #include "SDL.h"

    int main (int argc, char **argv) {

    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    fprintf(stderr, "Could not init SDL: %s\n", SDL_GetError());
    exit(1);
    }
    atexit(SDL_Quit);

    SDL_Surface *screen;
    screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);
    if (screen == NULL) {
    fprintf(stderr, "Could not set video mode: %s\n", SDL_GetError());
    exit(1);
    }

    SDL_Event event;
    int quit = 0;
    while (quit == 0) {
    SDL_Delay(1);
    while (SDL_PollEvent(&event)) {
    if (event.type == SDL_QUIT)
    quit = 1;
    }
    }

    SDL_FreeSurface(screen);

    return 0;

    }
    Compile it with
    gcc -Wall -ggdb `sdl-config --cflags --libs` ./SDL_app.c -o SDL_app
    and bingo, you've got a black screen. That's 35 lines of code, and it could have been less if I hadn't included error-checking and other nice things like that. For the record, most of it was cribbed from the SDL Introduction [libsdl.org].

    SDL is a beautiful, compact API that's also nicely extensible (eg. SDL_image [libsdl.org], SDL_mixer [libsdl.org], SDL_net [libsdl.org], smpeg, etc.). There's no *way* you need 150 lines of code to do interesting things with SDL.
  • by geordieboy ( 515166 ) on Tuesday July 06, 2004 @04:59PM (#9625806)
    I couldn't use Expose as a replacement for virtual desktops. I tend to put separate projects on each different desktop, not windows of the same type. So for example I will have TeX files and a DVI viewer for a paper I am working on on desktop 1, C code and a plotting program on another, etc. etc.
    It would be much less efficient for me to collect all the files
    I need using Expose. I tend to use Expose as a cute way to switch between say 5 Safari windows. It would be hideous trying to organize 50 windows with it.
  • by SuperKendall ( 25149 ) on Tuesday July 06, 2004 @05:10PM (#9625951)
    But theyt could also just have changed the names of these calls as well. Do you think the Apple engineers are not cognisant of the ways various third party apps are using even undocument features? They may not support it but they are sure to be monitoring it, and probably even figureing from the ways in which people are trying to call the system how they should enhance the calls further into an API for public consumption.

    The original poster sort if implied Apple was hostle to other ways of doing things - but I would say that at worst they are indifferent, and there is some evidence they are a little better than that in reality.
  • by isaac ( 2852 ) on Tuesday July 06, 2004 @05:28PM (#9626176)
    I'd love to use Desktop Manager instead of Codetek Virtual Desktop which has always felt iffy and bloated to me.

    Alas, multimonitor support is still pending, and Codetek gives me what I need even more than virtual desktops - Focus Follows Mouse!

    I sorely miss good focus-follows-mouse support; I know it's possible to enable it for X11 and Terminal.app, but only CTVD seems to allow enabling focus-follows-mouse across the whole system.

    -Isaac Salpeter
    iVillage Operations
  • Sometimes I wondered if the editor was adding his own remarks to the interview, since the parentheticals were italicized

    Just to clear this up, I didn't add anything to his remarks in any way, I did however format what was in parantheses in italics, simply because that's how I like to read (with something in italics being the continuation of a thought, and italics helps me jump out of it and back to the main thread). Whether or not that is the correct thing to do is something I'll have to be educated on.

    This is part of a larger series of chats I'm doing with people whose work/projects I find interesting, or topics I feel deserve some thought... and its obviously a case of a soup chef being given a piece of filet mignon and doing the best he can with it.
  • by SuperKendall ( 25149 ) * on Tuesday July 06, 2004 @05:55PM (#9626451)
    Now you're talking! Rather than bemoan the lack of virtual desktops, I think it's more useful to say "how can we make one desktop even more useful and usable?". That would be a great addition to Expose that would make it even more useful, even with a lot of windows. It would even elminiate the annoyance of having to define how a user moves windows between rooms or what rooms they show up in, as when new windows were open you could just shuffle them where you like with (as you say) some memory of where that was by app/title in case you re-opened them. You could have piles of stuff spatially related to a project, and possibly even some way to move a whole pile.
  • by Twirlip of the Mists ( 615030 ) <twirlipofthemists@yahoo.com> on Tuesday July 06, 2004 @05:59PM (#9626477)
    If apple's apps then call these APIs.

    Well, they don't, not really. There are two sets of calls he was talking about. There are the calls related to organizing the window hierarchy and splitting it. Nobody uses those calls. They may--this could be completely wrong, because I have done zero reading on the subject--date back to NEXTSTEP. Lots of little things in Cocoa do.

    The other set is related to the rotating-cube transition. Only one process calls that code.

    So these aren't pieces of code that are widely reused within Apple's programs.
  • by SuperKendall ( 25149 ) * on Tuesday July 06, 2004 @06:07PM (#9626536)
    I think over time applications themselves have to some extent replaced the need for virtual desktops. You mention managin 50 windows would be hard to use with Expose (actually I don't think it would be that bad, especially if you were mostly using the grouped Expose) but between tabbed browsing, and IDE's that really only have a few windows but easy code navigation reduce the number of windows you actually have to take care of.

    For project sets, I generally tend to close open windows nad have project related Finder windows open - threating them sort of like rooms. Since it's so quick just to open a document and not have to think if the program is open or not, having an icon in Finder is almost as good as a live window.

    Even when I was using virtual desktops more heavily I was using programs like Emacs (actually I still use Emacs very heavily) where having 200 files open was as easy as two.

    I'm not saying your pattern of working is any better or worse than any other, evryone thinks in different ways - I'm just trying to explain how people can be OK with no virtual desktops and still using working on a lot of projects at once.
  • by One_6453 ( 740362 ) on Tuesday July 06, 2004 @06:10PM (#9626552)
    I dont think it would be in apple's vested intrest to include virtual desktops with OSX because of these The new 30" displays..

    I mean why would they include a feature that (except for expose) that would take away from the main selling point of these huge displays i.e acres and acres of display real estate?
  • by TheRaven64 ( 641858 ) on Tuesday July 06, 2004 @07:09PM (#9627100) Journal
    I would like to see a nudge feature added to Exposé. Using this, you would press some combination of keys (or a mouse gesture, corner activation, or whatever) and get a different cursor. Any window you clicked on with this cursor would be nudged away (ideally off screen). When you got to the window you wanted, you would deactivate the nudge cursor, and the next window you selected would become the foreground window, at which point the others would all fly back to their old positions (behind the new front window). I believe that this would be better at preserving the spacial metaphor, and would scale to large number of windows, better than the current Exposé implementation.
  • by Anonymous Coward on Tuesday July 06, 2004 @07:40PM (#9627342)
    Now tell me how do I close a tab in Mozilla if it's not the one I'm currently looking at??? You can't.

    Don't get me wrong, I love Mozilla to death but I prefer the way Safari does the tab close button.
  • by peragrin ( 659227 ) on Tuesday July 06, 2004 @09:53PM (#9628230)
    The point is my Linux desktop takes longer to load than windows, but it also uses a karamba theme to displays today's weather on all desktops.

    The First one opens 5 different web pages in a browser full screen, in Different tabs.

    The Second one opens and checks email, loads and connects to three different IM protocols(one client) and, connects to two IRC servers

    The third one is a full screen konsole, with transparent background and no menu's or title bars.

    The Fourth screen Opens up a File manager set two two different working directories, as well as 6 Sticky notes on the side of the desktop.

    Can expose match the quick search features of all that in literally a click??? I can switch desktops, and which windows I am using with either ctrl-tab or a click on the pager.

    Just because though I have set KDE 3.2 to look like aqua, it does look and feel better than anything else.
  • Re:Or not... (Score:4, Interesting)

    by shellbeach ( 610559 ) on Wednesday July 07, 2004 @12:02AM (#9628984)
    ever heard of visual basic?

    Actually, I would have said that Perl (and Perl/Tk for creating GUIs) is the equivalent BASIC these days. Simple, straightforward, free and cross-platform ... and there's some excellent O'Reilly books for beginners.

    YMMV, of course :)
  • by mcc ( 14761 ) <amcclure@purdue.edu> on Wednesday July 07, 2004 @02:48AM (#9629564) Homepage
    I am rarely doing fewer than 8 things at once on my mac and have never had a problem even before Expose. The fact that the task switcher has applications rather than windows as its level of granularity, along with the fact every app does window-level tracking and accepts command-tilde for "next window", allow me to reach any window in the system immediately. The only time this becomes a problem is when I can't clearly remember whatall is open, and Expose neatly fills this gap.

    I am well familiar with how pagers work. For my purposes however the fact that the mac automatically categorizes windows based on parent application provides a far more useful and natural idiom than the somewhat more manual mechanism provided by virtual desktops.
  • So use COMMAND-TAB (switch applications) and COMMAND-TILDE (switch windows within an application). When you can't access your virtual desktop manager, I mean. I *ALWAYS* have one hand on the mouse for doing layout and such, and I try to stay out of shell as much as possible since this isn't the stone age and I am not a caveman.

    Oh, and just so this isn't flamebait -- my own opinion of shells does not mean that yours is invalid. I bought a Mac because I like the graphical user interface. I understand a lot of people know the CLI like the back of their hand and would never THINK of writing an AppleScript to do what they can already do in Perl. But I've also seen a lot of people swear at a poorly written regular expression that would be much more understandable -- and reusable -- as a Macro in BBEdit. More options does not mean more control, it just means you need to learn more before you can obtain control.

Math is like love -- a simple idea but it can get complicated. -- R. Drabek

Working...