зеркало из https://github.com/mozilla/pjs.git
Add SetBackgroundColor() stubs.
Add signals/methods from tracking realization.
This commit is contained in:
Родитель
582d73340c
Коммит
6ab0049a18
|
@ -25,11 +25,8 @@
|
||||||
#include "nsIFontMetrics.h"
|
#include "nsIFontMetrics.h"
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
|
||||||
// BGR, not RGB
|
// Taken from nsRenderingContextGTK.cpp
|
||||||
#define NSCOLOR_TO_GDKCOLOR(g,n) \
|
#define NS_TO_GDK_RGB(ns) (ns & 0xff) << 16 | (ns & 0xff00) | ((ns >> 16) & 0xff)
|
||||||
g.red=NS_GET_B(n); \
|
|
||||||
g.green=NS_GET_G(n); \
|
|
||||||
g.blue=NS_GET_R(n);
|
|
||||||
|
|
||||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||||
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||||
|
@ -411,6 +408,18 @@ NS_METHOD nsWidget::SetFont(const nsFont &aFont)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Set the background color
|
||||||
|
//
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
NS_METHOD nsWidget::SetBackgroundColor(const nscolor &aColor)
|
||||||
|
{
|
||||||
|
nsBaseWidget::SetBackgroundColor(aColor);
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Set this component cursor
|
// Set this component cursor
|
||||||
|
@ -792,7 +801,6 @@ NS_METHOD nsWidget::Create(nsNativeWidget aParent,
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
void nsWidget::InitCallbacks(char *aName)
|
void nsWidget::InitCallbacks(char *aName)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* basically we are keeping the parent from getting the childs signals by
|
/* basically we are keeping the parent from getting the childs signals by
|
||||||
* doing this. */
|
* doing this. */
|
||||||
|
@ -1072,6 +1080,16 @@ nsWidget::InstallButtonReleaseSignal(GtkWidget * aWidget)
|
||||||
GTK_SIGNAL_FUNC(nsWidget::ButtonReleaseSignal));
|
GTK_SIGNAL_FUNC(nsWidget::ButtonReleaseSignal));
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
void
|
||||||
|
nsWidget::InstallRealizeSignal(GtkWidget * aWidget)
|
||||||
|
{
|
||||||
|
NS_ASSERTION( nsnull != aWidget, "widget is null");
|
||||||
|
|
||||||
|
InstallSignal(aWidget,
|
||||||
|
"realize",
|
||||||
|
GTK_SIGNAL_FUNC(nsWidget::RealizeSignal));
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@ -1268,6 +1286,12 @@ nsWidget::OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent)
|
||||||
Release();
|
Release();
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
/* virtual */ void
|
||||||
|
nsWidget::OnRealize()
|
||||||
|
{
|
||||||
|
printf("nsWidget::OnRealize(%p)\n",this);
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
@ -1499,3 +1523,40 @@ nsWidget::ButtonReleaseSignal(GtkWidget * aWidget,
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
/* static */ gint
|
||||||
|
nsWidget::RealizeSignal(GtkWidget * aWidget,
|
||||||
|
gpointer aData)
|
||||||
|
{
|
||||||
|
printf("nsWidget::RealizeSignal(%p)\n",aData);
|
||||||
|
|
||||||
|
NS_ASSERTION( nsnull != aWidget, "widget is null");
|
||||||
|
|
||||||
|
nsWidget * widget = (nsWidget *) aData;
|
||||||
|
|
||||||
|
NS_ASSERTION( nsnull != widget, "instance pointer is null");
|
||||||
|
|
||||||
|
widget->OnRealize();
|
||||||
|
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dispatch standard event
|
||||||
|
//
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
/* virtual */ GdkWindow *
|
||||||
|
nsWidget::GetWindowForSetBackground()
|
||||||
|
{
|
||||||
|
GdkWindow * gdk_window = nsnull;
|
||||||
|
|
||||||
|
if (mWidget)
|
||||||
|
{
|
||||||
|
gdk_window = mWidget->window;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gdk_window;
|
||||||
|
}
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -80,6 +80,8 @@ class nsWidget : public nsBaseWidget
|
||||||
nsIFontMetrics *GetFont(void);
|
nsIFontMetrics *GetFont(void);
|
||||||
NS_IMETHOD SetFont(const nsFont &aFont);
|
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||||
|
|
||||||
|
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||||
|
|
||||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||||
|
|
||||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||||
|
@ -139,6 +141,9 @@ class nsWidget : public nsBaseWidget
|
||||||
|
|
||||||
PRBool DispatchWindowEvent(nsGUIEvent* event);
|
PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||||
|
|
||||||
|
// Return the Gdk window whose background should change
|
||||||
|
virtual GdkWindow * GetWindowForSetBackground();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// GTK signal installers
|
// GTK signal installers
|
||||||
|
@ -154,6 +159,8 @@ class nsWidget : public nsBaseWidget
|
||||||
|
|
||||||
void InstallButtonReleaseSignal(GtkWidget * aWidget);
|
void InstallButtonReleaseSignal(GtkWidget * aWidget);
|
||||||
|
|
||||||
|
void InstallRealizeSignal(GtkWidget * aWidget);
|
||||||
|
|
||||||
void AddToEventMask(GtkWidget * aWidget,
|
void AddToEventMask(GtkWidget * aWidget,
|
||||||
gint aEventMask);
|
gint aEventMask);
|
||||||
|
|
||||||
|
@ -167,6 +174,7 @@ class nsWidget : public nsBaseWidget
|
||||||
virtual void OnLeaveNotifySignal(GdkEventCrossing * aGdkCrossingEvent);
|
virtual void OnLeaveNotifySignal(GdkEventCrossing * aGdkCrossingEvent);
|
||||||
virtual void OnButtonPressSignal(GdkEventButton * aGdkButtonEvent);
|
virtual void OnButtonPressSignal(GdkEventButton * aGdkButtonEvent);
|
||||||
virtual void OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent);
|
virtual void OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent);
|
||||||
|
virtual void OnRealize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -196,6 +204,9 @@ private:
|
||||||
GdkEventButton * aGdkButtonEvent,
|
GdkEventButton * aGdkButtonEvent,
|
||||||
gpointer aData);
|
gpointer aData);
|
||||||
|
|
||||||
|
static gint RealizeSignal(GtkWidget * aWidget,
|
||||||
|
gpointer aData);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// GTK event support methods
|
// GTK event support methods
|
||||||
|
|
Загрузка…
Ссылка в новой задаче