Slashdot Mirror


Aqua Enhancements

Marsee writes: "Mike Beam looks at two Aqua enhancements -- one seemingly frivolous and the other not: animated window resizing and drawers." O'Reilly's really invested in Mac OS X, and they often have nice articles for developers on a wide range of subjects in their Mac DevCenter.

15 comments

  1. Re:Windows by EddydaSquige · · Score: 1

    it's not just window resizing, all windows managers can resize (did you even read the article?) It's about the wonderfully useless ANIMATED window resizing. Looks like all you apps are going down the frain when it's turned on.

  2. Re:Windows by dthable · · Score: 2, Insightful

    It fits more into subitle usability features. The "drain" effect is basically the Window manager showing you where it wants to put the application. Is this necessary for the power user? Not really. Do newbies like it? Yes.

    I used to work at the university call center. You wouldn't believe the number of people who claimed that Windows lost the program they were working on. It turns out that they would hit the minimize button or some keystroke. Then the application would minimize without warning. By having Aqua show you where things went, you can find them without any knowldege of computers.

  3. Resolution Independance by Matthias+Wiesmann · · Score: 5, Insightful

    Actually, using floating points is a very good thing for GUI stuff. While it might seem pointless for window sizes, all coordinates in Quartz are floating point. This makes it posible to work in a resolution independant way.

    Thinking of the screen as a discret grid is not the way to go if you want to handle anti-aliasing, sub-pixel text positioning, scaling for a screen with a different size/resolution, etc...

    Remember that Quartz is used for handling on screen drawing, but also printing -- current printers can have 24 times more resolution than your screen (2400 DPI vs 100)- so if you use the discrete grid of your screen to describe stuff for your printer, you can only adress directly one pixel out of 576.

    1. Re:Resolution Independance by extrasolar · · Score: 2

      Are you saying that Aqua actually does "anti-aliasing, sub-pixel text positioning, scaling for a screen with a different size/resolution" or that you think it might?

      Also, typically floating point operations are much slower than equivalent integer operations. If you need to divide integers, create a rational type. (apologies, my C is rusty)

      struct rational {
      int num;
      int denom;
      }

      From there it should be simple to build arithmetic operations for this rational type. Of course, this isn't going to help if you want the square root of a number but you can always build a polynomial type :)

      Remember that Quartz is used for handling on screen drawing, but also printing -- current printers can have 24 times more resolution than your screen (2400 DPI vs 100)- so if you use the discrete grid of your screen to describe stuff for your printer, you can only adress directly one pixel out of 576.

      I certainly hope that Mac OS X uses some sort of vector format for printing rather than printing from the screen (a raster display) :)

    2. Re:Resolution Independance by clarkcox3 · · Score: 1
      Are you saying that Aqua actually does "anti-aliasing, sub-pixel text positioning, scaling for a screen with a different size/resolution" or that you think it might?
      I does.
      Also, typically floating point operations are much slower than equivalent integer operations.
      Actually, IIRC, except for some divisions, on the PowerPC, all simple operations (integer and floating-point) execute in the same amount of time: a single cycle.
      --
      There are no tiger attacks in my area and it's all because this rock I'm holding keeps the tigers away.
  4. Publishers like O'Reilly by PrimeWaveZ · · Score: 2, Insightful

    I think publishers like O"Reilly who dive head first into Mac OS X will be happy with the return on their investment. Look at Microsoft, who went great gonzos with their next Office version, which is Mac OS X only.

    Other, more lukewarm publishers won't sell as many products, and in turn say "See, we were right! OS X isn't as cool as you all thought."

    It is a self-fulfilling prophecy, but O'Reilly has seemed to fulfill a good one for themselves, rather than a bad one. Bravo, I say!

  5. Re:Pixels by King+of+the+World · · Score: 0
    They're vectors and it's resolution independent.

    I HATE YOUR SOUL

  6. Slower floating point?? by brettper · · Score: 2, Informative

    Also, typically floating point operations are much slower than equivalent integer operations

    Erm. On a 386 maybe. These days FP mults and adds are as quick as (and sometimes faster than)integer ones.

  7. Fixed point by Matthias+Wiesmann · · Score: 4, Informative
    Actually, floating point is quite fast on a PPC. As people already pointed out, for matrix-like computation, PPC has a special instruction that does one multiplication and one addition in one cycle. If this is to slow, on a G4 you can use altivec.

    If you really want not to use floating point calculation, then rational numbers are not the way to go. Instead you should use fixed point numbers. Old 68K based macintoshes (without FPUs) relied on those for fast calculation - in fact as far as I remember, the original Quickdraw toolbox relied of fixed point number for geometric calculations (arcs, slopes, etc.).

    Basically, the idea is to use integers divided by a fixed number, so that the binary number has a fixed point. For instance if you have 32 bits numbers, you assume they are divided by 65536. This means that you have 16 bits before the point, and 16 bits after. This way for additions and substractions, you can use integer operations, calculation can also use the zero and sign flags of the processor. For mulitplication and division, you need to fiddle the integer system a bit (by multiplying or dividing by 2^16), but this could be done using shift operations, which are quite fast.

    The rational structure you propose is not good because a simple addition requires many assembly level operations. For instance to calculate 6/5 + 2/3, you need to do the following calculation:

    1. Find the greatest common dividers of 5 and 3 (this is quite an expensive calculation)
    2. If none is found, multiply 3 by 5.
    3. Multiply 6 by 3 and 2 by 5.
    4. Add the result
    So this basically for a single addition, you need to do perform at least a GCD calculation, one test, three multiplications and one addition. Multiplications and division are a little less costly, but you still need to check if the fraction is simplified.
    Rational numbers are good if you want absolute precision, but for they are not very fast - because there is no support for such a format in current processor instruction sets.

    As for OS X using a vector format, this is, of course the case. Quarty relies on the PDF abstractions and it does support anti-aliasing, and sub-pixel positioning (I don't know for screen scaling). But having a vector format is not sufficient Quickdraw was also vector based, but used an integer coordinate system. This meant that lines, rectangles and arcs had to have their extremities on round coordinates of the Quickdraw grid - the result was not always very satisfactory.