summaryrefslogtreecommitdiff
path: root/efl/utils
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-03-01 19:35:40 +0100
committerdavemds <dave@gurumeditation.it>2014-03-01 19:35:40 +0100
commitec71e46441ee43eb0416b4b4798b66f797b69a9e (patch)
treeed6d7e0285b733372b4543be4565f9624f298620 /efl/utils
parent2751ef6025663ce1253123e5c4472ac675772644 (diff)
Python-EFL: new 1.9 API : Win.wm_rotation_* functions and properties
NOTE: all this is UNTESTED as I do not have a rotating WM
Diffstat (limited to 'efl/utils')
-rw-r--r--efl/utils/conversions.pyx43
1 files changed, 43 insertions, 0 deletions
diff --git a/efl/utils/conversions.pyx b/efl/utils/conversions.pyx
index f8ae3a2..44eaeec 100644
--- a/efl/utils/conversions.pyx
+++ b/efl/utils/conversions.pyx
@@ -91,6 +91,49 @@ cdef const_char ** python_list_strings_to_array_of_strings(list strings) except
91 91
92 return array 92 return array
93 93
94cdef list array_of_ints_to_python_list(int *array, int array_length):
95 """
96
97 Converts an array of ints to a python list.
98
99 UNTESTED (used in Win.wm_rotation_available_rotations)
100
101 """
102 cdef:
103 list ret = list()
104 int i
105
106 for i in range(array_length):
107 ret.append(array[i])
108
109 return ret
110
111cdef int * python_list_ints_to_array_of_ints(list ints) except NULL:
112 """
113
114 Converts a python list to an array of ints.
115
116 UNTESTED (used in Win.wm_rotation_available_rotations)
117
118 Note: Remember to free the array when it's no longer needed.
119
120 """
121 cdef:
122 int *array = NULL
123 unsigned int i
124 unsigned int arr_len = len(ints)
125
126 if arr_len == 0:
127 return NULL
128
129 array = <int *>malloc(arr_len * sizeof(int))
130 if not array:
131 raise MemoryError()
132
133 for i in range(arr_len):
134 array[i] = ints[i]
135
136 return array
94 137
95cdef list eina_list_strings_to_python_list(const_Eina_List *lst): 138cdef list eina_list_strings_to_python_list(const_Eina_List *lst):
96 cdef: 139 cdef: