summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-01 22:18:03 (UTC)
committer mickeyl <mickeyl>2003-04-01 22:18:03 (UTC)
commita46668f70b74f27689afb956ff085d42c0775328 (patch) (side-by-side diff)
tree24e1477b919aa4453d8724512ed7dd9659d040dc
parent76b83c2b77e626fadf1d1bbbfd19a9a8a795334b (diff)
downloadopie-a46668f70b74f27689afb956ff085d42c0775328.zip
opie-a46668f70b74f27689afb956ff085d42c0775328.tar.gz
opie-a46668f70b74f27689afb956ff085d42c0775328.tar.bz2
- backgammon: g++3 fix
- add skeleton for opie-camera application
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--apps/Applications/camera.desktop10
-rw-r--r--noncore/games/backgammon/moveengine.cpp2
-rw-r--r--noncore/multimedia/camera/.cvsignore1
-rw-r--r--noncore/multimedia/camera/camera.pro21
-rw-r--r--noncore/multimedia/camera/config.in7
-rw-r--r--noncore/multimedia/camera/main.cpp28
-rw-r--r--noncore/multimedia/camera/mainwindow.cpp50
-rw-r--r--noncore/multimedia/camera/mainwindow.h40
-rw-r--r--noncore/multimedia/camera/zcameraio.cpp56
-rw-r--r--noncore/multimedia/camera/zcameraio.h35
-rw-r--r--packages1
-rwxr-xr-xpics/camera/cam.pngbin0 -> 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,558 +1,560 @@
#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++)
{
x_coord[a]=xfill[a];
}
int yfill[]={10,25,40,55,70,10+offset,25+offset,40+offset,55+offset,25,40,55, 25+offset,40+offset,40};
int zfill[]={1,1,1,1,1,2,2,2,2,3,3,3,4,4,5};
for(a=0;a<15;a++)
{
yup_coord[a]=yfill[a];
ylow_coord[a]=185-(yfill[a]);
z_coord[a]=zfill[a];
}
for(a=0;a<5;a++)
{
if(a<3)
{
x_fin1[a]=65+a*15;
x_fin2[a]=155-a*15;
}
y_fin[a]=225-a*5;
}
z_fin=1;
reset();
}
MoveEngine::~MoveEngine()
{}
void MoveEngine::position(Pieces& pieces,bool non_qte)
{
int player1_counter=0;
int player2_counter=0;
//non qte styles are smaller !!
int offset=(non_qte) ? 5 : 0;
for(int a=0;a<28;a++)
{
for(int b=0;b<abs(population[a].total);b++)
{
if(population[a].total>0) //player 1 pieces
{
pieces.player1[player1_counter].x=x_coord[a]-offset;
if(a>=0 && a<13)
{
pieces.player1[player1_counter].y=yup_coord[b]-offset;
pieces.player1[player1_counter].z=z_coord[b];
pieces.player1[player1_counter].side=false;
player1_counter++;
}
else if(a>12 && a<26)
{
pieces.player1[player1_counter].y=ylow_coord[b]-offset;
pieces.player1[player1_counter].z=z_coord[b];
pieces.player1[player1_counter].side=false;
player1_counter++;
}
else if(a==26)
{
if(b<5)
{
pieces.player1[player1_counter].x=x_fin1[0]-offset;
pieces.player1[player1_counter].y=y_fin[b]-offset;
pieces.player1[player1_counter].z=z_fin;
}
else if(b>=5 && b<10)
{
pieces.player1[player1_counter].x=x_fin1[1]-offset;
pieces.player1[player1_counter].y=y_fin[b-5]-offset;
pieces.player1[player1_counter].z=z_fin;
}
else
{
pieces.player1[player1_counter].x=x_fin1[2]-offset;
pieces.player1[player1_counter].y=y_fin[b-10]-offset;
pieces.player1[player1_counter].z=z_fin;
}
pieces.player1[player1_counter].side=true;
player1_counter++;
}
}
else if(population[a].total<0) //player 2 pieces
{
pieces.player2[player2_counter].x=x_coord[a]-offset;
if(a>=0 && a<13)
{
pieces.player2[player2_counter].y=yup_coord[b]-offset;
pieces.player2[player2_counter].z=z_coord[b];
pieces.player2[player2_counter].side=false;
player2_counter++;
}
else if(a>12 && a<26)
{
pieces.player2[player2_counter].y=ylow_coord[b]-offset;
pieces.player2[player2_counter].z=z_coord[b];
pieces.player2[player2_counter].side=false;
player2_counter++;
}
else if(a==27)
{
if(b<5)
{
pieces.player2[player2_counter].x=x_fin2[0]-offset;
pieces.player2[player2_counter].y=y_fin[b]-offset;
pieces.player2[player2_counter].z=z_fin;
}
else if(b>=5 && b<10)
{
pieces.player2[player2_counter].x=x_fin2[1]-offset;
pieces.player2[player2_counter].y=y_fin[b-5]-offset;
pieces.player2[player2_counter].z=z_fin;
}
else
{
pieces.player2[player2_counter].x=x_fin2[2]-offset;
pieces.player2[player2_counter].y=y_fin[b-10]-offset;
pieces.player2[player2_counter].z=z_fin;
}
pieces.player2[player2_counter].side=true;
player2_counter++;
}
}
}
}
}
void MoveEngine::diceroll(const int& newplayer,const int& face1,const int& face2,const int& face3,const int& face4,bool computer)
{
checkstate();
player=newplayer;
otherplayer=(player==1) ? 2 : 1;
dice[0]=face1;
dice[1]=face2;
dice[2]=face3;
dice[3]=face4;
marker_current=-1;
if(getPossibleMoves()==0)
{
emit nomove();
return; // player will be changed
}
if(!computer)
return; //human intervention required
QTimer::singleShot(2000,this,SLOT(automove()));
}
void MoveEngine::automove()
{
//the maximimum possibility
int maxpos=0;
//the position in the moves array
int from=-1;
int to=-1;
//dice1 or dice 2 ??
int index_dice=0;
for(int counter=0;counter<26;counter++)
{
int a=(player==1) ? counter : 25-counter;
for(int b=0;b<4;b++)
{
if(moves[a].weight[b]>maxpos)
{
maxpos=moves[a].weight[b];
from=a;
to=moves[a].to[b];
index_dice=b+1;
}
}
}
move(from,to,index_dice);
}
void MoveEngine::boardpressed(const int& x,const int& y,Marker& marker,bool non_qte)
{
//get the position of the mouse click
bool upper=true;
bool found=false;
int offset=(non_qte) ? 5 : 0;
if(y<=85) // board slots 0 to 12
marker.y_current=0;
else if(y>=105) //board slots 13 to 25
{
marker.y_current=195-2*offset;
upper=false;
}
int index=13; // the clicked board slot
while(index<25 && !found)
{
if(x>=x_coord[index] && x<x_coord[index+1])
{
marker.x_current=x_coord[index];
found=true;
;
}
else
{
index++;
}
}
if(!found)
{
marker.x_current=x_coord[25];
index=25;
}
if(upper)
{
index=25-index;
}
int a=0;
int usedice=-1;
int dice_value=7;
for(a=0;a<4;a++)
{
if(index==marker_next[a] && marker_next[a]!=-1 && dice_value>dice[a])
{
usedice=a;
dice_value=dice[0];
}
}
if(usedice!=-1)
{
move(marker_current,marker_next[usedice],usedice+1);
nomarker(marker);
return;
}
if(dice[0]==7 && dice[1]==7 && dice[2]==7 && dice[3]==7) //no dice rolled
{
nomarker(marker);
return;
}
else if(fieldColor(index)==player)
{
marker.visible_current=true;
marker_current=index;
}
else
{
nomarker(marker);
return;
}
for(a=0;a<4;a++)
{
if(moves[index].weight[a]>0)
{
int nextfield=moves[index].to[a];
marker.x_next[a]=x_coord[nextfield];
marker_next[a]=nextfield;
if(nextfield<13) //upper half
marker.y_next[a]=0;
else //lower half
marker.y_next[a]=195-2*offset;
marker.visible_next[a]=true;
}
else
{
marker.x_next[a]=0;
marker.y_next[a]=0;
marker_next[a]=-1;
marker.visible_next[a]=false;
}
}
return;
}
void MoveEngine::reset()
{
int a=0;
for(a=0;a<28;a++)
{
population[a].total=0;
}
int p1_index[]={1,1,12,12,12,12,12,17,17,17,19,19,19,19,19};
int p2_index[]={24,24,13,13,13,13,13,8,8,8,6,6,6,6,6};
//int p1_index[]={19,20,21,22,22,23,23,18,18,23,24,24,24,24,24};
//int p2_index[]={6,5,4,3,3,2,2,2,2,2,1,7,7,1,1};
for(a=0;a<15;a++)
{
population[p1_index[a]].total++;
population[p2_index[a]].total--;
}
player=0;
dice[0]=7;
dice[1]=7;
dice[2]=7;
dice[3]=7;
marker_current=-1;
marker_next[0]=-1;
marker_next[1]=-1;
marker_next[2]=-1;
marker_next[3]=-1;
//allclear[0]==false;
allclear[1]=false;
allclear[2]=false;
last_piece[1]=0;
last_piece[2]=25;
}
void MoveEngine::loadGame(const LoadSave& load)
{
for(int a=0;a<28;a++)
{
population[a].total=load.pop[a].total;
}
checkstate();
}
LoadSave MoveEngine::saveGame()
{
LoadSave save;
for(int a=0;a<28;a++)
{
save.pop[a].total=population[a].total;
}
return save;
}
AISettings MoveEngine::getAISettings()
{
return ai;
}
void MoveEngine::setAISettings(const AISettings& new_ai)
{
ai=new_ai;
}
void MoveEngine::setRules(Rules rules)
{
move_with_pieces_out=rules.move_with_pieces_out;
nice_dice=rules.generous_dice;
}
int MoveEngine::getPossibleMoves()
{
int homezone[]={0,25,0};
int lastToHomeZone=abs(last_piece[player]-homezone[player]);
for(int field=0;field<26;field++)
{
for(int b=0;b<4;b++)
{
int dice_tmp=dice[b];
if(dice[b]!=7 && dice[b]> lastToHomeZone)
dice_tmp=lastToHomeZone;
int nextfield=(player==1) ? field+dice_tmp : field-dice_tmp;
if(nice_dice)
{
if(player==1 && nextfield>homezone[1])
nextfield=homezone[1];
else if(player==2 && nextfield<homezone[2])
nextfield=homezone[2];
}
moves[field].weight[b]=0;
moves[field].to[b]=nextfield;
int out_of_board[]={-1,0,25};
if(!move_with_pieces_out && field!=out_of_board[player] && pieces_out[player])
{
continue;
}
if(dice[b]!=7 && fieldColor(field)==player ) //player can only move his own pieces
{
if((player==1 && nextfield > homezone[1]) || (player==2 && nextfield < homezone[2]))
{
moves[field].weight[b]=0; //movement would be far out of board
}
else if(nextfield==homezone[player] && !allclear[player])
{
moves[field].weight[b]=0; //can not rescue pieces until all are in the endzone
}
else if(nextfield==homezone[player] && allclear[player])
{
moves[field].weight[b]=ai.rescue; //rescue your pieces : nuff said ;-)
}
else if(fieldColor(nextfield)==otherplayer)
{
if(abs(population[nextfield].total)>1) //can not move to this field
moves[field].weight[b]=0;
else if(abs(population[nextfield].total)==1) //eliminate opponent : very nice
moves[field].weight[b]=ai.eliminate;
}
else if(fieldColor(nextfield)==player) //nextfield already occupied by player
{
if(abs(population[field].total)==2) //expose own piece : not diserable
moves[field].weight[b]=ai.expose;
else if(abs(population[nextfield].total)>1) //own pices already there : safe
moves[field].weight[b]=ai.safe;
else if(abs(population[nextfield].total)==1) //protect own piece : most importatnt
moves[field].weight[b]=ai.protect;
}
else if(population[nextfield].total==0) //nextfield empty
{
if(abs(population[field].total)==2) //expose own piece : not diserable
moves[field].weight[b]=ai.expose;
else
moves[field].weight[b]=ai.empty;
}
else
moves[field].weight[b]=0; //default.
}
else
moves[field].weight[b]=0; //dice already used or field not used by player
}
}
int total=0;
for(int field=0;field<26;field++)
{
total+=moves[field].weight[0]+moves[field].weight[1]+moves[field].weight[2]+moves[field].weight[3];
}
return total;
}
void MoveEngine::move(const int& from, int to, const int& dice)
{
//qDebug("%d moves from %d to %d (%d) with dice %d",player,from,to,to-from,dice);
if(player==1 && to==25)
to=26;
if(player==2 && to==0)
to=27;
//if space is occupied by enemy move pieces to startzone
if(fieldColor(to)==otherplayer)
{
population[to].total=0;
if(otherplayer==1)
population[0].total++;
else
population[25].total--;
}
if(player==1)
{
population[from].total--;
population[to].total++;
}
else //player=2
{
population[from].total++;
population[to].total--;
}
if(dice==1)
emit done_dice1();
else if(dice==2)
emit done_dice2();
else if(dice==3)
emit done_dice3();
else
emit done_dice4();
if(abs(population[26].total)==15)
emit player_finished(1);
if(abs(population[27].total)==15)
emit player_finished(2);
}
void MoveEngine::checkstate()
{
//check if pieces are out
pieces_out[1]=(population[0].total>0) ? true : false;
pieces_out[2]=(population[25].total<0) ? true : false;
//check if all pieces are in the endzones
allclear[1]=true;
allclear[2]=true;
last_piece[1]=25;
bool found_last_piece1=false;
last_piece[2]=0;
for(int a=0;a<26;a++)
{
if(a<19 && population[a].total>0)
allclear[1]=false;
if(a>6 && population[a].total<0)
allclear[2]=false;
if(population[a].total>0 && !found_last_piece1)
{
last_piece[1]=a;
found_last_piece1=true;
}
if(population[a].total<0)
last_piece[2]=a;
}
}
void MoveEngine::nomarker(Marker& marker)
{
marker.visible_current=false;
marker_current=-1;
for(int a=0;a<4;a++)
{
marker.x_next[a]=0;
marker.y_next[a]=0;
marker_next[a]=-1;
marker.visible_next[a]=false;
}
}
int MoveEngine::fieldColor(const int& index) const
{
if(population[index].total>0)
return 1;
else if(population[index].total<0)
return 2;
else
return 0;
}
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
diff --git a/packages b/packages
index 5fdf5d2..0e4ae43 100644
--- a/packages
+++ b/packages
@@ -1,163 +1,164 @@
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
CONFIG_MOBILEMSG noncore/comm/mobilemsg mobilemsg.pro
CONFIG_OFILESELECTOR libopie/ofileselector ofileselector.pro
CONFIG_OPIE-WRITE noncore/apps/opie-write opie-write.pro
CONFIG_QUICKEXEC quickexec quickexec.pro
CONFIG_RESTARTAPPLET core/applets/restartapplet restartapplet.pro
CONFIG_RESTARTAPPLET2 core/applets/restartapplet2 restartapplet2.pro
CONFIG_SIMPLE noncore/tools/calc2/simple simple.pro
CONFIG_TEST libsql/test test.pro
CONFIG_TEST noncore/apps/opie-console/test test.pro
CONFIG_UBROWSER noncore/net/ubrowser ubrowser.pro
CONFIG_WELLENREITER noncore/net/wellenreiter wellenreiter.pro
CONFIG_ADDRESSBOOK core/pim/addressbook addressbook.pro
CONFIG_ADVANCEDFM noncore/apps/advancedfm advancedfm.pro
CONFIG_APPEARANCE2 noncore/settings/appearance2 appearance2.pro
CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/applet applet.pro
CONFIG_AQPKG noncore/apps/aqpkg aqpkg.pro
CONFIG_BACKUP noncore/settings/backup backup.pro
CONFIG_BATTERYAPPLET core/applets/batteryapplet batteryapplet.pro
CONFIG_BEND noncore/mail/bend bend.pro
CONFIG_BLUE-PIN noncore/net/opietooth/blue-pin blue-pin.pro
CONFIG_BOUNCE noncore/games/bounce bounce.pro
CONFIG_BUTTON-SETTINGS core/settings/button button.pro
CONFIG_BUZZWORD noncore/games/buzzword buzzword.pro
CONFIG_CALCULATOR noncore/tools/calculator calculator.pro
CONFIG_CARDMON core/applets/cardmon cardmon.pro
CONFIG_CHECKBOOK noncore/apps/checkbook checkbook.pro
CONFIG_CITYTIME core/settings/citytime citytime.pro
CONFIG_CLIPBOARDAPPLET core/applets/clipboardapplet clipboardapplet.pro
CONFIG_CLOCK noncore/tools/clock clock.pro
CONFIG_CLOCKAPPLET core/applets/clockapplet clockapplet.pro
CONFIG_CONFEDIT noncore/apps/confedit confedit.pro
CONFIG_DATEBOOK core/pim/datebook datebook.pro
CONFIG_DECO_FLAT noncore/decorations/flat flat.pro
CONFIG_DECO_LIQUID noncore/decorations/liquid liquid.pro
CONFIG_DECO_POLISHED noncore/decorations/polished polished.pro
CONFIG_DRAWPAD noncore/graphics/drawpad drawpad.pro
CONFIG_DVORAK inputmethods/dvorak dvorak.pro
CONFIG_EMBEDDEDKONSOLE core/apps/embeddedkonsole embeddedkonsole.pro
CONFIG_FIFTEEN noncore/games/fifteen fifteen.pro
CONFIG_FILEBROWSER core/apps/filebrowser filebrowser.pro
CONFIG_FLAT noncore/styles/flat flat.pro
CONFIG_FORMATTER noncore/tools/formatter formatter.pro
CONFIG_FREETYPE freetype freetype.pro
CONFIG_FRESH noncore/styles/fresh fresh.pro
CONFIG_FTPLIB noncore/net/ftplib ftplib.pro
CONFIG_GO noncore/games/go go.pro
CONFIG_HANDWRITING inputmethods/handwriting handwriting.pro
CONFIG_HELPBROWSER core/apps/helpbrowser helpbrowser.pro
CONFIG_HOMEAPPLET core/applets/homeapplet homeapplet.pro
CONFIG_INTERFACES noncore/net/networksettings/interfaces interfaces.pro
CONFIG_IRDAAPPLET core/applets/irdaapplet irdaapplet.pro
CONFIG_JUMPX inputmethods/jumpx jumpx.pro
CONFIG_KBILL noncore/games/kbill kbill.pro
CONFIG_KCHECKERS noncore/games/kcheckers kcheckers.pro
CONFIG_KEYBOARD inputmethods/keyboard keyboard.pro
CONFIG_KEYPEBBLE noncore/comm/keypebble keypebble.pro
CONFIG_KJUMPX inputmethods/kjumpx kjumpx.pro
CONFIG_KPACMAN noncore/games/kpacman kpacman.pro
CONFIG_LANGUAGE noncore/settings/language language.pro
CONFIG_LAUNCHER-SETTINGS core/settings/launcher launcher.pro
CONFIG_LAUNCHER_CORE core/launcher launcher.pro
CONFIG_LIBOPIETOOTH noncore/net/opietooth/lib lib.pro
CONFIG_LIBKATE noncore/apps/tinykate/libkate libkate.pro
CONFIG_LIBMAD core/multimedia/opieplayer/libmad libmad.pro
CONFIG_LIBMAIL noncore/mail/libmail libmail.pro
CONFIG_LIBMPEG3 core/multimedia/opieplayer/libmpeg3 libmpeg3.pro
CONFIG_LIBOPIE libopie libopie.pro
CONFIG_LIBOPIE2CORE libopie2/opiecore opiecore.pro
CONFIG_LIBOPIE2DB libopie2/opiedb opiedb.pro
CONFIG_LIBOPIE2NET libopie2/opienet opienet.pro
CONFIG_LIBOPIE2PIM libopie2/opiepim opiepim.pro
CONFIG_LIBOPIE2UI libopie2/opieui opieui.pro
CONFIG_LIBOPIE2EXAMPLES libopie2/examples examples.pro
CONFIG_LIBQPE library library.pro
CONFIG_LIBQPE-X11 x11/libqpe-x11 libqpe-x11.pro
CONFIG_LIGHT-AND-POWER core/settings/light-and-power light-and-power.pro
CONFIG_LIQUID noncore/styles/liquid liquid.pro
CONFIG_LOGOUTAPPLET core/applets/logoutapplet logoutapplet.pro
CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/manager manager.pro
CONFIG_MEDIUMMOUNT noncore/settings/mediummount mediummount.pro
CONFIG_METAL noncore/styles/metal metal.pro
CONFIG_MINDBREAKER noncore/games/mindbreaker mindbreaker.pro
CONFIG_MINESWEEP noncore/games/minesweep minesweep.pro
CONFIG_MODPLUG core/multimedia/opieplayer/modplug modplug.pro
CONFIG_MULTIKEY inputmethods/multikey multikey.pro
CONFIG_NETSYSTEMTIME noncore/settings/netsystemtime netsystemtime.pro
CONFIG_NETWORKSETUP noncore/net/networksettings networksettings.pro
CONFIG_NOTESAPPLET noncore/applets/notesapplet notesapplet.pro
CONFIG_OBEX core/applets/obex2 obex.pro
CONFIG_OCOPSERVER x11/ipc/server ocopserver.pro
CONFIG_OIPKG core/apps/oipkg oipkg.pro
CONFIG_OPIE-CONSOLE noncore/apps/opie-console opie-console.pro
CONFIG_OPIE-LOGIN core/opie-login opie-login.pro
CONFIG_OPIEMAIL2 noncore/mail mail.pro
CONFIG_OPIE-READER noncore/apps/opie-reader opie-reader.pro
CONFIG_OPIE-SH noncore/tools/opie-sh opie-sh.pro
CONFIG_OPIE-SHEET noncore/apps/opie-sheet opie-sheet.pro
CONFIG_OPIEALARM core/opiealarm
CONFIG_OPIEFTP noncore/net/opieftp opieftp.pro
CONFIG_OPIEIRC noncore/net/opieirc opieirc.pro
CONFIG_OPIEPLAYER core/multimedia/opieplayer opieplayer.pro
CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2 opieplayer2.pro
CONFIG_OXYGEN noncore/apps/oxygen oxygen.pro
CONFIG_PARASHOOT noncore/games/parashoot parashoot.pro
CONFIG_PICKBOARD inputmethods/pickboard pickboard.pro
CONFIG_QASTEROIDS noncore/games/qasteroids qasteroids.pro
CONFIG_QCOP core/apps/qcop qcop.pro
CONFIG_ODICT noncore/apps/odict odict.pro
CONFIG_QPDF noncore/graphics/qpdf qpdf.pro
CONFIG_REMOTE noncore/tools/remote remote.pro
CONFIG_ROTATION noncore/settings/rotation rotation.pro
CONFIG_RUNAPPLET core/applets/runapplet runapplet.pro
CONFIG_SCREENSHOTAPPLET core/applets/screenshotapplet screenshotapplet.pro
CONFIG_SECURITY core/settings/security security.pro
CONFIG_SFCAVE noncore/games/sfcave sfcave.pro
CONFIG_SFCAVE-SDL noncore/games/sfcave-sdl sfcave-sdl.pro
CONFIG_SHOWIMG noncore/multimedia/showimg showimg.pro
CONFIG_SINGLE single single.pro
CONFIG_SNAKE noncore/games/snake snake.pro
CONFIG_SOLITAIRE noncore/games/solitaire solitaire.pro
CONFIG_SOUND noncore/settings/sound sound.pro
CONFIG_SSHKEYS noncore/settings/sshkeys sshkeys.pro
CONFIG_SUSPENDAPPLET core/applets/suspendapplet suspendapplet.pro
CONFIG_ROTATEAPPLET core/applets/rotateapplet rotateapplet.pro
CONFIG_SYSINFO noncore/apps/sysinfo sysinfo.pro
CONFIG_TABLEVIEWER noncore/apps/tableviewer tableviewer.pro
CONFIG_TABMANAGER noncore/settings/tabmanager tabmanager.pro
CONFIG_TETRIX noncore/games/tetrix tetrix.pro
CONFIG_TEXTEDIT core/apps/textedit textedit.pro
CONFIG_THEME noncore/styles/theme theme.pro
CONFIG_TICTAC noncore/games/tictac tictac.pro
CONFIG_TINYKATE noncore/apps/tinykate tinykate.pro
CONFIG_TODAY core/pim/today today.pro
CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro
CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebook datebook.pro
CONFIG_TODAY_FORTUNE noncore/todayplugins/fortune fortune.pro
CONFIG_TODAY_MAIL core/pim/today/plugins/mail mail.pro
CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stockticker stockticker.pro
CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlib stocktickerlib.pro
CONFIG_TODAY_WEATHER noncore/todayplugins/weather weather.pro
CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolist todolist.pro
CONFIG_TODO core/pim/todo todo.pro
CONFIG_UNIKEYBOARD inputmethods/unikeyboard unikeyboard.pro
CONFIG_USERMANAGER noncore/settings/usermanager usermanager.pro
CONFIG_VMEMO core/applets/vmemo vmemo.pro
CONFIG_VOLUMEAPPLET core/applets/volumeapplet volumeapplet.pro
CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavplugin wavplugin.pro
CONFIG_WIRELESSAPPLET noncore/applets/wirelessapplet wirelessapplet.pro
CONFIG_WLAN noncore/net/networksettings/wlan wlan.pro
CONFIG_WORDGAME noncore/games/wordgame wordgame.pro
diff --git a/pics/camera/cam.png b/pics/camera/cam.png
new file mode 100755
index 0000000..6bd468b
--- a/dev/null
+++ b/pics/camera/cam.png
Binary files differ