[changeset] Missing ScreenSize & ScreenPixelsPerInch properties

John W. Eaton jwe at octave.org
Thu Jan 22 12:03:11 CST 2009


On 22-Jan-2009, Ben Abbott wrote:

| The program's output is below.
| 
| 1280x1024 pixels
| 380x310 mm
| 83.9019 resx
| 85.5579 resx
| 84.7299 avg dpi
| 32 bit depth
| 
| I can confirm the numbers are correct as well ... well almost. The physical size of my screen is 14.75x11.75 inches.
| 
| >> [1280,1024]./[14.75,11.75]
| ans =
|    86.7797   87.1489
| 
| The manufacturer likes to claim 15x12inches
| 
| >> [1280,1024]./[15,12]
| ans =
|    85.3333   85.3333
| 
| In any event, looks good to me.

OK.

Is it reasonable to assume that all current OS X systems will have
CGDirectDisplay.h and CGDisplayConfiguration.h and these functions?

How should we decide that we are using OS X?  Are there any
preprocessor macros we can depend on?  We currently do this on Windows
systems:

  #if defined (_MSC_VER)
  #define __WIN32__
  #define WIN32
  [...]
  #endif

  /* Define if we expect to have <windows.h>, Sleep, etc. */
  #if defined (__WIN32__) && ! defined (__CYGWIN__)
  #define OCTAVE_USE_WINDOWS_API 1
  #endif

(Does GCC define __WIN32__ and WIN32 automatically?)  I'd like to do
something similar for OS X to define OCTAVE_USE_OS_X_API.

jwe


More information about the Octave-maintainers mailing list