#==============================================================================
# ** API
#==============================================================================
module API
#-------------------------------------------------------------------------
# * Name : Current API Module Version
# Author : SephirothSpawn
# Call Info : API Arguments, Function Arguments
#-------------------------------------------------------------------------
def self.call(api_arguments, function_arguments)
# Gets instance name
instance_name = "@#{api_arguments[1]}"
# Gets instance variable
instance = eval instance_name
# If nil instance variable
if instance.nil?
p 'create'
# Create instance variable
eval "#{instance_name} = Win32API.new(*api_arguments)"
end
# Get instance variable
instance = eval instance_name
# Call Instance
instance.call(*function_arguments)
end
end
#==============================================================================
# ** API::User32
#==============================================================================
module API::User32
#-------------------------------------------------------------------------
# * Name : ClipCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : lpRectAsAny)AsLong
#-------------------------------------------------------------------------
def self.ClipCursor(*args)
API.call(['user32', 'ClipCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : CopyCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValhcurAsLong)AsLong
#-------------------------------------------------------------------------
def self.CopyCursor(*args)
API.call(['user32', 'CopyCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : CreateCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValhInstanceAsLong
# ByValnXhotspotAsLong
# ByValnYhotspotAsLong
# ByValnWidthAsLong
# ByValnHeightAsLong
# lpANDbitPlaneAsAny
# lpXORbitPlaneAsAny)AsLong
#-------------------------------------------------------------------------
def self.CreateCursor(*args)
API.call(['user32', 'CreateCursor', 'PPPPPPP', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : DestroyCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValhCursorAsLong)AsLong
#-------------------------------------------------------------------------
def self.DestroyCursor(*args)
API.call(['user32', 'DestroyCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : GetClipCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : lprcAsRECT)AsLong
#-------------------------------------------------------------------------
def self.GetClipCursor(*args)
API.call(['user32', 'GetClipCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : GetCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : )AsLong
#-------------------------------------------------------------------------
def self.GetCursor(*args)
API.call(['user32', 'GetCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : GetCursorInfo
# Author : SephirothSpawn & rpgmaker
# Call Info : ByRefpciAsPCURSORINFO)AsLong
#-------------------------------------------------------------------------
def self.GetCursorInfo(*args)
API.call(['user32', 'GetCursorInfo', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : GetCursorPos
# Author : SephirothSpawn & rpgmaker
# Call Info : lpPointAsPOINTAPI)AsLong
#-------------------------------------------------------------------------
def self.GetCursorPos(*args)
API.call(['user32', 'GetCursorPos', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : LoadCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : Alias"LoadCursorA"ByValhInstanceAsLong
# ByVallpCursorNameAsString)AsLong
#-------------------------------------------------------------------------
def self.LoadCursor(*args)
API.call(['user32', 'LoadCursor', 'PP', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : LoadCursorFromFile
# Author : SephirothSpawn & rpgmaker
# Call Info : Alias"LoadCursorFromFileA"ByVallpFileNameAsString)AsLong
#-------------------------------------------------------------------------
def self.LoadCursorFromFile(*args)
API.call(['user32', 'LoadCursorFromFile', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : SetCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValhCursorAsLong)AsLong
#-------------------------------------------------------------------------
def self.SetCursor(*args)
API.call(['user32', 'SetCursor', 'P', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : SetCursorPos
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValxAsLong
# ByValyAsLong)AsLong
#-------------------------------------------------------------------------
def self.SetCursorPos(*args)
API.call(['user32', 'SetCursorPos', 'PP', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : SetSystemCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValhcurAsLong
# ByValidAsLong)AsLong
#-------------------------------------------------------------------------
def self.SetSystemCursor(*args)
API.call(['user32', 'SetSystemCursor', 'PP', 'L'], args)
end
#-------------------------------------------------------------------------
# * Name : ShowCursor
# Author : SephirothSpawn & rpgmaker
# Call Info : ByValbShowAsLong)AsLong
#-------------------------------------------------------------------------
def self.ShowCursor(*args)
API.call(['user32', 'ShowCursor', 'P', 'L'], args)
end
end