зеркало из https://github.com/mozilla/pjs.git
Made comments DOC++ compatible
This commit is contained in:
Родитель
5c4f86ae3d
Коммит
11af27de6a
|
@ -30,9 +30,12 @@ class nsIWidget;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum nsEventStatus {
|
enum nsEventStatus {
|
||||||
nsEventStatus_eIgnore, // The event is ignored, do default processing
|
/// The event is ignored, do default processing
|
||||||
nsEventStatus_eConsumeNoDefault, // The event is consumed, don't do default processing
|
nsEventStatus_eIgnore,
|
||||||
nsEventStatus_eConsumeDoDefault // The event is consumed, but do default processing
|
/// The event is consumed, don't do default processing
|
||||||
|
nsEventStatus_eConsumeNoDefault,
|
||||||
|
/// The event is consumed, but do default processing
|
||||||
|
nsEventStatus_eConsumeDoDefault
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,13 +43,16 @@ enum nsEventStatus {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct nsGUIEvent {
|
struct nsGUIEvent {
|
||||||
PRUint32 message; // see GUI MESSAGES
|
/// See GUI MESSAGES,
|
||||||
nsIWidget* widget; // Originator of the event
|
PRUint32 message;
|
||||||
nsPoint point; // in widget relative coordinates
|
/// Originator of the event
|
||||||
PRUint32 time; // elapsed time, in milliseconds, from the
|
nsIWidget* widget;
|
||||||
// time the system was started to the time
|
/// in widget relative coordinates
|
||||||
// the message was created
|
nsPoint point;
|
||||||
void* nativeMsg; // Internal platform specific mesasge.
|
/// elapsed time, in milliseconds, from the time the system was started to the time the message was created
|
||||||
|
PRUint32 time;
|
||||||
|
/// Internal platform specific message.
|
||||||
|
void* nativeMsg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +60,8 @@ struct nsGUIEvent {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct nsSizeEvent : public nsGUIEvent {
|
struct nsSizeEvent : public nsGUIEvent {
|
||||||
nsRect *windowSize; // x,y width, height in pixels
|
/// x,y width, height in pixels
|
||||||
|
nsRect *windowSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,8 +69,10 @@ struct nsSizeEvent : public nsGUIEvent {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct nsPaintEvent : public nsGUIEvent {
|
struct nsPaintEvent : public nsGUIEvent {
|
||||||
|
/// Context to paint in.
|
||||||
nsIRenderingContext *renderingContext;
|
nsIRenderingContext *renderingContext;
|
||||||
nsRect *rect; // x,y, width, height in pixels of area to paint
|
/// x,y, width, height in pixels of area to paint
|
||||||
|
nsRect *rect;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,9 +80,8 @@ struct nsPaintEvent : public nsGUIEvent {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct nsScrollbarEvent : public nsGUIEvent {
|
struct nsScrollbarEvent : public nsGUIEvent {
|
||||||
PRUint32 position; // ranges between scrollbar 0
|
/// ranges between scrollbar 0 and (maxRange - thumbSize). See nsIScrollbar
|
||||||
// and (maxRange - thumbSize)
|
PRUint32 position;
|
||||||
// see nsIScrollbar.h
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,16 +89,21 @@ struct nsScrollbarEvent : public nsGUIEvent {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct nsKeyEvent : public nsGUIEvent {
|
struct nsKeyEvent : public nsGUIEvent {
|
||||||
PRUint32 keyCode; // @see NS_VK codes
|
/// see NS_VK codes
|
||||||
PRBool isShift; // indicates whether the shift key in down
|
PRUint32 keyCode;
|
||||||
PRBool isControl; // indicates whether the control key in down
|
/// PR_TRUE indicates the shift key in down
|
||||||
PRBool isAlt; // indicates whether the alt key in down
|
PRBool isShift;
|
||||||
|
/// PR_TRUE indicates the control key in down
|
||||||
|
PRBool isControl;
|
||||||
|
/// PR_TRUE indicates the alt key in down
|
||||||
|
PRBool isAlt;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* GUI MESSAGES
|
* GUI MESSAGES
|
||||||
*/
|
*/
|
||||||
|
//@{
|
||||||
|
|
||||||
#define NS_WINDOW_START 100
|
#define NS_WINDOW_START 100
|
||||||
#define NS_CREATE (NS_WINDOW_START)
|
#define NS_CREATE (NS_WINDOW_START)
|
||||||
|
@ -120,7 +133,7 @@ struct nsKeyEvent : public nsGUIEvent {
|
||||||
#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2)
|
#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2)
|
||||||
#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3)
|
#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3)
|
||||||
#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4)
|
#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4)
|
||||||
|
//@}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Virtual key bindings for keyboard events
|
* Virtual key bindings for keyboard events
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
{ 0x961085f6, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } };
|
{ 0x961085f6, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single selection drop down list. @see nsIListWidget for capabilities
|
* Single selection drop down list. See nsIListWidget for capabilities
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class nsIComboBox : public nsIListWidget {
|
class nsIComboBox : public nsIListWidget {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "nsGUIEvent.h"
|
#include "nsGUIEvent.h"
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Event listener interface.
|
* Event listener interface.
|
||||||
* Alternative to a callback for recieving events.
|
* Alternative to a callback for recieving events.
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Processes all events.
|
* Processes all events.
|
||||||
* If a mouse listener is registered this method will not process mouse events.
|
* If a mouse listener is registered this method will not process mouse events.
|
||||||
* @param anEvent the event to process. @see nsGUIEvent.h for event types.
|
* @param anEvent the event to process. See nsGUIEvent.h for event types.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual nsEventStatus ProcessEvent(const nsGUIEvent & anEvent) = 0;
|
virtual nsEventStatus ProcessEvent(const nsGUIEvent & anEvent) = 0;
|
||||||
|
|
|
@ -27,10 +27,14 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File selector mode { load | save }
|
* File selector mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum nsMode { eMode_load, eMode_save };
|
enum nsMode {
|
||||||
|
/// Load a file or directory
|
||||||
|
eMode_load,
|
||||||
|
/// Save a file or directory
|
||||||
|
eMode_save };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File selector widget.
|
* File selector widget.
|
||||||
|
@ -72,7 +76,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Show File Dialog. The dialog is displayed modally.
|
* Show File Dialog. The dialog is displayed modally.
|
||||||
*
|
*
|
||||||
* @return PR_TRUE if user selects <OK>, PR_FALSE if <CANCEL> is selected
|
* @return PR_TRUE if user selects OK, PR_FALSE if user selects CANCEL
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class nsIListBox : public nsIListWidget {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ListBox to be multi-select.
|
* Set the listbox to be multi-select.
|
||||||
* @param aMultiple PR_TRUE can have multiple selections. PR_FALSE single
|
* @param aMultiple PR_TRUE can have multiple selections. PR_FALSE single
|
||||||
* selections only.
|
* selections only.
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
@ -34,30 +34,30 @@ class nsIMouseListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes a mouse pressed event
|
* Processes a mouse pressed event
|
||||||
* @param aMouseEvent @see nsGUIEvent.h
|
* @param aMouseEvent See nsGUIEvent.h
|
||||||
* @return whether the event was consumed or ignored. @see nsEventStatus
|
* @return whether the event was consumed or ignored. See nsEventStatus
|
||||||
*/
|
*/
|
||||||
virtual nsEventStatus MousePressed(const nsGUIEvent & aMouseEvent) = 0;
|
virtual nsEventStatus MousePressed(const nsGUIEvent & aMouseEvent) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes a mouse release event
|
* Processes a mouse release event
|
||||||
* @param aMouseEvent @see nsGUIEvent.h
|
* @param aMouseEvent See nsGUIEvent.h
|
||||||
* @return whether the event was consumed or ignored. @see nsEventStatus
|
* @return whether the event was consumed or ignored. See nsEventStatus
|
||||||
*/
|
*/
|
||||||
virtual nsEventStatus MouseReleased(const nsGUIEvent & aMouseEvent) = 0;
|
virtual nsEventStatus MouseReleased(const nsGUIEvent & aMouseEvent) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes a mouse clicked event
|
* Processes a mouse clicked event
|
||||||
* @param aMouseEvent @see nsGUIEvent.h
|
* @param aMouseEvent See nsGUIEvent.h
|
||||||
* @return whether the event was consumed or ignored. @see nsEventStatus
|
* @return whether the event was consumed or ignored. See nsEventStatus
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual nsEventStatus MouseClicked(const nsGUIEvent & aMouseEvent) = 0;
|
virtual nsEventStatus MouseClicked(const nsGUIEvent & aMouseEvent) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes a mouse moved event
|
* Processes a mouse moved event
|
||||||
* @param aMouseEvent @see nsGUIEvent.h
|
* @param aMouseEvent See nsGUIEvent.h
|
||||||
* @return whether the event was consumed or ignored. @see nsEventStatus
|
* @return whether the event was consumed or ignored. See nsEventStatus
|
||||||
*/
|
*/
|
||||||
virtual nsEventStatus MouseMoved(const nsGUIEvent & aMouseEvent) = 0;
|
virtual nsEventStatus MouseMoved(const nsGUIEvent & aMouseEvent) = 0;
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Scrollbar.
|
* Scrollbar, converts mouse input into values that can be used
|
||||||
* Converts mouse input into values that can be used
|
* to shift the contents of a window.
|
||||||
* to shift the contents of a window
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multi-line text editor.
|
* Multi-line text editor.
|
||||||
* @see nsITextWidget for capabilities.
|
* See nsITextWidget for capabilities.
|
||||||
* Displays a scrollbar when the text content exceeds the number of lines
|
* Displays a scrollbar when the text content exceeds the number of lines
|
||||||
* displayed.
|
* displayed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -50,8 +50,8 @@ class nsITextWidget : public nsIWidget
|
||||||
/**
|
/**
|
||||||
* Set the text of this component.
|
* Set the text of this component.
|
||||||
*
|
*
|
||||||
* @param nsString, the text to set, must be null terminated
|
* @param aTextBuffer on return it contains the text contents.
|
||||||
* @return PRUint32, the number of chars in the text string
|
* @return the number of chars in the text string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ struct nsRect;
|
||||||
struct nsFont;
|
struct nsFont;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function that deals with events.
|
* Callback function that processes events.
|
||||||
* The argument is actually a subtype (subclass) of nsEvent which carries
|
* The argument is actually a subtype (subclass) of nsEvent which carries
|
||||||
* platform specific information about the event. Platform specific code knows
|
* platform specific information about the event. Platform specific code knows
|
||||||
* how to deal with it.
|
* how to deal with it.
|
||||||
|
@ -50,7 +50,7 @@ typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flags for the getNativeData function.
|
* Flags for the getNativeData function.
|
||||||
* @see getNativeData()
|
* See getNativeData()
|
||||||
*/
|
*/
|
||||||
#define NS_NATIVE_WINDOW 0
|
#define NS_NATIVE_WINDOW 0
|
||||||
#define NS_NATIVE_GRAPHIC 1
|
#define NS_NATIVE_GRAPHIC 1
|
||||||
|
@ -70,15 +70,15 @@ typedef void* nsNativeWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cursor types.
|
* Cursor types.
|
||||||
* eCursor_standard (normal cursor, usually rendered as an arrow)
|
|
||||||
* eCursor_wait (system is busy, usually rendered as a hourglass or watch)
|
|
||||||
* eCursor_select (Selecting something, usually rendered as an IBeam)
|
|
||||||
* eCursor_hyperlink (can hyper-link, usually rendered as a human hand)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum nsCursor { eCursor_standard,
|
enum nsCursor { ///(normal cursor, usually rendered as an arrow)
|
||||||
|
eCursor_standard,
|
||||||
|
///(system is busy, usually rendered as a hourglass or watch)
|
||||||
eCursor_wait,
|
eCursor_wait,
|
||||||
|
///(Selecting something, usually rendered as an IBeam)
|
||||||
eCursor_select,
|
eCursor_select,
|
||||||
|
///(can hyper-link, usually rendered as a human hand)
|
||||||
eCursor_hyperlink };
|
eCursor_hyperlink };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -272,7 +272,7 @@ class nsIWidget : public nsISupports {
|
||||||
/**
|
/**
|
||||||
* Set the font for this widget
|
* Set the font for this widget
|
||||||
*
|
*
|
||||||
* @param aFont font to display. @see nsFont for allowable fonts
|
* @param aFont font to display. See nsFont for allowable fonts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void SetFont(const nsFont &aFont) = 0;
|
virtual void SetFont(const nsFont &aFont) = 0;
|
||||||
|
@ -315,7 +315,7 @@ class nsIWidget : public nsISupports {
|
||||||
/**
|
/**
|
||||||
* Return the widget's toolkit
|
* Return the widget's toolkit
|
||||||
*
|
*
|
||||||
* @return the toolkit this widget was created in. @see nsToolkit.
|
* @return the toolkit this widget was created in. See nsToolkit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual nsIToolkit* GetToolkit() = 0;
|
virtual nsIToolkit* GetToolkit() = 0;
|
||||||
|
@ -340,36 +340,17 @@ class nsIWidget : public nsISupports {
|
||||||
|
|
||||||
virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) = 0;
|
virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) = 0;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Internal methods
|
* Internal methods
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
//@{
|
||||||
* Internal Method
|
|
||||||
*/
|
|
||||||
virtual void AddChild(nsIWidget* aChild) = 0;
|
virtual void AddChild(nsIWidget* aChild) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal Method
|
|
||||||
*/
|
|
||||||
virtual void RemoveChild(nsIWidget* aChild) = 0;
|
virtual void RemoveChild(nsIWidget* aChild) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal Method
|
|
||||||
*/
|
|
||||||
virtual void* GetNativeData(PRUint32 aDataType) = 0;
|
virtual void* GetNativeData(PRUint32 aDataType) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal Method
|
|
||||||
*/
|
|
||||||
virtual nsIRenderingContext* GetRenderingContext() = 0;
|
virtual nsIRenderingContext* GetRenderingContext() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal Method
|
|
||||||
*/
|
|
||||||
virtual nsIDeviceContext* GetDeviceContext() = 0;
|
virtual nsIDeviceContext* GetDeviceContext() = 0;
|
||||||
|
//@}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // nsIWidget_h__
|
#endif // nsIWidget_h__
|
||||||
|
|
Загрузка…
Ссылка в новой задаче