summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/remote.cpp
Unidiff
Diffstat (limited to 'noncore/tools/remote/remote.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/remote.cpp100
1 files changed, 100 insertions, 0 deletions
diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp
new file mode 100644
index 0000000..7972def
--- a/dev/null
+++ b/noncore/tools/remote/remote.cpp
@@ -0,0 +1,100 @@
1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens
4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version.
8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details.
12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/
16
17#include <qpe/qpeapplication.h>
18#include <qpe/resource.h>
19#include <qpe/config.h>
20#include <qpushbutton.h>
21#include <qtabwidget.h>
22#include <qlayout.h>
23#include <qmessagebox.h>
24#include <qpaintdevice.h>
25#include <qobject.h>
26#include <sys/socket.h>
27#include <sys/types.h>
28#include <sys/un.h>
29#include <unistd.h>
30#include <stdio.h>
31#include <signal.h>
32
33#include "mainview.h"
34
35/*void reconnect(int &fd)
36{
37 //struct sockaddr_un addr;
38
39 addr.sun_family=AF_UNIX;
40 strcpy(addr.sun_path,"/dev/lircd");
41 fd = socket(AF_UNIX, SOCK_STREAM, 0);
42
43 if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
44 {
45 QMessageBox *mb = new QMessageBox("error",
46 "couldnt connect to socket",
47 QMessageBox::NoIcon,
48 QMessageBox::Ok,
49 QMessageBox::NoButton,
50 QMessageBox::NoButton);
51 mb->exec();
52 }
53}
54*/
55
56int main( int argc, char **argv )
57{
58 QPEApplication a( argc, argv );
59 MainView w;
60
61 int fd;
62 //struct sockaddr_un addr;
63 //char read_buffer[BUFFERSIZE+1];
64 //char write_buffer[] = "LIST\n";
65
66 //addr.sun_family=AF_UNIX;
67 //strcpy(addr.sun_path,"/dev/lircd");
68 //fd = socket(AF_UNIX, SOCK_STREAM, 0);
69
70 //printf("fd1: %d\n", fd);
71/*
72 if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
73 {
74 QMessageBox *mb = new QMessageBox("error",
75 "couldnt connect to socket",
76 QMessageBox::NoIcon,
77 QMessageBox::Ok,
78 QMessageBox::NoButton,
79 QMessageBox::NoButton);
80 mb->exec();
81 }
82*/
83
84 //printf("%d\n", write(fd, write_buffer, sizeof(write_buffer) ) );
85
86 //printf("%d\n", read(fd, read_buffer, BUFFERSIZE ) );
87
88 //QMessageBox *mbtest = new QMessageBox("lirc test",
89 // *new QString((const char *) read_buffer),
90 // QMessageBox::NoIcon,
91 // QMessageBox::Ok,
92 // QMessageBox::NoButton,
93 // QMessageBox::NoButton);
94 //mbtest->exec();
95
96 a.setMainWidget( &w );
97 w.setIRSocket(fd);
98 w.showMaximized();
99 return a.exec();
100}