Kivy-examples 2.3.1.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (624) hide show
  1. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/main.py +77 -0
  2. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/monkey.obj +7966 -0
  3. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/objloader.py +147 -0
  4. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/simple.glsl +47 -0
  5. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/RST_Editor/editor.kv +72 -0
  6. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/RST_Editor/main.py +64 -0
  7. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/android.txt +3 -0
  8. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/compass.kv +25 -0
  9. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/main.py +77 -0
  10. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/needle.png +0 -0
  11. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/rose.png +0 -0
  12. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/android.txt +3 -0
  13. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/main.py +80 -0
  14. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/shadow32.png +0 -0
  15. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/takepicture.kv +40 -0
  16. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/animation/animate.py +42 -0
  17. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_suite.py +152 -0
  18. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_suite_data/testkvdir.kv +4 -0
  19. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_build.py +24 -0
  20. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_config.py +49 -0
  21. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_kv.py +25 -0
  22. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_kv_in_template1.py +27 -0
  23. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/template1/test.kv +4 -0
  24. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/test.kv +4 -0
  25. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/testkvfile.kv +4 -0
  26. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/asyncio_advanced.py +90 -0
  27. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/asyncio_basic.py +59 -0
  28. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/trio_advanced.py +93 -0
  29. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/trio_basic.py +58 -0
  30. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12908_sweet_trip_mm_clap_hi.wav +0 -0
  31. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12909_sweet_trip_mm_clap_lo.wav +0 -0
  32. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12910_sweet_trip_mm_clap_mid.wav +0 -0
  33. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12911_sweet_trip_mm_hat_cl.wav +0 -0
  34. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12913_sweet_trip_mm_kick_hi.wav +0 -0
  35. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12914_sweet_trip_mm_kick_lo.wav +0 -0
  36. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12915_sweet_trip_mm_kick_mid.wav +0 -0
  37. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12916_sweet_trip_mm_kwik_mod_01.wav +0 -0
  38. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12917_sweet_trip_mm_kwik_mod_02.wav +0 -0
  39. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12918_sweet_trip_mm_kwik_mod_03.wav +0 -0
  40. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12919_sweet_trip_mm_kwik_mod_04.wav +0 -0
  41. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12920_sweet_trip_mm_kwik_mod_05.wav +0 -0
  42. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12921_sweet_trip_mm_kwik_mod_06.wav +0 -0
  43. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12922_sweet_trip_mm_kwik_mod_07.wav +0 -0
  44. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12923_sweet_trip_mm_metal_clave.wav +0 -0
  45. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12925_sweet_trip_mm_sweep_x.wav +0 -0
  46. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12926_sweet_trip_mm_sweep_y.wav +0 -0
  47. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12927_sweet_trip_mm_sweep_z.wav +0 -0
  48. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/audio.kv +59 -0
  49. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/main.py +81 -0
  50. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/pitch.py +42 -0
  51. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/camera/main.py +59 -0
  52. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/bezier.py +105 -0
  53. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/canvas_stress.py +72 -0
  54. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/circle.py +84 -0
  55. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/fbo_canvas.py +91 -0
  56. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/kiwi.jpg +0 -0
  57. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/lines.py +296 -0
  58. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/lines_extended.py +183 -0
  59. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mesh.py +57 -0
  60. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mesh_manipulation.py +101 -0
  61. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mtexture1.png +0 -0
  62. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mtexture2.png +0 -0
  63. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/multitexture.py +110 -0
  64. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/repeat_texture.py +65 -0
  65. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/rotation.py +35 -0
  66. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/rounded_rectangle.py +153 -0
  67. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/scale.py +37 -0
  68. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/stencil_canvas.py +85 -0
  69. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/tesselate.py +146 -0
  70. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/texture.py +143 -0
  71. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/texture_example_image.png +0 -0
  72. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/1.kv +28 -0
  73. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/2.kv +28 -0
  74. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/3.kv +28 -0
  75. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/root.kv +32 -0
  76. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/main.py +63 -0
  77. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/cover/cover_image.py +25 -0
  78. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/cover/cover_video.py +31 -0
  79. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/camera_puzzle.py +98 -0
  80. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/AnchorLayoutContainer.kv +15 -0
  81. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/BoxLayoutContainer.kv +14 -0
  82. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ButtonContainer.kv +27 -0
  83. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/CheckBoxContainer.kv +28 -0
  84. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/FileChooserContainer.kv +19 -0
  85. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/FloatLayoutContainer.kv +16 -0
  86. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/GridLayoutContainer.kv +20 -0
  87. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/LabelContainer.kv +62 -0
  88. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/MediaContainer.kv +9 -0
  89. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/PlaygroundContainer.kv +4 -0
  90. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/PopupContainer.kv +39 -0
  91. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ProgressBarContainer.kv +17 -0
  92. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/RestContainer.kv +5 -0
  93. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ScatterContainer.kv +16 -0
  94. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/SelectorsContainer.kv +10 -0
  95. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/StackLayoutContainer.kv +25 -0
  96. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/TextContainer.kv +20 -0
  97. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/kivycatalog.kv +144 -0
  98. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/main.py +192 -0
  99. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/gesturedatabase.kv +117 -0
  100. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/gesturedatabase.py +180 -0
  101. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/helpers.py +30 -0
  102. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/historymanager.kv +164 -0
  103. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/historymanager.py +276 -0
  104. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/main.py +144 -0
  105. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/multistroke.kv +101 -0
  106. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/settings.kv +110 -0
  107. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/settings.py +97 -0
  108. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/android.txt +3 -0
  109. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Bubbles.jpg +0 -0
  110. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Ill1.jpg +0 -0
  111. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Wall.jpg +0 -0
  112. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/faust_github.jpg +0 -0
  113. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/main.py +73 -0
  114. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/pictures.kv +57 -0
  115. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/shadow32.png +0 -0
  116. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/shadereditor/main.py +147 -0
  117. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/shadereditor/shadereditor.kv +39 -0
  118. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/README.txt +11 -0
  119. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/android.txt +3 -0
  120. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/background.png +0 -0
  121. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/faust_github.jpg +0 -0
  122. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/README +4 -0
  123. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/bug.png +0 -0
  124. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/chevron-left.png +0 -0
  125. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/chevron-right.png +0 -0
  126. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/accordions.kv +39 -0
  127. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/bubbles.kv +33 -0
  128. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/buttons.kv +26 -0
  129. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/carousel.kv +51 -0
  130. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/checkboxes.kv +33 -0
  131. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/codeinput.kv +9 -0
  132. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/dropdown.kv +40 -0
  133. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/filechoosers.kv +24 -0
  134. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/popups.kv +17 -0
  135. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/progressbar.kv +15 -0
  136. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/rstdocument.kv +24 -0
  137. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/scatter.kv +14 -0
  138. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/screenmanager.kv +46 -0
  139. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/sliders.kv +55 -0
  140. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/spinner.kv +11 -0
  141. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/splitter.kv +13 -0
  142. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/switches.kv +39 -0
  143. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/tabbedpanel + layouts.kv +69 -0
  144. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/textinputs.kv +48 -0
  145. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/togglebutton.kv +39 -0
  146. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/main.py +243 -0
  147. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/showcase.kv +100 -0
  148. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/README.txt +12 -0
  149. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/android.txt +3 -0
  150. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/icon.png +0 -0
  151. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/main.py +170 -0
  152. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/particle.png +0 -0
  153. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/touchtracer.kv +29 -0
  154. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/echo_client_app.py +82 -0
  155. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/echo_server_app.py +49 -0
  156. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/twistd_app.py +66 -0
  157. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/gestures/gesture_board.py +95 -0
  158. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/gestures/my_gestures.py +90 -0
  159. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/designwithkv/controller.kv +16 -0
  160. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/designwithkv/main.py +29 -0
  161. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/1_skeleton.py +15 -0
  162. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/2_print_touch.py +16 -0
  163. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/3_draw_ellipse.py +22 -0
  164. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/4_draw_line.py +26 -0
  165. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/5_random_colors.py +28 -0
  166. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/6_button.py +38 -0
  167. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/quickstart/main.py +15 -0
  168. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/button.kv +9 -0
  169. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/layout.kv +6 -0
  170. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/main.py +19 -0
  171. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/test.kv +5 -0
  172. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/android.txt +3 -0
  173. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/main.py +226 -0
  174. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/numeric.json +38 -0
  175. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kinect/README.txt +13 -0
  176. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kinect/kinectviewer.py +283 -0
  177. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_button.kv +9 -0
  178. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_camera.kv +25 -0
  179. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_fbo.kv +11 -0
  180. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_layout.kv +23 -0
  181. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_logo.kv +36 -0
  182. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_scatter.kv +6 -0
  183. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_stencil.kv +27 -0
  184. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_video.kv +42 -0
  185. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/builder_template.py +28 -0
  186. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/id_in_kv/id_in_kv.py +20 -0
  187. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/id_in_kv/test.kv +11 -0
  188. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/kv_and_py/kv_and_py.py +34 -0
  189. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/kv_and_py/test.kv +11 -0
  190. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/kivy.jpg +0 -0
  191. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/kvrun.py +38 -0
  192. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/clipboard.py +63 -0
  193. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/custom_titlebar.py +56 -0
  194. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/imagesave.py +14 -0
  195. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/joystick.py +83 -0
  196. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/multiple_dropfile.py +51 -0
  197. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/on_textedit_event.py +104 -0
  198. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/opacitywindow.py +28 -0
  199. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/shapecollisions.py +397 -0
  200. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/shapedwindow.py +98 -0
  201. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/two_panes.py +47 -0
  202. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/urlrequest.py +128 -0
  203. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/settings/android.txt +3 -0
  204. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/settings/main.py +122 -0
  205. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/plasma.kv +9 -0
  206. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/plasma.py +86 -0
  207. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/rotated.kv +91 -0
  208. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/rotated.py +102 -0
  209. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/shadertree.kv +29 -0
  210. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/shadertree.py +193 -0
  211. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/tex3.jpg +0 -0
  212. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/benchmark.py +19 -0
  213. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/cloud.svg +25 -0
  214. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/main-smaa.py +155 -0
  215. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/main.py +50 -0
  216. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/music.svg +68 -0
  217. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/rotated.svg +23 -0
  218. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/ship.svg +181 -0
  219. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/sun.svg +35 -0
  220. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/tiger.svg +813 -0
  221. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/text/pango_demo.py +296 -0
  222. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/data/icon.png +0 -0
  223. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/main.py +163 -0
  224. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/note.kv +154 -0
  225. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/main.py +82 -0
  226. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/pong.kv +53 -0
  227. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step1/main.py +15 -0
  228. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step1/pong.kv +2 -0
  229. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step2/main.py +15 -0
  230. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step2/pong.kv +21 -0
  231. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step3/main.py +26 -0
  232. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step3/pong.kv +31 -0
  233. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step4/main.py +48 -0
  234. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step4/pong.kv +34 -0
  235. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step5/main.py +75 -0
  236. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step5/pong.kv +53 -0
  237. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/accordion_1.py +17 -0
  238. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/actionbar.py +32 -0
  239. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/asyncimage.py +35 -0
  240. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/boxlayout_poshint.py +54 -0
  241. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/bubble_test.py +63 -0
  242. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/camera.py +33 -0
  243. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/carousel_buttons.py +50 -0
  244. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/cityCC0.mpg +0 -0
  245. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/cityCC0.png +0 -0
  246. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/codeinput.py +225 -0
  247. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/codeinputtest.kv +53 -0
  248. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/colorpicker.py +234 -0
  249. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/colorusage.py +62 -0
  250. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/compound_selection.py +83 -0
  251. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/customcollide.py +82 -0
  252. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget.py +193 -0
  253. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget2.py +47 -0
  254. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget3_advanced.py +62 -0
  255. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/fbowidget.py +111 -0
  256. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/focus_behavior.py +98 -0
  257. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/image_mipmap.py +31 -0
  258. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/keyboardlistener.py +42 -0
  259. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_mipmap.py +28 -0
  260. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_sizing.py +193 -0
  261. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_text_size.py +49 -0
  262. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_with_markup.py +21 -0
  263. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/lang_dynamic_classes.py +18 -0
  264. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/pagelayout.py +64 -0
  265. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/popup_with_kv.py +35 -0
  266. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/basic_data.py +124 -0
  267. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/infinite_scrolling.py +143 -0
  268. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/key_viewclass.py +149 -0
  269. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/messenger.py +196 -0
  270. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/pull_to_refresh.py +95 -0
  271. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/rv_animate_items.py +109 -0
  272. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/rstexample.py +128 -0
  273. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scatter.kv +53 -0
  274. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scatter.py +16 -0
  275. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/screenmanager.py +106 -0
  276. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scrollview.kv +16 -0
  277. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scrollview.py +40 -0
  278. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/android.txt +3 -0
  279. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/bird.zip +0 -0
  280. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/button_white.png +0 -0
  281. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/button_white_animated.zip +0 -0
  282. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/cube.zip +0 -0
  283. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/info.png +0 -0
  284. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/info.zip +0 -0
  285. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/simple_cv_joint_animated.gif +0 -0
  286. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/main.kv +63 -0
  287. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/main.py +150 -0
  288. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/uix/__init__.py +7 -0
  289. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/uix/custom_button.py +98 -0
  290. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/settings.py +93 -0
  291. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/shorten_text.py +80 -0
  292. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/spinner.py +17 -0
  293. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/splitter.py +74 -0
  294. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/tabbed_panel_showcase.py +316 -0
  295. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/tabbedpanel.py +50 -0
  296. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textalign.kv +49 -0
  297. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textalign.py +48 -0
  298. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textinput.py +59 -0
  299. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/unicode_textinput.py +244 -0
  300. Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/videoplayer.py +26 -0
  301. Kivy_examples-2.3.1.dev0.dist-info/AUTHORS +66 -0
  302. Kivy_examples-2.3.1.dev0.dist-info/LICENSE +21 -0
  303. Kivy_examples-2.3.1.dev0.dist-info/METADATA +382 -0
  304. Kivy_examples-2.3.1.dev0.dist-info/RECORD +624 -0
  305. Kivy_examples-2.3.1.dev0.dist-info/WHEEL +5 -0
  306. Kivy_examples-2.3.1.dev0.dist-info/dependency_links.txt +1 -0
  307. Kivy_examples-2.3.1.dev0.dist-info/top_level.txt +1 -0
  308. kivy/__init__.py +519 -0
  309. kivy/_version.py +18 -0
  310. kivy/animation.py +831 -0
  311. kivy/app.py +1213 -0
  312. kivy/atlas.py +456 -0
  313. kivy/base.py +617 -0
  314. kivy/cache.py +262 -0
  315. kivy/clock.py +1172 -0
  316. kivy/compat.py +82 -0
  317. kivy/config.py +1004 -0
  318. kivy/context.py +102 -0
  319. kivy/core/__init__.py +247 -0
  320. kivy/core/audio/__init__.py +223 -0
  321. kivy/core/audio/audio_android.py +104 -0
  322. kivy/core/audio/audio_avplayer.py +82 -0
  323. kivy/core/audio/audio_ffpyplayer.py +185 -0
  324. kivy/core/audio/audio_gstplayer.py +101 -0
  325. kivy/core/audio/audio_pygame.py +127 -0
  326. kivy/core/camera/__init__.py +151 -0
  327. kivy/core/camera/camera_android.py +206 -0
  328. kivy/core/camera/camera_gi.py +170 -0
  329. kivy/core/camera/camera_opencv.py +163 -0
  330. kivy/core/camera/camera_picamera.py +96 -0
  331. kivy/core/clipboard/__init__.py +157 -0
  332. kivy/core/clipboard/_clipboard_ext.py +36 -0
  333. kivy/core/clipboard/clipboard_android.py +91 -0
  334. kivy/core/clipboard/clipboard_dbusklipper.py +41 -0
  335. kivy/core/clipboard/clipboard_dummy.py +26 -0
  336. kivy/core/clipboard/clipboard_gtk3.py +47 -0
  337. kivy/core/clipboard/clipboard_nspaste.py +44 -0
  338. kivy/core/clipboard/clipboard_pygame.py +67 -0
  339. kivy/core/clipboard/clipboard_sdl2.py +36 -0
  340. kivy/core/clipboard/clipboard_winctypes.py +107 -0
  341. kivy/core/clipboard/clipboard_xclip.py +29 -0
  342. kivy/core/clipboard/clipboard_xsel.py +26 -0
  343. kivy/core/gl/__init__.py +90 -0
  344. kivy/core/image/__init__.py +996 -0
  345. kivy/core/image/img_dds.py +40 -0
  346. kivy/core/image/img_ffpyplayer.py +87 -0
  347. kivy/core/image/img_pil.py +123 -0
  348. kivy/core/image/img_pygame.py +119 -0
  349. kivy/core/image/img_sdl2.py +66 -0
  350. kivy/core/image/img_tex.py +58 -0
  351. kivy/core/spelling/__init__.py +135 -0
  352. kivy/core/spelling/spelling_enchant.py +50 -0
  353. kivy/core/spelling/spelling_osxappkit.py +64 -0
  354. kivy/core/text/__init__.py +1090 -0
  355. kivy/core/text/markup.py +893 -0
  356. kivy/core/text/text_pango.py +145 -0
  357. kivy/core/text/text_pil.py +84 -0
  358. kivy/core/text/text_pygame.py +117 -0
  359. kivy/core/text/text_sdl2.py +50 -0
  360. kivy/core/video/__init__.py +219 -0
  361. kivy/core/video/video_ffmpeg.py +106 -0
  362. kivy/core/video/video_ffpyplayer.py +449 -0
  363. kivy/core/video/video_gstplayer.py +140 -0
  364. kivy/core/video/video_null.py +12 -0
  365. kivy/core/window/__init__.py +2515 -0
  366. kivy/core/window/window_egl_rpi.py +86 -0
  367. kivy/core/window/window_pygame.py +441 -0
  368. kivy/core/window/window_sdl2.py +999 -0
  369. kivy/deps/__init__.py +6 -0
  370. kivy/effects/__init__.py +23 -0
  371. kivy/effects/dampedscroll.py +114 -0
  372. kivy/effects/kinetic.py +193 -0
  373. kivy/effects/opacityscroll.py +27 -0
  374. kivy/effects/scroll.py +126 -0
  375. kivy/event.py +12 -0
  376. kivy/eventmanager/__init__.py +185 -0
  377. kivy/extras/__init__.py +0 -0
  378. kivy/extras/highlight.py +52 -0
  379. kivy/factory.py +190 -0
  380. kivy/factory_registers.py +201 -0
  381. kivy/garden/__init__.py +186 -0
  382. kivy/geometry.py +121 -0
  383. kivy/gesture.py +424 -0
  384. kivy/graphics/__init__.py +126 -0
  385. kivy/graphics/cgl_backend/__init__.py +0 -0
  386. kivy/input/__init__.py +39 -0
  387. kivy/input/factory.py +35 -0
  388. kivy/input/motionevent.py +587 -0
  389. kivy/input/postproc/__init__.py +27 -0
  390. kivy/input/postproc/calibration.py +200 -0
  391. kivy/input/postproc/dejitter.py +74 -0
  392. kivy/input/postproc/doubletap.py +101 -0
  393. kivy/input/postproc/ignorelist.py +47 -0
  394. kivy/input/postproc/retaintouch.py +93 -0
  395. kivy/input/postproc/tripletap.py +106 -0
  396. kivy/input/provider.py +40 -0
  397. kivy/input/providers/__init__.py +68 -0
  398. kivy/input/providers/androidjoystick.py +117 -0
  399. kivy/input/providers/hidinput.py +778 -0
  400. kivy/input/providers/leapfinger.py +113 -0
  401. kivy/input/providers/linuxwacom.py +396 -0
  402. kivy/input/providers/mactouch.py +220 -0
  403. kivy/input/providers/mouse.py +424 -0
  404. kivy/input/providers/mtdev.py +380 -0
  405. kivy/input/providers/probesysfs.py +254 -0
  406. kivy/input/providers/tuio.py +326 -0
  407. kivy/input/providers/wm_common.py +162 -0
  408. kivy/input/providers/wm_pen.py +121 -0
  409. kivy/input/providers/wm_touch.py +157 -0
  410. kivy/input/recorder.py +335 -0
  411. kivy/input/shape.py +27 -0
  412. kivy/interactive.py +335 -0
  413. kivy/lang/__init__.py +883 -0
  414. kivy/lang/builder.py +1004 -0
  415. kivy/lang/parser.py +822 -0
  416. kivy/lib/__init__.py +21 -0
  417. kivy/lib/ddsfile.py +419 -0
  418. kivy/lib/gstplayer/__init__.py +27 -0
  419. kivy/lib/mtdev.py +254 -0
  420. kivy/lib/vidcore_lite/__init__.py +0 -0
  421. kivy/loader.py +579 -0
  422. kivy/logger.py +646 -0
  423. kivy/metrics.py +421 -0
  424. kivy/modules/__init__.py +300 -0
  425. kivy/modules/_webdebugger.py +200 -0
  426. kivy/modules/console.py +1059 -0
  427. kivy/modules/cursor.py +75 -0
  428. kivy/modules/inspector.py +755 -0
  429. kivy/modules/joycursor.py +299 -0
  430. kivy/modules/keybinding.py +64 -0
  431. kivy/modules/monitor.py +90 -0
  432. kivy/modules/recorder.py +94 -0
  433. kivy/modules/screen.py +183 -0
  434. kivy/modules/showborder.py +33 -0
  435. kivy/modules/touchring.py +97 -0
  436. kivy/modules/webdebugger.py +30 -0
  437. kivy/multistroke.py +1477 -0
  438. kivy/network/__init__.py +7 -0
  439. kivy/network/urlrequest.py +794 -0
  440. kivy/parser.py +154 -0
  441. kivy/resources.py +102 -0
  442. kivy/storage/__init__.py +405 -0
  443. kivy/storage/dictstore.py +98 -0
  444. kivy/storage/jsonstore.py +92 -0
  445. kivy/storage/redisstore.py +103 -0
  446. kivy/support.py +267 -0
  447. kivy/tests/__init__.py +11 -0
  448. kivy/tests/async_common.py +568 -0
  449. kivy/tests/common.py +524 -0
  450. kivy/tests/conftest.py +33 -0
  451. kivy/tests/fixtures.py +169 -0
  452. kivy/tests/perf_test_textinput.py +195 -0
  453. kivy/tests/pyinstaller/simple_widget/main.py +12 -0
  454. kivy/tests/pyinstaller/simple_widget/project/__init__.py +0 -0
  455. kivy/tests/pyinstaller/simple_widget/project/widget.py +12 -0
  456. kivy/tests/pyinstaller/test_pyinstaller.py +115 -0
  457. kivy/tests/pyinstaller/video_widget/main.py +6 -0
  458. kivy/tests/pyinstaller/video_widget/project/__init__.py +38 -0
  459. kivy/tests/test_animations.py +415 -0
  460. kivy/tests/test_app.py +216 -0
  461. kivy/tests/test_audio.py +69 -0
  462. kivy/tests/test_benchmark.py +292 -0
  463. kivy/tests/test_clipboard.py +48 -0
  464. kivy/tests/test_clock.py +292 -0
  465. kivy/tests/test_compat.py +6 -0
  466. kivy/tests/test_config.py +35 -0
  467. kivy/tests/test_coverage.py +83 -0
  468. kivy/tests/test_doc_gallery.py +38 -0
  469. kivy/tests/test_environ_cli.py +50 -0
  470. kivy/tests/test_fbo_py2py3.py +74 -0
  471. kivy/tests/test_filechooser.py +11 -0
  472. kivy/tests/test_filechooser_unicode.py +82 -0
  473. kivy/tests/test_fonts.py +42 -0
  474. kivy/tests/test_garden.py +23 -0
  475. kivy/tests/test_graphics.py +1149 -0
  476. kivy/tests/test_graphics_svg.py +84 -0
  477. kivy/tests/test_image.py +74 -0
  478. kivy/tests/test_imageloader.py +485 -0
  479. kivy/tests/test_invalid_lang.py +42 -0
  480. kivy/tests/test_issues/test_6315.py +55 -0
  481. kivy/tests/test_issues/test_issue_1084.py +47 -0
  482. kivy/tests/test_issues/test_issue_1091.py +19 -0
  483. kivy/tests/test_issues/test_issue_599.py +21 -0
  484. kivy/tests/test_issues/test_issue_609.py +19 -0
  485. kivy/tests/test_issues/test_issue_6909.py +28 -0
  486. kivy/tests/test_issues/test_issue_883.py +12 -0
  487. kivy/tests/test_kivy_init.py +30 -0
  488. kivy/tests/test_knspace.py +247 -0
  489. kivy/tests/test_lang.py +431 -0
  490. kivy/tests/test_lang_complex.py +87 -0
  491. kivy/tests/test_lang_pre_process_and_post_process.py +394 -0
  492. kivy/tests/test_logger.py +516 -0
  493. kivy/tests/test_metrics.py +30 -0
  494. kivy/tests/test_module_inspector.py +382 -0
  495. kivy/tests/test_motion_event.py +44 -0
  496. kivy/tests/test_mouse_hover_event.py +249 -0
  497. kivy/tests/test_mouse_multitouchsim.py +554 -0
  498. kivy/tests/test_multistroke.py +389 -0
  499. kivy/tests/test_properties.py +1332 -0
  500. kivy/tests/test_resources.py +79 -0
  501. kivy/tests/test_rst_replace.py +63 -0
  502. kivy/tests/test_screen.py +38 -0
  503. kivy/tests/test_storage.py +135 -0
  504. kivy/tests/test_uix_actionbar.py +363 -0
  505. kivy/tests/test_uix_anchorlayout.py +79 -0
  506. kivy/tests/test_uix_asyncimage.py +133 -0
  507. kivy/tests/test_uix_boxlayout.py +94 -0
  508. kivy/tests/test_uix_bubble.py +425 -0
  509. kivy/tests/test_uix_carousel.py +93 -0
  510. kivy/tests/test_uix_colorpicker.py +77 -0
  511. kivy/tests/test_uix_dropdown.py +91 -0
  512. kivy/tests/test_uix_gridlayout.py +244 -0
  513. kivy/tests/test_uix_layout.py +16 -0
  514. kivy/tests/test_uix_modal.py +101 -0
  515. kivy/tests/test_uix_recyclegridlayout.py +383 -0
  516. kivy/tests/test_uix_relativelayout.py +30 -0
  517. kivy/tests/test_uix_scrollview.py +358 -0
  518. kivy/tests/test_uix_settings.py +33 -0
  519. kivy/tests/test_uix_slider.py +156 -0
  520. kivy/tests/test_uix_stacklayout.py +120 -0
  521. kivy/tests/test_uix_textinput.py +577 -0
  522. kivy/tests/test_uix_translate_coordinates.py +72 -0
  523. kivy/tests/test_uix_videoplayer.py +112 -0
  524. kivy/tests/test_uix_widget.py +137 -0
  525. kivy/tests/test_urlrequest/test_urlrequest_requests.py +378 -0
  526. kivy/tests/test_urlrequest/test_urlrequest_urllib.py +155 -0
  527. kivy/tests/test_utils.py +237 -0
  528. kivy/tests/test_vector.py +256 -0
  529. kivy/tests/test_video.py +25 -0
  530. kivy/tests/test_weakmethod.py +44 -0
  531. kivy/tests/test_widget.py +127 -0
  532. kivy/tests/test_widget_walk.py +70 -0
  533. kivy/tests/test_window_base.py +60 -0
  534. kivy/tests/test_window_info.py +29 -0
  535. kivy/tests/visual_test_label.py +291 -0
  536. kivy/tools/__init__.py +44 -0
  537. kivy/tools/benchmark.py +286 -0
  538. kivy/tools/changelog_parser.py +120 -0
  539. kivy/tools/coverage.py +135 -0
  540. kivy/tools/gallery.py +323 -0
  541. kivy/tools/generate-icons.py +117 -0
  542. kivy/tools/gles_compat/subset_gles.py +125 -0
  543. kivy/tools/highlight/__init__.py +9 -0
  544. kivy/tools/kviewer.py +80 -0
  545. kivy/tools/packaging/__init__.py +12 -0
  546. kivy/tools/packaging/cython_cfg.py +82 -0
  547. kivy/tools/packaging/factory.py +105 -0
  548. kivy/tools/packaging/pyinstaller_hooks/__init__.py +381 -0
  549. kivy/tools/packaging/pyinstaller_hooks/__main__.py +29 -0
  550. kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py +9 -0
  551. kivy/tools/packaging/pyinstaller_hooks/pyi_rth_kivy.py +17 -0
  552. kivy/tools/pep8checker/pep8.py +2316 -0
  553. kivy/tools/pep8checker/pep8kivy.py +109 -0
  554. kivy/tools/report.py +223 -0
  555. kivy/tools/stub-gl-debug.py +201 -0
  556. kivy/tools/texturecompress.py +233 -0
  557. kivy/uix/__init__.py +56 -0
  558. kivy/uix/accordion.py +484 -0
  559. kivy/uix/actionbar.py +934 -0
  560. kivy/uix/anchorlayout.py +122 -0
  561. kivy/uix/behaviors/__init__.py +95 -0
  562. kivy/uix/behaviors/button.py +212 -0
  563. kivy/uix/behaviors/codenavigation.py +167 -0
  564. kivy/uix/behaviors/compoundselection.py +688 -0
  565. kivy/uix/behaviors/cover.py +160 -0
  566. kivy/uix/behaviors/drag.py +234 -0
  567. kivy/uix/behaviors/emacs.py +140 -0
  568. kivy/uix/behaviors/focus.py +595 -0
  569. kivy/uix/behaviors/knspace.py +590 -0
  570. kivy/uix/behaviors/togglebutton.py +156 -0
  571. kivy/uix/behaviors/touchripple.py +318 -0
  572. kivy/uix/boxlayout.py +331 -0
  573. kivy/uix/bubble.py +576 -0
  574. kivy/uix/button.py +137 -0
  575. kivy/uix/camera.py +118 -0
  576. kivy/uix/carousel.py +695 -0
  577. kivy/uix/checkbox.py +197 -0
  578. kivy/uix/codeinput.py +238 -0
  579. kivy/uix/colorpicker.py +486 -0
  580. kivy/uix/dropdown.py +391 -0
  581. kivy/uix/effectwidget.py +772 -0
  582. kivy/uix/filechooser.py +1134 -0
  583. kivy/uix/floatlayout.py +148 -0
  584. kivy/uix/gesturesurface.py +625 -0
  585. kivy/uix/gridlayout.py +629 -0
  586. kivy/uix/image.py +528 -0
  587. kivy/uix/label.py +1200 -0
  588. kivy/uix/layout.py +322 -0
  589. kivy/uix/modalview.py +339 -0
  590. kivy/uix/pagelayout.py +233 -0
  591. kivy/uix/popup.py +266 -0
  592. kivy/uix/progressbar.py +95 -0
  593. kivy/uix/recycleboxlayout.py +183 -0
  594. kivy/uix/recyclegridlayout.py +255 -0
  595. kivy/uix/recyclelayout.py +446 -0
  596. kivy/uix/recycleview/__init__.py +624 -0
  597. kivy/uix/recycleview/datamodel.py +194 -0
  598. kivy/uix/recycleview/layout.py +253 -0
  599. kivy/uix/recycleview/views.py +423 -0
  600. kivy/uix/relativelayout.py +324 -0
  601. kivy/uix/rst.py +1492 -0
  602. kivy/uix/sandbox.py +198 -0
  603. kivy/uix/scatter.py +645 -0
  604. kivy/uix/scatterlayout.py +93 -0
  605. kivy/uix/screenmanager.py +1275 -0
  606. kivy/uix/scrollview.py +1288 -0
  607. kivy/uix/settings.py +1343 -0
  608. kivy/uix/slider.py +421 -0
  609. kivy/uix/spinner.py +221 -0
  610. kivy/uix/splitter.py +430 -0
  611. kivy/uix/stacklayout.py +331 -0
  612. kivy/uix/stencilview.py +40 -0
  613. kivy/uix/switch.py +122 -0
  614. kivy/uix/tabbedpanel.py +880 -0
  615. kivy/uix/textinput.py +4049 -0
  616. kivy/uix/togglebutton.py +37 -0
  617. kivy/uix/treeview.py +665 -0
  618. kivy/uix/video.py +302 -0
  619. kivy/uix/videoplayer.py +697 -0
  620. kivy/uix/vkeyboard.py +879 -0
  621. kivy/uix/widget.py +1629 -0
  622. kivy/utils.py +550 -0
  623. kivy/vector.py +412 -0
  624. kivy/weakmethod.py +72 -0
kivy/uix/widget.py ADDED
@@ -0,0 +1,1629 @@
1
+ '''
2
+ Widget class
3
+ ============
4
+
5
+ The :class:`Widget` class is the base class required for creating Widgets.
6
+ This widget class was designed with a couple of principles in mind:
7
+
8
+ * *Event Driven*
9
+
10
+ Widget interaction is built on top of events that occur. If a property
11
+ changes, the widget can respond to the change in the 'on_<propname>'
12
+ callback. If nothing changes, nothing will be done. That's the main
13
+ goal of the :class:`~kivy.properties.Property` class.
14
+
15
+ * *Separation Of Concerns (the widget and its graphical representation)*
16
+
17
+ Widgets don't have a `draw()` method. This is done on purpose: The idea
18
+ is to allow you to create your own graphical representation outside the
19
+ widget class.
20
+ Obviously you can still use all the available properties to do that, so
21
+ that your representation properly reflects the widget's current state.
22
+ Every widget has its own :class:`~kivy.graphics.Canvas` that you
23
+ can use to draw. This separation allows Kivy to run your
24
+ application in a very efficient manner.
25
+
26
+ * *Bounding Box / Collision*
27
+
28
+ Often you want to know if a certain point is within the bounds of your
29
+ widget. An example would be a button widget where you only want to
30
+ trigger an action when the button itself is actually touched.
31
+ For this, you can use the :meth:`~Widget.collide_point` method, which
32
+ will return True if the point you pass to it is inside the axis-aligned
33
+ bounding box defined by the widget's position and size.
34
+ If a simple AABB is not sufficient, you can override the method to
35
+ perform the collision checks with more complex shapes, e.g. a polygon.
36
+ You can also check if a widget collides with another widget with
37
+ :meth:`~Widget.collide_widget`.
38
+
39
+
40
+ We also have some default values and behaviors that you should be aware of:
41
+
42
+ * A :class:`Widget` is not a :class:`~kivy.uix.layout.Layout`: it will not
43
+ change the position or the size of its children. If you want control over
44
+ positioning or sizing, use a :class:`~kivy.uix.layout.Layout`.
45
+
46
+ * The default size of a widget is (100, 100). This is only changed if the
47
+ parent is a :class:`~kivy.uix.layout.Layout`.
48
+ For example, if you add a :class:`Label` inside a
49
+ :class:`Button`, the label will not inherit the button's size or position
50
+ because the button is not a *Layout*: it's just another *Widget*.
51
+
52
+ * The default size_hint is (1, 1). If the parent is a :class:`Layout`, then the
53
+ widget size will be the parent layout's size.
54
+
55
+ * :meth:`~Widget.on_touch_down`, :meth:`~Widget.on_touch_move`,
56
+ :meth:`~Widget.on_touch_up` don't do any sort of collisions. If you want to
57
+ know if the touch is inside your widget, use :meth:`~Widget.collide_point`.
58
+
59
+ Using Properties
60
+ ----------------
61
+
62
+ When you read the documentation, all properties are described in the format::
63
+
64
+ <name> is a <property class> and defaults to <default value>.
65
+
66
+ e.g.
67
+
68
+ :attr:`~kivy.uix.label.Label.text` is a
69
+ :class:`~kivy.properties.StringProperty` and defaults to ''.
70
+
71
+ If you want to be notified when the pos attribute changes, i.e. when the
72
+ widget moves, you can bind your own callback function like this::
73
+
74
+ def callback_pos(instance, value):
75
+ print('The widget', instance, 'moved to', value)
76
+
77
+ wid = Widget()
78
+ wid.bind(pos=callback_pos)
79
+
80
+ Read more about :doc:`/api-kivy.properties`.
81
+
82
+ Basic drawing
83
+ -------------
84
+
85
+ Widgets support a range of drawing instructions that you can use to customize
86
+ the look of your widgets and layouts. For example, to draw a background image
87
+ for your widget, you can do the following:
88
+
89
+ .. code-block:: python
90
+
91
+ def redraw(self, args):
92
+ self.bg_rect.size = self.size
93
+ self.bg_rect.pos = self.pos
94
+
95
+ widget = Widget()
96
+ with widget.canvas:
97
+ widget.bg_rect = Rectangle(source="cover.jpg", pos=self.pos, \
98
+ size=self.size)
99
+ widget.bind(pos=redraw, size=redraw)
100
+
101
+ To draw a background in kv:
102
+
103
+ .. code-block:: kv
104
+
105
+ Widget:
106
+ canvas:
107
+ Rectangle:
108
+ source: "cover.jpg"
109
+ size: self.size
110
+ pos: self.pos
111
+
112
+ These examples only scratch the surface. Please see the :mod:`kivy.graphics`
113
+ documentation for more information.
114
+
115
+ .. _widget-event-bubbling:
116
+
117
+ Widget touch event bubbling
118
+ ---------------------------
119
+
120
+ When you catch touch events between multiple widgets, you often
121
+ need to be aware of the order in which these events are propagated. In Kivy,
122
+ events bubble up from the first child upwards through the other children.
123
+ If a widget has children, the event is passed through its children before
124
+ being passed on to the widget after it.
125
+
126
+ As the :meth:`~kivy.uix.widget.Widget.add_widget` method inserts widgets at
127
+ index 0 by default, this means the event goes from the most recently added
128
+ widget back to the first one added. Consider the following:
129
+
130
+ .. code-block:: python
131
+
132
+ box = BoxLayout()
133
+ box.add_widget(Label(text="a"))
134
+ box.add_widget(Label(text="b"))
135
+ box.add_widget(Label(text="c"))
136
+
137
+ The label with text "c" gets the event first, "b" second and "a" last. You can
138
+ reverse this order by manually specifying the index:
139
+
140
+ .. code-block:: python
141
+
142
+ box = BoxLayout()
143
+ box.add_widget(Label(text="a"), index=0)
144
+ box.add_widget(Label(text="b"), index=1)
145
+ box.add_widget(Label(text="c"), index=2)
146
+
147
+ Now the order would be "a", "b" then "c". One thing to keep in mind when using
148
+ kv is that declaring a widget uses the
149
+ :meth:`~kivy.uix.widget.Widget.add_widget` method for insertion. Hence, using
150
+
151
+ .. code-block:: kv
152
+
153
+ BoxLayout:
154
+ MyLabel:
155
+ text: "a"
156
+ MyLabel:
157
+ text: "b"
158
+ MyLabel:
159
+ text: "c"
160
+
161
+ would result in the event order "c", "b" then "a" as "c" was actually the last
162
+ added widget. It thus has index 0, "b" index 1 and "a" index 2. Effectively,
163
+ the child order is the reverse of its listed order.
164
+
165
+ This ordering is the same for the :meth:`~kivy.uix.widget.Widget.on_touch_move`
166
+ and :meth:`~kivy.uix.widget.Widget.on_touch_up` events.
167
+
168
+ In order to stop this event bubbling, a method can return `True`. This tells
169
+ Kivy the event has been handled and the event propagation stops. For example:
170
+
171
+ .. code-block:: python
172
+
173
+ class MyWidget(Widget):
174
+ def on_touch_down(self, touch):
175
+ If <some_condition>:
176
+ # Do stuff here and kill the event
177
+ return True
178
+ else:
179
+ return super(MyWidget, self).on_touch_down(touch)
180
+
181
+ This approach gives you good control over exactly how events are dispatched
182
+ and managed. Sometimes, however, you may wish to let the event be completely
183
+ propagated before taking action. You can use the
184
+ :class:`~kivy.clock.Clock` to help you here:
185
+
186
+ .. code-block:: python
187
+
188
+ class MyWidget(Label):
189
+ def on_touch_down(self, touch, after=False):
190
+ if after:
191
+ print "Fired after the event has been dispatched!"
192
+ else:
193
+ Clock.schedule_once(lambda dt: self.on_touch_down(touch, True))
194
+ return super(MyWidget, self).on_touch_down(touch)
195
+
196
+ Usage of :attr:`Widget.center`, :attr:`Widget.right`, and :attr:`Widget.top`
197
+ ----------------------------------------------------------------------------
198
+
199
+ A common mistake when using one of the computed properties such as
200
+ :attr:`Widget.right` is to use it to make a widget follow its parent with a
201
+ KV rule such as `right: self.parent.right`. Consider, for example:
202
+
203
+ .. code-block:: kv
204
+
205
+ FloatLayout:
206
+ id: layout
207
+ width: 100
208
+ Widget:
209
+ id: wid
210
+ right: layout.right
211
+
212
+ The (mistaken) expectation is that this rule ensures that wid's right will
213
+ always be whatever layout's right is - that is wid.right and layout.right will
214
+ always be identical. In actual fact, this rule only says that "whenever
215
+ layout's `right` changes, wid's right will be set to that value". The
216
+ difference being that as long as `layout.right` doesn't change, `wid.right`
217
+ could be anything, even a value that will make them different.
218
+
219
+ Specifically, for the KV code above, consider the following example::
220
+
221
+ >>> print(layout.right, wid.right)
222
+ (100, 100)
223
+ >>> wid.x = 200
224
+ >>> print(layout.right, wid.right)
225
+ (100, 300)
226
+
227
+ As can be seen, initially they are in sync, however, when we change `wid.x`
228
+ they go out of sync because `layout.right` is not changed and the rule is not
229
+ triggered.
230
+
231
+ The proper way to make the widget follow its parent's right is to use
232
+ :attr:`Widget.pos_hint`. If instead of `right: layout.right` we did
233
+ `pos_hint: {'right': 1}`, then the widgets right will always be set to be
234
+ at the parent's right at each layout update.
235
+ '''
236
+
237
+ __all__ = ('Widget', 'WidgetException')
238
+
239
+ from kivy.event import EventDispatcher
240
+ from kivy.eventmanager import (
241
+ MODE_DONT_DISPATCH,
242
+ MODE_FILTERED_DISPATCH,
243
+ MODE_DEFAULT_DISPATCH
244
+ )
245
+ from kivy.factory import Factory
246
+ from kivy.properties import (
247
+ NumericProperty, StringProperty, AliasProperty, ReferenceListProperty,
248
+ ObjectProperty, ListProperty, DictProperty, BooleanProperty)
249
+ from kivy.graphics import (
250
+ Canvas, Translate, Fbo, ClearColor, ClearBuffers, Scale)
251
+ from kivy.graphics.transformation import Matrix
252
+ from kivy.base import EventLoop
253
+ from kivy.lang import Builder
254
+ from kivy.context import get_current_context
255
+ from kivy.weakproxy import WeakProxy
256
+ from functools import partial
257
+ from itertools import islice
258
+
259
+
260
+ # References to all the widget destructors (partial method with widget uid as
261
+ # key).
262
+ _widget_destructors = {}
263
+
264
+
265
+ def _widget_destructor(uid, r):
266
+ # Internal method called when a widget is deleted from memory. the only
267
+ # thing we remember about it is its uid. Clear all the associated callbacks
268
+ # created in kv language.
269
+ del _widget_destructors[uid]
270
+ Builder.unbind_widget(uid)
271
+
272
+
273
+ class WidgetException(Exception):
274
+ '''Fired when the widget gets an exception.
275
+ '''
276
+ pass
277
+
278
+
279
+ class WidgetMetaclass(type):
280
+ '''Metaclass to automatically register new widgets for the
281
+ :class:`~kivy.factory.Factory`.
282
+
283
+ .. warning::
284
+ This metaclass is used by the Widget. Do not use it directly!
285
+ '''
286
+ def __init__(mcs, name, bases, attrs):
287
+ super(WidgetMetaclass, mcs).__init__(name, bases, attrs)
288
+ Factory.register(name, cls=mcs)
289
+
290
+
291
+ #: Base class used for Widget, that inherits from :class:`EventDispatcher`
292
+ WidgetBase = WidgetMetaclass('WidgetBase', (EventDispatcher, ), {})
293
+
294
+
295
+ class Widget(WidgetBase):
296
+ '''Widget class. See module documentation for more information.
297
+
298
+ :Events:
299
+ `on_touch_down`: `(touch, )`
300
+ Fired when a new touch event occurs. `touch` is the touch object.
301
+ `on_touch_move`: `(touch, )`
302
+ Fired when an existing touch moves. `touch` is the touch object.
303
+ `on_touch_up`: `(touch, )`
304
+ Fired when an existing touch disappears. `touch` is the touch
305
+ object.
306
+ `on_kv_post`: `(base_widget, )`
307
+ Fired after all the kv rules associated with the widget
308
+ and all other widgets that are in any of those rules have had
309
+ all their kv rules applied. `base_widget` is the base-most widget
310
+ whose instantiation triggered the kv rules (i.e. the widget
311
+ instantiated from Python, e.g. ``MyWidget()``).
312
+
313
+ .. versionchanged:: 1.11.0
314
+
315
+ .. warning::
316
+ Adding a `__del__` method to a class derived from Widget with Python
317
+ prior to 3.4 will disable automatic garbage collection for instances
318
+ of that class. This is because the Widget class creates reference
319
+ cycles, thereby `preventing garbage collection
320
+ <https://docs.python.org/2/library/gc.html#gc.garbage>`_.
321
+
322
+ .. versionchanged:: 1.0.9
323
+ Everything related to event properties has been moved to the
324
+ :class:`~kivy.event.EventDispatcher`. Event properties can now be used
325
+ when constructing a simple class without subclassing :class:`Widget`.
326
+
327
+ .. versionchanged:: 1.5.0
328
+ The constructor now accepts on_* arguments to automatically bind
329
+ callbacks to properties or events, as in the Kv language.
330
+ '''
331
+
332
+ __metaclass__ = WidgetMetaclass
333
+ __events__ = (
334
+ 'on_motion', 'on_touch_down', 'on_touch_move', 'on_touch_up',
335
+ 'on_kv_post'
336
+ )
337
+ _proxy_ref = None
338
+
339
+ def __init__(self, **kwargs):
340
+ # Before doing anything, ensure the windows exist.
341
+ EventLoop.ensure_window()
342
+
343
+ # Assign the default context of the widget creation.
344
+ if not hasattr(self, '_context'):
345
+ self._context = get_current_context()
346
+
347
+ no_builder = '__no_builder' in kwargs
348
+ self._disabled_value = False
349
+ if no_builder:
350
+ del kwargs['__no_builder']
351
+ on_args = {k: v for k, v in kwargs.items() if k[:3] == 'on_'}
352
+ for key in on_args:
353
+ del kwargs[key]
354
+
355
+ self._disabled_count = 0
356
+
357
+ super(Widget, self).__init__(**kwargs)
358
+
359
+ # Create the default canvas if it does not exist.
360
+ if self.canvas is None:
361
+ self.canvas = Canvas(opacity=self.opacity)
362
+
363
+ # Apply all the styles.
364
+ if not no_builder:
365
+ rule_children = []
366
+ self.apply_class_lang_rules(
367
+ ignored_consts=self._kwargs_applied_init,
368
+ rule_children=rule_children)
369
+
370
+ for widget in rule_children:
371
+ widget.dispatch('on_kv_post', self)
372
+ self.dispatch('on_kv_post', self)
373
+
374
+ # Bind all the events.
375
+ if on_args:
376
+ self.bind(**on_args)
377
+
378
+ @property
379
+ def proxy_ref(self):
380
+ '''Return a proxy reference to the widget, i.e. without creating a
381
+ reference to the widget. See `weakref.proxy
382
+ <http://docs.python.org/2/library/weakref.html?highlight\
383
+ =proxy#weakref.proxy>`_ for more information.
384
+
385
+ .. versionadded:: 1.7.2
386
+ '''
387
+ _proxy_ref = self._proxy_ref
388
+ if _proxy_ref is not None:
389
+ return _proxy_ref
390
+
391
+ f = partial(_widget_destructor, self.uid)
392
+ self._proxy_ref = _proxy_ref = WeakProxy(self, f)
393
+ # Only f should be enough here, but it appears that is a very
394
+ # specific case, the proxy destructor is not called if both f and
395
+ # _proxy_ref are not together in a tuple.
396
+ _widget_destructors[self.uid] = (f, _proxy_ref)
397
+ return _proxy_ref
398
+
399
+ def __hash__(self):
400
+ return id(self)
401
+
402
+ def apply_class_lang_rules(
403
+ self, root=None, ignored_consts=set(), rule_children=None):
404
+ '''
405
+ Method that is called by kivy to apply the kv rules of this widget's
406
+ class.
407
+
408
+ :Parameters:
409
+ `root`: :class:`Widget`
410
+ The root widget that instantiated this widget in kv, if the
411
+ widget was instantiated in kv, otherwise ``None``.
412
+ `ignored_consts`: set
413
+ (internal) See :meth:`~kivy.lang.builder.BuilderBase.apply`.
414
+ `rule_children`: list
415
+ (internal) See :meth:`~kivy.lang.builder.BuilderBase.apply`.
416
+
417
+ This is useful to be able to execute code before/after the class kv
418
+ rules are applied to the widget. E.g. if the kv code requires some
419
+ properties to be initialized before it is used in a binding rule.
420
+ If overwriting remember to call ``super``, otherwise the kv rules will
421
+ not be applied.
422
+
423
+ In the following example,
424
+
425
+ .. code-block:: python
426
+
427
+ class MyWidget(Widget):
428
+ pass
429
+
430
+ class OtherWidget(MyWidget):
431
+ pass
432
+
433
+ .. code-block:: kv
434
+
435
+ <MyWidget>:
436
+ my_prop: some_value
437
+
438
+ <OtherWidget>:
439
+ other_prop: some_value
440
+
441
+ When ``OtherWidget`` is instantiated with ``OtherWidget()``, the
442
+ widget's :meth:`apply_class_lang_rules` is called and it applies the
443
+ kv rules of this class - ``<MyWidget>`` and ``<OtherWidget>``.
444
+
445
+ Similarly, when the widget is instantiated from kv, e.g.
446
+
447
+ .. code-block:: kv
448
+
449
+ <MyBox@BoxLayout>:
450
+ height: 55
451
+ OtherWidget:
452
+ width: 124
453
+
454
+ ``OtherWidget``'s :meth:`apply_class_lang_rules` is called and it
455
+ applies the kv rules of this class - ``<MyWidget>`` and
456
+ ``<OtherWidget>``.
457
+
458
+ .. note::
459
+
460
+ It applies only the class rules not the instance rules. I.e. in the
461
+ above kv example in the ``MyBox`` rule when ``OtherWidget`` is
462
+ instantiated, its :meth:`apply_class_lang_rules` applies the
463
+ ``<MyWidget>`` and ``<OtherWidget>`` rules to it - it does not
464
+ apply the ``width: 124`` rule. The ``width: 124`` rule is part of
465
+ the ``MyBox`` rule and is applied by the ``MyBox``'s instance's
466
+ :meth:`apply_class_lang_rules`.
467
+
468
+ .. versionchanged:: 1.11.0
469
+ '''
470
+ Builder.apply(
471
+ self, ignored_consts=ignored_consts,
472
+ rule_children=rule_children)
473
+
474
+ #
475
+ # Collision
476
+ #
477
+ def collide_point(self, x, y):
478
+ '''
479
+ Check if a point (x, y) is inside the widget's axis aligned bounding
480
+ box.
481
+
482
+ :Parameters:
483
+ `x`: numeric
484
+ x position of the point (in parent coordinates)
485
+ `y`: numeric
486
+ y position of the point (in parent coordinates)
487
+
488
+ :Returns:
489
+ A bool. True if the point is inside the bounding box, False
490
+ otherwise.
491
+
492
+ .. code-block:: python
493
+
494
+ >>> Widget(pos=(10, 10), size=(50, 50)).collide_point(40, 40)
495
+ True
496
+ '''
497
+ return self.x <= x <= self.right and self.y <= y <= self.top
498
+
499
+ def collide_widget(self, wid):
500
+ '''
501
+ Check if another widget collides with this widget. This function
502
+ performs an axis-aligned bounding box intersection test by default.
503
+
504
+ :Parameters:
505
+ `wid`: :class:`Widget` class
506
+ Widget to test collision with.
507
+
508
+ :Returns:
509
+ bool. True if the other widget collides with this widget, False
510
+ otherwise.
511
+
512
+ .. code-block:: python
513
+
514
+ >>> wid = Widget(size=(50, 50))
515
+ >>> wid2 = Widget(size=(50, 50), pos=(25, 25))
516
+ >>> wid.collide_widget(wid2)
517
+ True
518
+ >>> wid2.pos = (55, 55)
519
+ >>> wid.collide_widget(wid2)
520
+ False
521
+ '''
522
+ if self.right < wid.x:
523
+ return False
524
+ if self.x > wid.right:
525
+ return False
526
+ if self.top < wid.y:
527
+ return False
528
+ if self.y > wid.top:
529
+ return False
530
+ return True
531
+
532
+ def on_motion(self, etype, me):
533
+ '''Called when a motion event is received.
534
+
535
+ :Parameters:
536
+ `etype`: `str`
537
+ Event type, one of "begin", "update" or "end"
538
+ `me`: :class:`~kivy.input.motionevent.MotionEvent`
539
+ Received motion event
540
+ :Returns: `bool`
541
+ `True` to stop event dispatching
542
+
543
+ .. versionadded:: 2.1.0
544
+
545
+ .. warning::
546
+ This is an experimental method and it remains so while this warning
547
+ is present.
548
+ '''
549
+ if self.disabled or me.dispatch_mode == MODE_DONT_DISPATCH:
550
+ return
551
+ if me.type_id not in self.motion_filter:
552
+ return
553
+ filtered = self.motion_filter[me.type_id]
554
+ if filtered[0] is self and len(filtered) == 1:
555
+ return
556
+ if me.dispatch_mode == MODE_DEFAULT_DISPATCH:
557
+ last_filtered = filtered[-1]
558
+ for widget in self.children[:]:
559
+ if widget.dispatch('on_motion', etype, me):
560
+ return True
561
+ if widget is last_filtered:
562
+ return
563
+ if me.dispatch_mode == MODE_FILTERED_DISPATCH:
564
+ widgets = filtered[1:] if filtered[0] is self else filtered[:]
565
+ for widget in widgets:
566
+ if widget.dispatch('on_motion', etype, me):
567
+ return True
568
+
569
+ #
570
+ # Default event handlers
571
+ #
572
+ def on_touch_down(self, touch):
573
+ '''Receive a touch down event.
574
+
575
+ :Parameters:
576
+ `touch`: :class:`~kivy.input.motionevent.MotionEvent` class
577
+ Touch received. The touch is in parent coordinates. See
578
+ :mod:`~kivy.uix.relativelayout` for a discussion on
579
+ coordinate systems.
580
+
581
+ :Returns: bool
582
+ If True, the dispatching of the touch event will stop.
583
+ If False, the event will continue to be dispatched to the rest
584
+ of the widget tree.
585
+ '''
586
+ if self.disabled and self.collide_point(*touch.pos):
587
+ return True
588
+ for child in self.children[:]:
589
+ if child.dispatch('on_touch_down', touch):
590
+ return True
591
+
592
+ def on_touch_move(self, touch):
593
+ '''Receive a touch move event. The touch is in parent coordinates.
594
+
595
+ See :meth:`on_touch_down` for more information.
596
+ '''
597
+ if self.disabled:
598
+ return
599
+ for child in self.children[:]:
600
+ if child.dispatch('on_touch_move', touch):
601
+ return True
602
+
603
+ def on_touch_up(self, touch):
604
+ '''Receive a touch up event. The touch is in parent coordinates.
605
+
606
+ See :meth:`on_touch_down` for more information.
607
+ '''
608
+ if self.disabled:
609
+ return
610
+ for child in self.children[:]:
611
+ if child.dispatch('on_touch_up', touch):
612
+ return True
613
+
614
+ def on_kv_post(self, base_widget):
615
+ pass
616
+
617
+ #
618
+ # Tree management
619
+ #
620
+ def add_widget(self, widget, index=0, canvas=None):
621
+ '''Add a new widget as a child of this widget.
622
+
623
+ :Parameters:
624
+ `widget`: :class:`Widget`
625
+ Widget to add to our list of children.
626
+ `index`: int, defaults to 0
627
+ Index to insert the widget in the list. Notice that the default
628
+ of 0 means the widget is inserted at the beginning of the list
629
+ and will thus be drawn on top of other sibling widgets. For a
630
+ full discussion of the index and widget hierarchy, please see
631
+ the :doc:`Widgets Programming Guide <guide/widgets>`.
632
+
633
+ .. versionadded:: 1.0.5
634
+ `canvas`: str, defaults to None
635
+ Canvas to add widget's canvas to. Can be 'before', 'after' or
636
+ None for the default canvas.
637
+
638
+ .. versionadded:: 1.9.0
639
+
640
+ .. code-block:: python
641
+
642
+ >>> from kivy.uix.button import Button
643
+ >>> from kivy.uix.slider import Slider
644
+ >>> root = Widget()
645
+ >>> root.add_widget(Button())
646
+ >>> slider = Slider()
647
+ >>> root.add_widget(slider)
648
+
649
+ '''
650
+ if not isinstance(widget, Widget):
651
+ raise WidgetException(
652
+ 'add_widget() can be used only with instances'
653
+ ' of the Widget class.')
654
+
655
+ widget = widget.__self__
656
+ if widget is self:
657
+ raise WidgetException(
658
+ 'Widget instances cannot be added to themselves.')
659
+ parent = widget.parent
660
+ # Check if the widget is already a child of another widget.
661
+ if parent:
662
+ raise WidgetException('Cannot add %r, it already has a parent %r'
663
+ % (widget, parent))
664
+ widget.parent = parent = self
665
+ # Child will be disabled if added to a disabled parent.
666
+ widget.inc_disabled(self._disabled_count)
667
+
668
+ canvas = self.canvas.before if canvas == 'before' else \
669
+ self.canvas.after if canvas == 'after' else self.canvas
670
+
671
+ if index == 0 or len(self.children) == 0:
672
+ self.children.insert(0, widget)
673
+ canvas.add(widget.canvas)
674
+ else:
675
+ canvas = self.canvas
676
+ children = self.children
677
+ if index >= len(children):
678
+ index = len(children)
679
+ next_index = canvas.indexof(children[-1].canvas)
680
+ else:
681
+ next_child = children[index]
682
+ next_index = canvas.indexof(next_child.canvas)
683
+ if next_index == -1:
684
+ next_index = canvas.length()
685
+ else:
686
+ next_index += 1
687
+
688
+ children.insert(index, widget)
689
+ # We never want to insert widget _before_ canvas.before.
690
+ if next_index == 0 and canvas.has_before:
691
+ next_index = 1
692
+ canvas.insert(next_index, widget.canvas)
693
+ for type_id in widget.motion_filter:
694
+ self.register_for_motion_event(type_id, widget)
695
+ widget.fbind('motion_filter', self._update_motion_filter)
696
+
697
+ def remove_widget(self, widget):
698
+ '''Remove a widget from the children of this widget.
699
+
700
+ :Parameters:
701
+ `widget`: :class:`Widget`
702
+ Widget to remove from our children list.
703
+
704
+ .. code-block:: python
705
+
706
+ >>> from kivy.uix.button import Button
707
+ >>> root = Widget()
708
+ >>> button = Button()
709
+ >>> root.add_widget(button)
710
+ >>> root.remove_widget(button)
711
+ '''
712
+ if widget not in self.children:
713
+ return
714
+ self.children.remove(widget)
715
+ if widget.canvas in self.canvas.children:
716
+ self.canvas.remove(widget.canvas)
717
+ elif widget.canvas in self.canvas.after.children:
718
+ self.canvas.after.remove(widget.canvas)
719
+ elif widget.canvas in self.canvas.before.children:
720
+ self.canvas.before.remove(widget.canvas)
721
+ for type_id in widget.motion_filter:
722
+ self.unregister_for_motion_event(type_id, widget)
723
+ widget.funbind('motion_filter', self._update_motion_filter)
724
+ widget.parent = None
725
+ widget.dec_disabled(self._disabled_count)
726
+
727
+ def clear_widgets(self, children=None):
728
+ '''
729
+ Remove all (or the specified) :attr:`~Widget.children` of this widget.
730
+ If the 'children' argument is specified, it should be a list (or
731
+ filtered list) of children of the current widget.
732
+
733
+ .. versionchanged:: 1.8.0
734
+ The `children` argument can be used to specify the children you
735
+ want to remove.
736
+ .. versionchanged:: 2.1.0
737
+
738
+ Specifying an empty ``children`` list leaves the widgets unchanged.
739
+ Previously it was treated like ``None`` and all children were
740
+ removed.
741
+ '''
742
+ if children is None or children is self.children:
743
+ children = self.children[:]
744
+
745
+ remove_widget = self.remove_widget
746
+ for child in children:
747
+ remove_widget(child)
748
+
749
+ def _update_motion_filter(self, child_widget, child_motion_filter):
750
+ old_events = []
751
+ for type_id, widgets in self.motion_filter.items():
752
+ if child_widget in widgets:
753
+ old_events.append(type_id)
754
+ for type_id in old_events:
755
+ if type_id not in child_motion_filter:
756
+ self.unregister_for_motion_event(type_id, child_widget)
757
+ for type_id in child_motion_filter:
758
+ if type_id not in old_events:
759
+ self.register_for_motion_event(type_id, child_widget)
760
+
761
+ def _find_index_in_motion_filter(self, type_id, widget):
762
+ if widget is self:
763
+ return 0
764
+ find_index = self.children.index
765
+ max_index = find_index(widget) + 1
766
+ motion_widgets = self.motion_filter[type_id]
767
+ insert_index = 1 if motion_widgets[0] is self else 0
768
+ for index in range(insert_index, len(motion_widgets)):
769
+ if find_index(motion_widgets[index]) < max_index:
770
+ insert_index += 1
771
+ else:
772
+ break
773
+ return insert_index
774
+
775
+ def register_for_motion_event(self, type_id, widget=None):
776
+ '''Register to receive motion events of `type_id`.
777
+
778
+ Override :meth:`on_motion` or bind to `on_motion` event to handle
779
+ the incoming motion events.
780
+
781
+ :Parameters:
782
+ `type_id`: `str`
783
+ Motion event type id (eg. "touch", "hover", etc.)
784
+ `widget`: `Widget`
785
+ Child widget or `self` if omitted
786
+
787
+ .. versionadded:: 2.1.0
788
+
789
+ .. note::
790
+ Method can be called multiple times with the same arguments.
791
+
792
+ .. warning::
793
+ This is an experimental method and it remains so while this warning
794
+ is present.
795
+ '''
796
+ a_widget = widget or self
797
+ motion_filter = self.motion_filter
798
+ if type_id not in motion_filter:
799
+ motion_filter[type_id] = [a_widget]
800
+ elif widget not in motion_filter[type_id]:
801
+ index = self._find_index_in_motion_filter(type_id, a_widget)
802
+ motion_filter[type_id].insert(index, a_widget)
803
+
804
+ def unregister_for_motion_event(self, type_id, widget=None):
805
+ '''Unregister to receive motion events of `type_id`.
806
+
807
+ :Parameters:
808
+ `type_id`: `str`
809
+ Motion event type id (eg. "touch", "hover", etc.)
810
+ `widget`: `Widget`
811
+ Child widget or `self` if omitted
812
+
813
+ .. versionadded:: 2.1.0
814
+
815
+ .. note::
816
+ Method can be called multiple times with the same arguments.
817
+
818
+ .. warning::
819
+ This is an experimental method and it remains so while this warning
820
+ is present.
821
+ '''
822
+ a_widget = widget or self
823
+ motion_filter = self.motion_filter
824
+ if type_id in motion_filter:
825
+ if a_widget in motion_filter[type_id]:
826
+ motion_filter[type_id].remove(a_widget)
827
+ if not motion_filter[type_id]:
828
+ del motion_filter[type_id]
829
+
830
+ def export_to_png(self, filename, *args, **kwargs):
831
+ '''Saves an image of the widget and its children in png format at the
832
+ specified filename. Works by removing the widget canvas from its
833
+ parent, rendering to an :class:`~kivy.graphics.fbo.Fbo`, and calling
834
+ :meth:`~kivy.graphics.texture.Texture.save`.
835
+
836
+ .. note::
837
+
838
+ The image includes only this widget and its children. If you want
839
+ to include widgets elsewhere in the tree, you must call
840
+ :meth:`~Widget.export_to_png` from their common parent, or use
841
+ :meth:`~kivy.core.window.WindowBase.screenshot` to capture the
842
+ whole window.
843
+
844
+ .. note::
845
+
846
+ The image will be saved in png format, you should include the
847
+ extension in your filename.
848
+
849
+ .. versionadded:: 1.9.0
850
+
851
+ :Parameters:
852
+ `filename`: str
853
+ The filename with which to save the png.
854
+ `scale`: float
855
+ The amount by which to scale the saved image, defaults to 1.
856
+
857
+ .. versionadded:: 1.11.0
858
+ '''
859
+ self.export_as_image(*args, **kwargs).save(filename, flipped=False)
860
+
861
+ def export_as_image(self, *args, **kwargs):
862
+ '''Return an core :class:`~kivy.core.image.Image` of the actual
863
+ widget.
864
+
865
+ .. versionadded:: 1.11.0
866
+ '''
867
+ from kivy.core.image import Image
868
+ scale = kwargs.get('scale', 1)
869
+
870
+ if self.parent is not None:
871
+ canvas_parent_index = self.parent.canvas.indexof(self.canvas)
872
+ if canvas_parent_index > -1:
873
+ self.parent.canvas.remove(self.canvas)
874
+
875
+ fbo = Fbo(size=(self.width * scale, self.height * scale),
876
+ with_stencilbuffer=True)
877
+
878
+ with fbo:
879
+ ClearColor(0, 0, 0, 0)
880
+ ClearBuffers()
881
+ Scale(1, -1, 1)
882
+ Scale(scale, scale, 1)
883
+ Translate(-self.x, -self.y - self.height, 0)
884
+
885
+ fbo.add(self.canvas)
886
+ fbo.draw()
887
+ img = Image(fbo.texture)
888
+ fbo.remove(self.canvas)
889
+
890
+ if self.parent is not None and canvas_parent_index > -1:
891
+ self.parent.canvas.insert(canvas_parent_index, self.canvas)
892
+
893
+ return img
894
+
895
+ def get_root_window(self):
896
+ '''Return the root window.
897
+
898
+ :Returns:
899
+ Instance of the root window. Can be a
900
+ :class:`~kivy.core.window.WindowBase` or
901
+ :class:`Widget`.
902
+ '''
903
+ if self.parent:
904
+ return self.parent.get_root_window()
905
+
906
+ def get_parent_window(self):
907
+ '''Return the parent window.
908
+
909
+ :Returns:
910
+ Instance of the parent window. Can be a
911
+ :class:`~kivy.core.window.WindowBase` or
912
+ :class:`Widget`.
913
+ '''
914
+ if self.parent:
915
+ return self.parent.get_parent_window()
916
+
917
+ def _walk(self, restrict=False, loopback=False, index=None):
918
+ # We pass index only when we are going on the parent
919
+ # so don't yield the parent as well.
920
+ if index is None:
921
+ index = len(self.children)
922
+ yield self
923
+
924
+ for child in reversed(self.children[:index]):
925
+ for walk_child in child._walk(restrict=True):
926
+ yield walk_child
927
+
928
+ # If we want to continue with our parent, just do it.
929
+ if not restrict:
930
+ parent = self.parent
931
+ try:
932
+ if parent is None or not isinstance(parent, Widget):
933
+ raise ValueError
934
+ index = parent.children.index(self)
935
+ except ValueError:
936
+ # Self is root, if we want to loopback from the first element:
937
+ if not loopback:
938
+ return
939
+ # If we started with root (i.e. index==None), then we have to
940
+ # start from root again, so we return self again. Otherwise, we
941
+ # never returned it, so return it now starting with it.
942
+ parent = self
943
+ index = None
944
+ for walk_child in parent._walk(loopback=loopback, index=index):
945
+ yield walk_child
946
+
947
+ def walk(self, restrict=False, loopback=False):
948
+ ''' Iterator that walks the widget tree starting with this widget and
949
+ goes forward returning widgets in the order in which layouts display
950
+ them.
951
+
952
+ :Parameters:
953
+ `restrict`: bool, defaults to False
954
+ If True, it will only iterate through the widget and its
955
+ children (or children of its children etc.). Defaults to False.
956
+ `loopback`: bool, defaults to False
957
+ If True, when the last widget in the tree is reached,
958
+ it'll loop back to the uppermost root and start walking until
959
+ we hit this widget again. Naturally, it can only loop back when
960
+ `restrict` is False. Defaults to False.
961
+
962
+ :return:
963
+ A generator that walks the tree, returning widgets in the
964
+ forward layout order.
965
+
966
+ For example, given a tree with the following structure:
967
+
968
+ .. code-block:: kv
969
+
970
+ GridLayout:
971
+ Button
972
+ BoxLayout:
973
+ id: box
974
+ Widget
975
+ Button
976
+ Widget
977
+
978
+ walking this tree:
979
+
980
+ .. code-block:: python
981
+
982
+ >>> # Call walk on box with loopback True, and restrict False
983
+ >>> [type(widget) for widget in box.walk(loopback=True)]
984
+ [<class 'BoxLayout'>, <class 'Widget'>, <class 'Button'>,
985
+ <class 'Widget'>, <class 'GridLayout'>, <class 'Button'>]
986
+ >>> # Now with loopback False, and restrict False
987
+ >>> [type(widget) for widget in box.walk()]
988
+ [<class 'BoxLayout'>, <class 'Widget'>, <class 'Button'>,
989
+ <class 'Widget'>]
990
+ >>> # Now with restrict True
991
+ >>> [type(widget) for widget in box.walk(restrict=True)]
992
+ [<class 'BoxLayout'>, <class 'Widget'>, <class 'Button'>]
993
+
994
+ .. versionadded:: 1.9.0
995
+ '''
996
+ gen = self._walk(restrict, loopback)
997
+ yield next(gen)
998
+ for node in gen:
999
+ if node is self:
1000
+ return
1001
+ yield node
1002
+
1003
+ def _walk_reverse(self, loopback=False, go_up=False):
1004
+ # process is walk up level, walk down its children tree, then walk up
1005
+ # next level etc.
1006
+ # default just walk down the children tree
1007
+ root = self
1008
+ index = 0
1009
+ # we need to go up a level before walking tree
1010
+ if go_up:
1011
+ root = self.parent
1012
+ try:
1013
+ if root is None or not isinstance(root, Widget):
1014
+ raise ValueError
1015
+ index = root.children.index(self) + 1
1016
+ except ValueError:
1017
+ if not loopback:
1018
+ return
1019
+ index = 0
1020
+ go_up = False
1021
+ root = self
1022
+
1023
+ # now walk children tree starting with last-most child
1024
+ for child in islice(root.children, index, None):
1025
+ for walk_child in child._walk_reverse(loopback=loopback):
1026
+ yield walk_child
1027
+ # we need to return ourself last, in all cases
1028
+ yield root
1029
+
1030
+ # if going up, continue walking up the parent tree
1031
+ if go_up:
1032
+ for walk_child in root._walk_reverse(loopback=loopback,
1033
+ go_up=go_up):
1034
+ yield walk_child
1035
+
1036
+ def walk_reverse(self, loopback=False):
1037
+ ''' Iterator that walks the widget tree backwards starting with the
1038
+ widget before this, and going backwards returning widgets in the
1039
+ reverse order in which layouts display them.
1040
+
1041
+ This walks in the opposite direction of :meth:`walk`, so a list of the
1042
+ tree generated with :meth:`walk` will be in reverse order compared
1043
+ to the list generated with this, provided `loopback` is True.
1044
+
1045
+ :Parameters:
1046
+ `loopback`: bool, defaults to False
1047
+ If True, when the uppermost root in the tree is
1048
+ reached, it'll loop back to the last widget and start walking
1049
+ back until after we hit widget again. Defaults to False.
1050
+
1051
+ :return:
1052
+ A generator that walks the tree, returning widgets in the
1053
+ reverse layout order.
1054
+
1055
+ For example, given a tree with the following structure:
1056
+
1057
+ .. code-block:: kv
1058
+
1059
+ GridLayout:
1060
+ Button
1061
+ BoxLayout:
1062
+ id: box
1063
+ Widget
1064
+ Button
1065
+ Widget
1066
+
1067
+ walking this tree:
1068
+
1069
+ .. code-block:: python
1070
+
1071
+ >>> # Call walk on box with loopback True
1072
+ >>> [type(widget) for widget in box.walk_reverse(loopback=True)]
1073
+ [<class 'Button'>, <class 'GridLayout'>, <class 'Widget'>,
1074
+ <class 'Button'>, <class 'Widget'>, <class 'BoxLayout'>]
1075
+ >>> # Now with loopback False
1076
+ >>> [type(widget) for widget in box.walk_reverse()]
1077
+ [<class 'Button'>, <class 'GridLayout'>]
1078
+ >>> forward = [w for w in box.walk(loopback=True)]
1079
+ >>> backward = [w for w in box.walk_reverse(loopback=True)]
1080
+ >>> forward == backward[::-1]
1081
+ True
1082
+
1083
+ .. versionadded:: 1.9.0
1084
+
1085
+ '''
1086
+ for node in self._walk_reverse(loopback=loopback, go_up=True):
1087
+ yield node
1088
+ if node is self:
1089
+ return
1090
+
1091
+ def to_widget(self, x, y, relative=False):
1092
+ '''Convert the coordinate from window to local (current widget)
1093
+ coordinates.
1094
+
1095
+ See :mod:`~kivy.uix.relativelayout` for details on the coordinate
1096
+ systems.
1097
+ '''
1098
+ if self.parent:
1099
+ x, y = self.parent.to_widget(x, y)
1100
+ return self.to_local(x, y, relative=relative)
1101
+
1102
+ def to_window(self, x, y, initial=True, relative=False):
1103
+ """If ``initial`` is True, the default, it transforms **parent**
1104
+ coordinates to window coordinates. Otherwise, it transforms **local**
1105
+ (current widget) coordinates to window coordinates.
1106
+
1107
+ See :mod:`~kivy.uix.relativelayout` for details on the coordinate
1108
+ systems.
1109
+ """
1110
+ if not initial:
1111
+ x, y = self.to_parent(x, y, relative=relative)
1112
+ if self.parent:
1113
+ return self.parent.to_window(x, y, initial=False,
1114
+ relative=relative)
1115
+ return (x, y)
1116
+
1117
+ def to_parent(self, x, y, relative=False):
1118
+ """Transform local (current widget) coordinates to parent coordinates.
1119
+
1120
+ See :mod:`~kivy.uix.relativelayout` for details on the coordinate
1121
+ systems.
1122
+
1123
+ :Parameters:
1124
+ `relative`: bool, defaults to False
1125
+ Change to True if you want to translate relative positions from
1126
+ a widget to its parent coordinates.
1127
+ """
1128
+ if relative:
1129
+ return (x + self.x, y + self.y)
1130
+ return (x, y)
1131
+
1132
+ def to_local(self, x, y, relative=False):
1133
+ """Transform parent coordinates to local (current widget) coordinates.
1134
+
1135
+ See :mod:`~kivy.uix.relativelayout` for details on the coordinate
1136
+ systems.
1137
+
1138
+ :Parameters:
1139
+ `relative`: bool, defaults to False
1140
+ Change to True if you want to translate coordinates to
1141
+ relative widget coordinates.
1142
+ """
1143
+ if relative:
1144
+ return (x - self.x, y - self.y)
1145
+ return (x, y)
1146
+
1147
+ def _apply_transform(self, m, pos=None):
1148
+ if self.parent:
1149
+ x, y = self.parent.to_widget(relative=True,
1150
+ *self.to_window(*(pos or self.pos)))
1151
+ m.translate(x, y, 0)
1152
+ m = self.parent._apply_transform(m) if self.parent else m
1153
+ return m
1154
+
1155
+ def get_window_matrix(self, x=0, y=0):
1156
+ '''Calculate the transformation matrix to convert between window and
1157
+ widget coordinates.
1158
+
1159
+ :Parameters:
1160
+ `x`: float, defaults to 0
1161
+ Translates the matrix on the x axis.
1162
+ `y`: float, defaults to 0
1163
+ Translates the matrix on the y axis.
1164
+ '''
1165
+ m = Matrix()
1166
+ m.translate(x, y, 0)
1167
+ m = self._apply_transform(m)
1168
+ return m
1169
+
1170
+ x = NumericProperty(0)
1171
+ '''X position of the widget.
1172
+
1173
+ :attr:`x` is a :class:`~kivy.properties.NumericProperty` and defaults to 0.
1174
+ '''
1175
+
1176
+ y = NumericProperty(0)
1177
+ '''Y position of the widget.
1178
+
1179
+ :attr:`y` is a :class:`~kivy.properties.NumericProperty` and defaults to 0.
1180
+ '''
1181
+
1182
+ width = NumericProperty(100)
1183
+ '''Width of the widget.
1184
+
1185
+ :attr:`width` is a :class:`~kivy.properties.NumericProperty` and defaults
1186
+ to 100.
1187
+
1188
+ .. warning::
1189
+ Keep in mind that the `width` property is subject to layout logic and
1190
+ that this has not yet happened at the time of the widget's `__init__`
1191
+ method.
1192
+
1193
+ .. warning::
1194
+ A negative width is not supported.
1195
+ '''
1196
+
1197
+ height = NumericProperty(100)
1198
+ '''Height of the widget.
1199
+
1200
+ :attr:`height` is a :class:`~kivy.properties.NumericProperty` and defaults
1201
+ to 100.
1202
+
1203
+ .. warning::
1204
+ Keep in mind that the `height` property is subject to layout logic and
1205
+ that this has not yet happened at the time of the widget's `__init__`
1206
+ method.
1207
+
1208
+ .. warning::
1209
+ A negative height is not supported.
1210
+ '''
1211
+
1212
+ pos = ReferenceListProperty(x, y)
1213
+ '''Position of the widget.
1214
+
1215
+ :attr:`pos` is a :class:`~kivy.properties.ReferenceListProperty` of
1216
+ (:attr:`x`, :attr:`y`) properties.
1217
+ '''
1218
+
1219
+ size = ReferenceListProperty(width, height)
1220
+ '''Size of the widget.
1221
+
1222
+ :attr:`size` is a :class:`~kivy.properties.ReferenceListProperty` of
1223
+ (:attr:`width`, :attr:`height`) properties.
1224
+ '''
1225
+
1226
+ def get_right(self):
1227
+ return self.x + self.width
1228
+
1229
+ def set_right(self, value):
1230
+ self.x = value - self.width
1231
+
1232
+ right = AliasProperty(get_right, set_right,
1233
+ bind=('x', 'width'),
1234
+ cache=True, watch_before_use=False)
1235
+ '''Right position of the widget.
1236
+
1237
+ :attr:`right` is an :class:`~kivy.properties.AliasProperty` of
1238
+ (:attr:`x` + :attr:`width`).
1239
+ '''
1240
+
1241
+ def get_top(self):
1242
+ return self.y + self.height
1243
+
1244
+ def set_top(self, value):
1245
+ self.y = value - self.height
1246
+
1247
+ top = AliasProperty(get_top, set_top,
1248
+ bind=('y', 'height'),
1249
+ cache=True, watch_before_use=False)
1250
+ '''Top position of the widget.
1251
+
1252
+ :attr:`top` is an :class:`~kivy.properties.AliasProperty` of
1253
+ (:attr:`y` + :attr:`height`).
1254
+ '''
1255
+
1256
+ def get_center_x(self):
1257
+ return self.x + self.width / 2.
1258
+
1259
+ def set_center_x(self, value):
1260
+ self.x = value - self.width / 2.
1261
+
1262
+ center_x = AliasProperty(get_center_x, set_center_x,
1263
+ bind=('x', 'width'),
1264
+ cache=True, watch_before_use=False)
1265
+ '''X center position of the widget.
1266
+
1267
+ :attr:`center_x` is an :class:`~kivy.properties.AliasProperty` of
1268
+ (:attr:`x` + :attr:`width` / 2.).
1269
+ '''
1270
+
1271
+ def get_center_y(self):
1272
+ return self.y + self.height / 2.
1273
+
1274
+ def set_center_y(self, value):
1275
+ self.y = value - self.height / 2.
1276
+
1277
+ center_y = AliasProperty(get_center_y, set_center_y,
1278
+ bind=('y', 'height'),
1279
+ cache=True, watch_before_use=False)
1280
+ '''Y center position of the widget.
1281
+
1282
+ :attr:`center_y` is an :class:`~kivy.properties.AliasProperty` of
1283
+ (:attr:`y` + :attr:`height` / 2.).
1284
+ '''
1285
+
1286
+ center = ReferenceListProperty(center_x, center_y)
1287
+ '''Center position of the widget.
1288
+
1289
+ :attr:`center` is a :class:`~kivy.properties.ReferenceListProperty` of
1290
+ (:attr:`center_x`, :attr:`center_y`) properties.
1291
+ '''
1292
+
1293
+ cls = ListProperty([])
1294
+ '''Class of the widget, used for styling.
1295
+ '''
1296
+
1297
+ children = ListProperty([])
1298
+ '''List of children of this widget.
1299
+
1300
+ :attr:`children` is a :class:`~kivy.properties.ListProperty` and
1301
+ defaults to an empty list.
1302
+
1303
+ Use :meth:`add_widget` and :meth:`remove_widget` for manipulating the
1304
+ children list. Don't manipulate the children list directly unless you know
1305
+ what you are doing.
1306
+ '''
1307
+
1308
+ parent = ObjectProperty(None, allownone=True, rebind=True)
1309
+ '''Parent of this widget. The parent of a widget is set when the widget
1310
+ is added to another widget and unset when the widget is removed from its
1311
+ parent.
1312
+
1313
+ :attr:`parent` is an :class:`~kivy.properties.ObjectProperty` and
1314
+ defaults to None.
1315
+ '''
1316
+
1317
+ size_hint_x = NumericProperty(1, allownone=True)
1318
+ '''x size hint. Represents how much space the widget should use in the
1319
+ direction of the x axis relative to its parent's width.
1320
+ Only the :class:`~kivy.uix.layout.Layout` and
1321
+ :class:`~kivy.core.window.Window` classes make use of the hint.
1322
+
1323
+ The size_hint is used by layouts for two purposes:
1324
+
1325
+ - When the layout considers widgets on their own rather than in
1326
+ relation to its other children, the size_hint_x is a direct proportion
1327
+ of the parent width, normally between 0.0 and 1.0. For instance, a
1328
+ widget with ``size_hint_x=0.5`` in
1329
+ a vertical BoxLayout will take up half the BoxLayout's width, or
1330
+ a widget in a FloatLayout with ``size_hint_x=0.2`` will take up 20%
1331
+ of the FloatLayout width. If the size_hint is greater than 1, the
1332
+ widget will be wider than the parent.
1333
+ - When multiple widgets can share a row of a layout, such as in a
1334
+ horizontal BoxLayout, their widths will be their size_hint_x as a
1335
+ fraction of the sum of widget size_hints. For instance, if the
1336
+ size_hint_xs are (0.5, 1.0, 0.5), the first widget will have a
1337
+ width of 25% of the parent width.
1338
+
1339
+ :attr:`size_hint_x` is a :class:`~kivy.properties.NumericProperty` and
1340
+ defaults to 1.
1341
+ '''
1342
+
1343
+ size_hint_y = NumericProperty(1, allownone=True)
1344
+ '''y size hint.
1345
+
1346
+ :attr:`size_hint_y` is a :class:`~kivy.properties.NumericProperty` and
1347
+ defaults to 1.
1348
+
1349
+ See :attr:`size_hint_x` for more information, but with widths and heights
1350
+ swapped.
1351
+ '''
1352
+
1353
+ size_hint = ReferenceListProperty(size_hint_x, size_hint_y)
1354
+ '''Size hint.
1355
+
1356
+ :attr:`size_hint` is a :class:`~kivy.properties.ReferenceListProperty` of
1357
+ (:attr:`size_hint_x`, :attr:`size_hint_y`) properties.
1358
+
1359
+ See :attr:`size_hint_x` for more information.
1360
+ '''
1361
+
1362
+ pos_hint = ObjectProperty({})
1363
+ '''Position hint. This property allows you to set the position of
1364
+ the widget inside its parent layout (similar to
1365
+ size_hint).
1366
+
1367
+ For example, if you want to set the top of the widget to be at 90%
1368
+ height of its parent layout, you can write::
1369
+
1370
+ widget = Widget(pos_hint={'top': 0.9})
1371
+
1372
+ The keys 'x', 'right' and 'center_x' will use the parent width.
1373
+ The keys 'y', 'top' and 'center_y' will use the parent height.
1374
+
1375
+ See :doc:`api-kivy.uix.floatlayout` for further reference.
1376
+
1377
+ .. note::
1378
+ :attr:`pos_hint` is not used by all layouts. Check the documentation
1379
+ of the layout in question to see if it supports pos_hint.
1380
+
1381
+ :attr:`pos_hint` is an :class:`~kivy.properties.ObjectProperty`
1382
+ containing a dict.
1383
+ '''
1384
+
1385
+ size_hint_min_x = NumericProperty(None, allownone=True)
1386
+ '''When not None, the x-direction minimum size (in pixels,
1387
+ like :attr:`width`) when :attr:`size_hint_x` is also not None.
1388
+
1389
+ When :attr:`size_hint_x` is not None, it is the minimum width that the
1390
+ widget will be set due to the :attr:`size_hint_x`. I.e. when a smaller size
1391
+ would be set, :attr:`size_hint_min_x` is the value used instead for the
1392
+ widget width. When None, or when :attr:`size_hint_x` is None,
1393
+ :attr:`size_hint_min_x` doesn't do anything.
1394
+
1395
+ Only the :class:`~kivy.uix.layout.Layout` and
1396
+ :class:`~kivy.core.window.Window` classes make use of the hint.
1397
+
1398
+ :attr:`size_hint_min_x` is a :class:`~kivy.properties.NumericProperty` and
1399
+ defaults to None.
1400
+
1401
+ .. versionadded:: 1.10.0
1402
+ '''
1403
+
1404
+ size_hint_min_y = NumericProperty(None, allownone=True)
1405
+ '''When not None, the y-direction minimum size (in pixels,
1406
+ like :attr:`height`) when :attr:`size_hint_y` is also not None.
1407
+
1408
+ When :attr:`size_hint_y` is not None, it is the minimum height that the
1409
+ widget will be set due to the :attr:`size_hint_y`. I.e. when a smaller size
1410
+ would be set, :attr:`size_hint_min_y` is the value used instead for the
1411
+ widget height. When None, or when :attr:`size_hint_y` is None,
1412
+ :attr:`size_hint_min_y` doesn't do anything.
1413
+
1414
+ Only the :class:`~kivy.uix.layout.Layout` and
1415
+ :class:`~kivy.core.window.Window` classes make use of the hint.
1416
+
1417
+ :attr:`size_hint_min_y` is a :class:`~kivy.properties.NumericProperty` and
1418
+ defaults to None.
1419
+
1420
+ .. versionadded:: 1.10.0
1421
+ '''
1422
+
1423
+ size_hint_min = ReferenceListProperty(size_hint_min_x, size_hint_min_y)
1424
+ '''Minimum size when using :attr:`size_hint`.
1425
+
1426
+ :attr:`size_hint_min` is a :class:`~kivy.properties.ReferenceListProperty`
1427
+ of (:attr:`size_hint_min_x`, :attr:`size_hint_min_y`) properties.
1428
+
1429
+ .. versionadded:: 1.10.0
1430
+ '''
1431
+
1432
+ size_hint_max_x = NumericProperty(None, allownone=True)
1433
+ '''When not None, the x-direction maximum size (in pixels,
1434
+ like :attr:`width`) when :attr:`size_hint_x` is also not None.
1435
+
1436
+ Similar to :attr:`size_hint_min_x`, except that it sets the maximum width.
1437
+
1438
+ :attr:`size_hint_max_x` is a :class:`~kivy.properties.NumericProperty` and
1439
+ defaults to None.
1440
+
1441
+ .. versionadded:: 1.10.0
1442
+ '''
1443
+
1444
+ size_hint_max_y = NumericProperty(None, allownone=True)
1445
+ '''When not None, the y-direction maximum size (in pixels,
1446
+ like :attr:`height`) when :attr:`size_hint_y` is also not None.
1447
+
1448
+ Similar to :attr:`size_hint_min_y`, except that it sets the maximum height.
1449
+
1450
+ :attr:`size_hint_max_y` is a :class:`~kivy.properties.NumericProperty` and
1451
+ defaults to None.
1452
+
1453
+ .. versionadded:: 1.10.0
1454
+ '''
1455
+
1456
+ size_hint_max = ReferenceListProperty(size_hint_max_x, size_hint_max_y)
1457
+ '''Maximum size when using :attr:`size_hint`.
1458
+
1459
+ :attr:`size_hint_max` is a :class:`~kivy.properties.ReferenceListProperty`
1460
+ of (:attr:`size_hint_max_x`, :attr:`size_hint_max_y`) properties.
1461
+
1462
+ .. versionadded:: 1.10.0
1463
+ '''
1464
+
1465
+ ids = DictProperty({})
1466
+ '''This is a dictionary of ids defined in your kv language. This will only
1467
+ be populated if you use ids in your kv language code.
1468
+
1469
+ .. versionadded:: 1.7.0
1470
+
1471
+ :attr:`ids` is a :class:`~kivy.properties.DictProperty` and defaults to an
1472
+ empty dict {}.
1473
+
1474
+ The :attr:`ids` are populated for each root level widget definition. For
1475
+ example:
1476
+
1477
+ .. code-block:: kv
1478
+
1479
+ # in kv
1480
+ <MyWidget@Widget>:
1481
+ id: my_widget
1482
+ Label:
1483
+ id: label_widget
1484
+ Widget:
1485
+ id: inner_widget
1486
+ Label:
1487
+ id: inner_label
1488
+ TextInput:
1489
+ id: text_input
1490
+ OtherWidget:
1491
+ id: other_widget
1492
+
1493
+
1494
+ <OtherWidget@Widget>
1495
+ id: other_widget
1496
+ Label:
1497
+ id: other_label
1498
+ TextInput:
1499
+ id: other_textinput
1500
+
1501
+ Then, in python:
1502
+
1503
+ .. code-block:: python
1504
+
1505
+ >>> widget = MyWidget()
1506
+ >>> print(widget.ids)
1507
+ {'other_widget': <weakproxy at 041CFED0 to OtherWidget at 041BEC38>,
1508
+ 'inner_widget': <weakproxy at 04137EA0 to Widget at 04138228>,
1509
+ 'inner_label': <weakproxy at 04143540 to Label at 04138260>,
1510
+ 'label_widget': <weakproxy at 04137B70 to Label at 040F97A0>,
1511
+ 'text_input': <weakproxy at 041BB5D0 to TextInput at 041BEC00>}
1512
+ >>> print(widget.ids['other_widget'].ids)
1513
+ {'other_textinput': <weakproxy at 041DBB40 to TextInput at 041BEF48>,
1514
+ 'other_label': <weakproxy at 041DB570 to Label at 041BEEA0>}
1515
+ >>> print(widget.ids['label_widget'].ids)
1516
+ {}
1517
+ '''
1518
+
1519
+ opacity = NumericProperty(1.0)
1520
+ '''Opacity of the widget and all its children.
1521
+
1522
+ .. versionadded:: 1.4.1
1523
+
1524
+ The opacity attribute controls the opacity of the widget and its children.
1525
+ Be careful, it's a cumulative attribute: the value is multiplied by the
1526
+ current global opacity and the result is applied to the current context
1527
+ color.
1528
+
1529
+ For example, if the parent has an opacity of 0.5 and a child has an
1530
+ opacity of 0.2, the real opacity of the child will be 0.5 * 0.2 = 0.1.
1531
+
1532
+ Then, the opacity is applied by the shader as:
1533
+
1534
+ .. code-block:: python
1535
+
1536
+ frag_color = color * vec4(1.0, 1.0, 1.0, opacity);
1537
+
1538
+ :attr:`opacity` is a :class:`~kivy.properties.NumericProperty` and defaults
1539
+ to 1.0.
1540
+ '''
1541
+
1542
+ def on_opacity(self, instance, value):
1543
+ canvas = self.canvas
1544
+ if canvas is not None:
1545
+ canvas.opacity = value
1546
+
1547
+ canvas = None
1548
+ '''Canvas of the widget.
1549
+
1550
+ The canvas is a graphics object that contains all the drawing instructions
1551
+ for the graphical representation of the widget.
1552
+
1553
+ There are no general properties for the Widget class, such as background
1554
+ color, to keep the design simple and lean. Some derived classes, such as
1555
+ Button, do add such convenience properties but generally the developer is
1556
+ responsible for implementing the graphics representation for a custom
1557
+ widget from the ground up. See the derived widget classes for patterns to
1558
+ follow and extend.
1559
+
1560
+ See :class:`~kivy.graphics.Canvas` for more information about the usage.
1561
+ '''
1562
+
1563
+ def get_disabled(self):
1564
+ return self._disabled_count > 0
1565
+
1566
+ def set_disabled(self, value):
1567
+ # Necessary to ensure a change between value of equal truthiness
1568
+ # doesn't mess up the count
1569
+ value = bool(value)
1570
+ if value != self._disabled_value:
1571
+ self._disabled_value = value
1572
+ if value:
1573
+ self.inc_disabled()
1574
+ else:
1575
+ self.dec_disabled()
1576
+ return True
1577
+
1578
+ def inc_disabled(self, count=1):
1579
+ self._disabled_count += count
1580
+ if self._disabled_count - count < 1 <= self._disabled_count:
1581
+ self.property('disabled').dispatch(self)
1582
+ for c in self.children:
1583
+ c.inc_disabled(count)
1584
+
1585
+ def dec_disabled(self, count=1):
1586
+ self._disabled_count -= count
1587
+ if self._disabled_count <= 0 < self._disabled_count + count:
1588
+ self.property('disabled').dispatch(self)
1589
+ for c in self.children:
1590
+ c.dec_disabled(count)
1591
+
1592
+ disabled = AliasProperty(get_disabled, set_disabled, watch_before_use=False)
1593
+ '''Indicates whether this widget can interact with input or not.
1594
+
1595
+ :attr:`disabled` is an :class:`~kivy.properties.AliasProperty` and
1596
+ defaults to False.
1597
+
1598
+ .. note::
1599
+
1600
+ 1. Child Widgets, when added to a disabled widget, will be disabled
1601
+ automatically.
1602
+ 2. Disabling/enabling a parent disables/enables all
1603
+ of its children.
1604
+
1605
+ .. versionadded:: 1.8.0
1606
+
1607
+ .. versionchanged:: 1.10.1
1608
+
1609
+ :attr:`disabled` was changed from a
1610
+ :class:`~kivy.properties.BooleanProperty` to an
1611
+ :class:`~kivy.properties.AliasProperty` to allow access to its
1612
+ previous state when a parent's disabled state is changed.
1613
+ '''
1614
+
1615
+ motion_filter = DictProperty()
1616
+ '''Holds a dict of `type_id` to `list` of child widgets registered to
1617
+ receive motion events of `type_id`.
1618
+
1619
+ Don't change the property directly but use
1620
+ :meth:`register_for_motion_event` and :meth:`unregister_for_motion_event`
1621
+ to register and unregister for motion events. If `self` is registered it
1622
+ will always be the first element in the list.
1623
+
1624
+ .. versionadded:: 2.1.0
1625
+
1626
+ .. warning::
1627
+ This is an experimental property and it remains so while this warning
1628
+ is present.
1629
+ '''