[Pkg-e-commits] [SCM] Python bindings for Ecore and Ecore-Evas branch, master, updated. debian/0.2.1-2-145-g53c6acf

Albin Tonnerre albin.tonnerre at gmail.com
Wed Dec 23 19:48:45 UTC 2009


The following commit has been merged in the master branch:
commit f4d7e28774d9622250c169298ed1b0afa1a43437
Author: Albin Tonnerre <albin.tonnerre at gmail.com>
Date:   Wed Dec 16 21:33:24 2009 +0100

    Import new SVN snapshot

diff --git a/ecore/__init__.py b/ecore/__init__.py
index ef66af9..9d66d58 100644
--- a/ecore/__init__.py
+++ b/ecore/__init__.py
@@ -20,12 +20,15 @@
 import c_ecore
 
 from c_ecore import shutdown, time_get, loop_time_get, timer_add, \
-     main_loop_begin, main_loop_quit, main_loop_iterate, event_handler_add, \
+     main_loop_begin, main_loop_quit, main_loop_iterate, \
+     main_loop_glib_integrate, event_handler_add, \
      animator_add, animator_frametime_set, animator_frametime_get, \
      idler_add, idle_enterer_add, idle_exiter_add, fd_handler_add, \
      Animator, Timer, Idler, IdleExiter, IdleEnterer, FdHandler, \
      Event, EventHandler
 
+ECORE_CALLBACK_CANCEL = 0
+ECORE_CALLBACK_RENEW = 1
 
 ECORE_FD_NONE = 0
 ECORE_FD_READ = 1
diff --git a/ecore/ecore.c_ecore.pyx b/ecore/ecore.c_ecore.pyx
index a754143..663b3af 100644
--- a/ecore/ecore.c_ecore.pyx
+++ b/ecore/ecore.c_ecore.pyx
@@ -47,6 +47,18 @@ def main_loop_iterate():
     ecore_main_loop_iterate()
     python.Py_END_ALLOW_THREADS
 
+def main_loop_glib_integrate():
+    """Ask Ecore to integrate with GLib, running its default GMainContext.
+
+    After this call, Ecore will act like GLib's main loop and also
+    dispatch GLib's timers, fd-handlers and idlers. It makes possible
+    to run Ecore-based applications with libraries that depends on
+    GLib main loop, like GConf, GTK, GUPnP and others.
+
+    @raises SystemError: if failed to integrate or no glib support.
+    """
+    if not ecore_main_loop_glib_integrate():
+        raise SystemError("failed to integrate GLib main loop into ecore.")
 
 def time_get():
     """Get current time, in seconds.
diff --git a/ecore/imf/ecore.imf.c_ecore_imf.pyx b/ecore/imf/ecore.imf.c_ecore_imf.pyx
index b40ec64..6a233d3 100644
--- a/ecore/imf/ecore.imf.c_ecore_imf.pyx
+++ b/ecore/imf/ecore.imf.c_ecore_imf.pyx
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this Python-Ecore.  If not, see <http://www.gnu.org/licenses/>.
 
-cimport ecore.c_ecore_data
+cimport ecore.c_ecore
 
 def init():
     return ecore_imf_init()
@@ -24,38 +24,30 @@ def shutdown():
     return ecore_imf_shutdown()
 
 def available_ids():
-    cdef Ecore_List *lst
+    cdef ecore.c_ecore.Eina_List *lst, *itr
     cdef char *data
     ret = []
 
-    lst = ecore_imf_context_available_ids_get()
-    if lst != NULL:
-        ecore.c_ecore_data.ecore_list_first_goto(lst)
-        data = <char *> ecore.c_ecore_data.ecore_list_next(lst)
-
-        while data != NULL:
-            ret.append(data)
-            data = <char*> ecore.c_ecore_data.ecore_list_next(lst)
-
-        ecore.c_ecore_data.ecore_list_destroy(lst)
+    lst = itr = ecore_imf_context_available_ids_get()
+    while itr != NULL:
+        data = <char *>itr.data
+        ret.append(data)
+        itr = itr.next
+    ecore.c_ecore.eina_list_free(lst)
 
     return ret
 
 def available_ids_by_canvas_type(char *canvas_type):
-    cdef Ecore_List *lst
+    cdef ecore.c_ecore.Eina_List *lst, *itr
     cdef char *data
     ret = []
 
-    lst = ecore_imf_context_available_ids_by_canvas_type_get(canvas_type)
-    if lst != NULL:
-        ecore.c_ecore_data.ecore_list_first_goto(lst)
-        data = <char *> ecore.c_ecore_data.ecore_list_next(lst)
-
-        while data != NULL:
-            ret.append(data)
-            data = <char*> ecore.c_ecore_data.ecore_list_next(lst)
-
-        ecore.c_ecore_data.ecore_list_destroy(lst)
+    lst = itr = ecore_imf_context_available_ids_by_canvas_type_get(canvas_type)
+    while itr != NULL:
+        data = <char *>itr.data
+        ret.append(data)
+        itr = itr.next
+    ecore.c_ecore.eina_list_free(lst)
 
     return ret
 
diff --git a/include/ecore/c_ecore.pxd b/include/ecore/c_ecore.pxd
index aa12340..cdd48cc 100644
--- a/include/ecore/c_ecore.pxd
+++ b/include/ecore/c_ecore.pxd
@@ -34,6 +34,14 @@ cdef extern from "Ecore.h":
     ctypedef struct Ecore_Fd_Handler
     ctypedef void Ecore_Event_Handler
 
+    ctypedef struct Eina_List:
+        void      *data
+        Eina_List *next
+        Eina_List *prev
+        void      *accounting
+
+    Eina_List *eina_list_free(Eina_List *list)
+
     int ecore_init()
     int ecore_shutdown()
 
@@ -41,6 +49,8 @@ cdef extern from "Ecore.h":
     void ecore_main_loop_begin()
     void ecore_main_loop_quit()
 
+    int ecore_main_loop_glib_integrate()
+
     double ecore_time_get()
     double ecore_loop_time_get()
 
diff --git a/include/ecore/c_ecore_data.pxd b/include/ecore/c_ecore_data.pxd
deleted file mode 100644
index ff2c902..0000000
--- a/include/ecore/c_ecore_data.pxd
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2007-2008 Gustavo Sverzut Barbieri
-#
-# This file is part of Python-Ecore.
-#
-# Python-Ecore is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# Python-Ecore is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this Python-Ecore.  If not, see <http://www.gnu.org/licenses/>.
-
-cdef extern from "Ecore_Data.h":
-
-    ctypedef struct Ecore_List
-
-    # Retrieve the current position in the list
-    void *ecore_list_current(Ecore_List * list)
-    void *ecore_list_first(Ecore_List * list)
-    void *ecore_list_last(Ecore_List * list)
-    int   ecore_list_index(Ecore_List * list)
-    int   ecore_list_count(Ecore_List * list)
-
-    # Traversing the list
-    void *ecore_list_first_goto(Ecore_List * list)
-    void *ecore_list_last_goto(Ecore_List * list)
-    void *ecore_list_index_goto(Ecore_List * list, int index)
-    void *ecore_list_goto(Ecore_List * list, void *_data)
-
-    # Traversing the list and returning data
-    void *ecore_list_next(Ecore_List * list)
-
-    # Free the list and it's contents
-    void ecore_list_destroy(Ecore_List *lst)
diff --git a/include/ecore/imf/c_ecore_imf.pxd b/include/ecore/imf/c_ecore_imf.pxd
index 4e8d1e8..dbcd149 100644
--- a/include/ecore/imf/c_ecore_imf.pxd
+++ b/include/ecore/imf/c_ecore_imf.pxd
@@ -66,7 +66,7 @@ cdef extern from "Ecore_IMF.h":
     # Structures
     #
     ctypedef struct Ecore_IMF_Context
-    ctypedef struct Ecore_List
+    ctypedef struct Eina_List
 
 
     ctypedef struct Ecore_IMF_Event_Preedit_Start:
@@ -220,8 +220,8 @@ cdef extern from "Ecore_IMF.h":
     int  ecore_imf_init()
     int  ecore_imf_shutdown()
 
-    Ecore_List *ecore_imf_context_available_ids_get()
-    Ecore_List *ecore_imf_context_available_ids_by_canvas_type_get(char *canvas_type)
+    Eina_List *ecore_imf_context_available_ids_get()
+    Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(char *canvas_type)
     char *ecore_imf_context_default_id_get()
     char *ecore_imf_context_default_id_by_canvas_type_get(char *canvas_type)
     Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(char *id)
diff --git a/python_ecore.egg-info/SOURCES.txt b/python_ecore.egg-info/SOURCES.txt
index 096c9e2..ac3d653 100644
--- a/python_ecore.egg-info/SOURCES.txt
+++ b/python_ecore.egg-info/SOURCES.txt
@@ -46,7 +46,6 @@ examples/x/mplayer_embed.py
 examples/x/window_creation.py
 include/ecore/__init__.py
 include/ecore/c_ecore.pxd
-include/ecore/c_ecore_data.pxd
 include/ecore/evas/__init__.py
 include/ecore/evas/c_ecore_evas.pxd
 include/ecore/imf/__init__.py
diff --git a/setup.py b/setup.py
index eb54d4c..4dca741 100644
--- a/setup.py
+++ b/setup.py
@@ -97,8 +97,7 @@ ecorexscreensavermodule = Extension('ecore.x.screensaver',
 
 ecoreimfmodule = Extension('ecore.imf.c_ecore_imf',
                            sources=['ecore/imf/ecore.imf.c_ecore_imf.pyx'],
-                           depends=['include/ecore/c_ecore_data.pxd',
-                                    'include/ecore/imf/c_ecore_imf.pxd',
+                           depends=['include/ecore/imf/c_ecore_imf.pxd',
                                    ],
                            **pkgconfig('"ecore-imf >= 0.9.9.050" ''"eina-0 >= 0.0.1"'))
 

-- 
Python bindings for Ecore and Ecore-Evas



More information about the Pkg-e-commits mailing list