From aa87aa621d1b4f909680645cf6437d697ee66ba1 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 7 Oct 1998 19:49:36 +0000 Subject: [PATCH] Updated Interfaces to support UNIX --- widget/public/Makefile | 12 ++++++++++++ widget/public/nsGUIEvent.h | 8 ++++++-- widget/public/nsIMenu.h | 10 ++++++++-- widget/public/nsIMenuBar.h | 8 +++++++- widget/public/nsIMenuItem.h | 15 +++++++++++++-- widget/public/nsIPopUpMenu.h | 6 ++++++ widget/public/nsIWidget.h | 7 +++++++ 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/widget/public/Makefile b/widget/public/Makefile index ed582edf3794..1f2040b7d88c 100644 --- a/widget/public/Makefile +++ b/widget/public/Makefile @@ -20,6 +20,18 @@ DEPTH=../.. DEFINES = -D_IMPL_NS_UI EXPORTS = \ + nsIMenuBar.h \ + nsIMenu.h \ + nsIMenuItem.h \ + nsIToolbar.h \ + nsIImageButton.h \ + nsIToolbarManager.h \ + nsIToolbarManagerListener.h \ + nsIToolbarItem.h \ + nsIToolbarItemHolder.h \ + nsIPopUpMenu.h \ + nsIMenuButton.h \ + nsIImageButtonListener.h \ nsStringUtil.h \ nsui.h \ nsITabWidget.h \ diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index 12a22a08730a..3319f07235bb 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -24,6 +24,7 @@ class nsIRenderingContext; class nsIWidget; +class nsIMenuItem; /** * Return status for event processors. @@ -134,11 +135,14 @@ struct nsTooltipEvent : public nsGUIEvent { /** * MenuItem event + * + * When this event occurs the widget field in nsGUIEvent holds the "target" + * for the event */ struct nsMenuEvent : public nsGUIEvent { - /// Index of the selected menu item - PRUint32 menuItem; + nsIMenuItem * mMenuItem; + PRUint32 mCommand; }; /** diff --git a/widget/public/nsIMenu.h b/widget/public/nsIMenu.h index 74cf69e7d6c5..7249d2246c76 100644 --- a/widget/public/nsIMenu.h +++ b/widget/public/nsIMenu.h @@ -21,10 +21,10 @@ #include "nsISupports.h" #include "nsString.h" -#include "nsIMenuItem.h" class nsIMenuBar; class nsIMenu; +class nsIMenuItem; // {35A3DEC1-4992-11d2-8DBA-00609703C14E} #define NS_IMENU_IID \ @@ -50,7 +50,13 @@ class nsIMenu : public nsISupports { * */ NS_IMETHOD Create(nsIMenu * aParent, const nsString &aLabel) = 0; - + + /** + * Get the Menu's Parent + * + */ + NS_IMETHOD GetParent(nsISupports *&aParent) = 0; + /** * Get the Menu label * diff --git a/widget/public/nsIMenuBar.h b/widget/public/nsIMenuBar.h index 807764a031ce..1166f3b61d4b 100644 --- a/widget/public/nsIMenuBar.h +++ b/widget/public/nsIMenuBar.h @@ -42,7 +42,13 @@ class nsIMenuBar : public nsISupports { * */ NS_IMETHOD Create(nsIWidget * aParent) = 0; - + + /** + * Get the MenuBar's Parent + * + */ + NS_IMETHOD GetParent(nsIWidget *&aParent) = 0; + /** * Adds the Menu * diff --git a/widget/public/nsIMenuItem.h b/widget/public/nsIMenuItem.h index 4a415e9ea426..b65e5bd430c2 100644 --- a/widget/public/nsIMenuItem.h +++ b/widget/public/nsIMenuItem.h @@ -29,6 +29,7 @@ class nsIMenu; class nsIPopUpMenu; +class nsIWidget; /** * MenuItem widget @@ -41,13 +42,17 @@ class nsIMenuItem : public nsISupports { * Creates the MenuItem * */ - NS_IMETHOD Create(nsIMenu * aParent, const nsString &aLabel, PRUint32 aCommand) = 0; + NS_IMETHOD Create(nsIMenu *aParent, + const nsString &aLabel, + PRUint32 aCommand) = 0; /** * Creates the MenuItem * */ - NS_IMETHOD Create(nsIPopUpMenu * aParent, const nsString &aLabel, PRUint32 aCommand) = 0; + NS_IMETHOD Create(nsIPopUpMenu *aParent, + const nsString &aLabel, + PRUint32 aCommand) = 0; /** * Get the MenuItem label @@ -60,6 +65,12 @@ class nsIMenuItem : public nsISupports { * */ NS_IMETHOD GetCommand(PRUint32 & aCommand) = 0; + + /** + * Gets the target for MenuItem + * + */ + NS_IMETHOD GetTarget(nsIWidget *& aTarget) = 0; /** * Gets Native Menu Handle diff --git a/widget/public/nsIPopUpMenu.h b/widget/public/nsIPopUpMenu.h index 484796be7ffe..2d3a6d9769e0 100644 --- a/widget/public/nsIPopUpMenu.h +++ b/widget/public/nsIPopUpMenu.h @@ -122,6 +122,12 @@ class nsIPopUpMenu : public nsISupports { */ NS_IMETHOD GetNativeData(void*& aData) = 0; + /** + * Gets parent widget + * + */ + NS_IMETHOD GetParent(nsIWidget *& aParent) = 0; + }; #endif diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index ca487606d20c..69334c926734 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -529,6 +529,13 @@ class nsIWidget : public nsISupports { */ NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight) = 0; + /** + * Dispatches and event to the widget + * + */ + NS_IMETHOD DispatchEvent(nsGUIEvent* event) = 0; + + virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) = 0; };