sbMacWindowTitlebarService.mm File Reference
#include "sbMacWindowTitlebarService.h"
#include "../NativeWindowFromNode.h"
#include <sbFileUtils.h>
#include <nsColor.h>
#include <nsICategoryManager.h>
#include <nsIDOMDocument.h>
#include <nsIDOMElement.h>
#include <nsIDOMWindow.h>
#include <nsIWindowWatcher.h>
#include <nsNetUtil.h>
#include <nsServiceManagerUtils.h>
#include <nsStringGlue.h>
#include <objc/objc-runtime.h>
Include dependency graph for sbMacWindowTitlebarService.mm:

Go to the source code of this file.

Functions

static nsresult GetDOMWindowFromNativeWindow (void *aNativeWindow, nsIDOMWindow **aDOMWindow)
 
static nsresult GetSBTitlebarColor (NSWindow *aWindow, NSColor **aColor)
 
static nsresult GetSBTitlebarImage (NSWindow *aWindow, NSImage **aImage)
 
static nsresult GetSBTitlebarTextColor (NSWindow *aWindow, NSColor **aColor)
 
static nsresult GetWindowAttribute (NSWindow *aWindow, const nsAString &aAttributeName, nsAString &aAttributeValue)
 
static nsresult GetWindowAttribute (NSWindow *aWindow, const nsAString &aAttributeName, NSColor **aColor)
 
static nsresult GetWindowAttribute (NSWindow *aWindow, const nsAString &aAttributeName, NSImage **aImage)
 
static NSImage * GetImageFromURL (const nsAString &aImageURL)
 
static PRBool SBParseColor (const nsAString &aColorString, nscolor *aColor)
 

Function Documentation

nsresult GetDOMWindowFromNativeWindow ( void *  aNativeWindow,
nsIDOMWindow **  aDOMWindow 
)
static

Return in aDOMWindow the DOM window corresponding to the native window specified by aNativeWindow.

Parameters
aNativeWindowNative window for which to find corresponding DOM window.
aDOMWindowReturned DOM window.
Returns
NS_ERROR_NOT_AVAILABLE No DOM window corresponds to the native window.

Definition at line 366 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

NSImage * GetImageFromURL ( const nsAString &  aImageURL)
static

Return an image object read from the image URL specified by aImageURL.

Parameters
aImageURLURL of image.
Returns
Image object.

Definition at line 666 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetSBTitlebarColor ( NSWindow *  aWindow,
NSColor **  aColor 
)
static

Return in aColor the Songbird color that should be used for the titlebar for the window specified by aWindow. The color depends upon whether or not the window is the key window.

Parameters
aWindowWindow for which to get titlebar color.
aColorReturned titlebar color.

Definition at line 422 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetSBTitlebarImage ( NSWindow *  aWindow,
NSImage **  aImage 
)
static

Return in aImage the Songbird image that should be used for the titlebar for the window specified by aWindow. The image depends upon whether or not the window is the key window.

Parameters
aWindowWindow for which to get titlebar image.
aImageReturned titlebar image.

Definition at line 460 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetSBTitlebarTextColor ( NSWindow *  aWindow,
NSColor **  aColor 
)
static

Return in aColor the Songbird color that should be used for the titlebar text for the window specified by aWindow. The color depends upon whether or not the window is the key window.

Parameters
aWindowWindow for which to get titlebar text color.
aColorReturned titlebar text color.

Definition at line 498 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetWindowAttribute ( NSWindow *  aWindow,
const nsAString &  aAttributeName,
nsAString &  aAttributeValue 
)
static

Return in aAttributeValue the value string for the attribute with the name specified by aAttributeName for the window specified by aWindow.

Parameters
aWindowWindow for which to get attribute value.
aAttributeNameName of attribute to get.
aAttributeValueReturned attribute value.

Definition at line 536 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult GetWindowAttribute ( NSWindow *  aWindow,
const nsAString &  aAttributeName,
NSColor **  aColor 
)
static

Return in aColor the color value for the attribute with the name specified by aAttributeName for the window specified by aWindow.

Parameters
aWindowWindow for which to get attribute value.
aAttributeNameName of attribute to get.
aColorReturned attribute color value.

Definition at line 583 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

nsresult GetWindowAttribute ( NSWindow *  aWindow,
const nsAString &  aAttributeName,
NSImage **  aImage 
)
static

Return in aImage the image value for the attribute with the name specified by aAttributeName for the window specified by aWindow.

Parameters
aWindowWindow for which to get attribute value.
aAttributeNameName of attribute to get.
aImageReturned attribute image value.

Definition at line 629 of file sbMacWindowTitlebarService.mm.

Here is the call graph for this function:

PRBool SBParseColor ( const nsAString &  aColorString,
nscolor *  aColor 
)
static

Parse the color string specified by aColorString and return the parsed color in aColor. See Mozilla's nsAttrValue::ParseColor.

Parameters
aColorStringColor string to be parsed.
aColorReturned parsed color string.
Returns
PR_TRUE Whether the string could be parsed to a color.

Definition at line 706 of file sbMacWindowTitlebarService.mm.

Here is the caller graph for this function: