зеркало из https://github.com/mozilla/pjs.git
Motif Mods
This commit is contained in:
Родитель
f68c4a84eb
Коммит
d0e6480337
|
@ -27,7 +27,7 @@ REQUIRES=util img xpcom raptor netlib
|
|||
|
||||
DEFINES = -D_IMPL_NS_WIDGET
|
||||
|
||||
LLIBS+=$(DIST)/lib/libxpcom.a $(DIST)/lib/libraptorbase.a $(DIST)/lib/libraptorgfx.a -lXm -lXt -lX11
|
||||
EXTRA_DSO_LDOPTS+=$(DIST)/lib/libxpcom.a $(DIST)/lib/libraptorbase.a $(DIST)/lib/libraptorgfx.a -lXm -lXt -lX11
|
||||
|
||||
CPPSRCS=nsWidgetFactory.cpp \
|
||||
nsWindow.cpp \
|
||||
|
|
|
@ -55,8 +55,7 @@ void nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
|||
// Setup initial tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::SetTooltips(PRUint32 aNumberOfTips,const nsRect* aTooltipAreas)
|
||||
void nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -66,7 +65,7 @@ void nsWindow::SetTooltips(PRUint32 aNumberOfTips,const nsRect* aTooltipAreas)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::UpdateTooltips(const nsRect* aNewTips)
|
||||
void nsWindow::UpdateTooltips(nsRect* aNewTips[])
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -91,6 +90,9 @@ nsWindow::nsWindow(nsISupports *aOuter)
|
|||
// XXX Til can deal with ColorMaps!
|
||||
SetForegroundColor(1);
|
||||
SetBackgroundColor(2);
|
||||
|
||||
mToolkit = nsnull ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,7 +117,7 @@ void nsWindow::Create(nsIWidget *aParent,
|
|||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIToolkit *aToolkit,
|
||||
void *aInitData)
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
|
||||
Widget mainWindow, frame;
|
||||
|
@ -152,6 +154,22 @@ void nsWindow::Create(nsIWidget *aParent,
|
|||
else {
|
||||
nsresult res;
|
||||
|
||||
// XXX Move this! - For some reason Registering in another DLL (shell) isn't working
|
||||
|
||||
#define GFXWIN_DLL "libgfxunix.so"
|
||||
|
||||
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
|
||||
|
||||
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
|
||||
|
||||
|
@ -236,7 +254,7 @@ void nsWindow::Create(nsNativeWindow aParent,
|
|||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIToolkit *aToolkit,
|
||||
void *aInitData)
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -488,11 +506,6 @@ void* nsWindow::GetNativeData(PRUint32 aDataType)
|
|||
return (void*)(mWidget);
|
||||
}
|
||||
break;
|
||||
case NS_NATIVE_DISPLAY:
|
||||
{
|
||||
return (void*)(XtDisplay(mWidget));
|
||||
}
|
||||
break;
|
||||
case NS_NATIVE_GRAPHIC:
|
||||
{
|
||||
XGCValues values;
|
||||
|
@ -670,6 +683,13 @@ void nsWindow::OnPaint(nsPaintEvent &event)
|
|||
}
|
||||
|
||||
|
||||
void nsWindow::BeginResizingChildren(void)
|
||||
{
|
||||
}
|
||||
|
||||
void nsWindow::EndResizingChildren(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -52,13 +52,13 @@ public:
|
|||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
void *aInitData = nsnull);
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
virtual void Create(nsNativeWindow aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
void *aInitData = nsnull);
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
virtual void Destroy();
|
||||
virtual nsIWidget* GetParent(void);
|
||||
virtual nsIEnumerator* GetChildren();
|
||||
|
@ -92,9 +92,10 @@ public:
|
|||
virtual nsIToolkit* GetToolkit();
|
||||
virtual void SetBorderStyle(nsBorderStyle aBorderStyle);
|
||||
virtual void SetTitle(const nsString& aTitle);
|
||||
virtual void SetTooltips(PRUint32 aNumberOfTips,const nsRect* aTooltipAreas);
|
||||
virtual void SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
|
||||
virtual void RemoveTooltips();
|
||||
virtual void UpdateTooltips(const nsRect* aNewTips);
|
||||
virtual void UpdateTooltips(nsRect* aNewTips[]);
|
||||
virtual void WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
virtual void ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
virtual void AddMouseListener(nsIMouseListener * aListener);
|
||||
|
@ -103,9 +104,11 @@ public:
|
|||
PRBool DispatchEvent(nsGUIEvent* event);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
|
||||
virtual void BeginResizingChildren(void);
|
||||
virtual void EndResizingChildren(void);
|
||||
|
||||
private:
|
||||
Widget mWidget;
|
||||
GC mGC ;
|
||||
EVENT_CALLBACK mEventCallback;
|
||||
nsIDeviceContext *mContext;
|
||||
nsIFontMetrics *mFontMetrics;
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#include "stdio.h"
|
||||
|
||||
void nsXtWidget_ExposureMask_EventHandler(Widget w, caddr_t client_data, XEvent * event)
|
||||
void nsXtWidget_ExposureMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
|
||||
{
|
||||
nsPaintEvent pevent ;
|
||||
nsWindow * widgetWindow = (nsWindow *) client_data ;
|
||||
nsWindow * widgetWindow = (nsWindow *) p ;
|
||||
|
||||
if (event->xexpose.count != 0)
|
||||
return ;
|
||||
|
@ -43,19 +43,19 @@ void nsXtWidget_ExposureMask_EventHandler(Widget w, caddr_t client_data, XEvent
|
|||
|
||||
}
|
||||
|
||||
void nsXtWidget_ButtonPressMask_EventHandler(Widget w, caddr_t client_data, XEvent * event)
|
||||
void nsXtWidget_ButtonPressMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
|
||||
{
|
||||
nsWindow * widgetWindow = (nsWindow *) client_data ;
|
||||
nsWindow * widgetWindow = (nsWindow *) p;
|
||||
}
|
||||
|
||||
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, caddr_t client_data, XEvent * event)
|
||||
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
|
||||
{
|
||||
nsWindow * widgetWindow = (nsWindow *) client_data ;
|
||||
nsWindow * widgetWindow = (nsWindow *) p ;
|
||||
}
|
||||
|
||||
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, caddr_t client_data, XEvent * event)
|
||||
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b)
|
||||
{
|
||||
nsWindow * widgetWindow = (nsWindow *) client_data ;
|
||||
nsWindow * widgetWindow = (nsWindow *) p ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
|
||||
#include "Xm/Xm.h"
|
||||
|
||||
void nsXtWidget_ExposureMask_EventHandler(Widget w, caddr_t client_data, XEvent * event);
|
||||
void nsXtWidget_ButtonPressMask_EventHandler(Widget w, caddr_t client_data, XEvent * event);
|
||||
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, caddr_t client_data, XEvent * event);
|
||||
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, caddr_t client_data, XEvent * event);
|
||||
void nsXtWidget_ExposureMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
|
||||
void nsXtWidget_ButtonPressMask_EventHandler(Widget w,XtPointer p, XEvent * event, Boolean * b);
|
||||
void nsXtWidget_ButtonReleaseMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
|
||||
void nsXtWidget_ButtonMotionMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b);
|
||||
|
||||
#endif // __nsXtEventHandler.h
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче