Loading widget/src/gtk/nsGtkEventHandler.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -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; Loading widget/src/gtk/nsScrollbar.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading widget/src/gtk/nsWidget.cpp +30 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ #include "nsRepository.h" #include <gdk/gdkx.h> #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() { Loading Loading @@ -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); Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -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; } Loading @@ -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; } Loading Loading @@ -460,7 +483,9 @@ nsresult nsWidget::StandardWindowCreate(nsIWidget *aParent, parentWidget = GTK_WIDGET(shellWidget); } #ifdef DBG g_print("--\n"); #endif CreateNative (parentWidget); Loading @@ -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(); Loading widget/src/gtk/nsWindow.cpp +3 −19 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; } Loading Loading @@ -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)); Loading Loading
widget/src/gtk/nsGtkEventHandler.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
widget/src/gtk/nsScrollbar.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
widget/src/gtk/nsWidget.cpp +30 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,10 @@ #include "nsRepository.h" #include <gdk/gdkx.h> #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() { Loading Loading @@ -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); Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -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; } Loading @@ -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; } Loading Loading @@ -460,7 +483,9 @@ nsresult nsWidget::StandardWindowCreate(nsIWidget *aParent, parentWidget = GTK_WIDGET(shellWidget); } #ifdef DBG g_print("--\n"); #endif CreateNative (parentWidget); Loading @@ -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(); Loading
widget/src/gtk/nsWindow.cpp +3 −19 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; } Loading Loading @@ -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)); Loading