WoWInterface SVN BrokerFactions

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/Broker_Factions/libs/LibQTip-1.0
    from Rev 52 to Rev 53
    Reverse comparison

Rev 52 → Rev 53

LibQTip-1.0.lua
1,5 → 1,5
local MAJOR = "LibQTip-1.0"
local MINOR = 28 -- Should be manually increased
local MINOR = 29 -- Should be manually increased
assert(LibStub, MAJOR.." requires LibStub")
 
local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
68,9 → 68,9
------------------------------------------------------------------------------
-- Cache debugging.
------------------------------------------------------------------------------
--[===[@debug@
--@debug@
local usedTables, usedFrames, usedTooltips = 0, 0, 0
--@end-debug@]===]
--@end-debug@
 
------------------------------------------------------------------------------
-- Internal constants to tweak the layout
130,9 → 130,9
local function AcquireFrame(parent)
local frame = tremove(frameHeap) or CreateFrame("Frame")
frame:SetParent(parent)
--[===[@debug@
--@debug@
usedFrames = usedFrames + 1
--@end-debug@]===]
--@end-debug@
return frame
end
 
143,9 → 143,9
frame:SetBackdrop(nil)
ClearFrameScripts(frame)
tinsert(frameHeap, frame)
--[===[@debug@
--@debug@
usedFrames = usedFrames - 1
--@end-debug@]===]
--@end-debug@
end
 
------------------------------------------------------------------------------
283,9 → 283,9
tooltip.scrollChild = scrollChild
setmetatable(tooltip, tipMetatable)
end
--[===[@debug@
--@debug@
usedTooltips = usedTooltips + 1
--@end-debug@]===]
--@end-debug@
return tooltip
end
 
311,9 → 311,9
 
layoutCleaner.registry[tooltip] = nil
tinsert(tooltipHeap, tooltip)
--[===[@debug@
--@debug@
usedTooltips = usedTooltips - 1
--@end-debug@]===]
--@end-debug@
end
 
------------------------------------------------------------------------------
333,6 → 333,7
cell:Hide()
cell:ClearAllPoints()
cell:SetParent(nil)
cell:SetBackdrop(nil)
ClearFrameScripts(cell)
cell._font, cell._justification, cell._colSpan, cell._line, cell._column = nil
 
348,9 → 349,9
-- Returns a table
function AcquireTable()
local tbl = tremove(tableHeap) or {}
--[===[@debug@
--@debug@
usedTables = usedTables + 1
--@end-debug@]===]
--@end-debug@
return tbl
end
 
358,9 → 359,9
function ReleaseTable(table)
wipe(table)
tinsert(tableHeap, table)
--[===[@debug@
--@debug@
usedTables = usedTables - 1
--@end-debug@]===]
--@end-debug@
end
 
------------------------------------------------------------------------------
791,28 → 792,34
return lineNum, colNum
end
 
function tipPrototype:SetCellColor(lineNum, colNum, r, g, b, a)
local cell = self.lines[lineNum].cells[colNum]
 
if cell then
local sr, sg, sb, sa = self:GetBackdropColor()
cell:SetBackdrop(GenericBackdrop)
cell:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
end
end
 
function tipPrototype:SetColumnColor(colNum, r, g, b, a)
if type(colNum) ~= "number" then
error("column number must be a number, not: "..tostring(colNum), 2)
elseif colNum < 1 or colNum > #self.columns then
error("column number out of range: "..tostring(colNum), 2)
local column = self.columns[colNum]
 
if column then
local sr, sg, sb, sa = self:GetBackdropColor()
column:SetBackdrop(GenericBackdrop)
column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
end
local column = self.columns[colNum]
local sr, sg, sb, sa = self:GetBackdropColor()
column:SetBackdrop(GenericBackdrop)
column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
end
 
function tipPrototype:SetLineColor(lineNum, r, g, b, a)
if type(lineNum) ~= "number" then
error("line number must be a number, not: "..tostring(lineNum), 2)
elseif lineNum < 1 or lineNum > #self.lines then
error("line number out of range: "..tostring(lineNum), 2)
local line = self.lines[lineNum]
 
if line then
local sr, sg, sb, sa = self:GetBackdropColor()
line:SetBackdrop(GenericBackdrop)
line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
end
local line = self.lines[lineNum]
local sr, sg, sb, sa = self:GetBackdropColor()
line:SetBackdrop(GenericBackdrop)
line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
end
 
-- TODO: fixed argument positions / remove checks for performance?
1019,7 → 1026,7
------------------------------------------------------------------------------
-- Debug slashcmds
------------------------------------------------------------------------------
--[===[@debug@
--@debug@
local print = print
local function PrintStats()
local tipCache = tostring(#tooltipHeap)
1042,4 → 1049,4
 
SLASH_LibQTip1 = "/qtip"
SlashCmdList["LibQTip"] = PrintStats
--@end-debug@]===]
--@end-debug@