WoWInterface SVN NeedyGreedy

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/libs
    from Rev 140 to Rev 145
    Reverse comparison

Rev 140 → Rev 145

AceTimer-3.0/AceTimer-3.0.lua
15,7 → 15,7
-- make into AceTimer.
-- @class file
-- @name AceTimer-3.0
-- @release $Id: AceTimer-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $
-- @release $Id: AceTimer-3.0.lua 1037 2011-09-02 16:24:08Z mikk $
 
--[[
Basic assumptions:
36,7 → 36,7
- ALLOWS unscheduling ANY timer (including the current running one) at any time, including during OnUpdate processing
]]
 
local MAJOR, MINOR = "AceTimer-3.0", 5
local MAJOR, MINOR = "AceTimer-3.0", 6
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
if not AceTimer then return end -- No upgrade needed
402,7 → 402,7
 
-- Time to clean it out?
local list = selfs[self]
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (max!). For one 'self'.
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (worst case!). For one 'self'.
return
end
 
411,7 → 411,9
local n=0
for k,v in pairs(list) do
newlist[k] = v
n=n+1
if type(v)=="table" and v.callback then -- if the timer is actually live: count it
n=n+1
end
end
newlist.__ops = 0 -- Reset operation count
 
468,6 → 470,6
AceTimer.frame:SetScript("OnEvent", OnEvent)
AceTimer.frame:RegisterEvent("PLAYER_REGEN_ENABLED")
 
-- In theory, we should hide&show the frame based on there being timers or not.
-- In theory, we could hide&show the frame based on there being timers or not.
-- However, this job is fairly expensive, and the chance that there will
-- actually be zero timers running is diminuitive to say the lest.
-- actually be zero timers running is diminuitive to say the least.
AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
1,7 → 1,7
--[[-----------------------------------------------------------------------------
Frame Container
-------------------------------------------------------------------------------]]
local Type, Version = "Frame", 22
local Type, Version = "Frame", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
 
127,6 → 127,13
self.frame:Show()
end,
 
["EnableResize"] = function(self, state)
local func = state and "Show" or "Hide"
self.sizer_se[func](self.sizer_se)
self.sizer_s[func](self.sizer_s)
self.sizer_e[func](self.sizer_e)
end,
 
-- called to set an external table to store status in
["SetStatusTable"] = function(self, status)
assert(type(status) == "table")
285,6 → 292,9
titletext = titletext,
statustext = statustext,
titlebg = titlebg,
sizer_se = sizer_se,
sizer_s = sizer_s,
sizer_e = sizer_e,
content = content,
frame = frame,
type = Type
AceAddon-3.0/AceAddon-3.0.lua
28,9 → 28,9
-- end
-- @class file
-- @name AceAddon-3.0.lua
-- @release $Id: AceAddon-3.0.lua 980 2010-10-27 14:20:11Z nevcairiel $
-- @release $Id: AceAddon-3.0.lua 1036 2011-08-16 22:45:05Z nevcairiel $
 
local MAJOR, MINOR = "AceAddon-3.0", 10
local MAJOR, MINOR = "AceAddon-3.0", 11
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
if not AceAddon then return end -- No Upgrade needed.
619,7 → 619,8
 
-- Event Handling
local function onEvent(this, event, arg1)
if event == "ADDON_LOADED" or event == "PLAYER_LOGIN" then
-- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up
if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then
-- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration
while(#AceAddon.initializequeue > 0) do
local addon = tremove(AceAddon.initializequeue, 1)
AceDB-3.0/AceDB-3.0.lua
39,8 → 39,8
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 940 2010-06-19 08:01:47Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 21
-- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
 
if not AceDB then return end -- No upgrade needed
260,6 → 260,9
local _, raceKey = UnitRace("player")
local factionKey = UnitFactionGroup("player")
local factionrealmKey = factionKey .. " - " .. realmKey
local factionrealmregionKey = factionrealmKey .. " - " .. string.sub(GetCVar("realmList"), 1, 2):upper()
local localeKey = GetLocale():lower()
 
-- Actual database initialization function
local function initdb(sv, defaults, defaultProfile, olddb, parent)
-- Generate the database keys for each section
295,7 → 298,9
["race"] = raceKey,
["faction"] = factionKey,
["factionrealm"] = factionrealmKey,
["factionrealmregion"] = factionrealmregionKey,
["profile"] = profileKey,
["locale"] = localeKey,
["global"] = true,
["profiles"] = true,
}
352,7 → 357,7
for db in pairs(AceDB.db_registry) do
db.callbacks:Fire("OnDatabaseShutdown", db)
db:RegisterDefaults(nil)
 
 
-- cleanup sections that are empty without defaults
local sv = rawget(db, "sv")
for section in pairs(db.keys) do
LibQTip-1.0/LibStub/tests/test.lua New file
0,0 → 1,41
debugstack = debug.traceback
strmatch = string.match
 
loadfile("../LibStub.lua")()
 
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
assert(lib) -- should return the library table
assert(not oldMinor) -- should not return the old minor, since it didn't exist
 
-- the following is to create data and then be able to check if the same data exists after the fact
function lib:MyMethod()
end
local MyMethod = lib.MyMethod
lib.MyTable = {}
local MyTable = lib.MyTable
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
assert(not newLib) -- should not return since out of date
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
assert(not newLib) -- should not return since out of date
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
assert(newLib) -- library table
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
assert(newOldMinor == 1) -- should return the minor version of the previous version
 
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
assert(newLib) -- library table
assert(newOldMinor == 2) -- previous version was 2
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
assert(newLib)
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
 
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
assert(newLib)
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
\ No newline at end of file
LibQTip-1.0/LibStub/tests/test2.lua New file
0,0 → 1,27
debugstack = debug.traceback
strmatch = string.match
 
loadfile("../LibStub.lua")()
 
for major, library in LibStub:IterateLibraries() do
-- check that MyLib doesn't exist yet, by iterating through all the libraries
assert(major ~= "MyLib")
end
 
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
assert(lib) -- check it exists
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
 
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
 
local count=0
for major, library in LibStub:IterateLibraries() do
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
if major == "MyLib" then -- we found it!
count = count +1
assert(rawequal(library, lib)) -- verify that the references are equal
end
end
assert(count == 1) -- verify that we actually found it, and only once
LibQTip-1.0/LibStub/tests/test3.lua New file
0,0 → 1,14
debugstack = debug.traceback
strmatch = string.match
 
loadfile("../LibStub.lua")()
 
local proxy = newproxy() -- non-string
 
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
 
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
 
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
\ No newline at end of file
LibQTip-1.0/LibStub/tests/test4.lua New file
0,0 → 1,41
debugstack = debug.traceback
strmatch = string.match
 
loadfile("../LibStub.lua")()
 
 
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
assert(LibStub.minor)
LibStub.minor = LibStub.minor - 0.0001
LibStub.IterateLibraries = nil
 
loadfile("../LibStub.lua")()
 
assert(type(LibStub.IterateLibraries)=="function")
 
 
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
LibStub.IterateLibraries = 123
 
loadfile("../LibStub.lua")()
 
assert(LibStub.IterateLibraries == 123)
 
 
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
LibStub.minor = LibStub.minor + 0.0001
 
loadfile("../LibStub.lua")()
 
assert(LibStub.IterateLibraries == 123)
 
 
-- Again with a huge number
LibStub.minor = LibStub.minor + 1234567890
 
loadfile("../LibStub.lua")()
 
assert(LibStub.IterateLibraries == 123)
 
 
print("OK")
\ No newline at end of file
LibQTip-1.0/Changelog-LibQTip-1.0-r152-release.txt New file
0,0 → 1,13
------------------------------------------------------------------------
r152 | torhal | 2011-04-27 08:11:19 +0000 (Wed, 27 Apr 2011) | 1 line
Changed paths:
A /tags/r152-release (from /trunk:151)
 
Tagging as r152-release
------------------------------------------------------------------------
r151 | torhal | 2011-04-27 08:09:30 +0000 (Wed, 27 Apr 2011) | 1 line
Changed paths:
M /trunk/LibQTip-1.0.toc
 
Updated ToC version for WoW 4.1
------------------------------------------------------------------------
AceLocale-3.0/AceLocale-3.0.lua
1,8 → 1,8
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
-- @class file
-- @name AceLocale-3.0
-- @release $Id: AceLocale-3.0.lua 1005 2011-01-29 14:19:43Z mikk $
local MAJOR,MINOR = "AceLocale-3.0", 5
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
local MAJOR,MINOR = "AceLocale-3.0", 6
 
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
10,7 → 10,7
 
-- Lua APIs
local assert, tostring, error = assert, tostring, error
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
 
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
56,10 → 56,10
__index = assertfalse
})
 
-- This metatable proxy is used when registering the default locale.
-- This metatable proxy is used when registering the default locale.
-- It refuses to overwrite existing values
-- Reason 1: Allows loading locales in any order
-- Reason 2: If 2 modules have the same string, but only the first one to be
-- Reason 2: If 2 modules have the same string, but only the first one to be
-- loaded has a translation for the current locale, the translation
-- doesn't get overwritten.
--
91,16 → 91,16
-- L["string1"] = "Zeichenkette1"
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
function AceLocale:NewLocale(application, locale, isDefault, silent)
 
 
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
local gameLocale = GAME_LOCALE or gameLocale
 
local app = AceLocale.apps[application]
 
if silent and app then
 
if silent and app and getmetatable(app) ~= readmetasilent then
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
end
 
 
if not app then
if silent=="raw" then
app = {}
110,13 → 110,13
AceLocale.apps[application] = app
AceLocale.appnames[app] = application
end
 
 
if locale ~= gameLocale and not isDefault then
return -- nop, we don't need these translations
end
 
 
registering = app -- remember globally for writeproxy and writedefaultproxy
 
 
if isDefault then
return writedefaultproxy
end