Quantcast

8.0 updates for the Ace Libraries. Apparently this is still being worked on since it's in the Alpha stages.

Xruptor [07-23-18 - 21:28]
8.0 updates for the Ace Libraries.  Apparently this is still being worked on since it's in the Alpha stages.
https://www.wowace.com/projects/ace3/files
Filename
libs/AceAddon-3.0/AceAddon-3.0.lua
libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
libs/AceGUI-3.0/AceGUI-3.0.lua
libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
libs/CallbackHandler-1.0/CallbackHandler-1.0.lua
libs/LibStub/LibStub.lua
diff --git a/libs/AceAddon-3.0/AceAddon-3.0.lua b/libs/AceAddon-3.0/AceAddon-3.0.lua
index a7f7279..e9d4154 100644
--- a/libs/AceAddon-3.0/AceAddon-3.0.lua
+++ b/libs/AceAddon-3.0/AceAddon-3.0.lua
@@ -28,7 +28,7 @@
 -- end
 -- @class file
 -- @name AceAddon-3.0.lua
--- @release $Id: AceAddon-3.0.lua 1084 2013-04-27 20:14:11Z nevcairiel $
+-- @release $Id: AceAddon-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $

 local MAJOR, MINOR = "AceAddon-3.0", 12
 local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@@ -62,43 +62,12 @@ local function errorhandler(err)
 	return geterrorhandler()(err)
 end

-local function CreateDispatcher(argCount)
-	local code = [[
-		local xpcall, eh = ...
-		local method, ARGS
-		local function call() return method(ARGS) end
-
-		local function dispatch(func, ...)
-			 method = func
-			 if not method then return end
-			 ARGS = ...
-			 return xpcall(call, eh)
-		end
-
-		return dispatch
-	]]
-
-	local ARGS = {}
-	for i = 1, argCount do ARGS[i] = "arg"..i end
-	code = code:gsub("ARGS", tconcat(ARGS, ", "))
-	return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
-	local dispatcher = CreateDispatcher(argCount)
-	rawset(self, argCount, dispatcher)
-	return dispatcher
-end})
-Dispatchers[0] = function(func)
-	return xpcall(func, errorhandler)
-end
-
 local function safecall(func, ...)
 	-- we check to see if the func is passed is actually a function here and don't error when it isn't
 	-- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not
 	-- present execution should continue without hinderance
 	if type(func) == "function" then
-		return Dispatchers[select('#', ...)](func, ...)
+		return xpcall(func, errorhandler, ...)
 	end
 end

diff --git a/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
index 66416e8..fb05018 100644
--- a/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
+++ b/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
@@ -1,7 +1,7 @@
 --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
 -- @class file
 -- @name AceConfigDialog-3.0
--- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $
+-- @release $Id: AceConfigDialog-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $

 local LibStub = LibStub
 local gui = LibStub("AceGUI-3.0")
@@ -45,39 +45,10 @@ local function errorhandler(err)
 	return geterrorhandler()(err)
 end

-local function CreateDispatcher(argCount)
-	local code = [[
-		local xpcall, eh = ...
-		local method, ARGS
-		local function call() return method(ARGS) end
-
-		local function dispatch(func, ...)
-			 method = func
-			 if not method then return end
-			 ARGS = ...
-			 return xpcall(call, eh)
-		end
-
-		return dispatch
-	]]
-
-	local ARGS = {}
-	for i = 1, argCount do ARGS[i] = "arg"..i end
-	code = code:gsub("ARGS", tconcat(ARGS, ", "))
-	return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
-	local dispatcher = CreateDispatcher(argCount)
-	rawset(self, argCount, dispatcher)
-	return dispatcher
-end})
-Dispatchers[0] = function(func)
-	return xpcall(func, errorhandler)
-end
-
 local function safecall(func, ...)
-	return Dispatchers[select("#", ...)](func, ...)
+	if func then
+		return xpcall(func, errorhandler, ...)
+	end
 end

 local width_multiplier = 170
diff --git a/libs/AceGUI-3.0/AceGUI-3.0.lua b/libs/AceGUI-3.0/AceGUI-3.0.lua
index 08904e4..e5c6aba 100644
--- a/libs/AceGUI-3.0/AceGUI-3.0.lua
+++ b/libs/AceGUI-3.0/AceGUI-3.0.lua
@@ -24,7 +24,7 @@
 -- f:AddChild(btn)
 -- @class file
 -- @name AceGUI-3.0
--- @release $Id: AceGUI-3.0.lua 1177 2018-06-25 12:12:48Z nevcairiel $
+-- @release $Id: AceGUI-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $
 local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 36
 local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)

@@ -66,39 +66,10 @@ local function errorhandler(err)
 	return geterrorhandler()(err)
 end

-local function CreateDispatcher(argCount)
-	local code = [[
-		local xpcall, eh = ...
-		local method, ARGS
-		local function call() return method(ARGS) end
-
-		local function dispatch(func, ...)
-			method = func
-			if not method then return end
-			ARGS = ...
-			return xpcall(call, eh)
-		end
-
-		return dispatch
-	]]
-
-	local ARGS = {}
-	for i = 1, argCount do ARGS[i] = "arg"..i end
-	code = code:gsub("ARGS", tconcat(ARGS, ", "))
-	return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
-	local dispatcher = CreateDispatcher(argCount)
-	rawset(self, argCount, dispatcher)
-	return dispatcher
-end})
-Dispatchers[0] = function(func)
-	return xpcall(func, errorhandler)
-end
-
 local function safecall(func, ...)
-	return Dispatchers[select("#", ...)](func, ...)
+	if func then
+		return xpcall(func, errorhandler, ...)
+	end
 end

 -- Recycling functions
diff --git a/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua b/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
index 9afb54b..a95579d 100644
--- a/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
@@ -2,7 +2,7 @@
 ScrollFrame Container
 Plain container that scrolls its content and doesn't grow in height.
 -------------------------------------------------------------------------------]]
-local Type, Version = "ScrollFrame", 24
+local Type, Version = "ScrollFrame", 25
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

@@ -128,6 +128,11 @@ local methods = {

 	["LayoutFinished"] = function(self, width, height)
 		self.content:SetHeight(height or 0 + 20)
+
+		-- update the scrollframe
+		self:FixScroll()
+
+		-- schedule another update when everything has "settled"
 		self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
 	end,

diff --git a/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua b/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
index 44cab23..e34debf 100644
--- a/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
+++ b/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
@@ -1,7 +1,7 @@
 --[[-----------------------------------------------------------------------------
 Checkbox Widget
 -------------------------------------------------------------------------------]]
-local Type, Version = "CheckBox", 24
+local Type, Version = "CheckBox", 25
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

@@ -26,7 +26,7 @@ local function AlignImage(self)
 		self.text:SetPoint("LEFT", self.checkbg, "RIGHT")
 		self.text:SetPoint("RIGHT")
 	else
-		self.text:SetPoint("LEFT", self.checkbg, "RIGHT", self.image:GetWidth() + 2, 0)
+		self.text:SetPoint("LEFT", self.image, "RIGHT", 1, 0)
 		self.text:SetPoint("RIGHT")
 	end
 end
diff --git a/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua b/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua
index 675d7b0..a8377fe 100644
--- a/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua
+++ b/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua
@@ -1,5 +1,5 @@
---[[ $Id: CallbackHandler-1.0.lua 1131 2015-06-04 07:29:24Z nevcairiel $ ]]
-local MAJOR, MINOR = "CallbackHandler-1.0", 6
+--[[ $Id: CallbackHandler-1.0.lua 1186 2018-07-21 14:19:18Z nevcairiel $ ]]
+local MAJOR, MINOR = "CallbackHandler-1.0", 7
 local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)

 if not CallbackHandler then return end -- No upgrade needed
@@ -22,41 +22,15 @@ local function errorhandler(err)
 	return geterrorhandler()(err)
 end

-local function CreateDispatcher(argCount)
-	local code = [[
-	local next, xpcall, eh = ...
-
-	local method, ARGS
-	local function call() method(ARGS) end
-
-	local function dispatch(handlers, ...)
-		local index
-		index, method = next(handlers)
-		if not method then return end
-		local OLD_ARGS = ARGS
-		ARGS = ...
-		repeat
-			xpcall(call, eh)
-			index, method = next(handlers, index)
-		until not method
-		ARGS = OLD_ARGS
-	end
-
-	return dispatch
-	]]
-
-	local ARGS, OLD_ARGS = {}, {}
-	for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end
-	code = code:gsub("OLD_ARGS", tconcat(OLD_ARGS, ", ")):gsub("ARGS", tconcat(ARGS, ", "))
-	return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler)
+local function Dispatch(handlers, ...)
+	local index, method = next(handlers)
+	if not method then return end
+	repeat
+		xpcall(method, errorhandler, ...)
+		index, method = next(handlers, index)
+	until not method
 end

-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
-	local dispatcher = CreateDispatcher(argCount)
-	rawset(self, argCount, dispatcher)
-	return dispatcher
-end})
-
 --------------------------------------------------------------------------
 -- CallbackHandler:New
 --
@@ -87,7 +61,7 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
 		local oldrecurse = registry.recurse
 		registry.recurse = oldrecurse + 1

-		Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...)
+		Dispatch(events[eventname], eventname, ...)

 		registry.recurse = oldrecurse

diff --git a/libs/LibStub/LibStub.lua b/libs/LibStub/LibStub.lua
index 7e9b5cd..0a41ac0 100644
--- a/libs/LibStub/LibStub.lua
+++ b/libs/LibStub/LibStub.lua
@@ -1,22 +1,13 @@
--- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $
--- LibStub is a simple versioning stub meant for use in Libraries.  http://www.wowace.com/addons/libstub/ for more info
--- LibStub is hereby placed in the Public Domain
--- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+-- LibStub is a simple versioning stub meant for use in Libraries.  http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
 local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2  -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
 local LibStub = _G[LIBSTUB_MAJOR]

--- Check to see is this version of the stub is obsolete
 if not LibStub or LibStub.minor < LIBSTUB_MINOR then
 	LibStub = LibStub or {libs = {}, minors = {} }
 	_G[LIBSTUB_MAJOR] = LibStub
 	LibStub.minor = LIBSTUB_MINOR

-	-- LibStub:NewLibrary(major, minor)
-	-- major (string) - the major version of the library
-	-- minor (string or number ) - the minor version of the library
-	--
-	-- returns nil if a newer or same version of the lib is already present
-	-- returns empty library object or old library object if upgrade is needed
 	function LibStub:NewLibrary(major, minor)
 		assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
 		minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
@@ -27,12 +18,6 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
 		return self.libs[major], oldminor
 	end

-	-- LibStub:GetLibrary(major, [silent])
-	-- major (string) - the major version of the library
-	-- silent (boolean) - if true, library is optional, silently return nil if its not found
-	--
-	-- throws an error if the library can not be found (except silent is set)
-	-- returns the library object if found
 	function LibStub:GetLibrary(major, silent)
 		if not self.libs[major] and not silent then
 			error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
@@ -40,12 +25,6 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
 		return self.libs[major], self.minors[major]
 	end

-	-- LibStub:IterateLibraries()
-	--
-	-- Returns an iterator for the currently registered libraries
-	function LibStub:IterateLibraries()
-		return pairs(self.libs)
-	end
-
+	function LibStub:IterateLibraries() return pairs(self.libs) end
 	setmetatable(LibStub, { __call = LibStub.GetLibrary })
 end