summaryrefslogtreecommitdiff
path: root/plugins/Actman30/tasks/scheduler.pas
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Actman30/tasks/scheduler.pas')
-rw-r--r--plugins/Actman30/tasks/scheduler.pas76
1 files changed, 76 insertions, 0 deletions
diff --git a/plugins/Actman30/tasks/scheduler.pas b/plugins/Actman30/tasks/scheduler.pas
new file mode 100644
index 0000000000..8edf794f77
--- /dev/null
+++ b/plugins/Actman30/tasks/scheduler.pas
@@ -0,0 +1,76 @@
+unit scheduler;
+
+interface
+
+implementation
+
+uses
+ windows, commctrl, messages,
+ mirutils, common, dbsettings, m_api, wrapper,
+ global;
+
+{$R tasks.res}
+
+{$include m_actman.inc}
+
+var
+ hevent: THANDLE;
+
+{$include i_task.inc}
+{$include i_tconst.inc}
+{$include i_options.inc}
+{$include i_opt_dlg.inc}
+{$include i_service.inc}
+
+// ------------ base interface functions -------------
+
+procedure Init;
+begin
+
+ if LoadTasks=0 then
+ begin
+ MaxTasks:=8;
+ GetMem (TaskList ,MaxTasks*SizeOf(tTaskRec));
+ FillChar(TaskList^,MaxTasks*SizeOf(tTaskRec),0);
+ end
+ else
+ SetAllTasks;
+
+ CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount);
+ CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable);
+ CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete);
+
+ hevent:=CreateHookableEvent(ME_ACT_BELL);
+
+end;
+
+procedure DeInit;
+begin
+ DestroyHookableEvent(hevent);
+ StopAllTasks;
+ ClearTasks;
+end;
+
+function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
+begin
+ result:=0;
+ tmpl:=PAnsiChar(IDD_TASKS);
+ proc:=@DlgProcOpt;
+ name:='Scheduler';
+end;
+
+var
+ amLink:tActionLink;
+
+procedure InitLink;
+begin
+ amLink.Next :=ActionLink;
+ amLink.Init :=@Init;
+ amLink.DeInit :=@DeInit;
+ amLink.AddOption:=@AddOptionPage;
+ ActionLink :=@amLink;
+end;
+
+initialization
+ InitLink;
+end.