-rw-r--r-- | apps/Applications/camera.desktop | 10 | ||||
-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 | ||||
-rw-r--r-- | packages | 1 | ||||
-rwxr-xr-x | pics/camera/cam.png | bin | 0 -> 2567 bytes |
12 files changed, 251 insertions, 0 deletions
diff --git a/apps/Applications/camera.desktop b/apps/Applications/camera.desktop new file mode 100644 index 0000000..26cc119 --- a/dev/null +++ b/apps/Applications/camera.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Comment = A Camera Program +Comment[de] = Ein Kamera-Programm +Exec = opiecam +File = opiecam +Icon = camera/cam +Name = OpieCam +Type = Application +Name[de]= Kamera + 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 @@ -1,14 +1,16 @@ #include "moveengine.h" #include <qmessagebox.h> #include <qtimer.h> +#include <stdlib.h> + MoveEngine::MoveEngine() : QObject() { int offset=7; int a=0; //counter variable int xfill[]={210,185,170,155,140,125,110,85,70,55,40,25,10,10,25,40,55,70,85,110,125,140,155,170,185,210}; for(a=0;a<26;a++) { 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 @@ -1,13 +1,14 @@ CONFIG_APPSKEY noncore/settings/appskey appskey.pro CONFIG_BACKGAMMON noncore/games/backgammon/ backgammon.pro CONFIG_BINARY noncore/tools/calc2/binary binary.pro CONFIG_CALC2 noncore/tools/calc2 calc2.pro CONFIG_CALIBRATE core/apps/calibrate calibrate.pro +CONFIG_CAMERA noncore/multimedia/camera camera.pro CONFIG_DICTIONARY noncore/apps/dictionary dictionary.pro CONFIG_EUROCONV noncore/tools/euroconv/ euroconv.pro CONFIG_GSMTOOL noncore/comm/gsmtool gsmtool.pro CONFIG_KEYVIEW development/keyview keyview.pro CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeg libffmpeg.pro CONFIG_LIBFLASH core/multimedia/opieplayer/libflash libflash.pro CONFIG_LIBOPIE_PIM libopie/pim pim.pro CONFIG_LIBSQL libsql libsql.pro diff --git a/pics/camera/cam.png b/pics/camera/cam.png Binary files differnew file mode 100755 index 0000000..6bd468b --- a/dev/null +++ b/pics/camera/cam.png |