windowUtils.js File Reference

Window Utility constants, functions and objects that are common to all windows. More...

Go to the source code of this file.

Functions

Components utils import ("resource://app/jsmodules/StringUtils.jsm")
 
 if (typeof(Cc)=="undefined") window.Cc
 
function sbScreenRect (inWidth, inHeight, inX, inY)
 
function getCurMaxScreenRect ()
 
function sbMacWindowZoomController ()
 
function SB_LOG (scopeStr, msg)
 
function getPref (aFunc, aPreference, aDefaultValue)
 Get a preference. Adapted from nsUpdateService.js.in. Need to replace with dataremotes. More...
 
function setPref (aFunc, aPreference, aValue)
 Set a preference. More...
 
function onMinimize ()
 onMinimize handler, minimizes the window in the current context. More...
 
function onMaximize (aMaximize)
 onMaximize handler, maximizes the window in the current context. More...
 
function isMaximized ()
 Is the window in the current context maximized? More...
 
function isMinimized ()
 Is the window in the current context minimized? More...
 
function onExit (skipSave)
 onExit handler, saves window size and position before closing the window. More...
 
function onHide ()
 onHide handler, handles hiding the window in the current context. More...
 
function onWindowResizeComplete ()
 Handles completion of resizing of the window in the current context. More...
 
function onWindowDragComplete ()
 Handles completion of dragging of the window in the current context. More...
 
function windowFocus ()
 Focus the window in the current context. More...
 
function delayedActivate ()
 Delayed focus of the window in the current context. More...
 
function windowPlacementSanityChecks ()
 See if a window needs to be somehow "fixed" after it is opened. More...
 

Variables

var CORE_WINDOWTYPE = "Songbird:Core"
 The Songbird Core Window Type. More...
 
var STATE_MAXIMIZED = Ci.nsIDOMChromeWindow.STATE_MAXIMIZED
 Maximized State value. More...
 
var STATE_MINIMIZED = Ci.nsIDOMChromeWindow.STATE_MINIMIZED
 Minimized State value. More...
 
var gMM
 
var gPrompt
 
var gPrefs
 
var gConsole
 
var gTypeSniffer
 
sbMacWindowZoomController prototype
 
var macZoomWindowController = null
 
var theSongbirdStrings = document.getElementById( "songbird_strings" )
 
var PREFS_SERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"
 
var nsIPrefBranch2 = Components.interfaces.nsIPrefBranch2
 

Detailed Description

Window Utility constants, functions and objects that are common to all windows.

Note: This file is dependent on chrome://global/content/globalOverlay.js

Definition in file windowUtils.js.

Function Documentation

function delayedActivate ( )

Delayed focus of the window in the current context.

Definition at line 442 of file windowUtils.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function getCurMaxScreenRect ( )

Get the current maximum available screen rect based on which screen the window is currently on.

Returns
A |sbScreenRect| object containing the max available coordinates of the current screen.

Definition at line 92 of file windowUtils.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function getPref (   aFunc,
  aPreference,
  aDefaultValue 
)

Get a preference. Adapted from nsUpdateService.js.in. Need to replace with dataremotes.

Parameters
aFuncFunction to used to retrieve the pref.
aPreferenceThe name of the pref to retrieve.
aDefaultValueThe default value to return if it is impossible to read the pref or it does not exist.

Definition at line 262 of file windowUtils.js.

if ( typeof(Cc = ="undefined")

Debug Wrapper. Subclasses and replaces DateRemote to keep track of how many dataremotes are alive, and for which keys.

Enable DEBUG_DATAREMOTES to track down leaks.

Definition at line 524 of file sbDataRemote.js.

Components utils import ( "resource://app/jsmodules/StringUtils.jsm"  )
function isMaximized ( )

Is the window in the current context maximized?

Returns
true or false.

Definition at line 329 of file windowUtils.js.

function isMinimized ( )

Is the window in the current context minimized?

Returns
true or false.

Definition at line 338 of file windowUtils.js.

function onExit (   skipSave)

onExit handler, saves window size and position before closing the window.

Definition at line 355 of file windowUtils.js.

function onHide ( )

onHide handler, handles hiding the window in the current context.

Definition at line 364 of file windowUtils.js.

function onMaximize (   aMaximize)

onMaximize handler, maximizes the window in the current context.

Definition at line 299 of file windowUtils.js.

Here is the caller graph for this function:

function onMinimize ( )

onMinimize handler, minimizes the window in the current context.

Definition at line 290 of file windowUtils.js.

function onWindowDragComplete ( )

Handles completion of dragging of the window in the current context.

Definition at line 414 of file windowUtils.js.

Here is the call graph for this function:

function onWindowResizeComplete ( )

Handles completion of resizing of the window in the current context.

Definition at line 404 of file windowUtils.js.

Here is the call graph for this function:

function SB_LOG (   scopeStr,
  msg 
)

Definition at line 244 of file windowUtils.js.

Here is the caller graph for this function:

function sbMacWindowZoomController ( )

Since the Mac doesn't technically "maximize" - it "zooms", this controller recreates that functionality for mac windows.

KREEGER: This functionality is also affected by mozbug 407405 and will make zoom to the secondary monitor work properly once that bug is fixed.

Definition at line 116 of file windowUtils.js.

function sbScreenRect (   inWidth,
  inHeight,
  inX,
  inY 
)

Simple JS container that holds rectangle information for (x, y) and (width, height).

Definition at line 79 of file windowUtils.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function setPref (   aFunc,
  aPreference,
  aValue 
)

Set a preference.

Parameters
aFuncFunction to used to set the pref.
aPreferenceThe name of the pref to set.
aValueThe value of the pref.
Returns
The return value of the function used to set the pref.

Definition at line 280 of file windowUtils.js.

function windowFocus ( )

Focus the window in the current context.

Definition at line 424 of file windowUtils.js.

Here is the caller graph for this function:

function windowPlacementSanityChecks ( )

See if a window needs to be somehow "fixed" after it is opened.

In addition to loading the size and position (if stored), we also perform some sanity checks. The window must be:

  • sized appropriately if we have never seen it before
  • not too small for its min-size styles or some default minimum.
  • actually on screen somewhere.

Get a style property from an element in the window in the current context.

Parameters
elThe element.
stylePropThe style property.
defaultValue[optional] the default value to return; 0 if not supplied
Returns
The computed style value.

Definition at line 457 of file windowUtils.js.

Here is the call graph for this function:

Variable Documentation

var CORE_WINDOWTYPE = "Songbird:Core"

The Songbird Core Window Type.

Definition at line 50 of file windowUtils.js.

var gConsole
Initial value:
= Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService)
const Cc
const Ci

Definition at line 68 of file windowUtils.js.

var gMM
Initial value:
= Cc["@songbirdnest.com/Songbird/Mediacore/Manager;1"]
.getService(Ci.sbIMediacoreManager)
const Cc
const Ci

Definition at line 62 of file windowUtils.js.

var gPrefs
Initial value:
= Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefBranch)
const Cc
const Ci

Definition at line 66 of file windowUtils.js.

var gPrompt
Initial value:
= Cc["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Ci.nsIPromptService)
const Cc
const Ci

Definition at line 64 of file windowUtils.js.

var gTypeSniffer
Initial value:
= Cc["@songbirdnest.com/Songbird/Mediacore/TypeSniffer;1"]
.createInstance(Ci.sbIMediacoreTypeSniffer)
const Cc
const Ci

Definition at line 71 of file windowUtils.js.

var macZoomWindowController = null

Definition at line 235 of file windowUtils.js.

var nsIPrefBranch2 = Components.interfaces.nsIPrefBranch2

Definition at line 253 of file windowUtils.js.

var PREFS_SERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"

Definition at line 252 of file windowUtils.js.

Definition at line 120 of file windowUtils.js.

var STATE_MAXIMIZED = Ci.nsIDOMChromeWindow.STATE_MAXIMIZED

Maximized State value.

Definition at line 55 of file windowUtils.js.

var STATE_MINIMIZED = Ci.nsIDOMChromeWindow.STATE_MINIMIZED

Minimized State value.

Definition at line 60 of file windowUtils.js.

var theSongbirdStrings = document.getElementById( "songbird_strings" )

Definition at line 241 of file windowUtils.js.