Skip to content

Commit 811129c

Browse files
committed
v10.7.2.6 - Plugins
1 parent 157945a commit 811129c

25 files changed

+1964
-143
lines changed

Clipjump.ahk

+109-76
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
;@Ahk2Exe-SetName Clipjump
2020
;@Ahk2Exe-SetDescription Clipjump
21-
;@Ahk2Exe-SetVersion 10.7
21+
;@Ahk2Exe-SetVersion 10.7.2.6
2222
;@Ahk2Exe-SetCopyright Avi Aryan
2323
;@Ahk2Exe-SetOrigFilename Clipjump.exe
2424

@@ -41,13 +41,13 @@ global ini_LANG := "" , H_Compiled := (Substr(A_AhkPath, Instr(A_AhkPath, "\", 0
4141
; Capitalised variables (here and everywhere) indicate that they are global
4242

4343
global PROGNAME := "Clipjump"
44-
global VERSION := "10.7"
44+
global VERSION := "10.7.2.6b"
4545
global CONFIGURATION_FILE := "settings.ini"
4646

4747
ini_LANG := ini_read("System", "lang")
4848
global TXT := Translations_load("languages/" ini_LANG ".txt") ;Load translations
4949

50-
global UPDATE_FILE := "https://raw.github.com/aviaryan/Clipjump/master/version.txt"
50+
global UPDATE_FILE := "http://sourceforge.net/projects/clipjump/files/version.txt/download"
5151
global PRODUCT_PAGE := "http://clipjump.sourceforge.net"
5252
global HELP_PAGE := "http://clipjump.sourceforge.net/docs"
5353
global AUTHOR_PAGE := "http://aviaryan.github.io"
@@ -88,14 +88,14 @@ global WORKINGHT := tempbottom-temptop
8888
global restoreCaller := 0
8989

9090
;Global Inits
91-
global CN := {}, CUSTOMS := {}, CDS := {}, SEARCHOBJ := {}, HISTORYOBJ := {}, TOTALCLIPS, ACTIONMODE := {}, PLUGINS := {}, ACTIONMODE_DEF := "H S C X F D P O E F1 L"
91+
global CN := {}, CUSTOMS := {}, CDS := {}, SEARCHOBJ := {}, HISTORYOBJ := {}, TOTALCLIPS, ACTIONMODE := {}, PLUGINS := {}, STORE := {} ;store=global public storage space
9292
global cut_is_delete_windows := "XLMAIN QWidget" ;excel, kingsoft office
93-
global CURSAVE, TEMPSAVE, LASTCLIP, LASTFORMAT, Islastformat_Changed := 1, IScurCBACTIVE := 0
93+
global CURSAVE, TEMPSAVE, LASTCLIP, LASTFORMAT, Islastformat_Changed := 1, IScurCBACTIVE := 0, curPformat, curPfunction, curPisPreviewable
9494
global NOINCOGNITO := 1, SPM := {}, protected_DoBeep := 1
9595

9696
;Initailizing Common Variables
9797
global CALLER_STATUS, CLIPJUMP_STATUS := 1 ; global vars are not declared like the below , without initialising
98-
global CALLER := CALLER_STATUS := true, IN_BACK := false
98+
global CALLER := CALLER_STATUS := 1, IN_BACK := 0, MULTIPASTE, PASTEMODE_ACT
9999
global CLIP_ACTION := "", ONCLIPBOARD := 0 , ISACTIVEEXCEL := 0 , HASCOPYFAILED := 0 , ctrlRef ;specific purpose global vars
100100

101101
;Init General vars
@@ -128,12 +128,12 @@ else if (ini_Version != VERSION)
128128

129129
;Global Ini declarations
130130
global ini_IsImageStored , ini_Quality , ini_MaxClips , ini_Threshold , ini_IsChannelMin := 1 , CopyMessage, FORMATTING
131-
, Copyfolderpath_K, Copyfilepath_K, Copyfilepath_K, channel_K, onetime_K, paste_k, actionmode_k, ini_is_duplicate_copied, ini_formatting, ini_actmd_keys
131+
, Copyfolderpath_K, Copyfilepath_K, Copyfilepath_K, channel_K, onetime_K, paste_k, actionmode_k, ini_is_duplicate_copied, ini_formatting
132132
, ini_CopyBeep , beepFrequency , ignoreWindows, ini_defEditor
133133

134134
; (search) paste mode keys
135135
global pastemodekey := {} , spmkey := {}
136-
temp_keys := "a|c|s|z|space|x|e|up|down|f|h"
136+
temp_keys := "a|c|s|z|space|x|e|up|down|f|h|Enter"
137137
loop, parse, temp_keys,|
138138
pastemodekey[A_LoopField] := "^" A_LoopField
139139
temp_keys := "Enter|Up|Down|Home"
@@ -142,13 +142,14 @@ loop, parse, temp_keys,|
142142

143143
global windows_copy_k, windows_cut_k
144144

145+
init_actionmode()
145146
;Initialising Clipjump Channels
146147
initChannels()
147148
;loading Settings
148149
load_Settings(1)
149150
validate_Settings()
150151
;load plugins
151-
;loadPlugins() ;<--- INACTIVE
152+
loadPlugins()
152153
;load custom settings
153154
loadCustomizations()
154155

@@ -201,7 +202,6 @@ hkZ(windows_copy_k, "windows_copy") , hkZ(windows_cut_k, "windows_cut")
201202
OnMessage(0x4a, "Receive_WM_COPYDATA") ; 0x4a is WM_COPYDATA
202203
;Clean History
203204
historyCleanup()
204-
init_actionmode()
205205

206206
;create Ignore windows group from | separated values
207207
loop, parse, ignoreWindows,|
@@ -291,8 +291,7 @@ paste:
291291

292292
if !IScurCBACTIVE ;if the current clipboard is not asked for , then only load from file
293293
try FileRead, Clipboard, *c %A_WorkingDir%/%CLIPS_dir%/%TEMPSAVE%.avc
294-
try temp_clipboard := Clipboard
295-
;temp_clipboard := CDS[CN.NG][TEMPSAVE]
294+
try temp_clipboard := Clipboard ;temp_clipboard := CDS[CN.NG][TEMPSAVE]
296295

297296
fixStatus := fixCheck()
298297
realclipno := CURSAVE - TEMPSAVE + 1
@@ -307,6 +306,8 @@ paste:
307306
halfClip := halfClip . "`n`n" MSG_MORE_PREVIEW
308307
}
309308
else halfClip := temp_clipboard
309+
if curPisPreviewable
310+
halfClip := %curPfunction%(halfClip)
310311
}
311312
PasteModeTooltip(temp_clipboard)
312313
SetTimer, ctrlCheck, 50
@@ -451,7 +452,6 @@ moveBack:
451452
IScurCBACTIVE := 0 ;the key will be always pressed after V
452453
try FileRead, clipboard, *c %CLIPS_dir%/%TEMPSAVE%.avc
453454
try temp_clipboard := Clipboard
454-
;temp_clipboard := CDS[CN.NG][TEMPSAVE]
455455

456456
fixStatus := fixCheck()
457457
realClipNo := CURSAVE - TEMPSAVE + 1
@@ -465,6 +465,8 @@ moveBack:
465465
halfClip := halfClip "`n`n" MSG_MORE_PREVIEW
466466
}
467467
else halfClip := temp_clipboard
468+
IF curPisPreviewable
469+
halfClip := %curPfunction%(halfClip)
468470
}
469471
PasteModeTooltip(temp_clipboard)
470472
SetTimer, ctrlCheck, 50
@@ -481,13 +483,30 @@ IN_BACK_correction(){ ; corrects TEMPSAVE value when C (backwards) is used in p
481483

482484
;-------------- paste mode tips ------------------------
483485

486+
multiPaste:
487+
if SPM.ACTIVE {
488+
WinHide, Clipjump_SPM ahk_class AutoHotkeyGUI
489+
WinWaitNotActive, Clipjump_SPM ahk_class AutoHotkeyGUI
490+
temp_spmWasActive := 1
491+
}
492+
MULTIPASTE := PASTEMODE_ACT := 1
493+
while PASTEMODE_ACT
494+
sleep 50 ; wait till ctrlCheck: runs
495+
if MULTIPASTE ; if multipaste is still ON, becomes OFF due to release of ctrl (which doesnt disturb when spm is active)
496+
gosub paste
497+
if temp_spmWasActive {
498+
WinShow, Clipjump_SPM ahk_class AutoHotkeyGUI
499+
temp_spmWasActive := 0
500+
}
501+
return
502+
484503
cancel:
485504
Gui, Hide
486505
PasteModeTooltip(TXT.TIP_cancelm "`t(1)`n" TXT.TIP_modem, 1)
487506
ctrlref := "cancel"
488507
if SPM.ACTIVE
489508
gosub SPM_dispose ; dispose it if There - Note that this step ends the label as ctrlCheck dies so ctrlRef is kept upwards to be updated
490-
hkZ(pastemodekey.c, "moveback", 0)
509+
hkZ(pastemodekey.c, "moveback", 0) , hkZ(pastemodekey.enter, "multiPaste", 0)
491510
hkZ(pastemodekey.space, "fixate", 0) , hkZ(pastemodekey.z, "Formatting", 0) , hkZ(pastemodekey.a, "navigate_to_first", 0)
492511
hkZ(pastemodekey.s, "Ssuspnd", 0) , hkZ(pastemodekey.up, "channel_up", 0) , hkZ(pastemodekey.down, "channel_down", 0)
493512
hkZ(pastemodekey.f, "searchpm", 0) , hkZ(pastemodekey.h, "editclip", 0) , hkZ(pastemodekey.x, "Cancel", 0) , hkZ(pastemodekey.x, "Delete", 1)
@@ -555,9 +574,33 @@ ctrlForCopy:
555574
return
556575

557576
Formatting:
558-
FORMATTING := !FORMATTING
577+
matched_pformat := 0
578+
if curPformat=
579+
matched_pformat := 1
580+
for key,value in PLUGINS["pformat"]
581+
{
582+
if matched_pformat {
583+
curPformat := value.name , curPfunction := value["*"] , matched_pformat := 0
584+
break
585+
}
586+
if ( value["name"] == curPformat )
587+
matched_pformat := 1
588+
}
589+
;rebuild show text
590+
if temp_clipboard != ""
591+
{
592+
If strlen(temp_clipboard) > 200
593+
{
594+
StringLeft,halfclip,temp_clipboard, 200
595+
halfClip := halfClip . "`n`n" MSG_MORE_PREVIEW
596+
}
597+
else halfClip := temp_clipboard
598+
}
599+
if matched_pformat
600+
curPformat := "" , FORMATTING := 1 , curPisPreviewable := 0 ; case of switching to default
601+
else halfClip := (curPisPreviewable := value["Previewable"]) ? %curPfunction%(halfClip) : halfClip , FORMATTING := 0
559602
if ctrlRef = pastemode
560-
PasteModeTooltip(temp_clipboard)
603+
PasteModeTooltip(temp_clipboard) ; rebuild prvw
561604
return
562605

563606
fixate:
@@ -668,21 +711,23 @@ PasteModeTooltip(cText, notpaste=0) {
668711
if cText =
669712
ToolTip % "{" CN.Name "} Clip " realclipno " of " CURSAVE "`t" fixStatus (WinExist("Display_Cj") ? "" : "`n`n" MSG_ERROR "`n`n"), % SPM.X, % SPM.Y
670713
else
671-
ToolTip % "{" CN.Name "} Clip " realclipno " of " CURSAVE "`t" GetClipboardFormat() "`t" fixstatus (!FORMATTING ? "`t[" TXT.TIP_noformatting "]" : "")
714+
ToolTip % "{" CN.Name "} Clip " realclipno " of " CURSAVE "`t" GetClipboardFormat() "`t" fixstatus ( curPformat ? "`t[" curPformat "]" : "" )
672715
. "`n`n" halfclip, % SPM.X, % SPM.Y
673716
}
674717
}
675718

676-
677719
ctrlCheck:
678-
if (!GetKeyState("Ctrl")) && (!SPM.ACTIVE)
720+
if ((!GetKeyState("Ctrl")) && (!SPM.ACTIVE)) || PASTEMODE_ACT
679721
{
680722
Critical
681723
SetTimer, ctrlCheck, Off
682-
CALLER := false , sleeptime := 300
683-
TEMPSAVE := realActive ; keep the current clip pos saved
684-
724+
CALLER := false , sleeptime := 300 , TEMPSAVE := realActive ; keep the current clip pos saved
685725
Gui, 1:Hide
726+
; Change vars a/c MULTIPASTE
727+
if MULTIPASTE && !GetKeyState("Ctrl") && !temp_spmWasActive ;if spmIsActive user is not expected to cancel by releasing Ctrl
728+
if ctrlRef = pastemode
729+
ctrlRef := "cancel"
730+
; ---
686731
if ctrlRef = cancel
687732
{
688733
ToolTip, %MSG_CANCELLED%
@@ -727,17 +772,17 @@ ctrlCheck:
727772
else if ctrlRef = pastemode
728773
{
729774
ToolTip, %MSG_PASTING%
730-
if !FORMATTING
775+
if curPformat ;use curpf to get the func
731776
{
732-
if Instr(GetClipboardFormat(), "Text")
733-
{
734-
Critical, Off ; off to enable thread overlap
735-
API.blockMonitoring(1)
736-
try Clipboard := Rtrim(Clipboard, "`r`n")
737-
API.blockMonitoring(0, 5)
738-
CALLER := 0 ; make it 0 again to avoid any interference with apps like Excel
739-
Critical, On ; on critical for just the case
740-
}
777+
Critical, Off
778+
API.blockMonitoring(1) ; this is done to have the boomerang effect ONCLIPBOARD work.
779+
STORE.ClipboardChanged := 0
780+
try Coutput := %curPfunction%(Clipboard)
781+
if STORE.ClipboardChanged
782+
try Clipboard := Coutput
783+
else ONCLIPBOARD := 1
784+
API.blockMonitoring(0, 5)
785+
Critical, On
741786
Send, ^{vk56}
742787
sleeptime := 1
743788
}
@@ -762,7 +807,9 @@ ctrlCheck:
762807
sleep % sleeptime
763808
Tooltip
764809

765-
restoreCaller := 0 ; make it 0 in case Clipboard was not touched (Pasting was done)
810+
restoreCaller := PASTEMODE_ACT := 0 ; restoreCaller - make it 0 in case Clipboard was not touched (Pasting was done)
811+
if !GetKeyState("Ctrl") && !SPM.ACTIVE
812+
MULTIPASTE := 0 ; deactivated when Ctrl released
766813
ctrlRef := ""
767814
CALLER := CALLER_STATUS , EmptyMem()
768815
}
@@ -797,7 +844,7 @@ hkZ_pasteMode(mode=0){
797844
hkZ(pastemodekey.c, "MoveBack", mode) , hkZ(pastemodekey.x, "Cancel", mode) , hkZ(pastemodekey.z, "Formatting", mode)
798845
hkZ(pastemodekey.space, "Fixate", mode) , hkZ(pastemodekey.s, "Ssuspnd", mode) , hkZ(pastemodekey.e, "export", mode)
799846
hkZ(pastemodekey.up, "channel_up", mode) , hkZ(pastemodekey.down, "channel_down", mode) , hkZ(pastemodekey.a, "navigate_to_first", mode)
800-
hkZ(pastemodekey.f, "searchpm", mode) , hkZ(pastemodekey.h, "editclip", mode)
847+
hkZ(pastemodekey.f, "searchpm", mode) , hkZ(pastemodekey.h, "editclip", mode) , hkZ(pastemodekey.enter, "multiPaste", mode)
801848

802849
if !mode ;init Cj
803850
{
@@ -808,17 +855,10 @@ hkZ_pasteMode(mode=0){
808855
}
809856
}
810857

811-
;changeCDS(nc, nx, ){
812-
; if nc=
813-
; nc := oc
814-
; CDS[nc][nx] := CDS[oc][ox]
815-
; CDS[nc][nx "f"] := CDS[oc][ox "f"]
816-
;}
817-
818858
;--------------------------- CHANNEL FUNCTIONS ----------------------------------------------------------------
819859

820860
channel_up:
821-
CN.NG += 2 ;+2 to counter that -1 below
861+
CN.NG += 2
822862
channel_down:
823863
CN.NG -= 1 , correctTEMPSAVE()
824864
if Instr(CN.NG, "-")
@@ -961,49 +1001,42 @@ historyCleanup()
9611001

9621002

9631003
actionmode:
1004+
update_actionmode()
9641005
temp_am := TT_Console(ACTIONMODE.text, ACTIONMODE.keys, temp3, temp3, 5, "s8", "Consolas|Courier New")
965-
if ACTIONMODE[temp_am] != ""
966-
gosub % ACTIONMODE[temp_am]
1006+
if ACTIONMODE[temp_am] != "Exit_actmd"
1007+
if Instr(ACTIONMODE[temp_am] , "(")
1008+
RunFunc(ACTIONMODE[temp_am])
1009+
else gosub % ACTIONMODE[temp_am]
9671010
else
9681011
EmptyMem()
9691012
return
9701013

9711014
init_actionmode() {
972-
;ini_actmd_keys stores user prefs till Help File
973-
974-
t12 := {}
975-
loop, parse, ini_actmd_keys, %A_space%, %A_space%
976-
t12.Insert(A_LoopField)
977-
978-
ACTIONMODE := {(t12.1): "history", (t12.2): "channelGUI", (t12.3): "copyfile", (t12.4): "copyfolder", (t12.5): "CopyFileData", (t12.6): "disable_clipjump"
979-
, (t12.7): "pitswap", (t12.8): "onetime", (t12.9): "settings", (t12.10): "hlp", (t12.11): "classTool"}
980-
981-
ACTIONMODE.keys := ini_actmd_keys " Esc End Q"
982-
983-
status_text := !CLIPJUMP_STATUS ? TXT.ACT_enable : TXT.ACT_disable ;8
1015+
ACTIONMODE := {H: "history", S: "channelGUI", C: "copyfile", X: "copyfolder", F: "CopyFileData", D: "disable_clipjump"
1016+
, P: "pitswap", O: "onetime", L: "classTool", E: "settings", F1: "hlp", Esc: "Exit_actmd", M: "pluginManager_GUI()"
1017+
, H_caption: TXT.HST__name, S_caption: TXT.CNL__name, C_caption: TXT._cfilep, X_caption: TXT._cfolderp, F_caption: cfiled
1018+
, D_caption: TXT.ACT_disable " " PROGNAME, P_caption: TXT._pitswp, O_caption: TXT._ot, L_caption: TXT.IGN__name, E_caption: TXT.SET__name
1019+
, F1_caption: TXT.TRY_help, Esc_caption: TXT.ACT_exit, M_caption: TXT.PLG__name}
1020+
}
9841021

985-
;auto-detect width
986-
; max 35
987-
ACTIONMODE.text := ""
1022+
update_actionmode(){
1023+
thetext := ""
9881024
. PROGNAME " " TXT.ACT__name
9891025
. "`n-----------"
9901026
. "`n"
991-
. "`n" fillwithSpaces(TXT.HST__name, 35) " - " t12.1 ;35 is default
992-
. "`n" fillwithSpaces(TXT.CNL__name) " - " t12.2
993-
. "`n" fillwithSpaces(TXT._cfilep) " - " t12.3
994-
. "`n" fillwithSpaces(TXT._cfolderp) " - " t12.4
995-
. "`n" fillwithSpaces(TXT._cfiled) " - " t12.5
996-
. "`n" fillwithSpaces(status_text " " PROGNAME) " - " t12.6
997-
. "`n" fillwithSpaces(TXT._pitswp) " - " t12.7
998-
. "`n" fillwithSpaces(TXT._ot) " - " t12.8
999-
. "`n"
1000-
. "`n" fillwithSpaces(TXT.IGN__name) " - " t12.11
1001-
. "`n" fillwithSpaces(TXT.SET__name) " - " t12.9
1002-
. "`n" fillwithSpaces(TXT.TRY_help) " - " t12.10
1003-
. "`n"
1004-
. "`n" fillwithSpaces(TXT.ACT_exit) " - Esc, End, Q"
1027+
ACTIONMODE.remove("text") , ACTIONMODE.remove("keys")
10051028

1029+
for k,v in ACTIONMODE
1030+
if !Instr(k, "_") && (k != "Esc") && v{
1031+
thekeys .= k " "
1032+
thetext .= "`n" fillwithSpaces( ACTIONMODE[k "_caption"] ? ACTIONMODE[k "_caption"] : v , 35 ) " - " k
1033+
}
1034+
if ACTIONMODE.Esc
1035+
thetext .= "`n`n" fillwithSpaces( ACTIONMODE.Esc_caption ? ACTIONMODE.Esc_caption : ACTIONMODE.Esc , 35 ) " - Esc" , thekeys .= "Esc"
1036+
ACTIONMODE.keys := Trim(thekeys)
1037+
ACTIONMODE.text := thetext
10061038
}
1039+
10071040
;****************COPY FILE/FOLDER/DATA***************************************************************************
10081041

10091042
copyFile:
@@ -1223,7 +1256,7 @@ disable_clipjump:
12231256

12241257
routines_Exit() {
12251258
Ini_write("Clipboard_history_window", "partial", history_partial, 0)
1226-
;updatePluginList() - ;ENABLE WHEN PLUGINS ARE INCORPORATED
1259+
updatePluginIncludes() - ;ENABLE WHEN PLUGINS ARE INCORPORATED
12271260
}
12281261

12291262
;#################### COMMUNICATION ##########################################
@@ -1318,7 +1351,7 @@ Receive_WM_COPYDATA(wParam, lParam)
13181351
#include %A_ScriptDir%\lib\anticj_func_labels.ahk
13191352
#include %A_ScriptDir%\lib\settings gui plug.ahk
13201353
#include %A_ScriptDir%\lib\history gui plug.ahk
1321-
;#include %A_ScriptDir%\lib\pluginManager.ahk
1322-
;#include %A_ScriptDir%\plugins\_registry.ahk
1354+
#include %A_ScriptDir%\lib\pluginManager.ahk
1355+
#include %A_ScriptDir%\plugins\_registry.ahk
13231356

13241357
;------------------------------------------------------------------- X -------------------------------------------------------------------------------

0 commit comments

Comments
 (0)