diff options
Diffstat (limited to 'plugins/Actman30')
29 files changed, 1250 insertions, 75 deletions
diff --git a/plugins/Actman30/actman.dpr b/plugins/Actman30/actman.dpr new file mode 100644 index 0000000000..d47d57c95a --- /dev/null +++ b/plugins/Actman30/actman.dpr @@ -0,0 +1,254 @@ +{$include compilers.inc}
+{$IFDEF COMPILER_16_UP}
+ {$WEAKLINKRTTI ON}
+ {.$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
+{$ENDIF}
+{$IMAGEBASE $13200000}
+library actman;
+{%File 'm_actman.inc'}
+{%File 'i_const.inc'}
+{%File 'i_opt_dlg2.inc'}
+{%File 'i_opt_dlg.inc'}
+{%File 'i_options.inc'}
+{%File 'i_services.inc'}
+{%File 'i_vars.inc'}
+{%File 'i_inoutxm.inc'}
+{%File 'tasks\i_opt_dlg.inc'}
+{%File 'tasks\i_options.inc'}
+{%File 'tasks\i_task.inc'}
+{%File 'hooks\i_options.inc'}
+{%File 'hooks\i_hook.inc'}
+{%File 'hooks\i_opt_dlg.inc'}
+{%File 'ua\i_opt_dlg.inc'}
+{%File 'ua\i_inoutxm.inc'}
+{%File 'ua\i_options.inc'}
+{%File 'ua\i_ua.inc'}
+{%File 'ua\i_uaplaces.inc'}
+{%File 'ua\i_uconst.inc'}
+
+uses
+// fastmm4,
+ Windows,
+ m_api,
+ messages,
+ commctrl,
+ common,
+ wrapper,
+ io,
+ dbsettings,
+ mirutils,
+ syswin,
+ base64,
+ question,
+ mApiCardM,
+ global,
+ lowlevelc,
+ dlgshare,
+ iac_global,
+ iac_settings,
+ iac_storage,
+ iac_dbrw,
+ iac_messagebox,
+ iac_text,
+ iac_jump,
+ iac_inout,
+ iac_service,
+ iac_program,
+ iac_chain,
+ iac_contact,
+ iac_call,
+ iac_ini,
+ iac_notes,
+ inoutxml,
+ sedit,
+ strans,
+ ua in 'ua\ua.pas',
+ hooks in 'hooks\hooks.pas',
+ scheduler in 'tasks\scheduler.pas';
+
+{$r options.res}
+
+const
+ PluginName = 'Action Manager';
+var
+ hevaction,hHookChanged,hevinout:THANDLE;
+
+{$include m_actman.inc}
+
+
+function MirandaPluginInfoEx(mirandaVersion:dword):PPLUGININFOEX; cdecl;
+begin
+ result:=@PluginInfo;
+ PluginInfo.cbSize :=SizeOf(TPLUGININFOEX);
+ PluginInfo.shortName :='Action manager';
+ PluginInfo.version :=$00030001;
+ PluginInfo.description:='Plugin for manage hotkeys to open contact window, insert text, '+
+ 'run program and call services';
+ PluginInfo.author :='Awkward';
+ PluginInfo.authorEmail:='panda75@bk.ru; awk1975@ya.ru';
+ PluginInfo.copyright :='(c) 2007-2013 Awkward';
+ PluginInfo.homepage :='http://code.google.com/p/delphi-miranda-plugins/';
+ PluginInfo.flags :=UNICODE_AWARE;
+ PluginInfo.uuid :=MIID_ACTMAN;
+end;
+
+{$include i_const.inc}
+
+{$include i_options.inc}
+{$include i_services.inc}
+{$include i_opt_dlg.inc}
+{.$include i_inoutxm.inc}
+
+function PreShutdown(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ ptr:pActionLink;
+begin
+ result:=0;
+
+ ptr:=ActionLink;
+ while ptr<>nil do
+ begin
+ if @ptr^.DeInit<>nil then
+ ptr^.DeInit;
+ ptr:=ptr^.Next;
+ end;
+
+ MacroList.Clear;
+ MacroList.Free;
+
+ DestroyHookableEvent(hHookChanged);
+ DestroyHookableEvent(hevinout);
+ DestroyHookableEvent(hevaction);
+
+end;
+
+procedure RegisterActTypes;
+var
+ p:pActModule;
+ sid:TSKINICONDESC;
+ buf:array [0..63] of AnsiChar;
+ pc:pAnsiChar;
+// ii:tIconItem;
+begin
+ FillChar(sid,SizeOf(sid),0);
+ sid.cbSize:=SizeOf(sid);
+ sid.cx:=16;
+ sid.cy:=16;
+ sid.szSection.a:='Actions';
+ sid.pszName :=@buf;
+ pc:=StrCopyE(buf,IcoLibPrefix);
+ p:=ModuleLink;
+{
+ ii.size :=0;
+ ii.hIcolib:=0;
+ ii.szName :=@buf;
+}
+ while p<>nil do
+ begin
+ if p^.Hash=0 then
+ p^.Hash:=Hash(p^.Name,StrLen(p^.Name));
+ //!! must add icon registration in icolib
+{
+ StrCopy(pc,p^.Name);
+ ii.szDescr :=p^.Name;
+ ii.DefIconID:=;
+ Icon_Register(hInstance,'Actions',@ii,1);
+}
+ sid.hDefaultIcon :=LoadImageA(hInstance,p^.Icon,IMAGE_ICON,16,16,0);
+ sid.szDescription.a:=p^.Name;
+ StrCopy(pc,p^.Name);
+ Skin_AddIcon(@sid);
+ DestroyIcon(sid.hDefaultIcon);
+
+ p:=p^.Next;
+ end;
+end;
+
+// This function implements autostart action execution after all others plugins loading
+function DoAutostart(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ i:integer;
+ Macro:pMacroRecord;
+ section:array [0..127] of AnsiChar;
+ p,p1:pAnsiChar;
+begin
+ Result:=0;
+ CallService(MS_ACT_RUNBYNAME,TWPARAM(AutoStartName),0);
+
+ p1:=StrCopyE(section,opt_group);
+ for i:=0 to MacroList.Count-1 do
+ begin
+ Macro:=MacroList[i];
+ if (Macro^.flags and ACF_FIRSTRUN)<>0 then
+ begin
+ CallService(MS_ACT_RUNBYID,TWPARAM(Macro^.id),0);
+ Macro^.flags:=Macro^.flags and not ACF_FIRSTRUN;
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p);
+ StrCopy(p,opt_flags); DBWriteDWord(0,DBBranch,section,Macro^.flags);
+ end;
+ end;
+end;
+
+function OnModulesLoaded(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ ptr:pActionLink;
+begin
+ Result:=0;
+
+ RegisterActTypes;
+
+ LoadMacros;
+ RegisterIcons;
+
+ HookEvent(ME_OPT_INITIALISE ,@OnOptInitialise);
+ HookEvent(ME_SYSTEM_SHUTDOWN{ME_SYSTEM_OKTOEXIT},@PreShutdown);
+ NotifyEventHooks(hHookChanged,twparam(ACTM_LOADED),0);
+
+ IsMultiThread:=true;
+ // Load additional modules
+ ptr:=ActionLink;
+ while ptr<>nil do
+ begin
+ if @ptr^.Init<>nil then
+ ptr^.Init;
+ ptr:=ptr^.Next;
+ end;
+
+ // cheat
+ HookEvent(ME_SYSTEM_MODULESLOADED,@DoAutostart);
+// DoAutostart(0,0);
+end;
+
+function Load:int; cdecl;
+begin
+ Result:=0;
+ Langpack_Register;
+
+ hHookChanged:=CreateHookableEvent(ME_ACT_CHANGED);
+ hevinout :=CreateHookableEvent(ME_ACT_INOUT);
+ hevaction :=CreateHookableEvent(ME_ACT_ACTION);
+
+ CreateServiceFunction(MS_ACT_FREELIST ,@ActFreeList);
+ CreateServiceFunction(MS_ACT_GETLIST ,@ActGetList);
+ CreateServiceFunction(MS_ACT_RUNBYID ,@ActRun);
+ CreateServiceFunction(MS_ACT_RUNBYNAME,@ActRunGroup);
+ CreateServiceFunction(MS_ACT_RUNPARAMS,@ActRunParam);
+//!! CreateServiceFunction(MS_ACT_INOUT ,@ActInOut);
+ CreateServiceFunction(MS_ACT_SELECT ,@ActSelect);
+
+ HookEvent(ME_SYSTEM_MODULESLOADED,@OnModulesLoaded);
+end;
+
+function Unload: int; cdecl;
+begin
+ Result:=0;
+end;
+
+exports
+ Load, Unload,
+ MirandaPluginInfoEx;
+
+begin
+ DisableThreadLibraryCalls(hInstance);
+end.
diff --git a/plugins/Actman30/actman30.dpr b/plugins/Actman30/actman30.dpr index 55f510418a..d47d57c95a 100644 --- a/plugins/Actman30/actman30.dpr +++ b/plugins/Actman30/actman30.dpr @@ -58,6 +58,7 @@ uses iac_contact,
iac_call,
iac_ini,
+ iac_notes,
inoutxml,
sedit,
strans,
diff --git a/plugins/Actman30/dlgshare.pas b/plugins/Actman30/dlgshare.pas index cd6dbb9023..0fc89a975b 100644 --- a/plugins/Actman30/dlgshare.pas +++ b/plugins/Actman30/dlgshare.pas @@ -27,7 +27,7 @@ procedure OptFillContactList(wnd:HWND); implementation
-uses messages, m_api, dbsettings, contact, common, global;
+uses messages, m_api, dbsettings, mircontacts, common, global;
{$include i_cnst_dlgshare.inc}
{$resource dlgshare.res}
diff --git a/plugins/Actman30/i_cnst_database.inc b/plugins/Actman30/i_cnst_database.inc index 01b6e382c5..0727d68451 100644 --- a/plugins/Actman30/i_cnst_database.inc +++ b/plugins/Actman30/i_cnst_database.inc @@ -7,10 +7,9 @@ const IDC_RW_SETTING = 2608;
IDC_RW_VALUE = 2610;
IDC_RW_DATATYPE = 2611;
- IDC_RW_CURRENT = 2614;
- IDC_RW_PARAM = 2615;
- IDC_RW_MANUAL = 2616;
- IDC_RW_RESULT = 2619;
+
+ IDC_CONTACTTYPE = 2614;
+
IDC_RW_LAST = 2620;
IDC_RW_SAVE = 2621;
diff --git a/plugins/Actman30/i_cnst_notes.inc b/plugins/Actman30/i_cnst_notes.inc new file mode 100644 index 0000000000..d7e779210d --- /dev/null +++ b/plugins/Actman30/i_cnst_notes.inc @@ -0,0 +1,3 @@ +{text data}
+const
+ IDC_TXT_TEXT = 2190;
diff --git a/plugins/Actman30/i_cnst_settings.inc b/plugins/Actman30/i_cnst_settings.inc index 6728f953a9..c8c495a24a 100644 --- a/plugins/Actman30/i_cnst_settings.inc +++ b/plugins/Actman30/i_cnst_settings.inc @@ -9,3 +9,4 @@ const IDC_FR_FLAG = 2155;
IDC_HC_WPAR = 2156;
+ IDC_VL_FLAG = 2157;
diff --git a/plugins/Actman30/i_options.inc b/plugins/Actman30/i_options.inc index 3a3d8dc65a..7cbfe6716d 100644 --- a/plugins/Actman30/i_options.inc +++ b/plugins/Actman30/i_options.inc @@ -78,16 +78,264 @@ begin DBWriteWord(0,DBBranch,opt_nummacro,NumMacro);
end;
-//----- Load settings -----
+//===== Load settings =====
-function LoadActions(Macro:pMacroRecord;section:pAnsiChar):integer;
+//----- V2 settings processing -----
+
+const
+ ACT_CONTACT = 1;
+ ACT_SERVICE = 2;
+ ACT_PROGRAM = 3;
+ ACT_TEXT = 4;
+ ACT_ADVANCE = 5;
+ ACT_CHAIN = 6;
+ ACT_RW = 7;
+ ACT_MESSAGE = 8;
+
+// action flags
+const
+ ACF_MASK = $00FFFFFF;
+
+ ACF_OLD_CLIPBRD = $00000002; // Clipboard operations, not window
+ ACF_OLD_FILE = $00000010; // File operations
+ ACF_OLD_FWRITE = $00000020; // read/write file
+ ACF_OLD_FAPPEND = $00000040; // append file
+
+procedure CheckActionList(Macro:pMacroRecord;num:integer);
+var
+ tmplist:pActionList;
+begin
+ if num=Macro^.ActionCount then
+ begin
+ GetMem(tmplist,SizeOf(tBaseAction)*(num+1));
+ move(Macro^.ActionList^,tmplist^,Macro^.ActionCount*SizeOf(tBaseAction));
+ FreeMem(Macro^.ActionList);
+ Macro^.ActionList:=tmplist;
+ Inc(Macro^.ActionCount);
+ end;
+end;
+
+function LoadActionsV2(Macro:pMacroRecord;section:pAnsiChar):boolean; stdcall;
+var
+ buf:array [0..31] of WideChar;
+ p,p1,pc:PAnsiChar;
+ action:tBaseAction;
+ actm:pActModule;
+ flags2,actionType:dword;
+ code,i,num,count:integer;
+ cond,act:byte;
+begin
+ result:=false;
+ p:=StrEnd(section);
+ StrCopy(p,opt_numacts); Macro^.ActionCount:=DBReadWord(0,DBBranch,section);
+
+ if Macro^.ActionCount>0 then
+ begin
+ GetMem(Macro^.ActionList,SizeOf(tBaseAction)*Macro^.ActionCount);
+ p1:=StrCopyE(p,opt_actions); // "Group#/Action"
+
+ num:=0;
+ count:=Macro^.ActionCount;
+ for i:=1 to count do
+ begin
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p); // "Group#/Action#/"
+
+ StrCopy(p,'type' ); actionType:=DBReadByte (0,DBBranch,section,ACT_CONTACT);
+ case actionType of
+ ACT_CONTACT: pc:='Contact';
+ ACT_SERVICE: pc:='Service';
+ ACT_PROGRAM: pc:='Program';
+ ACT_TEXT: pc:=nil;
+ ACT_ADVANCE: pc:=nil;
+ ACT_CHAIN: pc:='Chain';
+ ACT_RW: pc:='Database';
+ ACT_MESSAGE: pc:='MessageBox';
+ else
+ pc:=nil;
+ end;
+ if pc<>nil then
+ begin
+ actm :=GetLinkByName(pc);
+ action:=actm.Create;
+ end
+ else
+ begin
+ action:=nil;
+ end;
+
+ p^:=#0;
+ case actionType of
+ ACT_CONTACT: begin
+ action.Load(section,0);
+ end;
+
+ ACT_SERVICE: begin
+ action.Load(section,100);
+ end;
+
+ ACT_PROGRAM: begin
+ action.Load(section,100);
+ end;
+
+ ACT_TEXT: begin
+ StrCopy(p,opt_flags); flags2:=DBReadDWord(0,DBBranch,section,0);
+ p^:=#0;
+ if ((flags2 and ACF_OLD_CLIPBRD)=0) then
+ begin
+ if ((flags2 and ACF_OLD_FILE)=0) or ((flags2 and (ACF_OLD_FWRITE or ACF_OLD_FAPPEND)<>0)) then
+ begin
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+
+ action.Load(section,100);
+
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+ end;
+ end;
+
+ actm :=GetLinkByName('In/Out');
+ action:=actm.Create;
+
+ action.Load(section,100);
+ end;
+
+ ACT_ADVANCE: begin
+ StrCopy(p,'condition' ); cond:=DBReadByte(0,DBBranch,section);
+ StrCopy(p,'action'); act :=DBReadByte(0,DBBranch,section);
+ p^:=#0;
+ // get code of my list
+ code:=0;
+ if (cond and $0F)=0 then
+ begin
+ if act<>0 then code:=4; // action and jump
+ if (act and $F0)=0 then code:=6; // no action
+ if (act and $0F)=0 then code:=5; // no jump
+ end
+ else // with condition
+ begin
+ if act<>0 then code:=1; // action and jump
+ if (act and $F0)=0 then code:=2; // no action
+ if (act and $0F)=0 then code:=3; // no jump
+ end;
+ case code of
+ 1: begin // conditional action and jump
+ actm :=GetLinkByName('Jump'); // reversed condition jump to tmplabel
+ action:=actm.Create;
+ action.Load(section,102+i);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Text'); // action
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Jump'); // jump to label (no condition)
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Notes'); // tmplabel
+ action:=actm.Create;
+ mFreeMem(action.ActionDescr); // created by constructor
+ buf[0]:='$'; buf[1]:='$';
+ IntToStr(PWideChar(@buf[2]),i);
+ StrDupW(action.ActionDescr,buf);
+ end;
+ 2,6: begin // conditional and unconditional jump
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+
+ action.Load(section,100);
+ end;
+ 3: begin // conditional action
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+ action.Load(section,101+num);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Notes');
+ action:=actm.Create;
+ mFreeMem(action.ActionDescr); // created by constructor
+ buf[0]:='$'; buf[1]:='$';
+ StrDupW(action.ActionDescr,IntToStr(PWideChar(@buf[2]),num));
+ end;
+ 4: begin // action + unconditional jump
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+
+ action.Load(section,100);
+ end;
+ 5: begin // direct text action
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+
+ action.Load(section,101);
+ end;
+ end;
+ end;
+
+ ACT_CHAIN: begin
+ action.Load(section,100);
+ end;
+
+ ACT_RW: begin
+ action.Load(section,100);
+ end;
+
+ ACT_MESSAGE: begin
+ action.Load(section,0);
+
+ StrCopy(p,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+ action.flags:=(action.flags and not ACF_MASK) or flags2;
+ end;
+
+ end;
+
+ if action<>nil then
+ begin
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+ end;
+ end;
+ end;
+end;
+
+//----- V3 settings processing -----
+
+function LoadActions(Macro:pMacroRecord;section:pAnsiChar):integer; stdcall;
var
p,p1:PAnsiChar;
- i,num:integer;
actm:pActModule;
action:tBaseAction;
- uid:dword;
tmp:pActionList;
+ uid:dword;
+ i,num:integer;
begin
result:=0;
p:=StrEnd(section);
@@ -135,12 +383,18 @@ end; procedure LoadMacros;
var
Macro:pMacroRecord;
- i:cardinal;
p,p1:PAnsiChar;
section:array [0..127] of AnsiChar;
- NumMacros:cardinal;
tmp:pWideChar;
+ i:cardinal;
+ NumMacros:cardinal;
+ v2:bool;
begin
+ //!! Check if old actman version used
+// v2:=DBReadWord(0,DBBranch,opt_numacts,$FFFF)<>$FFFF;
+ // V2 counts actions from 1, not 0
+ v2:=DBReadDWord(0,DBBranch,'Group0/Action0/flags',$FFFFFFFF)=$FFFFFFFF;
+
// Allocate macro list
NumMacros :=DBReadWord(0,DBBranch,opt_nummacro,0);
MacroList:=tMacroList.Create(NumMacros);
@@ -167,7 +421,10 @@ begin StrCopyW(descr,tmp,MacroNameLen-1);
mFreeMem(tmp);
p^:=#0;
- LoadActions(Macro,section);
+ if v2 then
+ LoadActionsV2(Macro,section)
+ else
+ LoadActions(Macro,section);
end;
end;
inc(Macro);
diff --git a/plugins/Actman30/iac_chain.pas b/plugins/Actman30/iac_chain.pas index 39e03e13b8..ec695f3077 100644 --- a/plugins/Actman30/iac_chain.pas +++ b/plugins/Actman30/iac_chain.pas @@ -6,7 +6,7 @@ implementation uses
windows, messages, commctrl,
- global, iac_global, mirutils, m_api,
+ global, iac_global, mirutils, m_api, inouttext,
dlgshare,lowlevelc,common,dbsettings, wrapper;
{$include m_actman.inc}
@@ -135,6 +135,12 @@ begin end;
end;
+ 100: begin
+ flags:=flags and not ACF_BYNAME;
+ pc:=StrCopyE(section,pAnsiChar(node));
+ StrCopy(pc,'text'); id:=DBReadDWord(0,DBBranch,section);
+ end;
+
1: begin
with xmlparser do
begin
@@ -205,6 +211,13 @@ begin ]);
end;
}
+ 13: begin
+ tTextExport(node).AddTextW('actionname',actname);
+ tTextExport(node).AddFlag('samethread',(flags or ACF_SAMETHREAD)<>0);
+ tTextExport(node).AddFlag('nowait' ,(flags or ACF_NOWAIT )<>0);
+ tTextExport(node).AddFlag('keepold' ,(flags or ACF_KEEPOLD )<>0);
+ tTextExport(node).AddNewLine();
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_contact.pas b/plugins/Actman30/iac_contact.pas index 318dc8601e..c0a0740995 100644 --- a/plugins/Actman30/iac_contact.pas +++ b/plugins/Actman30/iac_contact.pas @@ -7,7 +7,7 @@ implementation uses
windows, messages, commctrl,
m_api, global, iac_global, common,
- contact, dlgshare, syswin,
+ mircontacts, dlgshare, syswin, inouttext, base64,
wrapper, mirutils, dbsettings;
{$include i_cnst_contact.inc}
@@ -106,6 +106,62 @@ begin end;
end;
+function ExportContactText(node:tTextExport;hContact:TMCONTACT):integer;
+var
+ proto,uid:pAnsiChar;
+ cws:TDBVARIANT;
+ p1:pAnsiChar;
+ p:pWideChar;
+ tmpbuf:array [0..63] of WideChar;
+ is_chat:boolean;
+begin
+ result:=0;
+ proto:=GetContactProtoAcc(hContact);
+ if proto<>nil then
+ begin
+ is_chat:=IsChat(hContact);
+ if is_chat then
+ begin
+ p:=DBReadUnicode(hContact,proto,'ChatRoomID');
+ node.AddTextW('id',p);
+ mFreeMem(p);
+ result:=1;
+ end
+ else
+ begin
+ uid:=pAnsiChar(CallProtoService(proto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0));
+ if DBReadSetting(hContact,proto,uid,@cws)=0 then
+ begin
+ result:=1;
+ node.AddDWord('ctype',cws._type);
+ case cws._type of
+ DBVT_BYTE : node.AddDWord('id',cws.bVal);
+ DBVT_WORD : node.AddDWord('id',cws.wVal);
+ DBVT_DWORD : node.AddDWord('id',cws.dVal);
+ DBVT_ASCIIZ: begin
+ node.AddText('id',cws.szVal.A); // ansi to utf
+ end;
+ DBVT_UTF8 : begin
+ node.AddText('id',cws.szVal.A);
+ end;
+ DBVT_WCHAR : node.AddTextW('id',cws.szVal.W);
+ DBVT_BLOB : begin
+ p1:=Base64Encode(cws.pbVal,cws.cpbVal);
+ node.AddText('id',p1);
+ mFreeMem(p1);
+ end;
+ end;
+ end;
+ DBFreeVariant(@cws);
+ end;
+ if result<>0 then
+ begin
+ node.AddText('protocol',proto);
+ node.AddFlag('ischat' ,is_chat);
+ end;
+ end;
+end;
+
procedure tContactAction.Save(node:pointer;fmt:integer);
begin
inherited Save(node,fmt);
@@ -120,6 +176,11 @@ begin if (flags and ACF_KEEPONLY)<>0 then AddAttrInt(sub,ioKeepOnly,1);
end;
}
+ 13: begin
+ tTextExport(node).AddFlag('keeponly' ,(flags or ACF_KEEPONLY )<>0);
+ tTextExport(node).AddFlag('getactive',(flags or ACF_GETACTIVE)<>0);
+ ExportContactText(tTextExport(node),contact);
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_database.rc b/plugins/Actman30/iac_database.rc index 5c5fe1f791..cc9f309ebf 100644 --- a/plugins/Actman30/iac_database.rc +++ b/plugins/Actman30/iac_database.rc @@ -7,10 +7,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0
{
- AUTORADIOBUTTON "Own settings", IDC_RW_CURRENT, 1, 0, 81, 11, BS_RIGHT | BS_LEFTTEXT | WS_GROUP
- AUTORADIOBUTTON "Manual" , IDC_RW_MANUAL , 1, 12, 81, 11, BS_RIGHT | BS_LEFTTEXT
- AUTORADIOBUTTON "Parameter" , IDC_RW_PARAM , 86, 0, 81, 11
- AUTORADIOBUTTON "Last result" , IDC_RW_RESULT , 86, 12, 81, 11
+ RTEXT "Contact type", -1, 1, 0, 160, 8, SS_CENTERIMAGE
+ COMBOBOX IDC_CONTACTTYPE , 18, 9, 148, 60, CBS_DROPDOWNLIST | WS_VSCROLL
CONTROL "Refresh",IDC_CNT_REFRESH,"MButtonClass",WS_TABSTOP,1,23,16,16,$18000000
COMBOBOX IDC_CONTACTLIST, 18, 25, 148, 128, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL
diff --git a/plugins/Actman30/iac_database.res b/plugins/Actman30/iac_database.res Binary files differindex b74dee1d7b..b4de95c9e7 100644 --- a/plugins/Actman30/iac_database.res +++ b/plugins/Actman30/iac_database.res diff --git a/plugins/Actman30/iac_dbrw.pas b/plugins/Actman30/iac_dbrw.pas index c4224f91b2..7ddbe0b61c 100644 --- a/plugins/Actman30/iac_dbrw.pas +++ b/plugins/Actman30/iac_dbrw.pas @@ -9,7 +9,7 @@ uses global, iac_global,
m_api,dbsettings,
common,mirutils,wrapper,
- editwrapper,contact,dlgshare;
+ editwrapper,mircontacts,dlgshare;
{$include i_cnst_database.inc}
{$resource iac_database.res}
@@ -65,6 +65,23 @@ const ACF_RW_SETTING = $00002000; // script for setting name
ACF_RW_VALUE = $00004000; // script for data value
+const // V2
+ ACF_OLD_DBWRITE = $00000001;
+ ACF_OLD_DBBYTE = $00000002;
+ ACF_OLD_DBWORD = $00000004;
+ ACF_OLD_PARAM = $00000008;
+ ACF_OLD_CURRENT = $00000010;
+ ACF_OLD_RESULT = $00000020;
+ ACF_OLD_LAST = $00000040;
+ ACF_OLD_DBUTEXT = $00000080;
+ ACF_OLD_DBANSI = $00000082;
+ ACF_OLD_DBDELETE = $00000100;
+ ACF_OLD_NOCNTCT = ACF_OLD_PARAM or ACF_OLD_CURRENT or ACF_OLD_RESULT;
+
+ ACF2_RW_MVAR = $00000001;
+ ACF2_RW_SVAR = $00000002;
+ ACF2_RW_TVAR = $00000004;
+
type
tDataBaseAction = class(tBaseAction)
private
@@ -134,6 +151,11 @@ var avalue:uint_ptr;
begin
result:=0;
+
+ if dbmodule=nil then
+ exit;
+ if (dbsetting=nil) and ((flags and ACF_DBDELETE)=0) then
+ exit;
// contact
case (flags and ACF_NOCONTACT) of
ACF_CURRENT: hContact:=0;
@@ -168,23 +190,30 @@ begin StrReplace(ambuf,protostr,proto);
// now process settings
- if (flags and ACF_RW_SETTING)<>0 then
+ if dbsetting<>nil then
begin
- tmp:=ParseVarString(dbsetting,hContact,ls);
- StrCopyW(bufw,tmp);
- mFreeMem(tmp);
+ if (flags and ACF_RW_SETTING)<>0 then
+ begin
+ tmp:=ParseVarString(dbsetting,hContact,ls);
+ StrCopyW(bufw,tmp);
+ mFreeMem(tmp);
+ end
+ else
+ StrCopyW(bufw,dbsetting);
+ StrReplaceW(@bufw,'<last>',ls);
+ FastWideToAnsiBuf(bufw,asbuf,SizeOf(asbuf)-1);
+ StrReplace(asbuf,protostr,proto);
end
else
- StrCopyW(bufw,dbsetting);
- StrReplaceW(@bufw,'<last>',ls);
- FastWideToAnsiBuf(bufw,asbuf,SizeOf(asbuf)-1);
- StrReplace(asbuf,protostr,proto);
+ asbuf[0]:=#0;
// Delete data
if (flags and ACF_DBDELETE)<>0 then
begin
if (asbuf[0]='*') or (asbuf[StrLen(asbuf)-1]='*') then
DBDeleteGroup(hContact,ambuf,asbuf)
+ else if asbuf[0]=#0 then
+ DBDeleteModule(hContact,ambuf)
else
DBDeleteSetting(hContact,ambuf,asbuf);
end
@@ -302,8 +331,10 @@ end; procedure tDataBaseAction.Load(node:pointer;fmt:integer);
var
section: array [0..127] of AnsiChar;
+ buf:array [0..31] of WideChar;
pc:pAnsiChar;
tmp:pWideChar;
+ lflags,flags2:dword;
begin
inherited Load(node,fmt);
case fmt of
@@ -313,13 +344,50 @@ begin pc:=StrCopyE(section,pAnsiChar(node));
StrCopy(pc,opt_module ); dbmodule :=DBReadUnicode(0,DBBranch,section);
StrCopy(pc,opt_setting); dbsetting:=DBReadUnicode(0,DBBranch,section);
- if ((flags and ACF_DBDELETE)=0) and
- ((flags and ACF_LAST)=0) then
+ if (flags and (ACF_DBDELETE or ACF_LAST))=0 then
begin
StrCopy(pc,opt_value); dbvalue:=DBReadUnicode(0,DBBranch,section);
end;
end;
+ 100: begin
+ if (flags and ACF_OLD_NOCNTCT)=0 then
+ dbcontact:=LoadContact(DBBranch,node);
+ pc:=StrCopyE(section,pAnsiChar(node));
+
+ // auto convert ansi to unicode
+ StrCopy(pc,opt_module ); dbmodule :=DBReadUnicode(0,DBBranch,section);
+ StrCopy(pc,opt_setting); dbsetting:=DBReadUnicode(0,DBBranch,section);
+
+ StrCopy(pc,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+
+ if (flags and (ACF_OLD_DBDELETE or ACF_OLD_LAST))=0 then
+ begin
+ StrCopy(pc,opt_value);
+ if ((flags and ACF_OLD_DBUTEXT)=0) and ((flags2 and ACF2_RW_TVAR)=0) then
+ StrDupW(dbvalue,IntToStr(buf,DBReadDWord(0,DBBranch,section)))
+ else
+ dbvalue:=DBReadUnicode(0,DBBranch,section);
+ end;
+
+ lflags:=flags;
+ flags:=flags and not ACF_MASK;
+ if (lflags and ACF_OLD_DBWRITE )<>0 then flags:=flags or ACF_DBWRITE;
+ if (lflags and ACF_OLD_DBDELETE)<>0 then flags:=flags or ACF_DBDELETE;
+ if (lflags and ACF_OLD_PARAM )<>0 then flags:=flags or ACF_PARAM;
+ if (lflags and ACF_OLD_CURRENT )<>0 then flags:=flags or ACF_CURRENT;
+ if (lflags and ACF_OLD_RESULT )<>0 then flags:=flags or ACF_RESULT;
+ if (lflags and ACF_OLD_LAST )<>0 then flags:=flags or ACF_LAST;
+ if (lflags and ACF_OLD_DBBYTE )=ACF_OLD_DBBYTE then flags:=flags or ACF_DBBYTE;
+ if (lflags and ACF_OLD_DBWORD )=ACF_OLD_DBWORD then flags:=flags or ACF_DBWORD;
+ if (lflags and ACF_OLD_DBUTEXT )=ACF_OLD_DBUTEXT then flags:=flags or ACF_DBUTEXT;
+ if (lflags and ACF_OLD_DBANSI )=ACF_OLD_DBANSI then flags:=(flags or ACF_DBANSI) and not (ACF_DBBYTE or ACF_DBUTEXT);
+ if (flags2 and ACF2_RW_MVAR)<>0 then flags:=flags or ACF_RW_MODULE;
+ if (flags2 and ACF2_RW_SVAR)<>0 then flags:=flags or ACF_RW_SETTING;
+ if (flags2 and ACF2_RW_TVAR)<>0 then flags:=flags or ACF_RW_VALUE;
+
+ end;
+
1: begin
with xmlparser do
begin
@@ -420,11 +488,23 @@ begin 1: begin
end;
}
+ 13: begin
+ end;
end;
end;
//----- Dialog realization -----
+procedure MakeContactTypeList(wnd:HWND);
+begin
+ SendMessage(wnd,CB_RESETCONTENT,0,0);
+ InsertString(wnd,0,'Own settings');
+ InsertString(wnd,1,'Parameter');
+ InsertString(wnd,2,'Last result');
+ InsertString(wnd,3,'Manual');
+ SendMessage(wnd,CB_SETCURSEL,0,0);
+end;
+
procedure MakeDataTypeList(wnd:HWND);
begin
SendMessage(wnd,CB_RESETCONTENT,0,0);
@@ -441,11 +521,6 @@ begin CheckDlgButton(Dialog,IDC_RW_LAST,BST_UNCHECKED);
CheckDlgButton(Dialog,IDC_RW_SAVE,BST_UNCHECKED);
- CheckDlgButton(Dialog,IDC_RW_CURRENT,BST_UNCHECKED);
- CheckDlgButton(Dialog,IDC_RW_MANUAL ,BST_UNCHECKED);
- CheckDlgButton(Dialog,IDC_RW_PARAM ,BST_UNCHECKED);
- CheckDlgButton(Dialog,IDC_RW_RESULT ,BST_UNCHECKED);
-
CheckDlgButton(Dialog,IDC_RW_READ ,BST_UNCHECKED);
CheckDlgButton(Dialog,IDC_RW_WRITE ,BST_UNCHECKED);
CheckDlgButton(Dialog,IDC_RW_DELETE,BST_UNCHECKED);
@@ -466,7 +541,8 @@ begin WM_INITDIALOG: begin
TranslateDialogDefault(Dialog);
- MakeDataTypeList(GetDlgItem(Dialog,IDC_RW_DATATYPE));
+ MakeContactTypeList(GetDlgItem(Dialog,IDC_CONTACTTYPE));
+ MakeDataTypeList (GetDlgItem(Dialog,IDC_RW_DATATYPE));
wnd:=GetDlgItem(Dialog,IDC_CNT_REFRESH);
OptSetButtonIcon(wnd,ACI_REFRESH);
@@ -492,18 +568,18 @@ begin // contact
bb:=false;
+ wnd:=GetDlgItem(Dialog,IDC_CONTACTLIST);
case (flags and ACF_NOCONTACT) of
- ACF_CURRENT: i:=IDC_RW_CURRENT;
- ACF_PARAM : i:=IDC_RW_PARAM;
- ACF_RESULT : i:=IDC_RW_RESULT;
+ ACF_CURRENT: i:=0;
+ ACF_PARAM : i:=1;
+ ACF_RESULT : i:=2;
else
- i:=IDC_RW_MANUAL;
+ i:=3;
bb:=true;
- SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_SETCURSEL,
- FindContact(GetDlgItem(Dialog,IDC_CONTACTLIST),dbcontact),0);
+ SendMessage(wnd,CB_SETCURSEL,FindContact(wnd,dbcontact),0);
end;
- CheckDlgButton(Dialog,i,BST_CHECKED);
- EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),bb);
+ CB_SelectData(GetDlgItem(Dialog,IDC_CONTACTTYPE),i);
+ EnableWindow(wnd,bb);
SetDlgItemTextW(Dialog,IDC_RW_MODULE ,dbmodule);
SetDlgItemTextW(Dialog,IDC_RW_SETTING,dbsetting);
@@ -545,6 +621,8 @@ begin NoProcess:=true;
ClearFields(Dialog);
+ CB_SelectData(GetDlgItem(Dialog,IDC_CONTACTTYPE),0);
+
SetDlgItemTextW(Dialog,IDC_RW_MODULE ,nil);
SetDlgItemTextW(Dialog,IDC_RW_SETTING,nil);
SetDlgItemTextW(Dialog,IDC_RW_VALUE ,nil);
@@ -554,7 +632,7 @@ begin CB_SelectData(GetDlgItem(Dialog,IDC_RW_DATATYPE),0);
CheckDlgButton(Dialog,IDC_RW_READ ,BST_CHECKED);
- CheckDlgButton(Dialog,IDC_RW_MANUAL,BST_CHECKED);
+ CheckDlgButton(Dialog,IDC_RW_SAVE ,BST_CHECKED);
EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
EnableWindow(GetDlgItem(Dialog,IDC_RW_VALUE),true);
@@ -565,12 +643,16 @@ begin with tDataBaseAction(lParam) do
begin
// contact
- if IsDlgButtonChecked(Dialog,IDC_RW_CURRENT)=BST_CHECKED then flags:=flags or ACF_CURRENT
- else if IsDlgButtonChecked(Dialog,IDC_RW_RESULT )=BST_CHECKED then flags:=flags or ACF_RESULT
- else if IsDlgButtonChecked(Dialog,IDC_RW_PARAM )=BST_CHECKED then flags:=flags or ACF_PARAM
- else
- dbcontact:=SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETITEMDATA,
- SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETCURSEL,0,0),0);
+ i:=CB_GetData(GetDlgItem(Dialog,IDC_CONTACTTYPE));
+ case i of
+ 0: flags:=flags or ACF_CURRENT;
+ 1: flags:=flags or ACF_PARAM;
+ 2: flags:=flags or ACF_RESULT;
+ 3: begin
+ wnd:=GetDlgItem(Dialog,IDC_CONTACTLIST);
+ dbcontact:=SendMessage(wnd,CB_GETITEMDATA,SendMessage(wnd,CB_GETCURSEL,0,0),0);
+ end;
+ end;
{mFreeMem(dbmodule ); }dbmodule :=GetDlgText(Dialog,IDC_RW_MODULE);
{mFreeMem(dbsetting); }dbsetting:=GetDlgText(Dialog,IDC_RW_SETTING);
@@ -606,7 +688,21 @@ begin WM_COMMAND: begin
case wParam shr 16 of
- CBN_SELCHANGE,
+ CBN_SELCHANGE: begin
+ if loword(wParam)=IDC_CONTACTTYPE then
+ begin
+ i:=CB_GetData(lParam);
+ case i of
+ 0,1,2: bb:=false;
+ else // 3
+ bb:=true;
+ end;
+ EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),bb);
+ end;
+ if not NoProcess then
+ SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
+ end;
+
EN_CHANGE: if not NoProcess then
SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
@@ -625,10 +721,6 @@ begin bb:=loword(wParam)=IDC_RW_WRITE;
EnableWindow(GetDlgItem(Dialog,IDC_RW_SAVE),bb);
end;
- IDC_RW_CURRENT,
- IDC_RW_PARAM,
- IDC_RW_RESULT: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),false);
- IDC_RW_MANUAL: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
IDC_RW_LAST: begin
EnableEditField(GetDlgItem(Dialog,IDC_RW_VALUE),
diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman30/iac_global.pas index 5e7ff9bec1..9a5534d52d 100644 --- a/plugins/Actman30/iac_global.pas +++ b/plugins/Actman30/iac_global.pas @@ -21,10 +21,14 @@ const WM_ACT_SAVE = WM_USER + 15;
WM_ACT_LISTCHANGE = WM_USER + 16; // group, action
+// Action flags
const
- ACF_DISABLED = $10000000; // action disabled
- ACF_REPLACED = $20000000; // action replaced by new in options
- ACF_INTRODUCED = $40000000; // action is newly created (not saved) in options
+ ACF_DISABLED = $10000000; // action disabled
+ // options editor only
+ ACF_REPLACED = $20000000; // action replaced by new in options
+ ACF_INTRODUCED = $40000000; // action is newly created (not saved) in options
+const
+ ACF_MASK = $00FFFFFF; // mask for private action flags
type
tLRType = record
@@ -86,15 +90,19 @@ function GetResultNumber(var WorkData:tWorkData;num:integer=-1):uint_ptr; procedure InsertString(wnd:HWND;num:dword;str:PAnsiChar);
+function GetLinkName(hash:dword):PAnsiChar;
function GetLink(hash:dword):pActModule;
function GetLinkByName(name:pAnsiChar):pActModule;
function ImportContact (node:HXML ):TMCONTACT;
function ImportContactINI(node:pointer):TMCONTACT;
+
implementation
-uses Common, global, dbsettings, mirutils;
+uses Common, global, dbsettings, inouttext,
+ mirutils, mircontacts;
+
//----- tBaseAction code -----
const
@@ -149,6 +157,7 @@ var pc:pAnsiChar;
begin
case fmt of
+ 100..199, // for V2
0: begin
pc:=StrCopyE(section,pAnsiChar(node));
mFreeMem(ActionDescr); // created by constructor
@@ -180,7 +189,7 @@ end; procedure tBaseAction.Save(node:pointer;fmt:integer);
var
section: array [0..127] of AnsiChar;
- pc:pAnsiChar;
+ pc:PAnsiChar;
begin
case fmt of
0: begin
@@ -193,6 +202,13 @@ begin 1: begin
end;
}
+ 13: begin
+ tTextExport(node).AddText ('type' ,GetLinkName(UID));
+ tTextExport(node).AddTextW('name' ,ActionDescr);
+ tTextExport(node).AddFlag ('disabled',(flags and ACF_DISABLED)<>0);
+ tTextExport(node).AddNewLine();
+ tTextExport(node).ShiftRight();
+ end;
end;
end;
@@ -281,6 +297,19 @@ begin }
end;
+function GetLinkName(hash:dword):PAnsiChar;
+var
+ link:pActModule;
+begin
+ link:=ModuleLink;
+ while (link<>nil) and (link.Hash<>hash) do
+ link:=link^.Next;
+ if link<>nil then
+ result:=link^.Name
+ else
+ result:=nil;
+end;
+
function GetLink(hash:dword):pActModule;
begin
result:=ModuleLink;
@@ -431,8 +460,8 @@ end; //----- DLL Handle Cache -----
type
tDLLCacheElement = record
- DLLName :PAnsiChar;
- DLLHandle:THANDLE;
+ DllName :PAnsiChar;
+ DllHandle:THANDLE;
count :word; // count for end-of-macro flag
flags :byte; // handle free mode
end;
diff --git a/plugins/Actman30/iac_ini.pas b/plugins/Actman30/iac_ini.pas index 7061d65936..17caa1e334 100644 --- a/plugins/Actman30/iac_ini.pas +++ b/plugins/Actman30/iac_ini.pas @@ -7,7 +7,7 @@ implementation uses
windows,messages,commctrl,
iac_global,global,
- common,m_api,wrapper,
+ common,m_api,wrapper, inouttext,
dbsettings,editwrapper,mirutils;
{$include i_cnst_ini.inc}
@@ -215,6 +215,21 @@ begin 1: begin
end;
}
+ 13: begin
+ tTextExport(node).AddFlag('write' ,(flags and ACF_INI_WRITE )<>0);
+ tTextExport(node).AddFlag('delete' ,(flags and ACF_INI_DELETE)<>0);
+ tTextExport(node).AddFlag('lastresult',(flags and ACF_INI_LR )<>0);
+ tTextExport(node).AddFlag('utf' ,(flags and ACF_INI_UTF )<>0);
+ if flags and (ACF_INI_WRITE or ACF_INI_DELETE or ACF_INI_LR or ACF_INI_UTF)<>0 then
+ tTextExport(node).AddNewLine();
+ tTextExport(node).AddTextW('inifile' ,inifile ); tTextExport(node).AddNewLine();
+ tTextExport(node).AddTextW('section' ,section ); tTextExport(node).AddNewLine();
+ tTextExport(node).AddTextW('parameter',parameter); tTextExport(node).AddNewLine();
+ if flags and (ACF_INI_DELETE or ACF_INI_LR)=0 then
+ begin
+ tTextExport(node).AddTextW('value',value); tTextExport(node).AddNewLine();
+ end;
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_inout.pas b/plugins/Actman30/iac_inout.pas index c8b63aa1dc..42e36913ff 100644 --- a/plugins/Actman30/iac_inout.pas +++ b/plugins/Actman30/iac_inout.pas @@ -7,7 +7,7 @@ implementation uses
windows, messages, commctrl,
iac_global, global,
- mirutils, common, dbsettings,
+ mirutils, mircontacts, common, dbsettings,
wrapper, editwrapper, io, syswin,
m_api;
@@ -41,6 +41,9 @@ const ACF_TEXTSEND = $00000400;
// dummy
ACF_MESSAGE = 0;
+
+const // V2
+ ACF2_TXT_FILE = $00000001;
type
tInOutAction = class(tBaseAction)
@@ -302,6 +305,7 @@ var section: array [0..127] of AnsiChar;
pc:pAnsiChar;
tmp:pWideChar;
+ flags2:dword;
begin
inherited Load(node,fmt);
case fmt of
@@ -313,6 +317,18 @@ begin end;
end;
+ 100: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+ if (flags and ACF_FILE)<>0 then
+ begin
+ StrCopy(pc,opt_file); tfile:=DBReadUnicode(0,DBBranch,section,nil);
+ end;
+
+ StrCopy(pc,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+ if (flags2 and ACF2_TXT_FILE)<>0 then
+ flags:=flags or ACF_FILE_PATH;
+ end;
+
1: begin
with xmlparser do
begin
@@ -405,6 +421,22 @@ begin 1: begin
end;
}
+ 13: begin
+{
+ ACF_CLIPBRD = $00000002; // Clipboard operations, not window
+ ACF_ANSI = $00000004; // File: ANSI or Unicode (UTF8/UTF16) text
+ ACF_COPYTO = $00000008; // Clipboard operations: 'copy to' or 'paste from'
+
+ ACF_FILE = $00000010; // File operations
+ ACF_FWRITE = $00000020; // read/write file
+ ACF_FAPPEND = $00000040; // append file
+ ACF_UTF8 = $00000080; // File: UTF8 or UTF16
+ ACF_SIGN = $00000100; // File: with signature or not
+ ACF_FILE_PATH = $00000200;
+
+ ACF_TEXTSEND = $00000400;
+}
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_jump.pas b/plugins/Actman30/iac_jump.pas index c06c1037dd..4f4176e583 100644 --- a/plugins/Actman30/iac_jump.pas +++ b/plugins/Actman30/iac_jump.pas @@ -52,6 +52,13 @@ const ACF_BACK = $00000020;
ACF_VALUE = $00000100;
+const // V2
+ ADV_ACT_BREAK = 1;
+ ADV_COND_NOT = $80;
+ ADV_COND_GT = 1;
+ ADV_COND_LT = 2;
+ ADV_COND_EQ = 3;
+
type
tJumpAction = class(tBaseAction)
private
@@ -219,9 +226,11 @@ end; procedure tJumpAction.Load(node:pointer;fmt:integer);
var
section: array [0..127] of AnsiChar;
+ buf:array [0..31] of WideChar;
pc:pAnsiChar;
tmp:pWideChar;
sub:HXML;
+ oper,cond:byte;
begin
inherited Load(node,fmt);
case fmt of
@@ -238,6 +247,50 @@ begin end;
end;
+ 100..199: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+ if fmt<>101 then // condition
+ begin
+ StrCopy(pc,opt_condition); cond:=DBReadByte(0,DBBranch,section);
+ if (cond and $F0)=0 then
+ flags:=flags or ACF_NOP
+ else
+ begin
+ if (cond and ADV_COND_NOT)<>0 then flags:=flags or ACF_NOT;
+ flags:=flags or ACF_MATH;
+ StrCopy(pc,opt_value); StrDupW(value,IntToStr(buf,DBReadDWord(0,DBBranch,section)));
+
+ case cond and $0F of
+ ADV_COND_GT: condition:=aeGT;
+ ADV_COND_LT: condition:=aeLT;
+ ADV_COND_EQ: condition:=aeEQ;
+ end;
+ end;
+ end
+ else // skip condition, jump
+ begin
+ flags:=flags or ACF_NOP
+ end;
+
+ if fmt>101 then // inverse condition, jump to label
+ begin
+ flags:=flags xor ACF_NOT;
+ buf[0]:='$'; buf[1]:='$';
+ IntToStr(PWideChar(@buf[2]),fmt-102);
+ StrDupW(actlabel,buf);
+ end
+ else
+ begin
+ StrCopy(pc,'oper'); oper:=DBReadByte(0,DBBranch,section) and $0F;
+ if (oper and ADV_ACT_BREAK)<>0 then
+ flags:= flags or ACF_BREAK
+ else
+ begin
+ StrCopy(pc,'operval'); actlabel:=DBReadUnicode(0,DBBranch,section);
+ end;
+ end;
+ end;
+
1: begin
with xmlparser do
begin
@@ -359,6 +412,17 @@ begin 1: begin
end;
}
+ 13: begin
+{
+ ACF_NOP = $00000001;
+ ACF_MATH = $00000002;
+ ACF_NOT = $00000004;
+ ACF_CASE = $00000008;
+ ACF_BREAK = $00000010;
+ ACF_BACK = $00000020;
+ ACF_VALUE = $00000100;
+}
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_messagebox.pas b/plugins/Actman30/iac_messagebox.pas index 7d99c5ffb3..41a1068ab2 100644 --- a/plugins/Actman30/iac_messagebox.pas +++ b/plugins/Actman30/iac_messagebox.pas @@ -143,7 +143,7 @@ begin pc:=StrCopyE(section,pAnsiChar(node));
StrCopy(pc,opt_msgtitle); msgtitle:=DBReadUnicode(0,DBBranch,section);
StrCopy(pc,opt_msgtext ); msgtext :=DBReadUnicode(0,DBBranch,section);
- StrCopy(pc,opt_boxopts ); boxopts :=DBReadDword (0,DBBranch,section);
+ StrCopy(pc,opt_boxopts ); boxopts :=DBReadDword (0,DBBranch,section); // v2 = byte
end;
1: begin
@@ -187,6 +187,8 @@ begin 1: begin
end;
}
+ 13: begin
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_notes.pas b/plugins/Actman30/iac_notes.pas new file mode 100644 index 0000000000..182e1aba9e --- /dev/null +++ b/plugins/Actman30/iac_notes.pas @@ -0,0 +1,173 @@ +unit iac_notes;
+
+interface
+
+implementation
+
+uses
+ windows, messages, commctrl,
+ common, wrapper,
+ mirutils, dbsettings, m_api,
+ global, iac_global;
+
+{$include i_cnst_notes.inc}
+{$resource iac_notes.res}
+
+const
+ opt_text = 'text';
+
+type
+ tNotesAction = class(tBaseAction)
+ private
+ note:PWideChar;
+ public
+ constructor Create(uid:dword);
+ destructor Destroy; override;
+// function Clone:tBaseAction; override;
+ function DoAction(var WorkData:tWorkData):LRESULT; override;
+ procedure Save(node:pointer;fmt:integer); override;
+ procedure Load(node:pointer;fmt:integer); override;
+ end;
+
+//----- Support functions -----
+
+//----- Object realization -----
+
+constructor tNotesAction.Create(uid:dword);
+begin
+ inherited Create(uid);
+end;
+
+destructor tNotesAction.Destroy;
+begin
+
+ inherited Destroy;
+end;
+
+function tNotesAction.DoAction(var WorkData:tWorkData):LRESULT;
+begin
+ result:=0;
+end;
+
+procedure tNotesAction.Load(node:pointer;fmt:integer);
+var
+ section: array [0..127] of AnsiChar;
+ pc:pAnsiChar;
+begin
+ inherited Load(node,0);
+ case fmt of
+ 0: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+ StrCopy(pc,opt_text); note:=DBReadUnicode(0,DBBranch,section,nil);
+ end;
+{
+ 1: begin
+ end;
+}
+ end;
+end;
+
+procedure tNotesAction.Save(node:pointer;fmt:integer);
+var
+ section: array [0..127] of AnsiChar;
+ pc:pAnsiChar;
+begin
+ inherited Save(node,fmt);
+ case fmt of
+ 0: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+ StrCopy(pc,opt_text); DBWriteUnicode(0,DBBranch,section,note);
+ end;
+{
+ 1: begin
+ end;
+}
+ end;
+end;
+
+//----- Dialog realization -----
+
+procedure ClearFields(Dialog:HWND);
+begin
+ SetDlgItemTextW(Dialog,IDC_TXT_TEXT,nil);
+end;
+
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+const
+ NoProcess:boolean=true;
+begin
+ result:=0;
+
+ case hMessage of
+ WM_INITDIALOG: begin
+ TranslateDialogDefault(Dialog);
+ end;
+
+ WM_ACT_SETVALUE: begin
+ NoProcess:=true;
+ ClearFields(Dialog);
+ with tNotesAction(lParam) do
+ begin
+ SetDlgItemTextW(Dialog,IDC_TXT_TEXT,note);
+ end;
+ NoProcess:=false;
+ end;
+
+ WM_ACT_RESET: begin
+ NoProcess:=true;
+ ClearFields(Dialog);
+ NoProcess:=false;
+ end;
+
+ WM_ACT_SAVE: begin
+ with tNotesAction(lParam) do
+ begin
+ flags:=0;
+ note:=GetDlgText(Dialog,IDC_TXT_TEXT);
+ end;
+ end;
+
+ WM_COMMAND: begin
+ case wParam shr 16 of
+ EN_CHANGE: if not NoProcess then
+ SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
+ end;
+ end;
+
+ WM_HELP: begin
+ result:=1;
+ end;
+
+ end;
+end;
+
+//----- Export/interface functions -----
+
+var
+ vc:tActModule;
+
+function CreateAction:tBaseAction;
+begin
+ result:=tNotesAction.Create(vc.Hash);
+end;
+
+function CreateDialog(parent:HWND):HWND;
+begin
+ result:=CreateDialogW(hInstance,'IDD_ACTNOTES',parent,@DlgProc);
+end;
+
+procedure Init;
+begin
+ vc.Next :=ModuleLink;
+
+ vc.Name :='Notes';
+ vc.Dialog :=@CreateDialog;
+ vc.Create :=@CreateAction;
+ vc.Icon :='IDI_NOTES';
+
+ ModuleLink :=@vc;
+end;
+
+begin
+ Init;
+end.
diff --git a/plugins/Actman30/iac_notes.rc b/plugins/Actman30/iac_notes.rc new file mode 100644 index 0000000000..a9ca1bc5ef --- /dev/null +++ b/plugins/Actman30/iac_notes.rc @@ -0,0 +1,13 @@ +#include "i_cnst_notes.inc"
+
+LANGUAGE 0,0
+
+IDD_ACTNOTES DIALOGEX 0, 0, 168, 200, 0
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0
+{
+ EDITTEXT IDC_TXT_TEXT, 1, 4, 166, 192, ES_AUTOHSCROLL
+}
+
+IDI_NOTES ICON "ico\notes.ico"
diff --git a/plugins/Actman30/iac_notes.res b/plugins/Actman30/iac_notes.res Binary files differnew file mode 100644 index 0000000000..72d05137cd --- /dev/null +++ b/plugins/Actman30/iac_notes.res diff --git a/plugins/Actman30/iac_program.pas b/plugins/Actman30/iac_program.pas index bf44fdffa6..33924c4279 100644 --- a/plugins/Actman30/iac_program.pas +++ b/plugins/Actman30/iac_program.pas @@ -8,7 +8,7 @@ uses editwrapper,
windows, messages, commctrl,
global, iac_global, m_api, wrapper, syswin,
- mirutils, common, dbsettings;
+ mirutils, mircontacts, common, dbsettings;
{$include i_cnst_program.inc}
{$resource iac_program.res}
@@ -19,6 +19,12 @@ const ACF_PRG_PRG = $00000004; // script for program path
ACF_PRG_ARG = $00000008; // script for program args
+const // V2
+ ACF_OLD_CURPATH = $00000002;
+ ACF_OLD_PRTHREAD = $00000004;
+ ACF2_PRG_PRG = $00000001;
+ ACF2_PRG_ARG = $00000002;
+
const
opt_prg = 'program';
opt_args = 'arguments';
@@ -207,6 +213,7 @@ var section: array [0..127] of AnsiChar;
pc:pAnsiChar;
tmp:pWideChar;
+ flags2,lflags:dword;
begin
inherited Load(node,fmt);
case fmt of
@@ -218,6 +225,24 @@ begin StrCopy(pc,opt_show); show :=DBReadDWord (0,DBBranch,section,SW_SHOW);
end;
+ 100: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+ StrCopy(pc,opt_prg ); prgname:=DBReadUnicode(0,DBBranch,section,nil);
+ StrCopy(pc,opt_args); args :=DBReadUnicode(0,DBBranch,section,nil);
+ StrCopy(pc,opt_time); time :=DBReadDWord (0,DBBranch,section,0);
+ StrCopy(pc,opt_show); show :=DBReadDWord (0,DBBranch,section,SW_SHOW);
+
+ StrCopy(pc,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+ lflags:=flags;
+ flags:=flags and not ACF_MASK;
+
+ if (lflags and ACF_OLD_CURPATH )<>0 then flags:=flags or ACF_CURPATH;
+ if (lflags and ACF_OLD_PRTHREAD)<>0 then flags:=flags or ACF_PRTHREAD;
+
+ if (flags2 and ACF2_PRG_PRG)<>0 then flags:=flags or ACF_PRG_PRG;
+ if (flags2 and ACF2_PRG_ARG)<>0 then flags:=flags or ACF_PRG_ARG;
+ end;
+
1: begin
with xmlparser do
begin
@@ -290,6 +315,8 @@ begin 1: begin
end;
}
+ 13: begin
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_service.pas b/plugins/Actman30/iac_service.pas index 88ca4f7f07..d670f2afec 100644 --- a/plugins/Actman30/iac_service.pas +++ b/plugins/Actman30/iac_service.pas @@ -9,7 +9,7 @@ uses global, iac_global,
m_api,
sedit,strans,mApiCardM,
- mirutils,dbsettings, editwrapper,
+ mirutils,mircontacts,dbsettings, editwrapper,
sparam,srvblock,
syswin,wrapper,common;
@@ -37,6 +37,31 @@ const // dummy
ACF_STRING = 0;
+const // V2
+ ACF2_SRV_WPAR = $00000001;
+ ACF2_SRV_LPAR = $00000002;
+ ACF2_SRV_SRVC = $00000004;
+ ACF2_FREEMEM = $00000100;
+ ACF_OLD_WPARNUM = $00000001;
+ ACF_OLD_LPARNUM = $00000002;
+ ACF_OLD_WUNICODE = $00000004;
+ ACF_OLD_LUNICODE = $00000008;
+ ACF_OLD_WCURRENT = $00000010;
+ ACF_OLD_LCURRENT = $00000020;
+ ACF_OLD_WPARHEX = $00000040;
+ ACF_OLD_LPARHEX = $00000080;
+
+ ACF_OLD_WRESULT = $00010000;
+ ACF_OLD_LRESULT = $00020000;
+ ACF_OLD_WPARAM = $00040000;
+ ACF_OLD_LPARAM = $00080000;
+ ACF_OLD_WSTRUCT = $00100000;
+ ACF_OLD_LSTRUCT = $00200000;
+
+ ACF_OLD_STRING = $00000800;
+ ACF_OLD_UNICODE = $00001000;
+ ACF_OLD_STRUCT = $00008000;
+
const
opt_service = 'service';
opt_flags2 = 'flags2';
@@ -354,10 +379,12 @@ end; }
procedure tServiceAction.Load(node:pointer;fmt:integer);
var
- section: array [0..127] of AnsiChar;
+ section:array [0..127] of AnsiChar;
+ buf:array [0..31] of WideChar;
pc:pAnsiChar;
sub:HXML;
tmp:pWideChar;
+ lflags,lflags2:dword;
begin
inherited Load(node,fmt);
@@ -372,6 +399,67 @@ begin StrCopy(pc,opt_lparam); LoadParam(section,flags2,pointer(lparam));
end;
+ 100: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+
+ StrCopy(pc,opt_service); service:=DBReadString(0,DBBranch,section,nil);
+ StrCopy(pc,opt_flags2 ); flags2 :=DBReadDword (0,DBBranch,section);
+
+
+ if (flags and (ACF_OLD_WCURRENT or ACF_OLD_WRESULT or ACF_OLD_WPARAM))=0 then
+ begin
+ StrCopy(pc,opt_wparam);
+
+ if (flags and ACF_OLD_WSTRUCT)<>0 then
+ wparam:=PWideChar(DBReadUTF8(0,DBBranch,section,nil))
+ else if ((flags and ACF_OLD_WPARNUM)=0) or ((flags2 and ACF2_SRV_WPAR)<>0) then
+ wparam:=DBReadUnicode(0,DBBranch,section,nil)
+ else
+ StrDupW(wparam,IntToStr(buf,DBReadDWord(0,DBBranch,section)));
+ end;
+
+ if (flags and (ACF_OLD_LCURRENT or ACF_OLD_LRESULT or ACF_OLD_LPARAM))=0 then
+ begin
+ StrCopy(pc,opt_lparam);
+
+ if (flags and ACF_OLD_LSTRUCT)<>0 then
+ lparam:=PWideChar(DBReadUTF8(0,DBBranch,section,nil))
+ else if ((flags and ACF_OLD_LPARNUM)=0) or ((flags2 and ACF2_SRV_LPAR)<>0) then
+ lparam:=DBReadUnicode(0,DBBranch,section,nil)
+ else
+ StrDupW(lparam,IntToStr(buf,DBReadDWord(0,DBBranch,section)));
+ end;
+
+ lflags :=flags;
+ lflags2:=flags2;
+ flags :=flags and not ACF_MASK;
+ flags2:=0;
+
+ if (lflags2 and ACF2_SRV_SRVC)<>0 then flags:=flags or ACF_SCRIPT_SERVICE;
+
+ if (lflags and ACF_OLD_WPARNUM )<>0 then flags:=flags or ACF_PARNUM;
+ if (lflags and ACF_OLD_WUNICODE)<>0 then flags:=flags or ACF_UNICODE;
+ if (lflags and ACF_OLD_WCURRENT)<>0 then flags:=flags or ACF_CURRENT;
+ if (lflags and ACF_OLD_WRESULT )<>0 then flags:=flags or ACF_RESULT;
+ if (lflags and ACF_OLD_WPARAM )<>0 then flags:=flags or ACF_PARAM;
+ if (lflags and ACF_OLD_WSTRUCT )<>0 then flags:=flags or ACF_STRUCT;
+ if (lflags2 and ACF2_SRV_WPAR )<>0 then flags:=flags or ACF_SCRIPT_PARAM;
+
+ if (lflags and ACF_OLD_LPARNUM )<>0 then flags2:=flags2 or ACF_PARNUM;
+ if (lflags and ACF_OLD_LUNICODE)<>0 then flags2:=flags2 or ACF_UNICODE;
+ if (lflags and ACF_OLD_LCURRENT)<>0 then flags2:=flags2 or ACF_CURRENT;
+ if (lflags and ACF_OLD_LRESULT )<>0 then flags2:=flags2 or ACF_RESULT;
+ if (lflags and ACF_OLD_LPARAM )<>0 then flags2:=flags2 or ACF_PARAM;
+ if (lflags and ACF_OLD_LSTRUCT )<>0 then flags2:=flags2 or ACF_STRUCT;
+ if (lflags2 and ACF2_SRV_LPAR )<>0 then flags2:=flags2 or ACF_SCRIPT_PARAM;
+
+ if (lflags and ACF_OLD_STRING )<>0 then flags:=flags or ACF_RSTRING;
+ if (lflags and ACF_OLD_UNICODE)<>0 then flags:=flags or ACF_RUNICODE;
+ if (lflags and ACF_OLD_STRUCT )<>0 then flags:=flags or ACF_RSTRUCT;
+ if (lflags2 and ACF2_FREEMEM )<>0 then flags:=flags or ACF_RFREEMEM;
+
+ end;
+
1: begin
with xmlparser do
begin
@@ -462,6 +550,8 @@ begin 1: begin
end;
}
+ 13: begin
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_settings.pas b/plugins/Actman30/iac_settings.pas index 0cd7d82507..3997fbe73d 100644 --- a/plugins/Actman30/iac_settings.pas +++ b/plugins/Actman30/iac_settings.pas @@ -34,6 +34,7 @@ begin SetDlgItemTextW(Dialog,IDC_EDIT_FORMAT,'');
CheckDlgButton(Dialog,IDC_FR_FLAG,BST_UNCHECKED);
+ CheckDlgButton(Dialog,IDC_VL_FLAG,BST_UNCHECKED);
end;
function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
@@ -79,7 +80,13 @@ begin stat:=BST_CHECKED
else
stat:=BST_UNCHECKED;
- CheckDlgButton(Dialog,IDC_FR_FLAG,stat);
+ CheckDlgButton(Dialog,IDC_FR_FLAG,stat);
+
+ if (lp and ACF_VOLATILE)<>0 then
+ stat:=BST_CHECKED
+ else
+ stat:=BST_UNCHECKED;
+ CheckDlgButton(Dialog,IDC_VL_FLAG,stat);
end;
end;
@@ -112,6 +119,17 @@ begin SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
end;
+
+ IDC_VL_FLAG: begin
+ lp:=LV_GetLParam(MacroListWindow);
+ if IsDlgButtonChecked(Dialog,IDC_VL_FLAG)=BST_UNCHECKED then
+ lp:=lp and not ACF_VOLATILE
+ else
+ lp:=lp or ACF_VOLATILE;
+ LV_SetLParam(MacroListWindow,lp);
+
+ SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
+ end;
end;
end;
end;
diff --git a/plugins/Actman30/iac_settings.rc b/plugins/Actman30/iac_settings.rc index 957fba3088..69487dd87d 100644 --- a/plugins/Actman30/iac_settings.rc +++ b/plugins/Actman30/iac_settings.rc @@ -18,8 +18,9 @@ FONT 8, "MS Shell Dlg", 0, 0 COMBOBOX IDC_SERVICELIST , 19, 94, 148, 96, CBS_DROPDOWNLIST | WS_VSCROLL
CONTROL "Apply",IDC_SRV_APPLY,"MButtonClass",WS_TABSTOP,1,93,16,16,$18000000
- GROUPBOX "Current Macro", -1, 1, 116, 166, 28, WS_GROUP
- AUTOCHECKBOX "Select for FirstRun",IDC_FR_FLAG, 4, 125, 160, 12
+ GROUPBOX "Current Macro", -1, 1, 116, 166, 40, WS_GROUP
+ AUTOCHECKBOX "Select for FirstRun",IDC_FR_FLAG, 4, 126, 160, 12
+ AUTOCHECKBOX "Select as Volatile" ,IDC_VL_FLAG, 4, 138, 160, 12
// AUTOCHECKBOX "hContact in wParam" ,IDC_HC_WPAR, 4, 138, 160, 12
}
diff --git a/plugins/Actman30/iac_settings.res b/plugins/Actman30/iac_settings.res Binary files differindex ee1b268205..1aaef00324 100644 --- a/plugins/Actman30/iac_settings.res +++ b/plugins/Actman30/iac_settings.res diff --git a/plugins/Actman30/iac_storage.pas b/plugins/Actman30/iac_storage.pas index 53be7dd153..37755d0e63 100644 --- a/plugins/Actman30/iac_storage.pas +++ b/plugins/Actman30/iac_storage.pas @@ -7,7 +7,7 @@ implementation uses
windows, messages,
common, wrapper,
- mirutils,m_api,dbsettings,
+ mirutils,m_api,dbsettings, inouttext,
global,iac_global;
{$include i_cnst_storage.inc}
@@ -179,6 +179,10 @@ begin 1: begin
end;
}
+ 13: begin
+ tTextExport(node).AddDWord('slot',Number);
+ tTextExport(node).AddFlag ('copy',(flags or ACF_COPYFROM)<>0);
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_text.pas b/plugins/Actman30/iac_text.pas index ddebb3f3c8..d7d9890192 100644 --- a/plugins/Actman30/iac_text.pas +++ b/plugins/Actman30/iac_text.pas @@ -7,7 +7,7 @@ implementation uses
windows, messages, commctrl,
global, iac_global, m_api, editwrapper,
- dbsettings, common, io,
+ dbsettings, common, io, inouttext,
mirutils, syswin, wrapper;
{$include i_cnst_text.inc}
@@ -26,6 +26,9 @@ const ACF_TEXTSCRIPT = $00000001;
ACF_POSTPROCESS = $00000002;
+const // V2
+ ACF2_TXT_TEXT = $00000002;
+
type
tTextAction = class(tBaseAction)
private
@@ -330,6 +333,7 @@ procedure tTextAction.Load(node:pointer;fmt:integer); var
section: array [0..127] of AnsiChar;
pc:pAnsiChar;
+ flags2:dword;
begin
inherited Load(node,fmt);
case fmt of
@@ -339,6 +343,23 @@ begin StrCopy(pc,opt_text); text:=DBReadUnicode(0,DBBranch,section,nil);
end;
+ 100: begin
+ pc:=StrCopyE(section,pAnsiChar(node));
+
+ StrCopy(pc,opt_text); text:=DBReadUnicode(0,DBBranch,section,nil);
+
+ StrCopy(pc,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+ flags:=flags and not ACF_MASK;
+
+ if (flags2 and ACF2_TXT_TEXT)<>0 then flags:=flags or ACF_TEXTSCRIPT;
+ end;
+
+ 101: begin // v2, from "Advanced"
+ pc:=StrCopyE(section,pAnsiChar(node));
+ StrCopy(pc,'varval'); text:=DBReadUnicode(0,DBBranch,section);
+ flags:=flags or ACF_TEXTSCRIPT;
+ end;
+
1: begin
with xmlparser do
begin
@@ -375,6 +396,11 @@ begin 1: begin
end;
}
+ 13: begin
+ tTextExport(node).AddTextW('text' ,text);
+ tTextExport(node).AddFlag ('script' ,(flags or ACF_TEXTSCRIPT )<>0);
+ tTextExport(node).AddFlag ('postprocess',(flags or ACF_POSTPROCESS)<>0);
+ end;
end;
end;
diff --git a/plugins/Actman30/ico/notes.ico b/plugins/Actman30/ico/notes.ico Binary files differnew file mode 100644 index 0000000000..fa6c604542 --- /dev/null +++ b/plugins/Actman30/ico/notes.ico diff --git a/plugins/Actman30/lowlevelc.pas b/plugins/Actman30/lowlevelc.pas index 5c4d6b7965..fe6d9bde31 100644 --- a/plugins/Actman30/lowlevelc.pas +++ b/plugins/Actman30/lowlevelc.pas @@ -6,13 +6,15 @@ uses windows,
iac_global;
+// Macro flags
const
- ACF_ASSIGNED = $80000000; // action assigned
+ ACF_ASSIGNED = $80000000; // macro assigned
ACF_FIRSTRUN = $40000000; // FirstRun flag
- ACF_USEDNOW = $20000000; // action in use (reserved)
+ ACF_USEDNOW = $20000000; // macro in use (reserved)
ACF_VOLATILE = $10000000; // don't save in DB
ACF_TOSAVE = ACF_ASSIGNED or ACF_FIRSTRUN;
+
type
pActionList = ^tActionList;
tActionList = array [0..1023] of tBaseAction;
|