XUL:XUL Layout Source

From MozillaWiki
Jump to: navigation, search

XUL Layout Source Files (/layout/xul/base/src/)

nsBox 
base for all frame types, even non-boxes. It contains various box layout functions but it adds no fields, just methods.
nsBoxFrame 
box frames (anything with display: -moz-box) which supports flexibility in both directions, children are laid out horizontally or vertically. All XUL elements are boxes, although some are descendant types like stack
nsBoxLayout 
base layout type for laying out boxes. This is a helper object used for layout which contains only methods. There are several descendant classes (SprocketLayout) Box layout objects are static global objects so there is only one of each type.
nsBoxLayoutState 
state object created during layout calls (reflow)
nsBoxObject 
a box object is used for XUL layout specific APIs such as getting the position and size of an element. There are several subclasses of box object and the one you get for an element is dependant on the CSS or XBL display. nsBoxObject is the base class for all other elements.
nsBrowserBoxObject 
box object used for <browser>. This adds a docShell property for getting at the document inside a browser.
nsButtonBoxFrame 
frame used for buttons, which adds command event support.
nsDeckFrame 
frame used for decks. It shows only one child of the deck at a time, specified by the selectedIndex attribute on the deck. It hides and shows the other children using views rather than using CSS.
nsDocElementBoxFrame 
used for the XUL document element. This type of frame will be constructed if a document contains a root tag that is a XUL element. This frame type adds a popupgroup and a default tooltip element placeholders, which are set as anonymous children of this frame. These special frames are used to hold the frames used for popups and tooltips when they are open.
nsEditorBoxFrame 
box object used for <editor>. It is pretty much equivalent to nsBrowserBoxObject.
nsFrameNavigator 
some utility functions for navigating the frame tree, but it appears to only be used by the SplitterFrame
nsGrippyFrame 
frame type used for grippy, which is supposed to be a notch inside a splitter. The user can click the notch inside the splitter to collapse a sidebar for example. This is only used by Mac Firefox and Seamonkey. For toolkit, this frame type isn't needed since the Mac splitter code could just handle it instead, and be more consistent with other Mac applications. For Seamonkey, it should be possible to move into XBL.
nsGroupBoxFrame 
frame type used for groupboxes. It places the first child as a caption and draws a rectangle around the remaining children. It doesn't do anything else but does have custom drawing code for this.
nsIBoxLayout 
base interface for layout objects
nsIFrameBoxFrame 
box object used for <iframe>. It is pretty much equivalent to nsBrowserBoxObject.
nsIMenuParent 
base interface for menu frames nsMenuPopupFrame and nsMenuBarFrame
nsIRootBox 
base interface for nsRootBoxFrame
nsIScrollbarFrame 
base interface for nsScrollbarFrame
nsIScrollbarListener 
used for callbacks from the slider but there doesn't seem to be anything that makes use of it. There's also nsIScrollbarMediator which does slider callbacks anyway and is used.
nsImageBoxFrame 
frame type used for images.
nsLeafBoxFrame 
base frame type used for elements that do not normally display children. Tags that inherit from this are: image, spacer, textbox and treechildren. It inherits from LeafFrame rather than BoxFrame. This frame appears to do layout of its children but the children do not appear on screen, so I'm not sure why it is done. Possibly to set their positions as needed.
nsListBoxBodyFrame 
used for listboxes. Has some code to dynamically create and destroy listitem frames as the list is scrolled.
nsListBoxLayout 
layout object for listboxes, inheriting from nsBoxLayout which positions child listitems.
nsListBoxObject 
box object for listboxes, which provides row information and scrolling methods.
nsListItemFrame 
frame type for listitems. This is the same as a grid row frame GridRowLeafFrame, except it ensures that the height of all listitems in a list are the same and it supports allowevents to control how mouse events are passed to the children.
nsMenuBarFrame 
frame type used for menubars on non-Mac platforms. Mac platforms use a native menubar. Adds an nsMenuBarListener which listens to keyboard events for menubar keyboard navigation. Also handles appropriate accesskeys.
nsMenuBarListener 
listener for menubar keyboard handling
nsMenuBoxObject 
box objects for menus.
nsMenuDismissalListener 
a global object used for closing menus. This object handles clicks outside the menu to close it.
nsMenuFrame 
frame type for menus.
nsMenuListener 
listener used for keyboard navigation within menus
nsMenuPopupFrame 
frame type used for popups.
nsNativeScrollbarFrame 
on the Mac, native scrollbars are used. This frame type wraps it and updates its state when the scrollbar attributes change and vice versa.
nsPIListBoxObject 
private interface associated with listbox box objects
nsPopupBoxObject 
box objects for popups.
nsPopupSetFrame 
special frame used to hold open popups. This frame type should only be created by the nsDocElementBoxFrame and only one should exist per document. This is a placeholder frame used for holding all popups that aren't part of a menu. Popup frames for menus are placed inside the menu frame.
nsProgressMeterFrame 
frame type used for progressmeters. It changes the flexibility of its first two children based on the value attribute, to make a progressmeter. The first child is the area completed and the second child is the area not yet completed. This code could just be moved into the binding for progressmeter.
nsRepeatService 
timer callback for elements that need to repeat mouse events. Currently, this is the slider dragging, clicking on scrollbar buttons and hovering over autorepeatbuttons.
nsResizerFrame 
frame type for resizers, which allow resizing the window by dragging.
nsRootBoxFrame 
root box frame for a XUL document.
nsScrollBoxFrame 
implements the AutoRepeatBoxFrame, which is a button frame which repeats its action while hovering over the button. The scrollbox that used to be here is implemented in other scrollbar handling code.
nsScrollBoxObject 
box object for scrollboxes
nsScrollbarButtonFrame 
frame type for scrollbarbuttons which is a subtype of the button frame. Supports repeating the button action while the mouse button is held down, and adjusting the scrollbar it is contained within.
nsScrollbarFrame 
frame type for scrollbars. Seems to be just a wrapper as nsSliderFrame does most of the work.
nsSliderFrame 
frame type for sliders, which currently is the area between the scrollbar buttons. Handles mouse events and adjusting the slider thumb as necessary.
nsSplitterFrame 
frame type for splitters. This frame type supports dragging to adjust the size of the panels around it.
nsSprocketLayout 
box layout object which positions and sizes children according to the xul box model.
nsStackFrame 
frame used for stacks, where each child is placed on top of each other, with optional positions and sizes.
nsStackLayout 
layout object for stacks
nsTextBoxFrame 
frame type for labels. Supports accesskeys and cropping using ellipses. Uses drawing code to draw the text, with support for various CSS text features such as underlines.
nsTitleBarFrame 
frame type for titlebars, which alolow dragging the window around. Only used for custom titlebars, not for normal native titlebars.
nsXULTooltipListener 
used to open and close tooltips as necessary

The grid directory contains grid handling code, and the tree directory contains tree handling code.