comparison Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua @ 51:dbf04157d63e v7.3.0.051

- ToC Update.
author Tercio
date Sat, 02 Sep 2017 12:42:52 -0300
parents 1c3534391efb
children
comparison
equal deleted inserted replaced
50:e33a1e89084c 51:dbf04157d63e
1 --[[ $Id: CallbackHandler-1.0.lua 965 2010-08-09 00:47:52Z mikk $ ]] 1 --[[ $Id: CallbackHandler-1.0.lua 1131 2015-06-04 07:29:24Z nevcairiel $ ]]
2 local MAJOR, MINOR = "CallbackHandler-1.0", 6 2 local MAJOR, MINOR = "CallbackHandler-1.0", 6
3 local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) 3 local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
4 4
5 if not CallbackHandler then return end -- No upgrade needed 5 if not CallbackHandler then return end -- No upgrade needed
6 6
63 -- target - target object to embed public APIs in 63 -- target - target object to embed public APIs in
64 -- RegisterName - name of the callback registration API, default "RegisterCallback" 64 -- RegisterName - name of the callback registration API, default "RegisterCallback"
65 -- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" 65 -- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
66 -- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. 66 -- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
67 67
68 function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused) 68 function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName)
69 -- TODO: Remove this after beta has gone out
70 assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused")
71 69
72 RegisterName = RegisterName or "RegisterCallback" 70 RegisterName = RegisterName or "RegisterCallback"
73 UnregisterName = UnregisterName or "UnregisterCallback" 71 UnregisterName = UnregisterName or "UnregisterCallback"
74 if UnregisterAllName==nil then -- false is used to indicate "don't want this method" 72 if UnregisterAllName==nil then -- false is used to indicate "don't want this method"
75 UnregisterAllName = "UnregisterAllCallbacks" 73 UnregisterAllName = "UnregisterAllCallbacks"