author | mickeyl <mickeyl> | 2003-04-01 22:18:03 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-01 22:18:03 (UTC) |
commit | a46668f70b74f27689afb956ff085d42c0775328 (patch) (side-by-side diff) | |
tree | 24e1477b919aa4453d8724512ed7dd9659d040dc /noncore | |
parent | 76b83c2b77e626fadf1d1bbbfd19a9a8a795334b (diff) | |
download | opie-a46668f70b74f27689afb956ff085d42c0775328.zip opie-a46668f70b74f27689afb956ff085d42c0775328.tar.gz opie-a46668f70b74f27689afb956ff085d42c0775328.tar.bz2 |
- backgammon: g++3 fix
- add skeleton for opie-camera application
-rw-r--r-- | noncore/games/backgammon/moveengine.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/camera/.cvsignore | 1 | ||||
-rw-r--r-- | noncore/multimedia/camera/camera.pro | 21 | ||||
-rw-r--r-- | noncore/multimedia/camera/config.in | 7 | ||||
-rw-r--r-- | noncore/multimedia/camera/main.cpp | 28 | ||||
-rw-r--r-- | noncore/multimedia/camera/mainwindow.cpp | 50 | ||||
-rw-r--r-- | noncore/multimedia/camera/mainwindow.h | 40 | ||||
-rw-r--r-- | noncore/multimedia/camera/zcameraio.cpp | 56 | ||||
-rw-r--r-- | noncore/multimedia/camera/zcameraio.h | 35 |
9 files changed, 240 insertions, 0 deletions
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp index 009c449..8106b3f 100644 --- a/noncore/games/backgammon/moveengine.cpp +++ b/noncore/games/backgammon/moveengine.cpp @@ -5,4 +5,6 @@ #include <qtimer.h> +#include <stdlib.h> + MoveEngine::MoveEngine() : QObject() diff --git a/noncore/multimedia/camera/.cvsignore b/noncore/multimedia/camera/.cvsignore new file mode 100644 index 0000000..6d678c6 --- a/dev/null +++ b/noncore/multimedia/camera/.cvsignore @@ -0,0 +1 @@ +config.in diff --git a/noncore/multimedia/camera/camera.pro b/noncore/multimedia/camera/camera.pro new file mode 100644 index 0000000..e937807 --- a/dev/null +++ b/noncore/multimedia/camera/camera.pro @@ -0,0 +1,21 @@ +MOC_DIR = ./moc +OBJECTS_DIR = ./obj +DESTDIR = $(OPIEDIR)/bin +TEMPLATE = app +CONFIG = qt warn_on debug + +HEADERS = zcameraio.h \ + mainwindow.h + +SOURCES = zcameraio.cpp \ + mainwindow.cpp \ + main.cpp + +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopiecore2 +INTERFACES = +TARGET = opiecam + +include ( $(OPIEDIR)/include.pro ) + diff --git a/noncore/multimedia/camera/config.in b/noncore/multimedia/camera/config.in new file mode 100644 index 0000000..a4dd248 --- a/dev/null +++ b/noncore/multimedia/camera/config.in @@ -0,0 +1,7 @@ + config CAMERA + boolean "opie-camera" + default "n" + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBOPIE2CORE + comment "opie-camera needs a libqpe, libopie and libopie2core" + depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBOPIE2CORE) + diff --git a/noncore/multimedia/camera/main.cpp b/noncore/multimedia/camera/main.cpp new file mode 100644 index 0000000..f25475c --- a/dev/null +++ b/noncore/multimedia/camera/main.cpp @@ -0,0 +1,28 @@ +/********************************************************************** +** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie 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. +** +**********************************************************************/ + +#include "mainwindow.h" +#include <opie2/oapplication.h> + +int main( int argc, char **argv ) +{ + OApplication a( argc, argv, "Opie-Camera" ); + CameraMainWindow* w = new CameraMainWindow(); + a.showMainWidget( w ); + a.exec(); + delete w; + return 0; +} + diff --git a/noncore/multimedia/camera/mainwindow.cpp b/noncore/multimedia/camera/mainwindow.cpp new file mode 100644 index 0000000..6431dfa --- a/dev/null +++ b/noncore/multimedia/camera/mainwindow.cpp @@ -0,0 +1,50 @@ +/********************************************************************** +** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie 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. +** +**********************************************************************/ + +#include "mainwindow.h" + +#include <qvbox.h> +#include <qpushbutton.h> +#include <qlabel.h> + +#include <qpe/resource.h> +#include <opie/ofiledialog.h> + +CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f ) + :QMainWindow( parent, name, f ) +{ + QVBox* v = new QVBox( this ); + QLabel* l = new QLabel( v ); + l->setFixedSize( QSize( 240, 160 ) ); + QPushButton* p = new QPushButton( "Snapshot", v ); + connect( p, SIGNAL( clicked() ), this, SLOT( clickedSnapShot() ) ); + v->show(); + l->show(); + p->show(); + setCentralWidget( v ); + +}; + + +CameraMainWindow::~CameraMainWindow() +{ +} + + +void CameraMainWindow::clickedSnapShot() +{ + qDebug( "Hello!" ); +} + diff --git a/noncore/multimedia/camera/mainwindow.h b/noncore/multimedia/camera/mainwindow.h new file mode 100644 index 0000000..a349652 --- a/dev/null +++ b/noncore/multimedia/camera/mainwindow.h @@ -0,0 +1,40 @@ +/********************************************************************** +** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie 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. +** +**********************************************************************/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <qmainwindow.h> + +class Wellenreiter; +class WellenreiterConfigWindow; +class QIconSet; +class QToolButton; + +class CameraMainWindow: public QMainWindow +{ + Q_OBJECT + + public: + CameraMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); + virtual ~CameraMainWindow(); + + protected: + + public slots: + void clickedSnapShot(); +}; + +#endif diff --git a/noncore/multimedia/camera/zcameraio.cpp b/noncore/multimedia/camera/zcameraio.cpp new file mode 100644 index 0000000..aa6cbe3 --- a/dev/null +++ b/noncore/multimedia/camera/zcameraio.cpp @@ -0,0 +1,56 @@ +/********************************************************************** +** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie 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. +** +**********************************************************************/ + +#include "zcameraio.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <string.h> +#include <fcntl.h> +#include <unistd.h> + +#include <qimage.h> + +#include <opie2/odebug.h> + +ZCameraIO::ZCameraIO() +{ + _driver = open( "/dev/sharp_zdc", O_RDWR ); + if ( _driver == -1 ) + oerr << "Can't open camera driver: " << strerror(errno) << oendl; + +}; + + +ZCameraIO::~ZCameraIO() +{ + if ( _driver != -1 ) + close( _driver ); +} + + +bool ZCameraIO::snapshot( QImage* img ) +{ + char buf[76800]; + + write( _driver, "M=13", 4 ); + write( _driver, "R=240,160,256,480", 17 ); + write( _driver, "M=12", 4 ); + + int result = read( _driver, &buf, sizeof buf ); + + return result == sizeof buf; +} diff --git a/noncore/multimedia/camera/zcameraio.h b/noncore/multimedia/camera/zcameraio.h new file mode 100644 index 0000000..817d3b4 --- a/dev/null +++ b/noncore/multimedia/camera/zcameraio.h @@ -0,0 +1,35 @@ +/********************************************************************** +** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie 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. +** +**********************************************************************/ + +#ifndef ZCAMERAIO_H +#define ZCAMERAIO_H + +class QImage; + +class ZCameraIO +{ + public: + ZCameraIO(); + virtual ~ZCameraIO(); + + bool isOpen() const { return _driver != -1; }; + + bool snapshot( QImage* ); + + private: + int _driver; +}; + +#endif |