Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
.
authorgiersch <giersch>
Sat, 24 Nov 2007 11:02:02 +0000 (11:02 +0000)
committergiersch <giersch>
Sat, 24 Nov 2007 11:02:02 +0000 (11:02 +0000)
Doxyfile
DrawingWindow.cpp
INSTALL
exemple.cpp
minimal/hello.cpp [new file with mode: 0644]
minimal/hello.pro [new file with mode: 0644]

index 3a5378f..fba7760 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -500,7 +500,7 @@ EXCLUDE_PATTERNS       =
 # directories that contain example code fragments that are included (see 
 # the \include command).
 
 # directories that contain example code fragments that are included (see 
 # the \include command).
 
-EXAMPLE_PATH           = 
+EXAMPLE_PATH           = ./ minimal/
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
index 7c63c86..fe759a8 100644 (file)
@@ -4,6 +4,69 @@
 #include <QThread>
 #include <QTimerEvent>
 
 #include <QThread>
 #include <QTimerEvent>
 
+/*! \mainpage
+ *
+ * Bla bla bla...
+ */
+
+/*! \class DrawingWindow
+ *  \brief Fenêtre de dessin.
+ *
+ * \author Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
+ * \date novenbre 2007
+ *
+ * Cette classe décrit un widget Qt permettant d'écrire des
+ * applications graphiques simples.  Pour cela, il faut définir une
+ * fonction de dessin.  Cette fonction ne retourne rien et prend comme
+ * unique paramètre une référence vers un objet de class
+ * DrawingWindow.
+ *
+ * La fonction devra ensuite être passée en paramètre pour les
+ * constructeurs de la classe, ainsi que les dimension requises pour
+ * la fenêtre graphique.  Le programme est ensuite compilé comme
+ * n'importe programme Qt.
+ *
+ * Concrètement, la fonction sera exécutée dans un nouveau thread,
+ * tandis que le thread principal s'occupera de la gestion des
+ * évènements et du rendu.
+ */
+
+/*! \example hello.cpp
+ *
+ * Voir le code source à la fin de la page.  Pour compiler et exécuter
+ * ce programme, il faut :
+ *
+ * <b>1. Créer le fichier \c hello.pro</b>
+ *
+ * Pour simplifier, ce fichier contient la liste des fichiers sources
+ * composant le programme.
+ *
+ * \include hello.pro
+ *
+ * <b>2. Créer le fichier \c Makefile avec la commande :</b>
+ *
+ * \verbatim qmake-qt4 hello.pro \endverbatim
+ * ou tout simplement :
+ * \verbatim qmake-qt4 \endverbatim
+ *
+ * <b>3. Compiler le programme avec la commande :</b>
+ *
+ * \verbatim make hello \endverbatim
+ * ou tout simplement :
+ * \verbatim make \endverbatim
+ *
+ * <b>4. Exécuter le programme avec la commande :</b>
+ *
+ * \verbatim ./exemple \endverbatim
+ *
+ * <b>Code source de l'exemple</b>
+ */
+
+/*! \example exemple.cpp
+ *
+ * Un exemple un peu plus sophistiqué.
+ */
+
 //! Classe de thread.
 class DrawingThread: public QThread {
 public:
 //! Classe de thread.
 class DrawingThread: public QThread {
 public:
@@ -56,10 +119,8 @@ public:
 
 //--- DrawingWindow ----------------------------------------------------
 
 
 //--- DrawingWindow ----------------------------------------------------
 
-/*! \class DrawingWindow
- *  \brief Fenêtre de dessin.
- *
- * Bla bla bla
+/*! \file DrawingWindow.h
+ *  \brief Classe DrawingWindow.
  */
 
 /*! \typedef DrawingWindow::ThreadFunction
  */
 
 /*! \typedef DrawingWindow::ThreadFunction
diff --git a/INSTALL b/INSTALL
index 1e464a7..58968af 100755 (executable)
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,7 @@ SRC = DrawingWindow.h DrawingWindow.cpp exemple.cpp exemple.pro
 .PHONY: install
 
 install:
 .PHONY: install
 
 install:
-       install -m 644 $(SRC) $(DEST)
        doxygen Doxyfile
        doxygen Doxyfile
+       install -m 644 $(SRC) $(DEST)
        install -m 755 -d $(DEST)/html
        install -m 644 html/* $(DEST)/html
        install -m 755 -d $(DEST)/html
        install -m 644 html/* $(DEST)/html
index 46e3510..d3eedc7 100644 (file)
@@ -10,7 +10,7 @@
  *      |CONFIG += debug                                             |
  *      |HEADERS += DrawingWindow.h                                  |
  *      |SOURCES += DrawingWindow.cpp                                |
  *      |CONFIG += debug                                             |
  *      |HEADERS += DrawingWindow.h                                  |
  *      |SOURCES += DrawingWindow.cpp                                |
- *      |SOURCES += exemple.c                                      |
+ *      |SOURCES += exemple.cpp                                      |
  *      +------------------------------------------------------------+
  *
  * 2. Créer le fichier Makefile avec la commande :
  *      +------------------------------------------------------------+
  *
  * 2. Créer le fichier Makefile avec la commande :
diff --git a/minimal/hello.cpp b/minimal/hello.cpp
new file mode 100644 (file)
index 0000000..8421198
--- /dev/null
@@ -0,0 +1,15 @@
+#include <QApplication>
+#include <DrawingWindow.h>
+
+void dessine(DrawingWindow& w)
+{
+    w.drawText(w.width / 2, w.height / 2, "Hello world!");
+}
+
+int main(int argc, char *argv[])
+{
+    QApplication application(argc, argv);
+    DrawingWindow fenetre(dessine, 640, 480);
+    fenetre.show();
+    return application.exec();
+}
diff --git a/minimal/hello.pro b/minimal/hello.pro
new file mode 100644 (file)
index 0000000..54c0b24
--- /dev/null
@@ -0,0 +1,7 @@
+TEMPLATE = app
+TARGET = hello
+CONFIG += qt
+CONFIG += debug
+HEADERS += DrawingWindow.h
+SOURCES += DrawingWindow.cpp
+SOURCES += hello.cpp