c# pdf viewer open source : Change pdf page order reader application SDK utility azure wpf web page visual studio World%20of%20Warcraft%20Programming%20(2nd%20Edition)58-part1858

CHA P T ER
27
API Reference
The WorldofWarcraft APIcontainsmorethanathousandfunctionsthat canbeused
to interact withthe game client,and obtain information about the state ofthe game.
This chapter includes an alphabetic listing of each of these functions with detailed
descriptionsofwhat eachfunctiondoes,what argumentsittakes,andwhat valuesit
returnstothe caller.
Although all efforts were made to provide the most up-to-date listing of func-
tions, the API is a constantly moving target, changing from patch to patch. For
the most current listing of the API please visit the book’s companion website
at http://wowprogramming.com/docs. Information about upcoming changes to
the API can be found on the official World of Warcraft UI & Macros Forums:
http://forums.worldofwarcraft.com/board.html?forumId=11114.
API Reference Conventions
Following each function is a description of what the function does, along with
the function signature, followed by any arguments, returns, or example snippets
ofcode.
Function Signatures
A function signature is a short way to express the name of a function, the argu-
ments that the function expects to be called with, and any values that the function
mayreturn.Considerthefollowing signature fortheCalculateAuctionDeposit()
function:
deposit = CalculateAuctionDeposit(runTime)
539
Change pdf page order reader - re-order PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Support Customizing Page Order of PDF Document in C# Project
reordering pdf pages; how to move pages in pdf reader
Change pdf page order reader - VB.NET PDF Page Move Library: re-order PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sort PDF Document Pages Using VB.NET Demo Code
move pages in pdf reader; how to reorder pdf pages in reader
540
Part IV
Reference
Thisnotationindicatesthat the functionacceptsasingle argument calledrunTime,
andreturnsasinglevaluecalleddeposit.Thesearen’t requirementsfornames:they
are simply names given toeach of the arguments and returns,to makethe signature
easiertoreadandunderstand.
Ifafunctionsignatureisomitted,thenthefunctiontakesnoarguments,andreturns
no values. This is equivalent to the function signature FunctionName(), so these
signaturesarenotlisted.
Optional Arguments
Whenasignaturecontainsanoptionalargument,it iswrappedinsquare bracketsto
indicate this.Here’sthe functionsignatureforBuyMerchantItem():
BuyMerchantItem(index [,quantity])
Thissignatureshowsthatthefunctionreturnsnoargumentsandtakesanargument
index,alongwithanoptionalargument quantity.Thespecificdetailsofwhatthe
optional argument does are listed in the description for that argument, which is
displayedbelowthesignature.
Functionscanhavemultiplenestedoptionalarguments,likeSendChatMessage():
SendChatMessage(“text“ [,“chatType“ [,“language“ [,“channel“]]])
Thisfunction requiresthe first argumenttext,but canalso take up to three more
arguments.Theoptionalargumentsarenestedinthiswaybecausetoincludetheargu-
mentlanguage,youmustalsoincludesomethingforchatType(evenifit’sthe value
nil). Likewise, tosupply a channel argument, you must also supplyvalues for
chatTypeand language.
Argument Choices
Certainfunctions,suchasIsAddOnLoaded(),have alternative choicesintheir argu-
ments:
loaded = IsAddOnLoaded(index) or IsAddOnLoaded(“name“)
Thisfunctioncantakeeitherthe indexofaddonintheaddonlisting,orthenameof
an addon.It thenreturns whether or not the addoniscurrently loaded by the game
client. When there are distinct choices for the function signature, each signature is
addedtotheendinthisway.
Argument and Return Listings
Following afunctionsignature isa detailed listing ofthe argumentsand returnsfor
thegivenfunction.Theargumentsandreturnsarebothgiveninasimilarformat.Here
isthelistingfortheGetSocketTypes()function:
Argument:
index—Theindexofthesockettoquery.(number)
C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
PDF Document; Remove Password from PDF; Change PDF Permission Settings. Page: Insert PDF pages; VB.NET Page: Delete PDF VB.NET Annotate: PDF Markup & Drawing. XDoc
pdf change page order acrobat; how to rearrange pdf pages
VB.NET PDF File & Page Process Library SDK for vb.net, ASP.NET
VB.NET PDF - How to Modify PDF Document Page in VB.NET. VB.NET Guide for Processing PDF Document Page and Sorting PDF Pages Order.
pdf rearrange pages online; move pdf pages online
Chapter27
APIReference
541
Return:
gemColor—Thecolorofthegivengemsocket.(string)
Blue
Yellow
Red
Meta
Under each section is alist ofnamed arguments,followed by a description ofthe
argument.Afterthedescriptionisanindicatorthat tellsyouwhichtypeofLuavalue
to pass(or what type to expectfromthefunction).Inthiscase,the functionacceptsa
numericargument calledindexandreturnsastring that isthecolor ofthe socket.If
theargumentisoptional,thiswillbeindicatedintheargument listingaswellasinthe
functionsignature.
Common API Flags
Throughout the API,there are a number ofcommon attributesthat a given function
might have, for example those functions that cannot be called by addons during
combat.Table 27-1showsalistingofthevariousAPIflags.
When a function isflagged with one of the API flags, you will see a margin icon
indicatingthis.Althoughmostflagsareselfexplanatory,youcanalwaysreferback to
Table27-1formoreinformation.
Table27-1: APIFlags
FLAG
DESCRIPTION
blizzardui
Thisfunction isnot aCAPIbutaLuafunction declared in
Blizzard’sdefaultuserinterface.Itsimplementationcan be
viewedbyextractingtheaddondatausingtheAddonKit
providedbyBlizzard.
confirmation
Thisfunction doesnotprompttheuser for confirmation
beforeitsresultstakeeffect--thatbehavior isprovidedby
thedefaultUI, andthisfunction iscalledfromthe
confirmationdialog
hardware
Thisfunction requiresakeyor mousepressin orderto be
used,butmaynotbeprotected.
luaapi
Thisfunction isdefinedin theLuastandard libraries
maconly
Thisfunction isdesignedfortheMacOSXclientonly.
nocombat
Thisfunction cannot becalledduringcombat.
protected
Thisfunction isprotected andcan onlybecalledbythe
Blizzard user interface.
C# PowerPoint - Sort PowerPoint Pages Order in C#.NET
control, developers can swap or adjust the order of all or several PowerPoint document pages, or just change the position of certain one PowerPoint page in an
rearrange pages in pdf online; how to move pages in pdf acrobat
C# Word - Sort Word Pages Order in C#.NET
library control, developers can swap or adjust the order of all or several Word document pages, or just change the position of certain one Word page in an
move pages in pdf; change pdf page order preview
542
Part IV
Reference
API Meta-Types
ToclarifythedocumentationofAPIfunctions,wehavecreatedanumberofmeta-types
thatareusedto describe whatsortofvaluesareaccepted inanargumentorreturned
fromanAPIfunction.These are not actualLuatypes,but aclassification ofaccepted
valuesinvariousAPIsub-systems.Whenameta-typeappliestoanargumentorreturn
value,this is indicated after the Luatype inthe argument listing.Meta-typesenable
youtoconsolidatethedocumentationforclassesofAPIfunctions,ratherthanhavingto
documentthesamelistofvaluesoverandoveragain.Thissectiondescribesthesetypes.
1nil
Many API functions use values indicative of a binary state but do not utilize the
BooleantrueandfalsevaluesinLua.Duetothewaythefunctionsarelimited,they
usethenumbervalue1fortrue,andnilforfalse.BecauseLuatreatsnilasafalse
value and any non-nil value as true in a conditional, these values can generally be
usedthesameasBooleanvaluesinconditionalstatements(suchasif IsInGuild()
then ... end).However,youshouldavoidmakingdirectcomparisonsusingthis
typeofvalue:forexample,theconditionif IsInGuild() ) == = true then ... end
willneverbe triggered.Thesetypesofvariablesarecalled1nilvalues,todistinguish
themfromBooleanvalues.
actionID
TheactionID meta-type is used to identify one of the player’s action bar slots. In
UI terms, actionbar slots are a layer of abstraction between spells or items and the
mechanismsavailabletotheplayerforusingthemconveniently.Forexample,instead
of the default UI internally usingSetBindingSpell(),SetBindingMacro(), and
so on whenever the player changes the contentsof the visible action bars, it instead
managesasetofkeybindingscorrespondingtotheactionbar slots.
C# TIFF: How to Reorder, Rearrange & Sort TIFF Pages Using C# Code
C# users to reorder and rearrange multi-page Tiff file Tiff image management library, you can easily change and move pages or make a totally new order for all
move pages within pdf; change pdf page order online
C# Word - Process Word Document in C#
various Word document processing implementations using C# demo codes, such as add or delete Word document page, change Word document pages order, merge or
change page order pdf preview; pdf reverse page order online
Chapter27
APIReference
543
Every player hasat leastNUM_ACTIONBAR_PAGES*NUM_ACTIONBAR_BUTTONS(in
the current client, 6 * * 12, or 72) action slots corresponding to the six default
actionbar pages. Inaddition,playersof certainclasses(or withcertain talents)may
have additional actionIDs available corresponding to the ‘‘bonus’’ action bars that
automaticallybecomeavailablewhenchangingstances,stealthing,shapeshifting,etc.
ah-list-type
There are three differenttypesofauctionhouse listings,representedbystringvalues.
Theseah-list-typevaluesmaybeoneofthe following:
list—Theitemsthatarecurrentlyforsaleintheauctionhouse.
bidder—Theitemsforwhichtheplayerhasplacedabid.
owner—Theitemsthattheplayerhasplacedupforauction.
anchorPoint
Framesandgraphicalregionsare anchored toeachother usinganchor points,repre-
sentedbytheanchorPointmeta-type.Thesepointsare simplestringsthatindicatea
pointontheregion.The followingarevalidanchorpointstrings:
CENTER
LEFT
BOTTOMRIGHT
BOTTOM
RIGHT
TOPLEFT
TOP
BOTTOMLEFT
TOPRIGHT
arenaTeamID
ThearenaTeamID API meta-type identifies one of the (up to three) arena teams to
whichaplayercanbelong.Theseindicesbeginat1fortheplayer’ssmallestteamand
increase with size. For example, if the player belongsto a2v2teamand a 5v5 team
then1willindicatethe2v2teamwhile2referstothe5v5team.However,iftheplayer
belongs to a 3v3 teamand a 5v5 teambut no 2v2 team,then1 will indicate the 3v3
team,and2
willagainindicatethe 5v5team.Iftheplayerisonteamsofallthreesizes,
then1indicatesthe2v2team,2indicatesthe3v3teamand3indicatesthe5v5team.
TheBlizzardUI’sLuafunctionArenaTeam_GetTeamSizeIDcanbeusedtotranslate
ateamsize(2,3,or5)totheappropriatearenaTeamIDfor theplayer.
auraFilter
BuffsanddebuffscanbefilteredintheWoWAPIusingstringsthatrepresentcomplex
aura filters, indicated by theauraFilter meta-type.These strings can contain any
number offilterersseparatedbyeitherthepipe character(|)oraspace.Possiblefilter
valuescurrentlyinclude:
HELPFUL—Helpfulspells(buffs).
HARMFUL—Harmfulspells(debuffs).
PLAYER—Spellsthatcanbecastbytheplayeronthemselves.
C# PDF: C# Code to Process PDF Document Page Using C#.NET PDF
Enable C#.NET developers to change the page order of source PDF document file; Allow C#.NET developers to add image to specified area of source PDF document
reorder pages pdf file; how to move pages in pdf files
RasterEdge.com General FAQs for Products
speaking, you will receive a copy of email containing order confirmation and dedicated to provide powerful & profession imaging controls, PDF document, image
pdf reorder pages; how to reorder pages in pdf file
544
Part IV
Reference
RAID—Spellsthatcanbecastbytheplayerontheirraid.
CANCELABLE—Spellsthatcanbecancelled.
NOT_CANCELABLE—Spellsthatcannotbecancelled.
For example the stringHELPFUL|RAIDwillfilterto showonly those helpful spells
that the player can cast on their raid. You cannot use both the HARMFUL and the
HELPFULfiltersatthesametime,astheycanceleachotherout.Inaddition,thesetwo
filters should not be used in theUnitBuff andUnitDebufffunctions, as they are
alreadyimplicitlyincludedintheirimplementationandassuchwillbeignored.
backdrop
AbackdropdefinitionisaLuatablewithspecific attributes that matchdirectly with
theelementsinthe<Backdrop>definitioninanXML definition.It hasthefollowing
structure:
{
-- path to the background texture
bgFile = “Interface\\DialogFrame\\UI-DialogBox-Gold-Background“,
-- path to the border texture
edgeFile = “Interface\\DialogFrame\\UI-DialogBox-Gold-Border“,
-- true to repeat the background texture to fill the frame,
i
false to scale it
tile = true,
-- size (width or height) of the square repeating background i
tiles (in pixels)
tileSize = 32,
-- thickness of edge segments and square size of edge corners i
(in pixels)
edgeSize = 32,
-- distance from the edges of the frame to those of the background i
texture (in pixels)
insets = {
left = 11,
right = 12,
top = 12,
bottom = 11
}
}
bitfield
Abitfieldisanumericvalue combiningseveralbinaryflagsinto onenumber.The
flagscanbeinspectedindividuallyusing the bitwise functionsinthebit
library.For
example (usingGetItemFamilyandrelatedconstants):
GetItemFamily(“Crystallized Air“)
-- returns 1224
bit.bor(0x0008,0x0040,0x0080,0x0400)
-- returns 1224
-- these are the masks for tradeskill bags.
Chapter27
APIReference
545
bit.band(GetItemFamily(“Crystallized Air“), 0x0040)
-- returns 64, or 0x0040: the item fits in an Enchanting Bag
bit.band(GetItemFamily(“Crystallized Air“), 0x0020)
-- returns 0, or 0x0000: the item does not fit in an Herb Bag
binding
Abindingisastringidentifyingoneormore keyboardkeysormouse buttons,used
withkeybindingandmodifiedclickAPIfunctionsandtheOnKeyDown/OnKeyUpscript
handlers. Most letter, number, and symbol keys are identified by their (uppercase)
letter,number,orsymbol.
Other keys are identified by a series of global variables with names prefaced
by KEY_; for instance, the localized name for the binding NUMPAD0 can be found
in_G[“KEY_NUMPAD0“]. Some keys have platform-specific names;for example, the
localizednameforthebindingPRINTSCREENcanbefoundin_G[“KEY_PRINTSCREEN
_MAC“](revealingthatitreferstotheF13keyfoundonMacextendedkeyboards).
Modifierkeysareidentifiedasfollows:
LSHIFT,RSHIFT,SHIFT—Left,right,orgenericShiftkey
LCTRL,RCTRL,CTRL—Left,right,orgenericControlkey
LALT,RALT,ALT—Left,right,orgenericAlt(orOption)key
STRG—GermanequivalenttoCTRLkey
Mouse buttons are identified by the token BUTTON followed by the but-
ton number—BUTTON1 for the primary (left) button, BUTTON2 for the right
button,BUTTON3formiddle,andsoon.
For use in key bindings, several key/button identifiers can be strung together
with hyphens to indicate a key combination; e.g. CTRL-SHIFT-SPACERALT-F12,
SHIFT-BUTTON1.
chatMsgType
ThechatMsgTypeis a string identifying the common type of aset of chat window
messages; used in chat window functions for determining which windows display
whichmessages,andthecolorsfordisplayingeachmessagetype.
EachCHAT_MSGevent hasa correspondingchatMsgTypeidentified by the part of
theeventname followingtheinitialCHAT_MSG_;e.g.thechatMsgTypeforCHAT_MSG
_COMBAT_FACTION_CHANGE is COMBAT_FACTION_CHANGE. A list of pre-configured
chatMsgTypescanbefoundaskeysintheglobaltableChatTypeInfo.
colorString
Formatting used to colorize sections of text when being displayed in a FontString.
AcolorStringtakestheform|c(colorvalue)(text)|r:
colorvalue—A string of f four hexadecimal formatted d bytes describing
component values ofthe color.Eachbyte canbe a value from00 (representing
546
Part IV
Reference
zero intensity of the component) to ff (representing full intensity of the
component):
1. Alphavalue,butcurrentlyunused:alwaysff
2. Redcomponentofthecolor
3. Greencomponentofthecolor
4. Bluecomponentofthecolor
text—Thetexttobecolorized.
Forexamplethe string|cffffff00Yellow Text|rwilldisplay yellowtextwhen
senttoafontstringormessageframe.Colorstringscanbeusedfordisplayanywhere
intheUI,butcanonlybedeliveredinachatmessageifincludedaspartofahyperlink.
containerID
AcontainerIDisanumericidentifierforoneoftheplayer’sbagsorothercontainers.
Possiblevalues:
-2—Keyring
-1—Mainstorageareainthebank
0—Backpack
In addition anumber from1 throughNUM_BAG_SLOTSindicates a bag slot, num-
bered as presented in the default UI from right to left. Container identifiers from
NUM_BAG_SLOTS + 1through NUM_BAG_SLOTS + NUM_BANKBAGSLOTSrepresentthe
bankbagslots,numberedaspresentedinthedefaultUIfromleft toright.
containerSlotID
AcontainerSlotIDisa numericindexofanitemslot within acontainer.Slotsare
numberedfromleft toright,toptobottom,aspresentedinthe defaultUI.
frameStrata
AframeStrata value is a string identifying the general layering order of frames.
Where frame level provides fine control over the layering of frames, frame strata
providesa coarser level of layering control.Framesina higher strataalwaysappear
‘‘infront of’’framesinlower strata regardless of frame level.Available frame strata
are listedbelowinorder fromlowest tohighest:
BACKGROUND—UsedbydefaultforstaticUIelementssuchasthePlayerFrame
andMinimap
LOW—Usedbydefaultforlower-priorityUIelementssuchasthepartymember
andtarget frames
MEDIUM—Defaultframestrataforgeneralusage
HIGH—Usedbydefaultforhigher-priorityUIelementssuchastheCalendarand
Lootframes
DIALOG—Usedbydefaultforalertsandotherdialogboxeswhichshouldappear
over nearlyallotherUIelements
Chapter27
APIReference
547
FULLSCREEN—Usedbydefaultforfull-screenwindowssuchastheWorldMap
FULLSCREEN_DIALOG—Usedbydefaultforalertsordialogboxeswhichshould
appearevenwhenafull-screenwindowisvisible
TOOLTIP—Usedformousecursortooltips,ensuringtheyappearoverallother
UIelements
glyphIndex
AglyphIndexisanumericglyphindex,orderedby thelevelat whichtheglyphsare
discovered.Specifically:
1. Themajorglyphat thetopoftheuserinterface(level15)
2. Theminorglyphatthebottomoftheuser interface(level15)
3. Theminorglyphat thetopleftoftheuserinterface (level30)
4. Themajorglyphat thebottomrightoftheuserinterface (level50)
5. Theminorglyphatthetoprightoftheuserinterface(level70)
6. Themajorglyphat thebottomleftoftheuserinterface(level80)
GUID (Globally Unique IDentifier)
EachentityinWorldofWarcraftisidentifiedbyagloballyuniqueidentifier(GUID),a
unique64-bit numberthatisgenerallypresentedasastringcontaining ahexadecimal
representationofthe number (e.g.‘‘0xF530007EAC083004’’).(Note that LuainWoW
doesnot support 64-bit integers, so this value cannot be convertedin alossless way
withtonumber.)
The type ofunit represented by aGUID canbe determined by usingbit.band()
tomaskthefirstthreedigitswith0x00F:
0x000—Aplayer
0x003—AnNPC
0x004—Aplayer’spet(i.e.hunter/warlockpetsandsimilar;non-combatpets
countasNPCs)
0x005—Avehicle
FurthercontentoftheGUIDvariesbyunittype:player,NPC,pet,orvehicle.
Players
The remaining thirteen digits are unique to a player character at least within that
character’sbattlegroup(thatis,they remainunique and constantevenincross-server
battlegrounds).Thisnumber is also semi-permanent—it persists fromcharacter cre-
ationuntildeletion,renaming,orservertransfer.
NPCs
ForNPCs,theremainingdigitsbreak downasfollows:
Digits4-6—Unused.
548
Part IV
Reference
Digits7-10—NPC creature ID:identifies the specific named NPC (e.g. Hogger,
Loque’nahak) or type of NPC (e.g. Sunfury Nethermancer, Shattertusk Mam-
moth). Converting to decimal results in the ID found on database sites such
ashttp://wowhead.com;can also be used with the PlayerModel widget API
SetCreaturetoviewthe NPC’smodel.
Digits 11-16—Spawn counter: identifies the individual NPC (i.e. differentiates
between the Gamon you recently killed and the Gamon that respawned a few
minuteslater.
Pets
Hunter pets immediately after taming retainthe GUID they had as a wild creature;
afterre-summoningorlogout/login,theirGUIDchangestothepetformat.Remaining
digitscanbebrokendownasfollows:
Digits4-10—Aconstantvalueuniquetotheindividualpet:likeaplayer’sunique
IDitisconstantacrossmultiplesessions.
Digits 11-16—Spawn counter: changes when the pet is dismissed and re-
summoned.
Vehicles
Vehicleshavethe same format andcontent asNPCs.
GUID Example
Forexample,theGUID0xF530007EAC083004canbedeconstructedasfollows:
Digits1-3are‘‘F53’’;bit.band(0xF53, 0x00F) == = 0x003,sothisisanNPC.
Digits7-10are‘‘7EAC’’;0x7EAC == 32428,whichyoucanlookuptofindtheNPC
isanUnderbellyRat.
Digits11-16havenointrinsicmeaning,butdistinguishthisUnderbellyRatfromall
othersspawnedsincethelastserverreset.
Thefollowingcode isanexampleofafunctiontodecodeGUIDs:
function ParseGUID(guid)
local first3 = tonumber(“0x“..strsub(guid, 3,5))
local unitType = bit.band(first3,0x00f)
if (unitType == 0x000) then
print(“Player, ID #“, strsub(guid,6))
elseif (unitType == 0x003) then
local creatureID = tonumber(“0x“..strsub(guid,9,12))
local spawnCounter = tonumber(“0x“..strsub(guid,13))
print(“NPC, ID #“,creatureID,“spawn #“,spawnCounter)
elseif (unitType == 0x004) then
local petID = tonumber(“0x“..strsub(guid,6,12))
local spawnCounter = tonumber(“0x“..strsub(guid,13))
print(“Pet, ID #“,petID,“spawn #“,spawnCounter)
elseif (unitType == 0x005) then
Documents you may be interested
Documents you may be interested