~ubuntu-branches/debian/lenny/italc/lenny

« back to all changes in this revision

Viewing changes to master/icv/src/qremoteview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-06-17 13:46:54 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20080617134654-2y5m7ki93r5c1ysf
Tags: upstream-1.0.9~rc3
ImportĀ upstreamĀ versionĀ 1.0.9~rc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                   qremoteview.cpp  -  widget that shows the remote framebuffer
3
 
                             -------------------
4
 
    begin                : Wed Dec 26 00:21:14 CET 2002
5
 
    copyright            : (C) 2002-2003 by Tim Jansen
6
 
    email                : tim@tjansen.de
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#include "qremoteview.h"
19
 
 
20
 
#include "qremoteview.moc"
21
 
 
22
 
 
23
 
QRemoteView::QRemoteView(QWidget *parent,
24
 
                         const char *name,
25
 
                         WFlags f) :
26
 
        QWidget(parent, name, f),
27
 
        m_status(REMOTE_VIEW_DISCONNECTED) {
28
 
}
29
 
 
30
 
enum RemoteViewStatus QRemoteView::status() {
31
 
        return m_status;
32
 
}
33
 
 
34
 
void QRemoteView::setStatus(RemoteViewStatus s) {
35
 
        if (m_status == s)
36
 
                return;
37
 
 
38
 
        if (((1+(int)m_status) != (int)s) &&
39
 
            (s != REMOTE_VIEW_DISCONNECTED)) {
40
 
                // follow state transition rules
41
 
 
42
 
                if (s == REMOTE_VIEW_DISCONNECTING) {
43
 
                    if (m_status == REMOTE_VIEW_DISCONNECTED)
44
 
                        return;
45
 
                }
46
 
                else {
47
 
                        Q_ASSERT(((int) s) >= 0);
48
 
                        if (((int)m_status) > ((int)s) ) {
49
 
                                m_status = REMOTE_VIEW_DISCONNECTED;
50
 
                                emit statusChanged(REMOTE_VIEW_DISCONNECTED);
51
 
                        }
52
 
                        // smooth state transition
53
 
                        int origState = (int)m_status;
54
 
                        for (int i = origState; i < (int)s; i++) {
55
 
                                m_status = (RemoteViewStatus) i;
56
 
                                emit statusChanged((RemoteViewStatus) i);
57
 
                        }
58
 
                }
59
 
        }
60
 
        m_status = s;
61
 
        emit statusChanged(m_status);
62
 
}
63
 
 
64
 
QRemoteView::~QRemoteView() {
65
 
}
66
 
 
67
 
bool QRemoteView::supportsScaling() const {
68
 
        return false;
69
 
}
70
 
 
71
 
bool QRemoteView::supportsLocalCursor() const {
72
 
        return false;
73
 
}
74
 
 
75
 
void QRemoteView::showDotCursor(DotCursorState) {
76
 
}
77
 
 
78
 
DotCursorState QRemoteView::dotCursorState() const {
79
 
        return DOT_CURSOR_OFF;
80
 
}
81
 
 
82
 
bool QRemoteView::scaling() const {
83
 
        return false;
84
 
}
85
 
 
86
 
void QRemoteView::enableScaling(bool) {
87
 
}
88
 
 
89
 
void QRemoteView::switchFullscreen(bool) {
90
 
}
91