<commit_before>--[[------------------------------------------------
	-- Love Frames - A GUI library for LOVE --
	-- Copyright (c) 2013 <NAME> --
--]]------------------------------------------------

local path = ...

-- central library table
loveframes = {}

-- library info
loveframes.author = "<NAME>"
loveframes.version = "0.9.7"
loveframes.stage = "Alpha"

-- library configurations
loveframes.config = {}
loveframes.config["DIRECTORY"] = nil
loveframes.config["DEFAULTSKIN"] = "Blue"
loveframes.config["ACTIVESKIN"] = "Blue"
loveframes.config["INDEXSKINIMAGES"] = true
loveframes.config["DEBUG"] = false

-- misc library vars
loveframes.state = "none"
loveframes.drawcount = 0
loveframes.collisioncount = 0
loveframes.objectcount = 0
loveframes.hoverobject = false
loveframes.modalobject = false
loveframes.inputobject = false
loveframes.downobject = false
loveframes.resizeobject = false
loveframes.hover = false
loveframes.input_cursor_set = false
loveframes.prevcursor = nil
loveframes.basicfont = love.graphics.newFont(12)
loveframes.basicfontsmall = love.graphics.newFont(10)
loveframes.objects = {}
loveframes.collisions = {}

--[[---------------------------------------------------------
	- func: load()
	- desc: loads the library
--]]---------------------------------------------------------
function loveframes.load()
	
	local loveversion = love._version
	
    --[[
	if loveversion ~= "0.8.0" and loveversion ~= "0.9.0" then
		error("Love Frames is not compatible with your version of LOVE.")
	end
    ]]--
	
	-- install directory of the library
	local dir = loveframes.config["DIRECTORY"] or path
	
	-- require the internal base libraries
	loveframes.class = require(dir .. ".third-party.middleclass")
	require(dir .. ".util")
	require(dir .. ".skins")
	require(dir .. ".templates")
	require(dir .. ".debug")
	
	-- replace all "." with "/" in the directory setting
	dir = dir:gsub("\\", "/"):gsub("(%a)%.(%a)", "%1/%2")
	loveframes.config["DIRECTORY"] = dir
	
	-- create a list of gui objects, skins and templates
	local objects = loveframes.util.GetDirectoryContents(dir .. "/objects")
	local skins = loveframes.util.GetDirectoryContents(dir .. "/skins")
	local templates = loveframes.util.GetDirectoryContents(dir .. "/templates")
	
	-- loop through a list of all gui objects and require them
	for k, v in ipairs(objects) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- loop through a list of all gui templates and require them
	for k, v in ipairs(templates) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- loop through a list of all gui skins and require them
	for k, v in ipairs(skins) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- create the base gui object
	local base = loveframes.objects["base"]
	loveframes.base = base:new()
	
end

--[[---------------------------------------------------------
	- func: update(deltatime)
	- desc: updates all library objects
--]]---------------------------------------------------------
function loveframes.update(dt)

	local base = loveframes.base
	local input_cursor_set = loveframes.input_cursor_set
	local version = love._version
	
	loveframes.collisioncount = 0
	loveframes.objectcount = 0
	loveframes.hover = false
	loveframes.hoverobject = false
	
	local downobject = loveframes.downobject
	if #loveframes.collisions > 0 then
		local top = loveframes.collisions[#loveframes.collisions]
		if not downobject then
			loveframes.hoverobject = top
		else
			if downobject == top then
				loveframes.hoverobject = top
			end
		end
	end
	
	if version == "0.9.0" then
		local hoverobject = loveframes.hoverobject
		local arrow = love.mouse.getSystemCursor("arrow")
		local curcursor = love.mouse.getCursor()
		if hoverobject then
			local ibeam = love.mouse.getSystemCursor("ibeam")
			local mx, my = love.mouse.getPosition()
			if hoverobject.type == "textinput" and not loveframes.resizeobject then
				if curcursor ~= ibeam then
					love.mouse.setCursor(ibeam)
				end
			elseif hoverobject.type == "frame" then
				if not hoverobject.dragging and hoverobject.canresize then
					if loveframes.util.BoundingBox(hoverobject.x, mx, hoverobject.y, my, 5, 1, 5, 1) then
						local sizenwse = love.mouse.getSystemCursor("sizenwse")
						if curcursor ~= sizenwse then
							love.mouse.setCursor(sizenwse)
						end
					elseif loveframes.util.BoundingBox(hoverobject.x + hoverobject.width - 5, mx, hoverobject.y + hoverobject.height - 5, my, 5, 1, 5, 1) then
						local sizenwse = love.mouse.getSystemCursor("sizenwse")<commit_msg>Added cross-version compatibility<commit_after>--[[------------------------------------------------
	-- Love Frames - A GUI library for LOVE --
	-- Copyright (c) 2013 <NAME> --
--]]------------------------------------------------

local path = ...

-- central library table
loveframes = {}

-- library info
loveframes.author = "<NAME>"
loveframes.version = "0.9.7"
loveframes.stage = "Alpha"

-- library configurations
loveframes.config = {}
loveframes.config["DIRECTORY"] = nil
loveframes.config["DEFAULTSKIN"] = "Blue"
loveframes.config["ACTIVESKIN"] = "Blue"
loveframes.config["INDEXSKINIMAGES"] = true
loveframes.config["DEBUG"] = false

-- misc library vars
loveframes.state = "none"
loveframes.drawcount = 0
loveframes.collisioncount = 0
loveframes.objectcount = 0
loveframes.hoverobject = false
loveframes.modalobject = false
loveframes.inputobject = false
loveframes.downobject = false
loveframes.resizeobject = false
loveframes.hover = false
loveframes.input_cursor_set = false
loveframes.prevcursor = nil
loveframes.basicfont = love.graphics.newFont(12)
loveframes.basicfontsmall = love.graphics.newFont(10)
loveframes.objects = {}
loveframes.collisions = {}

--[[---------------------------------------------------------
	- func: load()
	- desc: loads the library
--]]---------------------------------------------------------
function loveframes.load()
	
	local loveversion = love._version
	
    --[[
	if loveversion ~= "0.8.0" and loveversion ~= "0.9.0" then
		error("Love Frames is not compatible with your version of LOVE.")
	end
    ]]--
	
	-- install directory of the library
	local dir = loveframes.config["DIRECTORY"] or path
	
	-- require the internal base libraries
	loveframes.class = require(dir .. ".third-party.middleclass")
	require(dir .. ".util")
	require(dir .. ".skins")
	require(dir .. ".templates")
	require(dir .. ".debug")
	
	-- replace all "." with "/" in the directory setting
	dir = dir:gsub("\\", "/"):gsub("(%a)%.(%a)", "%1/%2")
	loveframes.config["DIRECTORY"] = dir
	
	-- create a list of gui objects, skins and templates
	local objects = loveframes.util.GetDirectoryContents(dir .. "/objects")
	local skins = loveframes.util.GetDirectoryContents(dir .. "/skins")
	local templates = loveframes.util.GetDirectoryContents(dir .. "/templates")
	
	-- loop through a list of all gui objects and require them
	for k, v in ipairs(objects) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- loop through a list of all gui templates and require them
	for k, v in ipairs(templates) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- loop through a list of all gui skins and require them
	for k, v in ipairs(skins) do
		if v.extension == "lua" then
			require(v.requirepath)
		end
	end
	
	-- create the base gui object
	local base = loveframes.objects["base"]
	loveframes.base = base:new()
	
end

--[[---------------------------------------------------------
	- func: update(deltatime)
	- desc: updates all library objects
--]]---------------------------------------------------------
function loveframes.update(dt)

	local base = loveframes.base
	local input_cursor_set = loveframes.input_cursor_set
	local version = love._version
	
	loveframes.collisioncount = 0
	loveframes.objectcount = 0
	loveframes.hover = false
	loveframes.hoverobject = false
	
	local downobject = loveframes.downobject
	if #loveframes.collisions > 0 then
		local top = loveframes.collisions[#loveframes.collisions]
		if not downobject then
			loveframes.hoverobject = top
		else
			if downobject == top then
				loveframes.hoverobject = top
			end
		end
	end
	
	if version == "0.9.0" or version == "0.9.1" or version == "0.9.2" then
		local hoverobject = loveframes.hoverobject
		local arrow = love.mouse.getSystemCursor("arrow")
		local curcursor = love.mouse.getCursor()
		if hoverobject then
			local ibeam = love.mouse.getSystemCursor("ibeam")
			local mx, my = love.mouse.getPosition()
			if hoverobject.type == "textinput" and not loveframes.resizeobject then
				if curcursor ~= ibeam then
					love.mouse.setCursor(ibeam)
				end
			elseif hoverobject.type == "frame" then
				if not hoverobject.dragging and hoverobject.canresize then
					if loveframes.util.BoundingBox(hoverobject.x, mx, hoverobject.y, my, 5, 1, 5, 1) then
						local sizenwse = love.mouse.getSystemCursor("sizenwse")
						if curcursor ~= sizenwse then
							love.mouse.setCursor(sizenwse)
						end
					elseif loveframes.util.BoundingBox(hoverobject.x + hoverobject.width - 5, mx, hoverobject.y + hoverobject.height - 5, my, 5, 1, 5, 1) then
						local sizenwse = love.mouse.getSystemCursor("sizenwse")
{'fraction_non_alphanumeric': 0.1831887201735358, 'fraction_numerical': 0.008893709327548807, 'mean_word_length': 2.7483739837398375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4887737', 'n_tokens_mistral': 2989, 'n_tokens_neox': 2718, 'n_words': 763}