forked from Tenzer/xbmcstubs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
xbmcgui.py
1355 lines (1051 loc) · 44.9 KB
/
xbmcgui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#noinspection PyUnusedLocal
class Window(object):
def __new__(cls, windowId=-1):
"""Create a new Window to draw on.
Specify an id to use an existing window.
Raises:
ValueError: If supplied window Id does not exist.
Exception: If more then 200 windows are created.
Deleting this window will activate the old window that was active
and resets (not delete) all controls that are associated with this window.
"""
super(Window, cls).__new__(cls)
def show(self):
"""Show this window.
Shows this window by activating it, calling close() after it wil activate the current window again.
Note:
If your script ends this window will be closed to. To show it forever,
make a loop at the end of your script and use doModal() instead.
"""
pass
def close(self):
"""Closes this window.
Closes this window by activating the old window.
The window is not deleted with this method.
"""
pass
def onAction(self, action):
"""onAction method.
This method will recieve all actions that the main program will send to this window.
By default, only the PREVIOUS_MENU action is handled.
Overwrite this method to let your script handle all actions.
Don't forget to capture ACTION_PREVIOUS_MENU, else the user can't close this window.
"""
pass
def onClick(self, control):
"""onClick method.
This method will recieve all click events that the main program will send to this window.
"""
pass
def onFocus(self, control):
"""onFocus method.
This method will recieve all focus events that the main program will send to this window.
"""
pass
def onInit(self):
"""onInit method.
This method will be called to initialize the window.
"""
pass
def doModal(self):
"""Display this window until close() is called."""
pass
def addControl(self, control):
"""Add a Control to this window.
Raises:
TypeError: If supplied argument is not a Control type.
ReferenceError: If control is already used in another window.
RuntimeError: Should not happen :-)
The next controls can be added to a window atm:
ControlLabel
ControlFadeLabel
ControlTextBox
ControlButton
ControlCheckMark
ControlList
ControlGroup
ControlImage
ControlRadioButton
ControlProgress
"""
pass
def addControls(self, controls):
pass
def getControl(self, controlId):
"""Get's the control from this window.
Raises:
Exception: If Control doesn't exist
controlId doesn't have to be a python control, it can be a control id
from a xbmc window too (you can find id's in the xml files).
Note:
Not python controls are not completely usable yet.
You can only use the Control functions.
"""
return ControlList
def setFocus(self, Control):
"""Give the supplied control focus.
Raises:
TypeError: If supplied argument is not a Control type.
SystemError: On Internal error.
RuntimeError: If control is not added to a window.
"""
pass
def setFocusId(self, int):
"""Gives the control with the supplied focus.
Raises:
SystemError: On Internal error.
RuntimeError: If control is not added to a window.
"""
pass
def getFocus(self):
"""Returns the control which is focused.
Raises:
SystemError: On Internal error.
RuntimeError: If no control has focus.
"""
return object
def getFocusId(self):
"""Returns the id of the control which is focused.
Raises:
SystemError: On Internal error.
RuntimeError: If no control has focus.
"""
return long
def removeControl(self, control):
"""Removes the control from this window.
Raises:
TypeError: If supplied argument is not a Control type.
RuntimeError: If control is not added to this window.
This will not delete the control. It is only removed from the window.
"""
pass
def removeControls(self, controls):
pass
def getHeight(self):
"""Returns the height of this screen."""
return long
def getWidth(self):
"""Returns the width of this screen."""
return long
def getResolution(self):
"""Returns the resolution of the screen.
The returned value is one of the following:
0 - 1080i (1920x1080)
1 - 720p (1280x720)
2 - 480p 4:3 (720x480)
3 - 480p 16:9 (720x480)
4 - NTSC 4:3 (720x480)
5 - NTSC 16:9 (720x480)
6 - PAL 4:3 (720x576)
7 - PAL 16:9 (720x576)
8 - PAL60 4:3 (720x480)
9 - PAL60 16:9 (720x480)
"""
return long
def setCoordinateResolution(self, resolution):
"""Sets the resolution that the coordinates of all controls are defined in.
Allows XBMC to scale control positions and width/heights to whatever resolution
XBMC is currently using.
resolution is one of the following:
0 - 1080i (1920x1080)
1 - 720p (1280x720)
2 - 480p 4:3 (720x480)
3 - 480p 16:9 (720x480)
4 - NTSC 4:3 (720x480)
5 - NTSC 16:9 (720x480)
6 - PAL 4:3 (720x576)
7 - PAL 16:9 (720x576)
8 - PAL60 4:3 (720x480)
9 - PAL60 16:9 (720x480)
"""
pass
def setProperty(self, key, value):
"""Sets a window property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
key is NOT case sensitive. Setting value to an empty string is equivalent to clearProperty(key).
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.setProperty('Category', 'Newest')
"""
pass
def getProperty(self, key):
"""Returns a window property as a string, similar to an infolabel.
key: string - property name.
Note:
key is NOT case sensitive.
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
category = win.getProperty('Category')
"""
return str
def clearProperty(self, key):
"""Clears the specific window property.
key: string - property name.
Note:
key is NOT case sensitive. Equivalent to setProperty(key,'').
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperty('Category')
"""
pass
def clearProperties(self):
"""Clears all window properties.
Example:
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperties()
"""
pass
#noinspection PyUnusedLocal
class WindowDialog(Window):
def __new__(cls, xmlFilename, scriptPath, defaultSkin="Default", defaultRes="720p"):
"""Create a new WindowXMLDialog script.
xmlFilename: string - the name of the xml file to look for.
scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())
defaultSkin: string - name of the folder in the skins path to look in for the xml.
defaultRes: string - default skins resolution.
Note:
Skin folder structure is eg(resources/skins/Default/720p).
Example:
ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')
ui.doModal()
del ui
"""
super(WindowDialog, cls).__new__(cls)
#noinspection PyUnusedLocal
class WindowXML(Window):
def __new__(cls, xmlFilename, scriptPath, defaultSkin="Default", defaultRes="720p"):
"""Create a new WindowXML script.
xmlFilename: string - the name of the xml file to look for.
scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())
defaultSkin: string - name of the folder in the skins path to look in for the xml.
defaultRes: string - default skins resolution.
Note:
Skin folder structure is eg(resources/skins/Default/720p).
Example:
ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')
ui.doModal()
del ui
"""
super(WindowXML, cls).__new__(cls)
def removeItem(self, position):
"""Removes a specified item based on position, from the Window List.
position: integer - position of item to remove.
"""
pass
def addItem(self, item, position=32767):
"""Add a new item to this Window List.
item: string, unicode or ListItem - item to add.
position: integer - position of item to add. (NO Int = Adds to bottom,0 adds to top, 1 adds to one below from top,-1 adds to one above from bottom etc etc)
If integer positions are greater than list size, negative positions will add to top of list, positive positions will add to bottom of list.
Example:
self.addItem('Reboot XBMC', 0)
"""
pass
def clearList(self):
"""Clear the Window List."""
pass
def setCurrentListPosition(self, position):
"""Set the current position in the Window List.
position: integer - position of item to set.
"""
pass
def getCurrentListPosition(self):
"""Gets the current position in the Window List."""
return long
def getListItem(self, position):
"""Returns a given ListItem in this Window List.
position: integer - position of item to return.
"""
return ListItem
def getListSize(self):
"""Returns the number of items in this Window List."""
return long
def setProperty(self, key, value):
"""Sets a container property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
Key is NOT case sensitive.
Example:
self.setProperty('Category', 'Newest')
"""
pass
#noinspection PyUnusedLocal
class WindowXMLDialog(WindowXML):
def __new__(cls, xmlFilename, scriptPath, defaultSkin="Default", defaultRes="720p"):
"""Create a new WindowXMLDialog script.
xmlFilename: string - the name of the xml file to look for.
scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())
defaultSkin: string - name of the folder in the skins path to look in for the xml.
defaultRes: string - default skins resolution.
Note:
Skin folder structure is eg(resources/skins/Default/720p).
Example:
ui = GUI('script-Lyrics-main.xml', os.getcwd(), 'LCARS', 'PAL')
ui.doModal()
del ui
"""
super(WindowXML, cls).__new__(cls)
#noinspection PyUnusedLocal
class ListItem(object):
def __init__(self, label=None, label2=None, iconImage=None, thumbnailImage=None, path=None):
"""Creates a new ListItem.
label: string or unicode - label1 text.
label2: string or unicode - label2 text.
iconImage: string - icon filename.
thumbnailImage: string - thumbnail filename.
path: string or unicode - listitem's path.
Example:
listitem = xbmcgui.ListItem('Casino Royale', '[PG-13]', 'blank-poster.tbn', 'poster.tbn', path='f:\\movies\\casino_royale.mov')
"""
pass
def getLabel(self):
"""Returns the listitem label."""
return str
def getLabel2(self):
"""Returns the listitem's second label."""
return str
def setLabel(self, label):
"""Sets the listitem's label.
label: string or unicode - text string.
"""
pass
def setLabel2(self, label2):
"""Sets the listitem's second label.
label2: string or unicode - text string.
"""
pass
def setIconImage(self, icon):
"""Sets the listitem's icon image.
icon: string or unicode - image filename.
"""
pass
def setThumbnailImage(self, thumb):
"""Sets the listitem's thumbnail image.
thumb: string or unicode - image filename.
"""
pass
def select(self, selected):
"""Sets the listitem's selected status.
selected: bool - True=selected/False=not selected.
"""
pass
def isSelected(self):
"""Returns the listitem's selected status."""
return bool
def setInfo(self, type, infoLabels):
"""Sets the listitem's infoLabels.
type: string - type of media(video/music/pictures).
infoLabels: dictionary - pairs of { label: value }.
Note:
To set pictures exif info, prepend 'exif:' to the label. Exif values must be passed
as strings, separate value pairs with a comma. (eg. {'exif:resolution': '720,480'}
See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings.
General Values that apply to all types:
count: integer (12) - can be used to store an id for later, or for sorting purposes
size: long (1024) - size in bytes
date: string (%d.%m.%Y / 01.01.2009) - file date
Video Values:
genre: string (Comedy)
year: integer (2009)
episode: integer (4)
season: integer (1)
top250: integer (192)
tracknumber: integer (3)
rating: float (6.4) - range is 0..10
watched: depreciated - use playcount instead
playcount: integer (2) - number of times this item has been played
overlay: integer (2) - range is 0..8. See GUIListItem.h for values
cast: list (Michal C. Hall)
castandrole: list (Michael C. Hall|Dexter)
director: string (Dagur Kari)
mpaa: string (PG-13)
plot: string (Long Description)
plotoutline: string (Short Description)
title: string (Big Fan)
originaltitle: string (Big Fan)
duration: string (3:18)
studio: string (Warner Bros.)
tagline: string (An awesome movie) - short description of movie
writer: string (Robert D. Siegel)
tvshowtitle: string (Heroes)
premiered: string (2005-03-04)
status: string (Continuing) - status of a TVshow
code: string (tt0110293) - IMDb code
aired: string (2008-12-07)
credits: string (Andy Kaufman) - writing credits
lastplayed: string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)
album: string (The Joshua Tree)
votes: string (12345 votes)
trailer: string (/home/user/trailer.avi)
Music Values:
tracknumber: integer (8)
duration: integer (245) - duration in seconds
year: integer (1998)
genre: string (Rock)
album: string (Pulse)
artist: string (Muse)
title: string (American Pie)
rating: string (3) - single character between 0 and 5
lyrics: string (On a dark desert highway...)
playcount: integer (2) - number of times this item has been played
lastplayed: string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)
Picture Values:
title: string (In the last summer-1)
picturepath: string (/home/username/pictures/img001.jpg)
exif*: string (See CPictureInfoTag::TranslateString in PictureInfoTag.cpp for valid strings)
Example:
self.list.getSelectedItem().setInfo('video', { 'Genre': 'Comedy' })
"""
pass
def setProperty(self, key, value):
"""Sets a listitem property, similar to an infolabel.
key: string - property name.
value: string or unicode - value of property.
Note:
Key is NOT case sensitive.
Some of these are treated internally by XBMC, such as the 'StartOffset' property, which is
the offset in seconds at which to start playback of an item. Others may be used in the skin
to add extra information, such as 'WatchedCount' for tvshow items
Example:
self.list.getSelectedItem().setProperty('AspectRatio', '1.85 : 1')
self.list.getSelectedItem().setProperty('StartOffset', '256.4')
"""
pass
def getProperty(self, key):
"""Returns a listitem property as a string, similar to an infolabel.
key: string - property name.
Note:
Key is NOT case sensitive.
"""
return str
def addContextMenuItems(self, list, replaceItems=False):
"""Adds item(s) to the context menu for media lists.
items: list - [(label, action)] A list of tuples consisting of label and action pairs.
label: string or unicode - item's label.
action: string or unicode - any built-in function to perform.
replaceItems: bool - True=only your items will show/False=your items will be added to context menu.
List of functions: http://wiki.xbmc.org/?title=List_of_Built_In_Functions
Example:
listitem.addContextMenuItems([('Theater Showtimes', 'XBMC.RunScript(special://home/scripts/showtimes/default.py,Iron Man)')])
"""
pass
def setPath(self, path):
"""Sets the listitem's path.
path: string or unicode - path, activated when item is clicked.
"""
pass
#noinspection PyUnusedLocal
class ControlLabel(object):
def __init__(self, x, y, width, height, label, font=None, textColor=None, disabledColor=None, alignment=None,
hasPath=None, angle=None):
"""ControlLabel class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
label: string or unicode - text string.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
alignment: integer - alignment of label - *Note, see xbfont.h
hasPath: bool - True=stores a path / False=no path.
angle: integer - angle of control. (+ rotates CCW, - rotates CW)"
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)
"""
pass
def setLabel(self, label):
"""Set's text for this label.
label: string or unicode - text string.
"""
pass
def getLabel(self):
"""Returns the text value for this label."""
return str
#noinspection PyUnusedLocal
class ControlFadeLabel(object):
def __init__(self, x, y, width, height, font=None, textColor=None, alignment=None):
"""Control that scroll's lables.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')
alignment: integer - alignment of label - *Note, see xbfont.h
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')
"""
pass
def addLabel(self, label):
"""Add a label to this control for scrolling.
label: string or unicode - text string.
"""
pass
def reset(self):
"""Clears this fadelabel."""
pass
#noinspection PyUnusedLocal
class ControlTextBox(object):
def __init__(self, x, y, width, height, font=None, textColor=None):
"""ControlTextBox class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
font: string - font used for text. (e.g. 'font13')
textColor: hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
"""
pass
def setText(self, text):
"""Set's the text for this textbox.
text: string or unicode - text string.
"""
pass
def scroll(self, position):
"""Scrolls to the given position.
id: integer - position to scroll to.
"""
pass
def reset(self):
"""Clear's this textbox."""
pass
#noinspection PyUnusedLocal
class ControlButton(object):
def __init__(self, x, y, width, height, label, focusTexture=None, noFocusTexture=None, textOffsetX=None,
textOffsetY=None, alignment=None, font=None, textColor=None, disabledColor=None, angle=None,
shadowColor=None, focusedColor=None):
"""ControlButton class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
label: string or unicode - text string.
focusTexture: string - filename for focus texture.
noFocusTexture: string - filename for no focus texture.
textOffsetX: integer - x offset of label.
textOffsetY: integer - y offset of label.
alignment: integer - alignment of label - *Note, see xbfont.h
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
angle: integer - angle of control. (+ rotates CCW, - rotates CW)
shadowColor: hexstring - color of button's label's shadow. (e.g. '0xFF000000')
focusedColor: hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')
"""
pass
def setDisabledColor(self, disabledColor):
"""Set's this buttons disabled color.
disabledColor: hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
"""
pass
def setLabel(self, label=None, font=None, textColor=None, disabledColor=None, shadowColor=None, focusedColor=None):
"""Set's this buttons text attributes.
label: string or unicode - text string.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
shadowColor: hexstring - color of button's label's shadow. (e.g. '0xFF000000')
focusedColor: hexstring - color of focused button's label. (e.g. '0xFFFFFF00')
label2: string or unicode - text string.
Example:
self.button.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
"""
pass
def getLabel(self):
"""Returns the buttons label as a unicode string."""
return unicode
def getLabel2(self):
"""Returns the buttons label2 as a unicode string."""
return unicode
#noinspection PyUnusedLocal
class ControlCheckMark(object):
def __init__(self, x, y, width, height, label, focusTexture=None, noFocusTexture=None, checkWidth=None,
checkHeight=None, alignment=None, font=None, textColor=None, disabledColor=None):
"""ControlCheckMark class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
label: string or unicode - text string.
focusTexture: string - filename for focus texture.
noFocusTexture: string - filename for no focus texture.
checkWidth: integer - width of checkmark.
checkHeight: integer - height of checkmark.
alignment: integer - alignment of label - *Note, see xbfont.h
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.checkmark = xbmcgui.ControlCheckMark(100, 250, 200, 50, 'Status', font='font14')
"""
pass
def setDisabledColor(self, disabledColor):
"""Set's this controls disabled color.
disabledColor: hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
"""
pass
def setLabel(self, label, font=None, textColor=None, disabledColor=None):
"""Set's this controls text attributes.
label: string or unicode - text string.
font: string - font used for label text. (e.g. 'font13')
textColor: hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')
disabledColor: hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
Example:
self.checkmark.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300')
"""
pass
def getSelected(self):
"""Returns the selected status for this checkmark as a bool."""
return bool
def setSelected(self, isOn):
"""Sets this checkmark status to on or off.
isOn: bool - True=selected (on) / False=not selected (off)
"""
pass
#noinspection PyUnusedLocal
class ControlList(object):
def __init__(self, x, y, width, height, font=None, textColor=None, buttonTexture=None, buttonFocusTexture=None,
selectedColor=None, imageWidth=None, imageHeight=None, itemTextXOffset=None, itemTextYOffset=None,
itemHeight=None, space=None, alignmentY=None):
"""ControlList class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
font: string - font used for items label. (e.g. 'font13')
textColor: hexstring - color of items label. (e.g. '0xFFFFFFFF')
buttonTexture: string - filename for focus texture.
buttonFocusTexture: string - filename for no focus texture.
selectedColor: integer - x offset of label.
imageWidth: integer - width of items icon or thumbnail.
imageHeight: integer - height of items icon or thumbnail.
itemTextXOffset: integer - x offset of items label.
itemTextYOffset: integer - y offset of items label.
itemHeight: integer - height of items.
space: integer - space between items.
alignmentY: integer - Y-axis alignment of items label - *Note, see xbfont.h
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.cList = xbmcgui.ControlList(100, 250, 200, 250, 'font14', space=5)
"""
pass
def addItem(self, item):
"""Add a new item to this list control.
item: string, unicode or ListItem - item to add.
"""
pass
def addItems(self, items):
"""Adds a list of listitems or strings to this list control.
items: List - list of strings, unicode objects or ListItems to add.
"""
pass
def selectItem(self, item):
"""Select an item by index number.
item: integer - index number of the item to select.
"""
pass
def reset(self):
"""Clear all ListItems in this control list."""
pass
def getSpinControl(self):
"""Returns the associated ControlSpin object.
Note:
Not working completely yet -
After adding this control list to a window it is not possible to change
the settings of this spin control.
"""
return object
def setImageDimensions(self, imageWidth=None, imageHeight=None):
"""Sets the width/height of items icon or thumbnail.
imageWidth: integer - width of items icon or thumbnail.
imageHeight: integer - height of items icon or thumbnail.
"""
pass
def setItemHeight(self, itemHeight):
"""Sets the height of items.
itemHeight: integer - height of items.
"""
pass
def setPageControlVisible(self, visible):
"""Sets the spin control's visible/hidden state.
visible: boolean - True=visible / False=hidden.
"""
pass
def setSpace(self, space=None):
"""Set's the space between items.
space: integer - space between items.
"""
pass
def getSelectedPosition(self):
"""Returns the position of the selected item as an integer.
Note:
Returns -1 for empty lists.
"""
return long
def getSelectedItem(self):
"""Returns the selected item as a ListItem object.
Note:
Same as getSelectedPosition(), but instead of an integer a ListItem object is returned. Returns None for empty lists.
See windowexample.py on how to use this.
"""
return ListItem
def size(self):
"""Returns the total number of items in this list control as an integer."""
return long
def getListItem(self, index):
"""Returns a given ListItem in this List.
index: integer - index number of item to return.
Raises:
ValueError: If index is out of range.
"""
return ListItem
def getItemHeight(self):
"""Returns the control's current item height as an integer."""
return long
def getSpace(self):
"""Returns the control's space between items as an integer."""
return long
def setStaticContent(self, items):
"""Fills a static list with a list of listitems.
items: List - list of listitems to add.
"""
pass
#noinspection PyUnusedLocal
class ControlImage(object):
def __init__(self, x, y, width, height, filename, colorKey=None, aspectRatio=None, colorDiffuse=None):
"""ControlImage class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
filename: string - image filename.
colorKey: hexString - (example, '0xFFFF3300')
aspectRatio: integer - (values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bars)
colorDiffuse: hexString - (example, '0xC0FF0000' (red tint)).
Note:
After you create the control, you need to add it to the window with addControl().
Example:
self.image = xbmcgui.ControlImage(100, 250, 125, 75, aspectRatio=2)
"""
pass
def setImage(self, filename):
"""Changes the image.
filename: string - image filename.
"""
pass
def setColorDiffuse(self, colorDiffuse):
"""Changes the images color.
colorDiffuse: hexString - (example, '0xC0FF0000' (red tint)).
"""
pass
#noinspection PyUnusedLocal
class ControlProgress(object):
def __init__(self, x, y, width, height, texturebg=None, textureleft=None, texturemid=None, textureright=None,
textureoverlay=None):
"""ControlProgress class.
x: integer - x coordinate of control.
y: integer - y coordinate of control.
width: integer - width of control.
height: integer - height of control.
texturebg: string - image filename.
textureleft: string - image filename.
texturemid: string - image filename.
textureright: string - image filename.
textureoverlay: string - image filename.
Note:
After you create the control, you need to add it to the window with addControl().