示例#1
0
EAPI Eina_Accessor*
efl_model_list_slice(Eina_List *list, unsigned start, unsigned count)
{
   if (!list) return NULL;

   if ((start == 0) && (count == 0)) /* this is full data */
     {
        /*
         * children_accessor will be set to NULL by
         * eina_list_accessor_new if the later fails.
         */
       return eina_list_accessor_new(list);
     }

   Eo *child;
   Eina_List *l, *ln, *lr = NULL;
   ln = eina_list_nth_list(list, (start-1));
   if (!ln)
     {
        return NULL;
     }

   EINA_LIST_FOREACH(ln, l, child)
     {
        efl_ref(child);
        lr = eina_list_append(lr, child);
        if (eina_list_count(lr) == count)
          break;
     }
示例#2
0
EOLIAN static Efl_Input_Event *
_efl_input_pointer_efl_duplicate_duplicate(const Eo *obj, Efl_Input_Pointer_Data *pd)
{
   Efl_Input_Pointer_Data *ev;
   Efl_Input_Focus *evt;

   if (efl_invalidated_get(obj))
     {
        ERR("Object %s has already been invalidated and can't be duplicated.", efl_debug_name_get(obj));
        return NULL;
     }
   if (!efl_parent_get(obj))
     {
        ERR("Object %s has not parent during duplicate.", efl_debug_name_get(obj));
        return NULL;
     }
   evt = efl_add(MY_CLASS, efl_parent_get(obj),
                 efl_allow_parent_unref_set(efl_added, EINA_TRUE));
   ev = efl_data_scope_get(evt, MY_CLASS);
   if (!ev) return NULL;

   memcpy(ev, pd, sizeof(*ev));
   ev->eo = evt;
   ev->legacy = NULL;
   ev->evas_done = 0;
   ev->win_fed = 0;
   ev->fake = 1;
   ev->device = efl_ref(pd->device);

   return evt;
}
示例#3
0
Eina_Bool
_evas_render2(Eo *eo_e, Evas_Public_Data *e)
{
   double t;

   // if nothing changed at all since last render - skip this frame
   if (!e->changed) return EINA_FALSE;
   // we are still rendering while being asked to render - skip this
   if (e->rendering) return EINA_FALSE;
   // mark this canvas as a render2 canvas - not normal render
   e->render2 = EINA_TRUE;
   // check viewport size is same as output - not allowed to differ
   if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
     ERR("viewport size != output size!");

   // if render threads not initted - init them - maybe move this later?
   _evas_render2_th_init();

   printf("-------------------------------------------- %p %p\n", eo_e, e);
   // wait for any previous render pass to do its thing
   t = get_time();
   evas_canvas_async_block(e);
   t = get_time() - t;
   printf("T: block wait: "); out_time(t);
   // we have to calculate smare objects before render so do that here
   t = get_time();
   evas_call_smarts_calculate(eo_e);
   t = get_time() - t;
   printf("T: smart calc: "); out_time(t);
   // call canvas callbacks saying we are in the pre-render state
   _always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
   // bock any susbequent rneders from doing this walk
   eina_lock_take(&(e->lock_objects));
   // gain a reference
   efl_ref(eo_e);
   // put into the "i'm rendering" pool
   e->rendering = EINA_TRUE;
   _rendering = eina_list_append(_rendering, eo_e);

   // call our flush pre at this point before rendering begins...
   _always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);

   // tell main render thread to wake up and begin processing this canvas
   _evas_render2_th_main_msg_render(eo_e, e);

   return EINA_FALSE;
}
示例#4
0
static Eina_Error
_efl_net_socket_windows_operation_done(Efl_Net_Socket_Windows_Operation *op, DWORD win32err, DWORD used_size)
{
   Efl_Net_Socket_Windows_Data *pd;
   Eina_Error err = 0;

   if (eina_log_domain_level_check(_ecore_con_log_dom, EINA_LOG_LEVEL_DBG))
     {
        char *msg = _efl_net_windows_error_msg_get(win32err);
        DBG("op=%p (socket=%p) success_cb=%p failure_cb=%p data=%p error=%s used_size=%lu",
            op, op->o, op->success_cb, op->failure_cb, op->data, msg, used_size);
        free(msg);
     }

   op->deleting = EINA_TRUE;

   efl_ref(op->o);
   pd = efl_data_scope_get(op->o, EFL_NET_SOCKET_WINDOWS_CLASS);
   if (pd)
     pd->pending_ops = eina_list_remove(pd->pending_ops, op);

   if (win32err)
     err = op->failure_cb((void *)op->data, op->o, win32err);
   else
     op->success_cb((void *)op->data, op->o, used_size);

   if (op->event_handler)
     {
        if (WaitForSingleObject(pd->handle, 0) != WAIT_OBJECT_0)
          {
             DWORD used_size = 0;
             if (GetOverlappedResult(pd->handle, &op->base, &used_size, FALSE))
               {
                  DBG("op=%p (socket=%p) success_cb=%p failure_cb=%p data=%p GetOverlappedResult(%p, %p, &size=%lu, FALSE)",
                      op, op->o, op->success_cb, op->failure_cb, op->data, pd->handle, &op->base, used_size);
               }
             else
               {
                  win32err = GetLastError();
                  if (eina_log_domain_level_check(_ecore_con_log_dom, EINA_LOG_LEVEL_DBG))
                    {
                       char *msg = _efl_net_windows_error_msg_get(win32err);
                       DBG("op=%p (socket=%p) success_cb=%p failure_cb=%p data=%p GetOverlappedResult(%p, %p, &size=%lu, TRUE)=%s",
                           op, op->o, op->success_cb, op->failure_cb, op->data, pd->handle, &op->base, used_size, msg);
                       free(msg);
                    }

                  if (win32err == ERROR_IO_INCOMPLETE)
                    {
                       DBG("op=%p (socket=%p) success_cb=%p failure_cb=%p data=%p: still pending I/O...",
                           op, op->o, op->success_cb, op->failure_cb, op->data);
                       efl_unref(op->o);
                       op->o = NULL;
                       return 0;
                    }
               }
          }

        ecore_main_win32_handler_del(op->event_handler);
     }

#ifndef ERROR_HANDLES_CLOSED
#define ERROR_HANDLES_CLOSED 676
#endif
   if ((win32err == ERROR_HANDLES_CLOSED) && !efl_io_closer_closed_get(op->o))
     efl_io_closer_close(op->o);
   efl_unref(op->o);

   CloseHandle(op->base.hEvent);
   free(op);
   return err;
}