Diffstat (limited to 'noncore/games/go/gowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/go/gowidget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp index d134540..ec03c1d 100644 --- a/noncore/games/go/gowidget.cpp +++ b/noncore/games/go/gowidget.cpp @@ -1,83 +1,84 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "gowidget.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/config.h> #include <qpe/resource.h> +using namespace Opie::Core; +/* QT */ #include <qpainter.h> #include <qtoolbar.h> #include <qmenubar.h> #include <qaction.h> #include <qapplication.h> //processEvents() #include <qlabel.h> -//#include <stdio.h> - - static const enum bVal computer_color = BLACK; static int current_handicap = 1; static QBrush *goBrush; //static QImage *newBlackStone; //static QImage *blackStone; //static QImage *whiteStone; static QPixmap *newBlackStone; static QPixmap *blackStone; static QPixmap *whiteStone; static bool smallStones = FALSE; GoMainWidget::GoMainWidget( QWidget *parent, const char* name, WFlags fl) : QMainWindow( parent, name, fl ) { setToolBarsMovable( FALSE ); GoWidget *go = new GoWidget(this); setCentralWidget(go); toolbar = new QToolBar(this); toolbar->setHorizontalStretchable( TRUE ); addToolBar(toolbar); QMenuBar *mb = new QMenuBar( toolbar ); mb->setMargin(0); QPopupMenu *file = new QPopupMenu( this ); QAction *a = new QAction( tr( "New Game" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( newGame() ) ); a->addTo( file ); a = new QAction( tr( "Pass" ), Resource::loadPixmap( "pass" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( pass() ) ); a->addTo( file ); a->addTo( toolbar ); a = new QAction( tr( "Resign" ), Resource::loadPixmap( "reset" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), go, SLOT( resign() ) ); a->addTo( file ); a = new QAction( tr( "Two player option" ), QString::null, 0, this, 0 ); a->setToggleAction( TRUE ); connect( a, SIGNAL( toggled(bool) ), go, SLOT( setTwoplayer(bool) ) ); a->addTo( file ); @@ -403,58 +404,58 @@ void GoWidget::mouseReleaseEvent( QMouseEvent * ) void GoWidget::refresh( int x, int y ) { update( bx+d*x-d/2-1, by+d*y-d/2-1, d+2, d+2 ); } void GoWidget::removeStone(short x, short y) { board[x][y]=-1; refresh( x, y ); } void GoWidget::placeStone (enum bVal c, short x, short y ) { board[x][y]=c; refresh( x, y ); } void GoWidget::reportPrisoners( int blackcnt, int whitecnt ) { QString s = tr( "Prisoners: black %1, white %2" ).arg(blackcnt).arg(whitecnt); emit showScore( s ); } void GoWidget::setTwoplayer( bool b ) { twoplayer = b; } void GoWidget::setHandicap( int h ) { current_handicap = h; } extern "C" { void removestone(short x, short y) { GoWidget::self->removeStone(x,y); } void placestone (enum bVal c, short x, short y ) { GoWidget::self->placeStone(c,x,y); } void intrMoveReport(enum bVal c ,char *coord ,char *reason ) { - qDebug( "intrMoveReport colour %d, %s %s", c, coord, reason ); + odebug << "intrMoveReport colour " << c << ", " << coord << " " << reason << "" << oendl; } void intrPrisonerReport( short blackcnt, short whitecnt ) { GoWidget::self->reportPrisoners(blackcnt,whitecnt); } } |