A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
graphlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Commit last experimental bits (dated December 6th, 2013).
[graphlib.git]
/
DrawingWindow.cpp
diff --git
a/DrawingWindow.cpp
b/DrawingWindow.cpp
index
5c918ba
..
78a6296
100644
(file)
--- a/
DrawingWindow.cpp
+++ b/
DrawingWindow.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2007-2013, Arnaud Giersch <arnaud.giersch@
iut-bm.
univ-fcomte.fr>
+ * Copyright (c) 2007-2013, Arnaud Giersch <arnaud.giersch@univ-fcomte.fr>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-36,7
+36,7
@@
/*! \class DrawingWindow
* \brief Fenêtre de dessin.
*
/*! \class DrawingWindow
* \brief Fenêtre de dessin.
*
- * \author Arnaud Giersch <arnaud.giersch@
iut-bm.
univ-fcomte.fr>
+ * \author Arnaud Giersch <arnaud.giersch@univ-fcomte.fr>
* \date 2007-2013
*
* Cette classe décrit un widget Qt permettant d'écrire des
* \date 2007-2013
*
* Cette classe décrit un widget Qt permettant d'écrire des
@@
-665,11
+665,11
@@
bool DrawingWindow::waitMousePress(int &x, int &y, int &button,
unsigned long time)
{
bool pressed;
unsigned long time)
{
bool pressed;
- safeLock(
mouse
Mutex);
+ safeLock(
input
Mutex);
if (terminateThread) {
pressed = false;
} else {
if (terminateThread) {
pressed = false;
} else {
- pressed =
mouseCondition.wait(&mouse
Mutex, time) && !terminateThread;
+ pressed =
inputCondition.wait(&input
Mutex, time) && !terminateThread;
if (pressed) {
x = mousePos.x();
y = mousePos.y();
if (pressed) {
x = mousePos.x();
y = mousePos.y();
@@
-683,7
+683,7
@@
bool DrawingWindow::waitMousePress(int &x, int &y, int &button,
button = 0;
}
}
button = 0;
}
}
- safeUnlock(
mouse
Mutex);
+ safeUnlock(
input
Mutex);
return pressed;
}
return pressed;
}
@@
-745,6
+745,9
@@
void DrawingWindow::usleep(unsigned long usecs)
DrawingThread::usleep(usecs);
}
DrawingThread::usleep(usecs);
}
+//--- DrawingWindow (protected methods) --------------------------------
+//! \cond show_protected
+
/*!
* \see QWidget
*/
/*!
* \see QWidget
*/
@@
-753,7
+756,7
@@
void DrawingWindow::closeEvent(QCloseEvent *ev)
timer.stop();
thread->exit();
syncMutex.lock();
timer.stop();
thread->exit();
syncMutex.lock();
-
mouse
Mutex.lock();
+
input
Mutex.lock();
terminateThread = true; // this flag is needed for the case
// where the following wakeAll() call
// occurs between the
terminateThread = true; // this flag is needed for the case
// where the following wakeAll() call
// occurs between the
@@
-761,8
+764,8
@@
void DrawingWindow::closeEvent(QCloseEvent *ev)
// mutex lock in safeLock() called
// from sync()
syncCondition.wakeAll();
// mutex lock in safeLock() called
// from sync()
syncCondition.wakeAll();
-
mouse
Condition.wakeAll();
-
mouse
Mutex.unlock();
+
input
Condition.wakeAll();
+
input
Mutex.unlock();
syncMutex.unlock();
QWidget::closeEvent(ev);
if (!thread->wait(250)) {
syncMutex.unlock();
QWidget::closeEvent(ev);
if (!thread->wait(250)) {
@@
-797,12
+800,12
@@
void DrawingWindow::customEvent(QEvent *ev)
*/
void DrawingWindow::mousePressEvent(QMouseEvent *ev)
{
*/
void DrawingWindow::mousePressEvent(QMouseEvent *ev)
{
-
mouse
Mutex.lock();
+
input
Mutex.lock();
mousePos = ev->pos();
mouseButton = ev->button();
ev->accept();
mousePos = ev->pos();
mouseButton = ev->button();
ev->accept();
-
mouse
Condition.wakeAll();
-
mouse
Mutex.unlock();
+
input
Condition.wakeAll();
+
input
Mutex.unlock();
}
/*!
}
/*!
@@
-854,6
+857,8
@@
void DrawingWindow::timerEvent(QTimerEvent *ev)
}
}
}
}
+// \endcond
+
//--- DrawingWindow (private methods) ----------------------------------
//! Fonction d'initialisation.
//--- DrawingWindow (private methods) ----------------------------------
//! Fonction d'initialisation.