api: add bool data to efl.io.reader/writer 'changed' events
authorMike Blumenkrantz <zmike@samsung.com>
Fri, 22 Feb 2019 13:50:02 +0000 (08:50 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 8 Mar 2019 11:49:35 +0000 (20:49 +0900)
Summary:
changed events should always be triggered with the accompanying changed
data to reduce function calls

ref T7600, T7599

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7600, T7599

Differential Revision: https://phab.enlightenment.org/D7984

15 files changed:
src/lib/ecore/efl_appthread.c
src/lib/ecore/efl_exe.c
src/lib/ecore/efl_io_buffered_stream.c
src/lib/ecore/efl_io_reader_fd.c
src/lib/ecore/efl_io_writer_fd.c
src/lib/ecore/efl_thread.c
src/lib/ecore_con/efl_net_dialer_http.c
src/lib/ecore_con/efl_net_dialer_websocket.c
src/lib/ecore_con/efl_net_server_udp_client.c
src/lib/ecore_con/efl_net_socket_ssl.c
src/lib/ecore_con/efl_net_socket_windows.c
src/lib/efl/interfaces/efl_io_buffer.c
src/lib/efl/interfaces/efl_io_queue.c
src/lib/efl/interfaces/efl_io_reader.eo
src/lib/efl/interfaces/efl_io_writer.eo

index 4eb190b..b1871dd 100644 (file)
@@ -139,7 +139,7 @@ _efl_appthread_efl_io_reader_can_read_set(Eo *obj, Efl_Appthread_Data *pd, Eina_
    else
      efl_loop_handler_active_set(pd->fd.in_handler,
                                  EFL_LOOP_HANDLER_FLAGS_READ);
-   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -231,7 +231,7 @@ _efl_appthread_efl_io_writer_can_write_set(Eo *obj, Efl_Appthread_Data *pd, Eina
    else
      efl_loop_handler_active_set(pd->fd.in_handler,
                                  EFL_LOOP_HANDLER_FLAGS_WRITE);
-   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index 61ff4ba..3a0bd0f 100644 (file)
@@ -759,7 +759,7 @@ _efl_exe_efl_io_reader_can_read_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_rea
    else
      efl_loop_handler_active_set(pd->fd.out_handler,
                                  EFL_LOOP_HANDLER_FLAGS_READ);
-   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -857,7 +857,7 @@ _efl_exe_efl_io_writer_can_write_set(Eo *obj, Efl_Exe_Data *pd, Eina_Bool can_wr
    else
      efl_loop_handler_active_set(pd->fd.in_handler,
                                  EFL_LOOP_HANDLER_FLAGS_WRITE);
-   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index 53b1eda..f2054c2 100644 (file)
@@ -273,7 +273,7 @@ _efl_io_buffered_stream_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffered_Stream
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -339,7 +339,7 @@ _efl_io_buffered_stream_efl_io_writer_can_write_set(Eo *o, Efl_Io_Buffered_Strea
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static void
index 670a22f..078af8c 100644 (file)
@@ -79,7 +79,7 @@ _efl_io_reader_fd_efl_io_reader_can_read_set(Eo *o, Efl_Io_Reader_Fd_Data *pd, E
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_reader_fd_get(o) < 0 && can_read);
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
index 091bb1b..50be01c 100644 (file)
@@ -83,7 +83,7 @@ _efl_io_writer_fd_efl_io_writer_can_write_set(Eo *o, Efl_Io_Writer_Fd_Data *pd,
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_writer_fd_get(o) < 0 && can_write);
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 #include "efl_io_writer_fd.eo.c"
index ce1ab8f..bd20cd1 100644 (file)
@@ -892,7 +892,7 @@ _efl_thread_efl_io_reader_can_read_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool c
    else
      efl_loop_handler_active_set(pd->fd.out_handler,
                                  EFL_LOOP_HANDLER_FLAGS_READ);
-   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -986,7 +986,7 @@ _efl_thread_efl_io_writer_can_write_set(Eo *obj, Efl_Thread_Data *pd, Eina_Bool
    else
      efl_loop_handler_active_set(pd->fd.in_handler,
                                  EFL_LOOP_HANDLER_FLAGS_WRITE);
-   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index 20f3156..40503c8 100644 (file)
@@ -1626,7 +1626,7 @@ _efl_net_dialer_http_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Http_Data
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -1714,7 +1714,7 @@ _efl_net_dialer_http_efl_io_writer_can_write_set(Eo *o, Efl_Net_Dialer_Http_Data
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 static Eina_Value _efl_net_dialer_http_pending_close(Eo *o, void *data, Eina_Value value);
index 01f4418..8d8719a 100644 (file)
@@ -1297,7 +1297,7 @@ _efl_net_dialer_websocket_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Webso
    if (pd->streaming_mode == EFL_NET_DIALER_WEBSOCKET_STREAMING_MODE_DISABLED) return;
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static void
@@ -1350,7 +1350,7 @@ _efl_net_dialer_websocket_efl_io_writer_can_write_set(Eo *o, Efl_Net_Dialer_Webs
      can_write = EINA_FALSE;
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Error
index 52a9d38..ec4f1fd 100644 (file)
@@ -234,7 +234,7 @@ _efl_net_server_udp_client_efl_io_reader_can_read_set(Eo *o, Efl_Net_Server_Udp_
    EINA_SAFETY_ON_TRUE_RETURN(pd->fd == INVALID_SOCKET);
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -265,7 +265,7 @@ _efl_net_server_udp_client_efl_io_writer_can_write_set(Eo *o, Efl_Net_Server_Udp
    EINA_SAFETY_ON_TRUE_RETURN(pd->fd == INVALID_SOCKET);
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index 3f9e6ce..912a8cb 100644 (file)
@@ -536,7 +536,7 @@ _efl_net_socket_ssl_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Ssl_Data *p
    EINA_SAFETY_ON_NULL_RETURN(pd->sock);
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -599,7 +599,7 @@ _efl_net_socket_ssl_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Ssl_Data *
    EINA_SAFETY_ON_NULL_RETURN(pd->sock);
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index c69d0a8..0aaa8ed 100644 (file)
@@ -816,7 +816,7 @@ _efl_net_socket_windows_efl_io_reader_can_read_set(Eo *o, Efl_Net_Socket_Windows
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o) && can_read);
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -899,7 +899,7 @@ _efl_net_socket_windows_efl_io_writer_can_write_set(Eo *o, Efl_Net_Socket_Window
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o) && can_write);
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Bool
index c0c505e..62050d0 100644 (file)
@@ -232,7 +232,7 @@ _efl_io_buffer_efl_io_reader_can_read_set(Eo *o, Efl_Io_Buffer_Data *pd, Eina_Bo
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -322,7 +322,7 @@ _efl_io_buffer_efl_io_writer_can_write_set(Eo *o, Efl_Io_Buffer_Data *pd, Eina_B
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Error
index 20f3e95..c30f7e8 100644 (file)
@@ -346,7 +346,7 @@ _efl_io_queue_efl_io_reader_can_read_set(Eo *o, Efl_Io_Queue_Data *pd, Eina_Bool
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_read == can_read) return;
    pd->can_read = can_read;
-   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, (void*) (uintptr_t) can_read);
 }
 
 EOLIAN static Eina_Bool
@@ -448,7 +448,7 @@ _efl_io_queue_efl_io_writer_can_write_set(Eo *o, Efl_Io_Queue_Data *pd, Eina_Boo
    EINA_SAFETY_ON_TRUE_RETURN(efl_io_closer_closed_get(o));
    if (pd->can_write == can_write) return;
    pd->can_write = can_write;
-   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
+   efl_event_callback_call(o, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, (void*) (uintptr_t) can_write);
 }
 
 EOLIAN static Eina_Error
index 0fa08b4..ca5aea0 100644 (file)
@@ -55,7 +55,7 @@ interface @beta Efl.Io.Reader {
     }
 
     events {
-        can_read,changed: void; [[Notifies can_read property changed.
+        can_read,changed: bool; [[Notifies can_read property changed.
 
                             If @.can_read is $true there is data to
                             @.read without blocking/error. If
index 295fe7c..443f7b2 100644 (file)
@@ -47,7 +47,7 @@ interface @beta Efl.Io.Writer {
     }
 
     events {
-        can_write,changed: void; [[Notifies can_write property changed.
+        can_write,changed: bool; [[Notifies can_write property changed.
 
                              If @.can_write is $true there is data to
                              @.write without blocking/error. If