Mercurial > wow > askmrrobot
comparison Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua @ 106:e635cd648e01 v49
7.2 update
author | yellowfive |
---|---|
date | Tue, 28 Mar 2017 16:10:00 -0700 |
parents | 01b63b8ed811 |
children |
comparison
equal
deleted
inserted
replaced
105:3ce266c86bd3 | 106:e635cd648e01 |
---|---|
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" |