XUL:XUL Layout Source

From MozillaWiki
Jump to: navigation, search

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

base for all frame types, even non-boxes. It contains various box layout functions but it adds no fields, just methods.
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
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.
state object created during layout calls (reflow)
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.
box object used for <browser>. This adds a docShell property for getting at the document inside a browser.
frame used for buttons, which adds command event support.
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.
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.
box object used for <editor>. It is pretty much equivalent to nsBrowserBoxObject.
some utility functions for navigating the frame tree, but it appears to only be used by the SplitterFrame
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.
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.
base interface for layout objects
box object used for <iframe>. It is pretty much equivalent to nsBrowserBoxObject.
base interface for menu frames nsMenuPopupFrame and nsMenuBarFrame
base interface for nsRootBoxFrame
base interface for nsScrollbarFrame
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.
frame type used for images.
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.
used for listboxes. Has some code to dynamically create and destroy listitem frames as the list is scrolled.
layout object for listboxes, inheriting from nsBoxLayout which positions child listitems.
box object for listboxes, which provides row information and scrolling methods.
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.
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.
listener for menubar keyboard handling
box objects for menus.
a global object used for closing menus. This object handles clicks outside the menu to close it.
frame type for menus.
listener used for keyboard navigation within menus
frame type used for popups.
on the Mac, native scrollbars are used. This frame type wraps it and updates its state when the scrollbar attributes change and vice versa.
private interface associated with listbox box objects
box objects for popups.
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.
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.
timer callback for elements that need to repeat mouse events. Currently, this is the slider dragging, clicking on scrollbar buttons and hovering over autorepeatbuttons.
frame type for resizers, which allow resizing the window by dragging.
root box frame for a XUL document.
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.
box object for scrollboxes
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.
frame type for scrollbars. Seems to be just a wrapper as nsSliderFrame does most of the work.
frame type for sliders, which currently is the area between the scrollbar buttons. Handles mouse events and adjusting the slider thumb as necessary.
frame type for splitters. This frame type supports dragging to adjust the size of the panels around it.
box layout object which positions and sizes children according to the xul box model.
frame used for stacks, where each child is placed on top of each other, with optional positions and sizes.
layout object for stacks
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.
frame type for titlebars, which alolow dragging the window around. Only used for custom titlebars, not for normal native titlebars.
used to open and close tooltips as necessary

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