diff --git a/mozilla/widget/src/gtk/nsGtkEventHandler.cpp b/mozilla/widget/src/gtk/nsGtkEventHandler.cpp index 86c70b33c0f..6de91041e33 100644 --- a/mozilla/widget/src/gtk/nsGtkEventHandler.cpp +++ b/mozilla/widget/src/gtk/nsGtkEventHandler.cpp @@ -388,8 +388,6 @@ void nsGtkWidget_Scrollbar_Callback(GtkWidget *w, gpointer p) nsScrollbar *widget = (nsScrollbar*) p; nsScrollbarEvent sevent; - g_print("in Scrollbar callback\n"); - #if 0 nsWindow * widgetWindow = (nsWindow *) p ; XmScrollBarCallbackStruct * cbs = (XmScrollBarCallbackStruct*) call_data; diff --git a/mozilla/widget/src/gtk/nsScrollbar.cpp b/mozilla/widget/src/gtk/nsScrollbar.cpp index eb52d64012c..b7873e8a958 100644 --- a/mozilla/widget/src/gtk/nsScrollbar.cpp +++ b/mozilla/widget/src/gtk/nsScrollbar.cpp @@ -277,7 +277,6 @@ PRBool nsScrollbar::OnScroll(nsScrollbarEvent & aEvent, PRUint32 cPos) PRBool result = PR_TRUE; float newPosition; - g_print("nsScrollbar::OnScroll\n"); #if 0 switch (aEvent.message) { diff --git a/mozilla/widget/src/gtk/nsWidget.cpp b/mozilla/widget/src/gtk/nsWidget.cpp index 8a01a5897db..83a6dbc95a3 100644 --- a/mozilla/widget/src/gtk/nsWidget.cpp +++ b/mozilla/widget/src/gtk/nsWidget.cpp @@ -23,6 +23,10 @@ #include "nsRepository.h" #include +#define NSCOLOR_TO_GDKCOLOR(g,n) \ + g.red=NS_GET_R(n); \ + g.green=NS_GET_G(n); \ + g.blue=NS_GET_B(n); nsWidget::nsWidget() { @@ -87,8 +91,9 @@ nsIWidget *nsWidget::GetParent(void) NS_METHOD nsWidget::Show(PRBool bState) { +#ifdef DBG g_print("nsWidget::Show(%6d) - %s %p\n", bState, mWidget->name, this); - +#endif if (bState) { if (mWidget) { gtk_widget_show(mWidget); @@ -126,7 +131,9 @@ NS_METHOD nsWidget::IsVisible(PRBool &aState) NS_METHOD nsWidget::Move(PRUint32 aX, PRUint32 aY) { +#ifdef DBG g_print("nsWidget::Move(%3d,%3d) - %s %p\n", aX, aY, mWidget->name, this); +#endif mBounds.x = aX; mBounds.y = aY; gtk_layout_move(GTK_LAYOUT(mWidget->parent), mWidget, aX, aY); @@ -136,7 +143,9 @@ NS_METHOD nsWidget::Move(PRUint32 aX, PRUint32 aY) NS_METHOD nsWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint) { +#ifdef DBG g_print("nsWidget::Resize(%3d,%3d) - %s %p\n", aWidth, aHeight, mWidget->name, this); +#endif mBounds.width = aWidth; mBounds.height = aHeight; gtk_widget_set_usize(mWidget, aWidth, aHeight); @@ -197,8 +206,15 @@ nscolor nsWidget::GetForegroundColor(void) //------------------------------------------------------------------------- NS_METHOD nsWidget::SetForegroundColor(const nscolor &aColor) { + GtkStyle *style; + GdkColor color; mForeground = aColor; - NS_NOTYETIMPLEMENTED("nsWidget::SetForegroundColor"); + + NSCOLOR_TO_GDKCOLOR(color, aColor); + style = gtk_style_copy(mWidget->style); + style->fg[GTK_STATE_NORMAL] = color; + gtk_widget_set_style(mWidget, style); + return NS_OK; } @@ -220,8 +236,15 @@ nscolor nsWidget::GetBackgroundColor(void) //------------------------------------------------------------------------- NS_METHOD nsWidget::SetBackgroundColor(const nscolor &aColor) { + GtkStyle *style; + GdkColor color; mBackground = aColor; - NS_NOTYETIMPLEMENTED("nsWidget::SetBackgroundColor"); + + NSCOLOR_TO_GDKCOLOR(color, aColor); + style = gtk_style_copy(mWidget->style); + style->bg[GTK_STATE_NORMAL] = color; + gtk_widget_set_style(mWidget, style); + return NS_OK; } @@ -460,7 +483,9 @@ nsresult nsWidget::StandardWindowCreate(nsIWidget *aParent, parentWidget = GTK_WIDGET(shellWidget); } +#ifdef DBG g_print("--\n"); +#endif CreateNative (parentWidget); @@ -469,7 +494,9 @@ nsresult nsWidget::StandardWindowCreate(nsIWidget *aParent, if (parentWidget) { gtk_layout_put(GTK_LAYOUT(parentWidget), mWidget, mBounds.x, mBounds.y); +#ifdef DBG g_print("nsWidget::SWC(%3d,%3d) - %s %p\n", mBounds.x, mBounds.y, mWidget->name, this); +#endif } InitCallbacks(); diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index e7ae2afc3b1..bd0eb4a0d30 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -36,11 +36,8 @@ #include "stdio.h" -#define DBG 1 -#if 0 -#define DEBUG_shaver 1 -#define DEBUG_pavlov 1 -#endif +//#define DBG 0 + static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); extern GtkWidget *gAppContext; @@ -487,13 +484,7 @@ nsIAppShell* nsWindow::GetAppShell() //------------------------------------------------------------------------- NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) { -#ifdef DBG - g_print("nsWindow::Scroll\n"); -#endif if (GTK_IS_LAYOUT(mWidget)) { -#ifdef DBG - g_print ("is layout dX = %d, dY = %d\n", aDx, aDy); -#endif GtkAdjustment* horiz = gtk_layout_get_hadjustment(GTK_LAYOUT(mWidget)); GtkAdjustment* vert = gtk_layout_get_vadjustment(GTK_LAYOUT(mWidget)); horiz->value -= aDx; @@ -641,10 +632,6 @@ void nsWindow::OnDestroy() PRBool nsWindow::OnResize(nsSizeEvent &aEvent) { -#ifdef DBG - g_print("nsWindow::OnResize\n"); -#endif - nsRect* size = aEvent.windowSize; if (mEventCallback && !mIgnoreResize) { @@ -673,9 +660,6 @@ PRBool nsWindow::DispatchFocus(nsGUIEvent &aEvent) PRBool nsWindow::OnScroll(nsScrollbarEvent & aEvent, PRUint32 cPos) { -#ifdef DBG - g_print("nsWindow::OnScroll\n"); -#endif return FALSE; } @@ -818,7 +802,7 @@ gint DoRefresh(gpointer call_data) void DoResize(GtkWidget *w, GtkAllocation *allocation, gpointer data) { - g_print("DoResized called\n"); +// g_print("DoResized called\n"); nsWindow *win = (nsWindow*)data; gtk_layout_freeze(GTK_LAYOUT(w));