HP Prime/Skins

De TI-Planet Wiki
Aller à la navigation Aller à la recherche
This is a backup copy of the article from the old "HPWiki" of TI-Planet (that only hosted HP Prime info)

.skin files are used by the HP Prime simulator as skin files. The format is a simple key=value format. Different values for the same key when it accepts an array are separated by commas. Perl-style comments at the end of the line are accepted. The simulator detects any .skin files in its installation directory and lists them in its Skins menu.

File format

picture

Path to the picture of the calculator, relative to its directory.

Formats accepted: BMP

picture=picture.bmp

size

Size of the picture.

size=width,height

border

Path defining the border of the picture of the calculator, used in hidden titlebar mode.

border=x1,y1,x2,y2,x3,y3,...

MATRIX

Unknown. Seems to be related to the screen's size.

MATRIX=320,240,107,0

screen

Position of the calculator screen. For best results, width should be 320 and height should be 240.

screen=x,y,width,height

screenfore

Hexadecimal number representing the screen's foreground color.

screenfore=FFFFFF

screenback

Hexadecimal number representing the screen's background color.

screenback=000000

MAXIMIZED

Position of the cropped keypad, used in maximized mode:

MAXIMIZED=x,y,width,height

The area can be splitted in several areas[1]:

MAXIMIZED=x,y,width,height #total region when both combined
MAXIMIZED1=source_x,source_y,width,height,x,y #region with offset, most cases offset values will match first two parameters
MAXIMIZED2=source_x,source_y,width,height,x,y #region with offset, most cases offset values will match first two parameters

key

Position of each of the clickable keys of the simulated calculator, one per key.

key=["ascii",]id,left,top,right,bottom,{},{},{}[,"mapped"]
  • Value 0 (optional): Quoted ASCII representation of the key. (e.g. "^")
  • Value 1: ID of the key. (Range: 0-50)
  • Value 2-3: Upper left coordinates of the key.
  • Value 4-5: Lower right coordinates of the key (the values may be flipped, for example left might be right yet they work properly in the emulator).
  • Value 6-8: Unknown, seems to be arrays containing decimal ASCII representations of the key (if they are control characters) in various states (shifted, uppercased, lowercased). (e.g. {115,36})
  • Value 9 (optional): Seems to be related with the direct mappings of this key with the keyboard. (e.g. "a""A" for Vars)

Parsing the key value

All the available versions of the key value (including the key= prefix and optional comments at the end of each line) can be parsed with the following regular expression:
^key=(?<value>".*",)?(?<id>[0-9]+),(?<left>[0-9]+),(?<top>[0-9]+),(?<right>[0-9]+),(?<bottom>[0-9]+),(?<modifier1>\{\d?[\d,]*\}),(?<modifier2>\{\d?[\d,]*\}),(?<modifier3>\{\d?[\d,]*\})(?:,\[(?<mappings>.*)\])?(?:[\t #]+(?<comment>.*))?$

mright

Unknown.

mright=41

SCREEN

Unknown.

SCREEN=0,0

end

Marks the end of file. Does not have any value.

end

Errors

An error will be thrown when the simulator fails to load a skin.

Number Description
27 Invalid or missing bmp file (usually opening and saving the file again in mspaint as bmp 24 bits fixes the issue)
33 Missing a required sentence ('end', 'picture', etc)

References

Modèle:Reflist