summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/lib/zcameraio.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/camera/lib/zcameraio.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/lib/zcameraio.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/camera/lib/zcameraio.cpp b/noncore/multimedia/camera/lib/zcameraio.cpp
index d59cbbb..c4be42f 100644
--- a/noncore/multimedia/camera/lib/zcameraio.cpp
+++ b/noncore/multimedia/camera/lib/zcameraio.cpp
@@ -1,80 +1,82 @@
/**********************************************************************
** 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 <stdio.h>
#include <qimage.h>
#include <qdatetime.h>
#include <opie2/odebug.h>
#define SHARPZDC "/dev/sharp_zdc"
+using namespace Opie::Core;
+
ZCameraIO* ZCameraIO::_instance = 0;
ZCameraIO* ZCameraIO::instance()
{
if ( !ZCameraIO::_instance )
{
odebug << "Creating ZCameraIO::_instance" << oendl;
ZCameraIO::_instance = new ZCameraIO();
}
return ZCameraIO::_instance;
}
ZCameraIO::ZCameraIO()
: _pressed( false ), _height( 0 ), _width( 0 ), _zoom( 0 ),
_flip( -1 ), _rot( 0 ), _readlen( 0 )
{
_driver = ::open( SHARPZDC, O_RDWR );
if ( _driver == -1 )
oerr << "Can't open camera driver: " << strerror(errno) << oendl;
else
init();
}
void ZCameraIO::init()
{
if ( ZCameraIO::_instance )
ofatal << "Don't create more than one ZCameraIO instances." << oendl;
else
{
_timer = new QTime();
setReadMode( STATUS );
}
}
ZCameraIO::~ZCameraIO()
{
if ( _driver != -1 )
{
setReadMode( 0 );
::close( _driver );
}
}