From 864081102a5f252415f41950b3039a896b4ae9c5 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Mon, 8 Oct 2012 18:43:29 +0000 Subject: Awkwars's plugins - welcome to our trunk git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Actman/tasks/scheduler.pas | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 plugins/Actman/tasks/scheduler.pas (limited to 'plugins/Actman/tasks/scheduler.pas') diff --git a/plugins/Actman/tasks/scheduler.pas b/plugins/Actman/tasks/scheduler.pas new file mode 100644 index 0000000000..05e9cb6a58 --- /dev/null +++ b/plugins/Actman/tasks/scheduler.pas @@ -0,0 +1,86 @@ +unit scheduler; + +interface + +procedure Init; +procedure DeInit; +function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer; + +implementation + +uses + windows, commctrl, messages, + mirutils, common, dbsettings, io, 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 ------------- + +var + hendis, + hcount, + hdel: THANDLE; + +procedure Init; +begin + + if LoadTasks=0 then + begin + MaxTasks:=8; + GetMem (TaskList ,MaxTasks*SizeOf(tTaskRec)); + FillChar(TaskList^,MaxTasks*SizeOf(tTaskRec),0); + end + else + SetAllTasks; + + hcount:=CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount); + hendis:=CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable); + hdel :=CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete); + hevent:=CreateHookableEvent(ME_ACT_BELL); + +end; + +procedure DeInit; +begin + StopAllTasks; + DestroyServiceFunction(hendis); + DestroyServiceFunction(hdel); + DestroyServiceFunction(hcount); + 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. -- cgit v1.2.3