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
@@ -0,0 +1,1275 @@
1
+ '''Screen Manager
2
+ ==============
3
+
4
+ .. image:: images/screenmanager.gif
5
+ :align: right
6
+
7
+ .. versionadded:: 1.4.0
8
+
9
+ The screen manager is a widget dedicated to managing multiple screens for your
10
+ application. The default :class:`ScreenManager` displays only one
11
+ :class:`Screen` at a time and uses a :class:`TransitionBase` to switch from one
12
+ Screen to another.
13
+
14
+ Multiple transitions are supported based on changing the screen coordinates /
15
+ scale or even performing fancy animation using custom shaders.
16
+
17
+ Basic Usage
18
+ -----------
19
+
20
+ Let's construct a Screen Manager with 4 named screens. When you are creating
21
+ a screen, **you absolutely need to give a name to it**::
22
+
23
+ from kivy.uix.screenmanager import ScreenManager, Screen
24
+
25
+ # Create the manager
26
+ sm = ScreenManager()
27
+
28
+ # Add few screens
29
+ for i in range(4):
30
+ screen = Screen(name='Title %d' % i)
31
+ sm.add_widget(screen)
32
+
33
+ # By default, the first screen added into the ScreenManager will be
34
+ # displayed. You can then change to another screen.
35
+
36
+ # Let's display the screen named 'Title 2'
37
+ # A transition will automatically be used.
38
+ sm.current = 'Title 2'
39
+
40
+ The default :attr:`ScreenManager.transition` is a :class:`SlideTransition` with
41
+ options :attr:`~SlideTransition.direction` and
42
+ :attr:`~TransitionBase.duration`.
43
+
44
+ Please note that by default, a :class:`Screen` displays nothing: it's just a
45
+ :class:`~kivy.uix.relativelayout.RelativeLayout`. You need to use that class as
46
+ a root widget for your own screen, the best way being to subclass.
47
+
48
+ .. warning::
49
+ As :class:`Screen` is a :class:`~kivy.uix.relativelayout.RelativeLayout`,
50
+ it is important to understand the
51
+ :ref:`kivy-uix-relativelayout-common-pitfalls`.
52
+
53
+ Here is an example with a 'Menu Screen' and a 'Settings Screen'::
54
+
55
+ from kivy.app import App
56
+ from kivy.lang import Builder
57
+ from kivy.uix.screenmanager import ScreenManager, Screen
58
+
59
+ # Create both screens. Please note the root.manager.current: this is how
60
+ # you can control the ScreenManager from kv. Each screen has by default a
61
+ # property manager that gives you the instance of the ScreenManager used.
62
+ Builder.load_string("""
63
+ <MenuScreen>:
64
+ BoxLayout:
65
+ Button:
66
+ text: 'Goto settings'
67
+ on_press: root.manager.current = 'settings'
68
+ Button:
69
+ text: 'Quit'
70
+
71
+ <SettingsScreen>:
72
+ BoxLayout:
73
+ Button:
74
+ text: 'My settings button'
75
+ Button:
76
+ text: 'Back to menu'
77
+ on_press: root.manager.current = 'menu'
78
+ """)
79
+
80
+ # Declare both screens
81
+ class MenuScreen(Screen):
82
+ pass
83
+
84
+ class SettingsScreen(Screen):
85
+ pass
86
+
87
+ class TestApp(App):
88
+
89
+ def build(self):
90
+ # Create the screen manager
91
+ sm = ScreenManager()
92
+ sm.add_widget(MenuScreen(name='menu'))
93
+ sm.add_widget(SettingsScreen(name='settings'))
94
+
95
+ return sm
96
+
97
+ if __name__ == '__main__':
98
+ TestApp().run()
99
+
100
+
101
+ Changing Direction
102
+ ------------------
103
+
104
+ A common use case for :class:`ScreenManager` involves using a
105
+ :class:`SlideTransition` which slides right to the next screen
106
+ and slides left to the previous screen. Building on the previous
107
+ example, this can be accomplished like so::
108
+
109
+ Builder.load_string("""
110
+ <MenuScreen>:
111
+ BoxLayout:
112
+ Button:
113
+ text: 'Goto settings'
114
+ on_press:
115
+ root.manager.transition.direction = 'left'
116
+ root.manager.current = 'settings'
117
+ Button:
118
+ text: 'Quit'
119
+
120
+ <SettingsScreen>:
121
+ BoxLayout:
122
+ Button:
123
+ text: 'My settings button'
124
+ Button:
125
+ text: 'Back to menu'
126
+ on_press:
127
+ root.manager.transition.direction = 'right'
128
+ root.manager.current = 'menu'
129
+ """)
130
+
131
+
132
+ Advanced Usage
133
+ --------------
134
+
135
+ From 1.8.0, you can now switch dynamically to a new screen, change the
136
+ transition options and remove the previous one by using
137
+ :meth:`~ScreenManager.switch_to`::
138
+
139
+ sm = ScreenManager()
140
+ screens = [Screen(name='Title {}'.format(i)) for i in range(4)]
141
+
142
+ sm.switch_to(screens[0])
143
+ # later
144
+ sm.switch_to(screens[1], direction='right')
145
+
146
+ Note that this method adds the screen to the :class:`ScreenManager` instance
147
+ and should not be used if your screens have already been added to this
148
+ instance. To switch to a screen which is already added, you should use the
149
+ :attr:`~ScreenManager.current` property.
150
+
151
+
152
+ Changing transitions
153
+ --------------------
154
+
155
+ You have multiple transitions available by default, such as:
156
+
157
+ - :class:`NoTransition` - switches screens instantly with no animation
158
+ - :class:`SlideTransition` - slide the screen in/out, from any direction
159
+ - :class:`CardTransition` - new screen slides on the previous
160
+ or the old one slides off the new one depending on the mode
161
+ - :class:`SwapTransition` - implementation of the iOS swap transition
162
+ - :class:`FadeTransition` - shader to fade the screen in/out
163
+ - :class:`WipeTransition` - shader to wipe the screens from right to left
164
+ - :class:`FallOutTransition` - shader where the old screen 'falls' and
165
+ becomes transparent, revealing the new one behind it.
166
+ - :class:`RiseInTransition` - shader where the new screen rises from the
167
+ screen centre while fading from transparent to opaque.
168
+
169
+ You can easily switch transitions by changing the
170
+ :attr:`ScreenManager.transition` property::
171
+
172
+ sm = ScreenManager(transition=FadeTransition())
173
+
174
+ .. note::
175
+
176
+ Currently, none of Shader based Transitions use
177
+ anti-aliasing. This is because they use the FBO which doesn't have
178
+ any logic to handle supersampling. This is a known issue and we
179
+ are working on a transparent implementation that will give the
180
+ same results as if it had been rendered on screen.
181
+
182
+ To be more concrete, if you see sharp edged text during the animation, it's
183
+ normal.
184
+
185
+ '''
186
+
187
+ __all__ = ('Screen', 'ScreenManager', 'ScreenManagerException',
188
+ 'TransitionBase', 'ShaderTransition', 'SlideTransition',
189
+ 'SwapTransition', 'FadeTransition', 'WipeTransition',
190
+ 'FallOutTransition', 'RiseInTransition', 'NoTransition',
191
+ 'CardTransition')
192
+
193
+ from kivy.compat import iteritems
194
+ from kivy.logger import Logger
195
+ from kivy.event import EventDispatcher
196
+ from kivy.clock import Clock
197
+ from kivy.uix.floatlayout import FloatLayout
198
+ from kivy.properties import (StringProperty, ObjectProperty, AliasProperty,
199
+ NumericProperty, ListProperty, OptionProperty,
200
+ BooleanProperty, ColorProperty)
201
+ from kivy.animation import Animation, AnimationTransition
202
+ from kivy.uix.relativelayout import RelativeLayout
203
+ from kivy.lang import Builder
204
+ from kivy.graphics import (RenderContext, Rectangle, Fbo,
205
+ ClearColor, ClearBuffers, BindTexture, PushMatrix,
206
+ PopMatrix, Translate, Callback, Scale)
207
+
208
+
209
+ class ScreenManagerException(Exception):
210
+ '''Exception for the :class:`ScreenManager`.
211
+ '''
212
+ pass
213
+
214
+
215
+ class Screen(RelativeLayout):
216
+ '''Screen is an element intended to be used with a :class:`ScreenManager`.
217
+ Check module documentation for more information.
218
+
219
+ :Events:
220
+ `on_pre_enter`: ()
221
+ Event fired when the screen is about to be used: the entering
222
+ animation is started.
223
+ `on_enter`: ()
224
+ Event fired when the screen is displayed: the entering animation is
225
+ complete.
226
+ `on_pre_leave`: ()
227
+ Event fired when the screen is about to be removed: the leaving
228
+ animation is started.
229
+ `on_leave`: ()
230
+ Event fired when the screen is removed: the leaving animation is
231
+ finished.
232
+
233
+ .. versionchanged:: 1.6.0
234
+ Events `on_pre_enter`, `on_enter`, `on_pre_leave` and `on_leave` were
235
+ added.
236
+ '''
237
+
238
+ name = StringProperty('')
239
+ '''
240
+ Name of the screen which must be unique within a :class:`ScreenManager`.
241
+ This is the name used for :attr:`ScreenManager.current`.
242
+
243
+ :attr:`name` is a :class:`~kivy.properties.StringProperty` and defaults to
244
+ ''.
245
+ '''
246
+
247
+ manager = ObjectProperty(None, allownone=True)
248
+ ''':class:`ScreenManager` object, set when the screen is added to a
249
+ manager.
250
+
251
+ :attr:`manager` is an :class:`~kivy.properties.ObjectProperty` and
252
+ defaults to None, read-only.
253
+
254
+ '''
255
+
256
+ transition_progress = NumericProperty(0.)
257
+ '''Value that represents the completion of the current transition, if any
258
+ is occurring.
259
+
260
+ If a transition is in progress, whatever the mode, the value will change
261
+ from 0 to 1. If you want to know if it's an entering or leaving animation,
262
+ check the :attr:`transition_state`.
263
+
264
+ :attr:`transition_progress` is a :class:`~kivy.properties.NumericProperty`
265
+ and defaults to 0.
266
+ '''
267
+
268
+ transition_state = OptionProperty('out', options=('in', 'out'))
269
+ '''Value that represents the state of the transition:
270
+
271
+ - 'in' if the transition is going to show your screen
272
+ - 'out' if the transition is going to hide your screen
273
+
274
+ After the transition is complete, the state will retain its last value (in
275
+ or out).
276
+
277
+ :attr:`transition_state` is an :class:`~kivy.properties.OptionProperty` and
278
+ defaults to 'out'.
279
+ '''
280
+
281
+ __events__ = ('on_pre_enter', 'on_enter', 'on_pre_leave', 'on_leave')
282
+
283
+ def on_pre_enter(self, *args):
284
+ pass
285
+
286
+ def on_enter(self, *args):
287
+ pass
288
+
289
+ def on_pre_leave(self, *args):
290
+ pass
291
+
292
+ def on_leave(self, *args):
293
+ pass
294
+
295
+ def __repr__(self):
296
+ return '<Screen name=%r>' % self.name
297
+
298
+
299
+ class TransitionBase(EventDispatcher):
300
+ '''TransitionBase is used to animate 2 screens within the
301
+ :class:`ScreenManager`. This class acts as a base for other
302
+ implementations like the :class:`SlideTransition` and
303
+ :class:`SwapTransition`.
304
+
305
+ :Events:
306
+ `on_progress`: Transition object, progression float
307
+ Fired during the animation of the transition.
308
+ `on_complete`: Transition object
309
+ Fired when the transition is finished.
310
+ '''
311
+
312
+ screen_out = ObjectProperty()
313
+ '''Property that contains the screen to hide.
314
+ Automatically set by the :class:`ScreenManager`.
315
+
316
+ :class:`screen_out` is an :class:`~kivy.properties.ObjectProperty` and
317
+ defaults to None.
318
+ '''
319
+
320
+ screen_in = ObjectProperty()
321
+ '''Property that contains the screen to show.
322
+ Automatically set by the :class:`ScreenManager`.
323
+
324
+ :class:`screen_in` is an :class:`~kivy.properties.ObjectProperty` and
325
+ defaults to None.
326
+ '''
327
+
328
+ duration = NumericProperty(.4)
329
+ '''Duration in seconds of the transition.
330
+
331
+ :class:`duration` is a :class:`~kivy.properties.NumericProperty` and
332
+ defaults to .4 (= 400ms).
333
+
334
+ .. versionchanged:: 1.8.0
335
+
336
+ Default duration has been changed from 700ms to 400ms.
337
+ '''
338
+
339
+ manager = ObjectProperty()
340
+ ''':class:`ScreenManager` object, set when the screen is added to a
341
+ manager.
342
+
343
+ :attr:`manager` is an :class:`~kivy.properties.ObjectProperty` and
344
+ defaults to None, read-only.
345
+
346
+ '''
347
+
348
+ is_active = BooleanProperty(False)
349
+ '''Indicate whether the transition is currently active or not.
350
+
351
+ :attr:`is_active` is a :class:`~kivy.properties.BooleanProperty` and
352
+ defaults to False, read-only.
353
+ '''
354
+
355
+ # privates
356
+
357
+ _anim = ObjectProperty(allownone=True)
358
+
359
+ __events__ = ('on_progress', 'on_complete')
360
+
361
+ def start(self, manager):
362
+ '''(internal) Starts the transition. This is automatically
363
+ called by the :class:`ScreenManager`.
364
+ '''
365
+ if self.is_active:
366
+ raise ScreenManagerException('start() is called twice!')
367
+ self.manager = manager
368
+ self._anim = Animation(d=self.duration, s=0)
369
+ self._anim.bind(on_progress=self._on_progress,
370
+ on_complete=self._on_complete)
371
+
372
+ self.add_screen(self.screen_in)
373
+ self.screen_in.transition_progress = 0.
374
+ self.screen_in.transition_state = 'in'
375
+ self.screen_out.transition_progress = 0.
376
+ self.screen_out.transition_state = 'out'
377
+ self.screen_in.dispatch('on_pre_enter')
378
+ self.screen_out.dispatch('on_pre_leave')
379
+
380
+ self.is_active = True
381
+ self._anim.start(self)
382
+ self.dispatch('on_progress', 0)
383
+
384
+ def stop(self):
385
+ '''(internal) Stops the transition. This is automatically called by the
386
+ :class:`ScreenManager`.
387
+ '''
388
+ if self._anim:
389
+ self._anim.cancel(self)
390
+ self.dispatch('on_complete')
391
+ self._anim = None
392
+ self.is_active = False
393
+
394
+ def add_screen(self, screen):
395
+ '''(internal) Used to add a screen to the :class:`ScreenManager`.
396
+ '''
397
+ self.manager.real_add_widget(screen)
398
+
399
+ def remove_screen(self, screen):
400
+ '''(internal) Used to remove a screen from the :class:`ScreenManager`.
401
+ '''
402
+ self.manager.real_remove_widget(screen)
403
+
404
+ def on_complete(self):
405
+ self.remove_screen(self.screen_out)
406
+
407
+ def on_progress(self, progression):
408
+ pass
409
+
410
+ def _on_progress(self, *l):
411
+ progress = l[-1]
412
+ self.screen_in.transition_progress = progress
413
+ self.screen_out.transition_progress = 1. - progress
414
+ self.dispatch('on_progress', progress)
415
+
416
+ def _on_complete(self, *l):
417
+ self.is_active = False
418
+ self.dispatch('on_complete')
419
+ self.screen_in.dispatch('on_enter')
420
+ self.screen_out.dispatch('on_leave')
421
+ self._anim = None
422
+
423
+
424
+ class ShaderTransition(TransitionBase):
425
+ '''Transition class that uses a Shader for animating the transition between
426
+ 2 screens. By default, this class doesn't assign any fragment/vertex
427
+ shader. If you want to create your own fragment shader for the transition,
428
+ you need to declare the header yourself and include the "t", "tex_in" and
429
+ "tex_out" uniform::
430
+
431
+ # Create your own transition. This shader implements a "fading"
432
+ # transition.
433
+ fs = """$HEADER
434
+ uniform float t;
435
+ uniform sampler2D tex_in;
436
+ uniform sampler2D tex_out;
437
+
438
+ void main(void) {
439
+ vec4 cin = texture2D(tex_in, tex_coord0);
440
+ vec4 cout = texture2D(tex_out, tex_coord0);
441
+ gl_FragColor = mix(cout, cin, t);
442
+ }
443
+ """
444
+
445
+ # And create your transition
446
+ tr = ShaderTransition(fs=fs)
447
+ sm = ScreenManager(transition=tr)
448
+
449
+ '''
450
+
451
+ fs = StringProperty(None)
452
+ '''Fragment shader to use.
453
+
454
+ :attr:`fs` is a :class:`~kivy.properties.StringProperty` and defaults to
455
+ None.'''
456
+
457
+ vs = StringProperty(None)
458
+ '''Vertex shader to use.
459
+
460
+ :attr:`vs` is a :class:`~kivy.properties.StringProperty` and defaults to
461
+ None.'''
462
+
463
+ clearcolor = ColorProperty([0, 0, 0, 1])
464
+ '''Sets the color of Fbo ClearColor.
465
+
466
+ .. versionadded:: 1.9.0
467
+
468
+ :attr:`clearcolor` is a :class:`~kivy.properties.ColorProperty`
469
+ and defaults to [0, 0, 0, 1].
470
+
471
+ .. versionchanged:: 2.0.0
472
+ Changed from :class:`~kivy.properties.ListProperty` to
473
+ :class:`~kivy.properties.ColorProperty`.
474
+ '''
475
+
476
+ def make_screen_fbo(self, screen):
477
+ fbo = Fbo(size=screen.size, with_stencilbuffer=True)
478
+ with fbo:
479
+ ClearColor(*self.clearcolor)
480
+ ClearBuffers()
481
+ fbo.add(screen.canvas)
482
+ with fbo.before:
483
+ PushMatrix()
484
+ Translate(-screen.x, -screen.y, 0)
485
+ with fbo.after:
486
+ PopMatrix()
487
+ return fbo
488
+
489
+ def on_progress(self, progress):
490
+ self.render_ctx['t'] = progress
491
+
492
+ def on_complete(self):
493
+ self.render_ctx['t'] = 1.
494
+ super(ShaderTransition, self).on_complete()
495
+
496
+ def _remove_out_canvas(self, *args):
497
+ if (self.screen_out and
498
+ self.screen_out.canvas in self.manager.canvas.children and
499
+ self.screen_out not in self.manager.children):
500
+ self.manager.canvas.remove(self.screen_out.canvas)
501
+
502
+ def add_screen(self, screen):
503
+ self.screen_in.pos = self.screen_out.pos
504
+ self.screen_in.size = self.screen_out.size
505
+ self.manager.real_remove_widget(self.screen_out)
506
+ self.manager.canvas.add(self.screen_out.canvas)
507
+
508
+ def remove_screen_out(instr):
509
+ Clock.schedule_once(self._remove_out_canvas, -1)
510
+ self.render_ctx.remove(instr)
511
+
512
+ self.fbo_in = self.make_screen_fbo(self.screen_in)
513
+ self.fbo_out = self.make_screen_fbo(self.screen_out)
514
+ self.manager.canvas.add(self.fbo_in)
515
+ self.manager.canvas.add(self.fbo_out)
516
+
517
+ self.render_ctx = RenderContext(fs=self.fs, vs=self.vs,
518
+ use_parent_modelview=True,
519
+ use_parent_projection=True)
520
+ with self.render_ctx:
521
+ BindTexture(texture=self.fbo_out.texture, index=1)
522
+ BindTexture(texture=self.fbo_in.texture, index=2)
523
+ x, y = self.screen_in.pos
524
+ w, h = self.fbo_in.texture.size
525
+ Rectangle(size=(w, h), pos=(x, y),
526
+ tex_coords=self.fbo_in.texture.tex_coords)
527
+ Callback(remove_screen_out)
528
+ self.render_ctx['tex_out'] = 1
529
+ self.render_ctx['tex_in'] = 2
530
+ self.manager.canvas.add(self.render_ctx)
531
+
532
+ def remove_screen(self, screen):
533
+ self.manager.canvas.remove(self.fbo_in)
534
+ self.manager.canvas.remove(self.fbo_out)
535
+ self.manager.canvas.remove(self.render_ctx)
536
+ self._remove_out_canvas()
537
+ self.manager.real_add_widget(self.screen_in)
538
+
539
+ def stop(self):
540
+ self._remove_out_canvas()
541
+ super(ShaderTransition, self).stop()
542
+
543
+
544
+ class NoTransition(TransitionBase):
545
+ '''No transition, instantly switches to the next screen with no delay or
546
+ animation.
547
+
548
+ .. versionadded:: 1.8.0
549
+ '''
550
+
551
+ duration = NumericProperty(0.0)
552
+
553
+ def on_complete(self):
554
+ self.screen_in.pos = self.manager.pos
555
+ self.screen_out.pos = self.manager.pos
556
+ super(NoTransition, self).on_complete()
557
+
558
+
559
+ class SlideTransition(TransitionBase):
560
+ '''Slide Transition, can be used to show a new screen from any direction:
561
+ left, right, up or down.
562
+ '''
563
+
564
+ direction = OptionProperty('left', options=('left', 'right', 'up', 'down'))
565
+ '''Direction of the transition.
566
+
567
+ :attr:`direction` is an :class:`~kivy.properties.OptionProperty` and
568
+ defaults to 'left'. Can be one of 'left', 'right', 'up' or 'down'.
569
+ '''
570
+
571
+ def on_progress(self, progression):
572
+ a = self.screen_in
573
+ b = self.screen_out
574
+ manager = self.manager
575
+ x, y = manager.pos
576
+ width, height = manager.size
577
+ direction = self.direction
578
+ al = AnimationTransition.out_quad
579
+ progression = al(progression)
580
+ if direction == 'left':
581
+ a.y = b.y = y
582
+ a.x = x + width * (1 - progression)
583
+ b.x = x - width * progression
584
+ elif direction == 'right':
585
+ a.y = b.y = y
586
+ b.x = x + width * progression
587
+ a.x = x - width * (1 - progression)
588
+ elif direction == 'down':
589
+ a.x = b.x = x
590
+ a.y = y + height * (1 - progression)
591
+ b.y = y - height * progression
592
+ elif direction == 'up':
593
+ a.x = b.x = x
594
+ b.y = y + height * progression
595
+ a.y = y - height * (1 - progression)
596
+
597
+ def on_complete(self):
598
+ self.screen_in.pos = self.manager.pos
599
+ self.screen_out.pos = self.manager.pos
600
+ super(SlideTransition, self).on_complete()
601
+
602
+
603
+ class CardTransition(SlideTransition):
604
+ '''Card transition that looks similar to Android 4.x application drawer
605
+ interface animation.
606
+
607
+ It supports 4 directions like SlideTransition: left, right, up and down,
608
+ and two modes, pop and push. If push mode is activated, the previous
609
+ screen does not move, and the new one slides in from the given direction.
610
+ If the pop mode is activated, the previous screen slides out, when the new
611
+ screen is already on the position of the ScreenManager.
612
+
613
+ .. versionadded:: 1.10
614
+ '''
615
+
616
+ mode = OptionProperty('push', options=['pop', 'push'])
617
+ '''Indicates if the transition should push or pop
618
+ the screen on/off the ScreenManager.
619
+
620
+ - 'push' means the screen slides in in the given direction
621
+ - 'pop' means the screen slides out in the given direction
622
+
623
+ :attr:`mode` is an :class:`~kivy.properties.OptionProperty` and
624
+ defaults to 'push'.
625
+ '''
626
+
627
+ def start(self, manager):
628
+ '''(internal) Starts the transition. This is automatically
629
+ called by the :class:`ScreenManager`.
630
+ '''
631
+ super(CardTransition, self).start(manager)
632
+ mode = self.mode
633
+ a = self.screen_in
634
+ b = self.screen_out
635
+ # ensure that the correct widget is "on top"
636
+ if mode == 'push':
637
+ manager.canvas.remove(a.canvas)
638
+ manager.canvas.add(a.canvas)
639
+ elif mode == 'pop':
640
+ manager.canvas.remove(b.canvas)
641
+ manager.canvas.add(b.canvas)
642
+
643
+ def on_progress(self, progression):
644
+ a = self.screen_in
645
+ b = self.screen_out
646
+ manager = self.manager
647
+ x, y = manager.pos
648
+ width, height = manager.size
649
+ direction = self.direction
650
+ mode = self.mode
651
+ al = AnimationTransition.out_quad
652
+ progression = al(progression)
653
+ if mode == 'push':
654
+ b.pos = x, y
655
+ if direction == 'left':
656
+ a.pos = x + width * (1 - progression), y
657
+ elif direction == 'right':
658
+ a.pos = x - width * (1 - progression), y
659
+ elif direction == 'down':
660
+ a.pos = x, y + height * (1 - progression)
661
+ elif direction == 'up':
662
+ a.pos = x, y - height * (1 - progression)
663
+ elif mode == 'pop':
664
+ a.pos = x, y
665
+ if direction == 'left':
666
+ b.pos = x - width * progression, y
667
+ elif direction == 'right':
668
+ b.pos = x + width * progression, y
669
+ elif direction == 'down':
670
+ b.pos = x, y - height * progression
671
+ elif direction == 'up':
672
+ b.pos = x, y + height * progression
673
+
674
+
675
+ class SwapTransition(TransitionBase):
676
+ '''Swap transition that looks like iOS transition when a new window
677
+ appears on the screen.
678
+ '''
679
+ def __init__(self, **kwargs):
680
+ super(SwapTransition, self).__init__(**kwargs)
681
+ self.scales = {}
682
+
683
+ def start(self, manager):
684
+ for screen in self.screen_in, self.screen_out:
685
+ with screen.canvas.before:
686
+ PushMatrix(group='swaptransition_scale')
687
+ scale = Scale(group='swaptransition_scale')
688
+ with screen.canvas.after:
689
+ PopMatrix(group='swaptransition_scale')
690
+
691
+ screen.bind(center=self.update_scale)
692
+ self.scales[screen] = scale
693
+ super(SwapTransition, self).start(manager)
694
+
695
+ def update_scale(self, screen, center):
696
+ self.scales[screen].origin = center
697
+
698
+ def add_screen(self, screen):
699
+ self.manager.real_add_widget(screen, 1)
700
+
701
+ def on_complete(self):
702
+ self.screen_in.pos = self.manager.pos
703
+ self.screen_out.pos = self.manager.pos
704
+ for screen in self.screen_in, self.screen_out:
705
+ for canvas in screen.canvas.before, screen.canvas.after:
706
+ canvas.remove_group('swaptransition_scale')
707
+ super(SwapTransition, self).on_complete()
708
+
709
+ def on_progress(self, progression):
710
+ a = self.screen_in
711
+ b = self.screen_out
712
+ manager = self.manager
713
+
714
+ self.scales[b].xyz = [1. - progression * 0.7 for xyz in 'xyz']
715
+ self.scales[a].xyz = [0.5 + progression * 0.5 for xyz in 'xyz']
716
+ a.center_y = b.center_y = manager.center_y
717
+
718
+ al = AnimationTransition.in_out_sine
719
+
720
+ if progression < 0.5:
721
+ p2 = al(progression * 2)
722
+ width = manager.width * 0.7
723
+ widthb = manager.width * 0.2
724
+ a.x = manager.center_x + p2 * width / 2.
725
+ b.center_x = manager.center_x - p2 * widthb / 2.
726
+ else:
727
+ if self.screen_in is self.manager.children[-1]:
728
+ self.manager.real_remove_widget(self.screen_in)
729
+ self.manager.real_add_widget(self.screen_in)
730
+ p2 = al((progression - 0.5) * 2)
731
+ width = manager.width * 0.85
732
+ widthb = manager.width * 0.2
733
+ a.x = manager.x + width * (1 - p2)
734
+ b.center_x = manager.center_x - (1 - p2) * widthb / 2.
735
+
736
+
737
+ class WipeTransition(ShaderTransition):
738
+ '''Wipe transition, based on a fragment Shader.
739
+ '''
740
+
741
+ WIPE_TRANSITION_FS = '''$HEADER$
742
+ uniform float t;
743
+ uniform sampler2D tex_in;
744
+ uniform sampler2D tex_out;
745
+
746
+ void main(void) {
747
+ vec4 cin = texture2D(tex_in, tex_coord0);
748
+ vec4 cout = texture2D(tex_out, tex_coord0);
749
+ gl_FragColor = mix(cout, cin, clamp((-1.5 + 1.5*tex_coord0.x + 2.5*t),
750
+ 0.0, 1.0));
751
+ }
752
+ '''
753
+ fs = StringProperty(WIPE_TRANSITION_FS)
754
+
755
+
756
+ class FadeTransition(ShaderTransition):
757
+ '''Fade transition, based on a fragment Shader.
758
+ '''
759
+
760
+ FADE_TRANSITION_FS = '''$HEADER$
761
+ uniform float t;
762
+ uniform sampler2D tex_in;
763
+ uniform sampler2D tex_out;
764
+
765
+ void main(void) {
766
+ vec4 cin = vec4(texture2D(tex_in, tex_coord0.st));
767
+ vec4 cout = vec4(texture2D(tex_out, tex_coord0.st));
768
+ vec4 frag_col = vec4(t * cin) + vec4((1.0 - t) * cout);
769
+ gl_FragColor = frag_col;
770
+ }
771
+ '''
772
+ fs = StringProperty(FADE_TRANSITION_FS)
773
+
774
+
775
+ class FallOutTransition(ShaderTransition):
776
+ '''Transition where the new screen 'falls' from the screen centre,
777
+ becoming smaller and more transparent until it disappears, and
778
+ revealing the new screen behind it. Mimics the popular/standard
779
+ Android transition.
780
+
781
+ .. versionadded:: 1.8.0
782
+
783
+ '''
784
+
785
+ duration = NumericProperty(0.15)
786
+ '''Duration in seconds of the transition, replacing the default of
787
+ :class:`TransitionBase`.
788
+
789
+ :class:`duration` is a :class:`~kivy.properties.NumericProperty` and
790
+ defaults to .15 (= 150ms).
791
+ '''
792
+
793
+ FALLOUT_TRANSITION_FS = '''$HEADER$
794
+ uniform float t;
795
+ uniform sampler2D tex_in;
796
+ uniform sampler2D tex_out;
797
+
798
+ void main(void) {
799
+ /* quantities for position and opacity calculation */
800
+ float tr = 0.5*sin(t); /* 'real' time */
801
+ vec2 diff = (tex_coord0.st - 0.5) * (1.0/(1.0-tr));
802
+ vec2 dist = diff + 0.5;
803
+ float max_dist = 1.0 - tr;
804
+
805
+ /* in and out colors */
806
+ vec4 cin = vec4(texture2D(tex_in, tex_coord0.st));
807
+ vec4 cout = vec4(texture2D(tex_out, dist));
808
+
809
+ /* opacities for in and out textures */
810
+ float oin = clamp(1.0-cos(t), 0.0, 1.0);
811
+ float oout = clamp(cos(t), 0.0, 1.0);
812
+
813
+ bvec2 outside_bounds = bvec2(abs(tex_coord0.s - 0.5) > 0.5*max_dist,
814
+ abs(tex_coord0.t - 0.5) > 0.5*max_dist);
815
+
816
+ vec4 frag_col;
817
+ if (any(outside_bounds) ){
818
+ frag_col = vec4(cin.x, cin.y, cin.z, 1.0);
819
+ }
820
+ else {
821
+ frag_col = vec4(oout*cout.x + oin*cin.x, oout*cout.y + oin*cin.y,
822
+ oout*cout.z + oin*cin.z, 1.0);
823
+ }
824
+
825
+ gl_FragColor = frag_col;
826
+ }
827
+ '''
828
+
829
+ fs = StringProperty(FALLOUT_TRANSITION_FS)
830
+
831
+
832
+ class RiseInTransition(ShaderTransition):
833
+ '''Transition where the new screen rises from the screen centre,
834
+ becoming larger and changing from transparent to opaque until it
835
+ fills the screen. Mimics the popular/standard Android transition.
836
+
837
+ .. versionadded:: 1.8.0
838
+ '''
839
+
840
+ duration = NumericProperty(0.2)
841
+ '''Duration in seconds of the transition, replacing the default of
842
+ :class:`TransitionBase`.
843
+
844
+ :class:`duration` is a :class:`~kivy.properties.NumericProperty` and
845
+ defaults to .2 (= 200ms).
846
+ '''
847
+
848
+ RISEIN_TRANSITION_FS = '''$HEADER$
849
+ uniform float t;
850
+ uniform sampler2D tex_in;
851
+ uniform sampler2D tex_out;
852
+
853
+ void main(void) {
854
+ /* quantities for position and opacity calculation */
855
+ float tr = 0.5 - 0.5*sqrt(sin(t)); /* 'real' time */
856
+ vec2 diff = (tex_coord0.st - 0.5) * (1.0/(1.0-tr));
857
+ vec2 dist = diff + 0.5;
858
+ float max_dist = 1.0 - tr;
859
+
860
+ /* in and out colors */
861
+ vec4 cin = vec4(texture2D(tex_in, dist));
862
+ vec4 cout = vec4(texture2D(tex_out, tex_coord0.st));
863
+
864
+ /* opacities for in and out textures */
865
+ float oin = clamp(sin(2.0*t), 0.0, 1.0);
866
+ float oout = clamp(1.0 - sin(2.0*t), 0.0, 1.0);
867
+
868
+ bvec2 outside_bounds = bvec2(abs(tex_coord0.s - 0.5) > 0.5*max_dist,
869
+ abs(tex_coord0.t - 0.5) > 0.5*max_dist);
870
+
871
+ vec4 frag_col;
872
+ if (any(outside_bounds) ){
873
+ frag_col = vec4(cout.x, cout.y, cout.z, 1.0);
874
+ }
875
+ else {
876
+ frag_col = vec4(oout*cout.x + oin*cin.x, oout*cout.y + oin*cin.y,
877
+ oout*cout.z + oin*cin.z, 1.0);
878
+ }
879
+
880
+ gl_FragColor = frag_col;
881
+ }
882
+ '''
883
+
884
+ fs = StringProperty(RISEIN_TRANSITION_FS)
885
+
886
+
887
+ class ScreenManager(FloatLayout):
888
+ '''Screen manager. This is the main class that will control your
889
+ :class:`Screen` stack and memory.
890
+
891
+ By default, the manager will show only one screen at a time.
892
+ '''
893
+
894
+ current = StringProperty(None, allownone=True)
895
+ '''
896
+ Name of the screen currently shown, or the screen to show.
897
+
898
+ ::
899
+
900
+ from kivy.uix.screenmanager import ScreenManager, Screen
901
+
902
+ sm = ScreenManager()
903
+ sm.add_widget(Screen(name='first'))
904
+ sm.add_widget(Screen(name='second'))
905
+
906
+ # By default, the first added screen will be shown. If you want to
907
+ # show another one, just set the 'current' property.
908
+ sm.current = 'second'
909
+
910
+ :attr:`current` is a :class:`~kivy.properties.StringProperty` and defaults
911
+ to None.
912
+ '''
913
+
914
+ transition = ObjectProperty(baseclass=TransitionBase)
915
+ '''Transition object to use for animating the transition from the current
916
+ screen to the next one being shown.
917
+
918
+ For example, if you want to use a :class:`WipeTransition` between
919
+ slides::
920
+
921
+ from kivy.uix.screenmanager import ScreenManager, Screen,
922
+ WipeTransition
923
+
924
+ sm = ScreenManager(transition=WipeTransition())
925
+ sm.add_widget(Screen(name='first'))
926
+ sm.add_widget(Screen(name='second'))
927
+
928
+ # by default, the first added screen will be shown. If you want to
929
+ # show another one, just set the 'current' property.
930
+ sm.current = 'second'
931
+
932
+ :attr:`transition` is an :class:`~kivy.properties.ObjectProperty` and
933
+ defaults to a :class:`SlideTransition`.
934
+
935
+ .. versionchanged:: 1.8.0
936
+
937
+ Default transition has been changed from :class:`SwapTransition` to
938
+ :class:`SlideTransition`.
939
+ '''
940
+
941
+ screens = ListProperty()
942
+ '''List of all the :class:`Screen` widgets added. You should not change
943
+ this list manually. Use the
944
+ :meth:`add_widget <kivy.uix.widget.Widget.add_widget>` method instead.
945
+
946
+ :attr:`screens` is a :class:`~kivy.properties.ListProperty` and defaults to
947
+ [], read-only.
948
+ '''
949
+
950
+ current_screen = ObjectProperty(None, allownone=True)
951
+ '''Contains the currently displayed screen. You must not change this
952
+ property manually, use :attr:`current` instead.
953
+
954
+ :attr:`current_screen` is an :class:`~kivy.properties.ObjectProperty` and
955
+ defaults to None, read-only.
956
+ '''
957
+
958
+ def _get_screen_names(self):
959
+ return [s.name for s in self.screens]
960
+
961
+ screen_names = AliasProperty(_get_screen_names, bind=('screens',))
962
+ '''List of the names of all the :class:`Screen` widgets added. The list
963
+ is read only.
964
+
965
+ :attr:`screens_names` is an :class:`~kivy.properties.AliasProperty` and
966
+ is read-only. It is updated if the screen list changes or the name
967
+ of a screen changes.
968
+ '''
969
+
970
+ def __init__(self, **kwargs):
971
+ if 'transition' not in kwargs:
972
+ self.transition = SlideTransition()
973
+ super(ScreenManager, self).__init__(**kwargs)
974
+ self.fbind('pos', self._update_pos)
975
+
976
+ def _screen_name_changed(self, screen, name):
977
+ self.property('screen_names').dispatch(self)
978
+ if screen == self.current_screen:
979
+ self.current = name
980
+
981
+ def add_widget(self, widget, *args, **kwargs):
982
+ '''
983
+ .. versionchanged:: 2.1.0
984
+ Renamed argument `screen` to `widget`.
985
+ '''
986
+ if not isinstance(widget, Screen):
987
+ raise ScreenManagerException(
988
+ 'ScreenManager accepts only Screen widget.')
989
+ if widget.manager:
990
+ if widget.manager is self:
991
+ raise ScreenManagerException(
992
+ 'Screen already managed by this ScreenManager (are you '
993
+ 'calling `switch_to` when you should be setting '
994
+ '`current`?)')
995
+ raise ScreenManagerException(
996
+ 'Screen already managed by another ScreenManager.')
997
+ widget.manager = self
998
+ widget.bind(name=self._screen_name_changed)
999
+ self.screens.append(widget)
1000
+ if self.current is None:
1001
+ self.current = widget.name
1002
+
1003
+ def remove_widget(self, widget, *args, **kwargs):
1004
+ if not isinstance(widget, Screen):
1005
+ raise ScreenManagerException(
1006
+ 'ScreenManager uses remove_widget only for removing Screens.')
1007
+
1008
+ if widget not in self.screens:
1009
+ return
1010
+
1011
+ if self.current_screen == widget:
1012
+ other = next(self)
1013
+ if widget.name == other:
1014
+ self.current = None
1015
+ widget.parent.real_remove_widget(widget)
1016
+ else:
1017
+ self.current = other
1018
+
1019
+ widget.manager = None
1020
+ widget.unbind(name=self._screen_name_changed)
1021
+ self.screens.remove(widget)
1022
+
1023
+ def clear_widgets(self, children=None, *args, **kwargs):
1024
+ '''
1025
+ .. versionchanged:: 2.1.0
1026
+ Renamed argument `screens` to `children`.
1027
+ '''
1028
+ if children is None:
1029
+ # iterate over a copy of screens, as self.remove_widget
1030
+ # modifies self.screens in place
1031
+ children = self.screens[:]
1032
+ remove_widget = self.remove_widget
1033
+ for widget in children:
1034
+ remove_widget(widget)
1035
+
1036
+ def real_add_widget(self, screen, *args):
1037
+ # ensure screen is removed from its previous parent
1038
+ parent = screen.parent
1039
+ if parent:
1040
+ parent.real_remove_widget(screen)
1041
+ super(ScreenManager, self).add_widget(screen)
1042
+
1043
+ def real_remove_widget(self, screen, *args):
1044
+ super(ScreenManager, self).remove_widget(screen)
1045
+
1046
+ def on_current(self, instance, value):
1047
+ if value is None:
1048
+ self.transition.stop()
1049
+ self.current_screen = None
1050
+ return
1051
+
1052
+ screen = self.get_screen(value)
1053
+ if screen == self.current_screen:
1054
+ return
1055
+
1056
+ self.transition.stop()
1057
+
1058
+ previous_screen = self.current_screen
1059
+ self.current_screen = screen
1060
+ if previous_screen:
1061
+ self.transition.screen_in = screen
1062
+ self.transition.screen_out = previous_screen
1063
+ self.transition.start(self)
1064
+ else:
1065
+ self.real_add_widget(screen)
1066
+ screen.pos = self.pos
1067
+ self.do_layout()
1068
+ screen.dispatch('on_pre_enter')
1069
+ screen.dispatch('on_enter')
1070
+
1071
+ def get_screen(self, name):
1072
+ '''Return the screen widget associated with the name or raise a
1073
+ :class:`ScreenManagerException` if not found.
1074
+ '''
1075
+ matches = [s for s in self.screens if s.name == name]
1076
+ num_matches = len(matches)
1077
+ if num_matches == 0:
1078
+ raise ScreenManagerException('No Screen with name "%s".' % name)
1079
+ if num_matches > 1:
1080
+ Logger.warn('Multiple screens named "%s": %s' % (name, matches))
1081
+ return matches[0]
1082
+
1083
+ def has_screen(self, name):
1084
+ '''Return True if a screen with the `name` has been found.
1085
+
1086
+ .. versionadded:: 1.6.0
1087
+ '''
1088
+ return bool([s for s in self.screens if s.name == name])
1089
+
1090
+ def __next__(self):
1091
+ '''Py2K backwards compatibility without six or other lib.
1092
+ '''
1093
+ screens = self.screens
1094
+ if not screens:
1095
+ return
1096
+ try:
1097
+ index = screens.index(self.current_screen)
1098
+ index = (index + 1) % len(screens)
1099
+ return screens[index].name
1100
+ except ValueError:
1101
+ return
1102
+
1103
+ def next(self):
1104
+ '''Return the name of the next screen from the screen list.'''
1105
+ return self.__next__()
1106
+
1107
+ def previous(self):
1108
+ '''Return the name of the previous screen from the screen list.
1109
+ '''
1110
+ screens = self.screens
1111
+ if not screens:
1112
+ return
1113
+ try:
1114
+ index = screens.index(self.current_screen)
1115
+ index = (index - 1) % len(screens)
1116
+ return screens[index].name
1117
+ except ValueError:
1118
+ return
1119
+
1120
+ def switch_to(self, screen, **options):
1121
+ '''Add a new or existing screen to the ScreenManager and switch to it.
1122
+ The previous screen will be "switched away" from. `options` are the
1123
+ :attr:`transition` options that will be changed before the animation
1124
+ happens.
1125
+
1126
+ If no previous screens are available, the screen will be used as the
1127
+ main one::
1128
+
1129
+ sm = ScreenManager()
1130
+ sm.switch_to(screen1)
1131
+ # later
1132
+ sm.switch_to(screen2, direction='left')
1133
+ # later
1134
+ sm.switch_to(screen3, direction='right', duration=1.)
1135
+
1136
+ If any animation is in progress, it will be stopped and replaced by
1137
+ this one: you should avoid this because the animation will just look
1138
+ weird. Use either :meth:`switch_to` or :attr:`current` but not both.
1139
+
1140
+ The `screen` name will be changed if there is any conflict with the
1141
+ current screen.
1142
+
1143
+ .. versionadded: 1.8.0
1144
+ '''
1145
+ assert screen is not None
1146
+
1147
+ if not isinstance(screen, Screen):
1148
+ raise ScreenManagerException(
1149
+ 'ScreenManager accepts only Screen widget.')
1150
+
1151
+ # stop any transition that might be happening already
1152
+ self.transition.stop()
1153
+
1154
+ # ensure the screen name will be unique
1155
+ if screen not in self.screens:
1156
+ if self.has_screen(screen.name):
1157
+ screen.name = self._generate_screen_name()
1158
+
1159
+ # change the transition if given explicitly
1160
+ old_transition = self.transition
1161
+ specified_transition = options.pop("transition", None)
1162
+ if specified_transition:
1163
+ self.transition = specified_transition
1164
+
1165
+ # change the transition options
1166
+ for key, value in iteritems(options):
1167
+ setattr(self.transition, key, value)
1168
+
1169
+ # add and leave if we are set as the current screen
1170
+ if screen.manager is not self:
1171
+ self.add_widget(screen)
1172
+ if self.current_screen is screen:
1173
+ return
1174
+
1175
+ old_current = self.current_screen
1176
+
1177
+ def remove_old_screen(transition):
1178
+ if old_current in self.children:
1179
+ self.remove_widget(old_current)
1180
+ self.transition = old_transition
1181
+ transition.unbind(on_complete=remove_old_screen)
1182
+ self.transition.bind(on_complete=remove_old_screen)
1183
+
1184
+ self.current = screen.name
1185
+
1186
+ def _generate_screen_name(self):
1187
+ i = 0
1188
+ while True:
1189
+ name = '_screen{}'.format(i)
1190
+ if not self.has_screen(name):
1191
+ return name
1192
+ i += 1
1193
+
1194
+ def _update_pos(self, instance, value):
1195
+ for child in self.children:
1196
+ if self.transition.is_active and \
1197
+ (child == self.transition.screen_in or
1198
+ child == self.transition.screen_out):
1199
+ continue
1200
+ child.pos = value
1201
+
1202
+ def on_motion(self, etype, me):
1203
+ if self.transition.is_active:
1204
+ return False
1205
+ return super().on_motion(etype, me)
1206
+
1207
+ def on_touch_down(self, touch):
1208
+ if self.transition.is_active:
1209
+ return False
1210
+ return super(ScreenManager, self).on_touch_down(touch)
1211
+
1212
+ def on_touch_move(self, touch):
1213
+ if self.transition.is_active:
1214
+ return False
1215
+ return super(ScreenManager, self).on_touch_move(touch)
1216
+
1217
+ def on_touch_up(self, touch):
1218
+ if self.transition.is_active:
1219
+ return False
1220
+ return super(ScreenManager, self).on_touch_up(touch)
1221
+
1222
+
1223
+ if __name__ == '__main__':
1224
+ from kivy.app import App
1225
+ from kivy.uix.button import Button
1226
+ Builder.load_string('''
1227
+ <Screen>:
1228
+ canvas:
1229
+ Color:
1230
+ rgb: .2, .2, .2
1231
+ Rectangle:
1232
+ size: self.size
1233
+
1234
+ GridLayout:
1235
+ cols: 2
1236
+ Button:
1237
+ text: 'Hello world'
1238
+ Button:
1239
+ text: 'Hello world'
1240
+ Button:
1241
+ text: 'Hello world'
1242
+ Button:
1243
+ text: 'Hello world'
1244
+ ''')
1245
+
1246
+ class TestApp(App):
1247
+
1248
+ def change_view(self, *l):
1249
+ # d = ('left', 'up', 'down', 'right')
1250
+ # di = d.index(self.sm.transition.direction)
1251
+ # self.sm.transition.direction = d[(di + 1) % len(d)]
1252
+ self.sm.current = next(self.sm)
1253
+
1254
+ def remove_screen(self, *l):
1255
+ self.sm.remove_widget(self.sm.get_screen('test1'))
1256
+
1257
+ def build(self):
1258
+ root = FloatLayout()
1259
+ self.sm = sm = ScreenManager(transition=SwapTransition())
1260
+
1261
+ sm.add_widget(Screen(name='test1'))
1262
+ sm.add_widget(Screen(name='test2'))
1263
+
1264
+ btn = Button(size_hint=(None, None))
1265
+ btn.bind(on_release=self.change_view)
1266
+
1267
+ btn2 = Button(size_hint=(None, None), x=100)
1268
+ btn2.bind(on_release=self.remove_screen)
1269
+
1270
+ root.add_widget(sm)
1271
+ root.add_widget(btn)
1272
+ root.add_widget(btn2)
1273
+ return root
1274
+
1275
+ TestApp().run()