Module: Rabbit::ScreenInfo

Included in:
Frame
Defined in:
lib/rabbit/utils.rb

Class Method Summary collapse

Class Method Details

.default_screenObject



372
373
374
# File 'lib/rabbit/utils.rb', line 372

def default_screen
  Gdk::Screen.default
end

.mm_to_inch(mm) ⇒ Object



404
405
406
# File 'lib/rabbit/utils.rb', line 404

def mm_to_inch(mm)
  mm / 25.4
end

.screen_depthObject



400
401
402
# File 'lib/rabbit/utils.rb', line 400

def screen_depth
  default_screen.system_visual.depth
end

.screen_heightObject



384
385
386
# File 'lib/rabbit/utils.rb', line 384

def screen_height
  default_screen.height
end

.screen_height_mmObject



388
389
390
# File 'lib/rabbit/utils.rb', line 388

def screen_height_mm
  default_screen.height_mm
end

.screen_widthObject



376
377
378
# File 'lib/rabbit/utils.rb', line 376

def screen_width
  default_screen.width
end

.screen_width_mmObject



380
381
382
# File 'lib/rabbit/utils.rb', line 380

def screen_width_mm
  default_screen.width_mm
end

.screen_x_resolutionObject



392
393
394
# File 'lib/rabbit/utils.rb', line 392

def screen_x_resolution
  screen_width / mm_to_inch(screen_width_mm)
end

.screen_y_resolutionObject



396
397
398
# File 'lib/rabbit/utils.rb', line 396

def screen_y_resolution
  screen_height / mm_to_inch(screen_height_mm)
end