summaryrefslogtreecommitdiff
path: root/src/glibext/delayed-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/delayed-int.h')
-rw-r--r--src/glibext/delayed-int.h41
1 files changed, 11 insertions, 30 deletions
diff --git a/src/glibext/delayed-int.h b/src/glibext/delayed-int.h
index 7fb8f3a..b2e2b23 100644
--- a/src/glibext/delayed-int.h
+++ b/src/glibext/delayed-int.h
@@ -25,12 +25,17 @@
#include "../common/dllist.h"
+#include "../gtkext/gtkextstatusbar.h"
/* -------------------------- TACHE DIFFEREE DANS LE TEMPS -------------------------- */
+/* Traite un travail programmé. */
+typedef void (* run_task_fc) (GDelayedWork *, GtkExtStatusBar *);
+
+
/* Travail différé (instance) */
struct _GDelayedWork
{
@@ -38,6 +43,8 @@ struct _GDelayedWork
DL_LIST_ITEM(link); /* Lien vers les maillons */
+ run_task_fc run; /* Traitement externalisé */
+
};
/* Travail différé (classe) */
@@ -45,38 +52,12 @@ struct _GDelayedWorkClass
{
GObjectClass parent; /* A laisser en premier */
-};
-
-
-#define delayed_work_list_add_tail(new, head) dl_list_add_tail(new, head, GDelayedWork, link)
-#define delayed_work_list_del(item, head) dl_list_del(item, head, GDelayedWork, link)
-
-
-
-/* ------------------------- TRAITEMENT DE TACHES DIFFEREES ------------------------- */
-
+ /* Signaux */
-/* Effectue le traitement d'une tâche donnée. */
-typedef void (* process_work_fc) (GWorkQueue *, GDelayedWork *);
-
-
-/* Gestionnaire des travaux différés (instance) */
-struct _GWorkQueue
-{
- GObject parent; /* A laisser en premier */
-
- GDelayedWork *works; /* Tâches à mener à bien */
- GMutex *mutex; /* Verrou pour l'accès */
- GCond *cond; /* Réveil pour un traitement */
-
- GThread *thread; /* Procédure de traitement */
- process_work_fc process; /* Coeur du traitement */
+ void (* work_completed) (GDelayedWork *);
};
-/* Gestionnaire des travaux différés (classe) */
-struct _GWorkQueueClass
-{
- GObjectClass parent; /* A laisser en premier */
-};
+#define delayed_work_list_add_tail(new, head) dl_list_add_tail(new, head, GDelayedWork, link)
+#define delayed_work_list_del(item, head) dl_list_del(item, head, GDelayedWork, link)