Esempio n. 1
0
File: shotgun.c Progetto: Limsik/e17
void
shotgun_ping_delay_set(Shotgun_Auth *auth, double delay)
{
   EINA_SAFETY_ON_NULL_RETURN(auth);
   auth->ping_delay = delay;
   if (auth->et_ping) 
      ecore_timer_interval_set(auth->et_ping, auth->ping_delay);
}
Esempio n. 2
0
/**
 * @brief Frees an allocated Store structure.
 * @param store Store structure to free.
 */
void
store_free(Store *store)
{
   EINA_SAFETY_ON_NULL_RETURN(store);

   eina_stringshare_replace(&store->url, NULL);
   free(store);
}
Esempio n. 3
0
File: shotgun.c Progetto: Limsik/e17
void
shotgun_ping_timeout_set(Shotgun_Auth *auth, double timeout)
{
   EINA_SAFETY_ON_NULL_RETURN(auth);
   auth->ping_timeout = timeout;
   if (auth->et_ping_timeout) 
      ecore_timer_interval_set(auth->et_ping_timeout, auth->ping_timeout);
}
Esempio n. 4
0
/**
 * Free a E_Bluez_Device_Found struct
 *
 * @param device the struct to be freed
 */
void
e_bluez_devicefound_free(E_Bluez_Device_Found *device)
{
   EINA_SAFETY_ON_NULL_RETURN(device);

   eina_stringshare_del(device->name);
   e_bluez_element_array_free(device->array, NULL);
}
Esempio n. 5
0
static void
_elm_plug_disconnected(Ecore_Evas *ee)
{
   Evas_Object *plug = ecore_evas_data_get(ee, PLUG_KEY);
   EINA_SAFETY_ON_NULL_RETURN(plug);
   eo_do(plug, eo_event_callback_call(ELM_PLUG_EVENT_IMAGE_DELETED, NULL));
   /* TODO: was a typo. Deprecated, remove in future releases: */
   evas_object_smart_callback_call(plug, "image.deleted", NULL);
}
Esempio n. 6
0
void ewk_cookies_cookie_free(Ewk_Cookie* cookie)
{
    EINA_SAFETY_ON_NULL_RETURN(cookie);
    eina_stringshare_del(cookie->name);
    eina_stringshare_del(cookie->value);
    eina_stringshare_del(cookie->domain);
    eina_stringshare_del(cookie->path);
    delete cookie;
}
Esempio n. 7
0
static void
esql_mysac_query(Esql *e, const char *query, unsigned int len EINA_UNUSED)
{
   MYSAC_RES *res;

   res = mysac_new_res(2048, 1);
   EINA_SAFETY_ON_NULL_RETURN(res);
   mysac_s_set_query(e->backend.db, res, query);
}
Esempio n. 8
0
/**
 * @brief Set automatic reconnect mode
 * @param e The #Esql object (NOT NULL)
 * @param enable If EINA_TRUE, this feature is enabled.
 *
 * This function enables autoreconnect mode, where a server connection will automatically
 * re-establish itself if disconnection occurs for any reason.
 */
void
esql_reconnect_set(Esql     *e,
                   Eina_Bool enable)
{
   EINA_SAFETY_ON_NULL_RETURN(e);

   e->reconnect = enable;
   if (e->pool) esql_pool_reconnect_set((Esql_Pool*)e, enable);
}
Esempio n. 9
0
void ewk_url_response_unref(Ewk_Url_Response* response)
{
    EINA_SAFETY_ON_NULL_RETURN(response);

    if (--response->__ref)
        return;

    delete response;
}
Esempio n. 10
0
EAPI void
eina_array_free(Eina_Array *array)
{
   eina_array_flush(array);

   EINA_SAFETY_ON_NULL_RETURN(array);
   EINA_MAGIC_CHECK_ARRAY(array);
   MAGIC_FREE(array);
}
Esempio n. 11
0
void ewk_web_resource_unref(Ewk_Web_Resource* resource)
{
    EINA_SAFETY_ON_NULL_RETURN(resource);

    if (--resource->__ref)
        return;

    delete resource;
}
Esempio n. 12
0
/**
 * @brief Set a connected callback for an #Esql object
 * Use this function to set a callback to override the ESQL_EVENT_CONNECTED event,
 * calling @p cb with @p data instead.
 * @param e The #Esql object (NOT NULL)
 * @param cb The callback
 * @param data The data
 */
void
esql_connect_callback_set(Esql           *e,
                          Esql_Connect_Cb cb,
                          void           *data)
{
   EINA_SAFETY_ON_NULL_RETURN(e);

   e->connect_cb = cb;
   e->connect_cb_data = data;
}
Esempio n. 13
0
/**
 * @brief Disconnect from the currently connected server
 * This function calls all necessary functions to cleanly disconnect from the server
 * previously connected to by @p e.
 * @note Disconnecting is immediate, but an ESQL_EVENT_DISCONNECT is still emitted.
 * @param e The #Esql object (NOT NULL)
 */
void
esql_disconnect(Esql *e)
{
   DBG("(e=%p)", e);
   EINA_SAFETY_ON_NULL_RETURN(e);
   e->connected = EINA_FALSE;
   if (e->pool)
     {
        esql_pool_disconnect((Esql_Pool *)e);
        return;
     }
   EINA_SAFETY_ON_NULL_RETURN(e->backend.db);

   e->backend.disconnect(e);
   if (e->fdh) ecore_main_fd_handler_del(e->fdh);
   e->fdh = NULL;
   INFO("Disconnected");
   ecore_event_add(ESQL_EVENT_DISCONNECT, e, (Ecore_End_Cb)esql_fake_free, NULL);
}
Esempio n. 14
0
static void
_elm_plug_resized(Ecore_Evas *ee)
{
   Evas_Coord_Size size = {0, 0};
   Evas_Object *plug = ecore_evas_data_get(ee, PLUG_KEY);
   EINA_SAFETY_ON_NULL_RETURN(plug);

   ecore_evas_geometry_get(ee, NULL, NULL, &(size.w), &(size.h));
   eo_do(plug, eo_event_callback_call(ELM_PLUG_EVENT_IMAGE_RESIZED, &size));
}
Esempio n. 15
0
static void
_ecore_imf_context_xim_input_panel_hide(Ecore_IMF_Context *ctx)
{
   Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
   DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
   EINA_SAFETY_ON_NULL_RETURN(imf_context_data);

   ecore_x_e_virtual_keyboard_state_set
        (imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
}
Esempio n. 16
0
void ewk_paint_context_free(Ewk_Paint_Context* context)
{
    EINA_SAFETY_ON_NULL_RETURN(context);

    if (context->image && context->pixels) {
        // Decrease refcount inside image object.
        evas_object_image_data_set(context->image, context->pixels);
    }
    delete context;
}
Esempio n. 17
0
static void
_on_conn_message_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
   Eldbus_Message_Cb cb = eldbus_pending_data_del(pending, "__user_cb");
   Eldbus_Connection *conn = eldbus_pending_data_del(pending, "__connection");

   EINA_SAFETY_ON_NULL_RETURN(conn);
   eldbus_connection_pending_del(conn, pending);
   cb(data, msg, pending);
}
Esempio n. 18
0
void
animal_eat(Eina_Model *m)
{
   EINA_SAFETY_ON_FALSE_RETURN(eina_model_instance_check(m, ANIMAL_TYPE));

   void (*pf)(Eina_Model *m);
   pf = eina_model_method_resolve(m, Animal_Type, eat);
   EINA_SAFETY_ON_NULL_RETURN(pf);
   printf("%s()    \t", __func__);
   pf(m);
}
Esempio n. 19
0
/**
 * Frees the memory used by a cookie.
 *
 * @param cookie the Ewk_Cookie struct that will be freed.
 */
void ewk_cookies_cookie_free(Ewk_Cookie *cookie)
{
#if USE(SOUP)
    EINA_SAFETY_ON_NULL_RETURN(cookie);
    free(cookie->name);
    free(cookie->value);
    free(cookie->domain);
    free(cookie->path);
    free(cookie);
#endif
}
Esempio n. 20
0
EINTERN void
e_xinerama_fake_screen_del(int num)
{
   Eina_List *l;
   E_Screen *scr, *lscr;
   int n = 0, x = 0;

   /* this assumes X number of identical horizontal screens */
   EINA_SAFETY_ON_NULL_RETURN(fake_screens);
   l = eina_list_nth_list(fake_screens, num);
   EINA_SAFETY_ON_NULL_RETURN(l);
   scr = eina_list_data_get(l);
   free(scr);
   fake_screens = eina_list_remove_list(fake_screens, l);
   EINA_LIST_FOREACH(fake_screens, l, lscr)
     {
        lscr->screen = n++;
        lscr->x = x;
        lscr->w = e_comp->w / eina_list_count(fake_screens);
        x = lscr->x + lscr->w;
     }
Esempio n. 21
0
void ewk_paint_context_paint_contents(Ewk_Paint_Context* context, WebCore::FrameView* view, const Eina_Rectangle* area)
{
    EINA_SAFETY_ON_NULL_RETURN(context);
    EINA_SAFETY_ON_NULL_RETURN(view);
    EINA_SAFETY_ON_NULL_RETURN(area);

    WebCore::IntRect paintArea(*area);

    if (view->isTransparent())
        context->graphicContext->clearRect(paintArea);
    view->paintContents(context->graphicContext.get(), paintArea);

#if ENABLE(INSPECTOR)
    WebCore::Page* page = view->frame()->page();
    if (page) {
        WebCore::InspectorController* controller = page->inspectorController();
        if (controller->highlightedNode())
            controller->drawHighlight(*context->graphicContext);
    }
#endif
}
Esempio n. 22
0
void ewk_intent_request_unref(Ewk_Intent_Request* request)
{
#if ENABLE(WEB_INTENTS)
    EINA_SAFETY_ON_NULL_RETURN(request);

    if (--request->__ref)
        return;

    ewk_intent_free(request->intent);
    delete request;
#endif
}
Esempio n. 23
0
void ewk_js_object_type_set(Ewk_JS_Object* jsObject, Ewk_JS_Object_Type type)
{
#if ENABLE(NETSCAPE_PLUGIN_API)
    EINA_SAFETY_ON_NULL_RETURN(jsObject);
    EINA_MAGIC_CHECK_OR_RETURN(jsObject);

    jsObject->type = type;
#else
    UNUSED_PARAM(jsObject);
    UNUSED_PARAM(type);
#endif
}
Esempio n. 24
0
EAPI void
efreet_setowner(const char *path)
{
   EINA_SAFETY_ON_NULL_RETURN(path);

   int fd;

   fd = open(path, O_RDONLY);
   if (fd < 0) return;
   efreet_fsetowner(fd);
   close(fd);
}
Esempio n. 25
0
EAPI void
eina_prefix_free(Eina_Prefix *pfx)
{
   EINA_SAFETY_ON_NULL_RETURN(pfx);

   IF_FREE_NULL(pfx->exe_path);
   IF_FREE_NULL(pfx->prefix_path);
   IF_FREE_NULL(pfx->prefix_path_bin);
   IF_FREE_NULL(pfx->prefix_path_data);
   IF_FREE_NULL(pfx->prefix_path_lib);
   IF_FREE_NULL(pfx->prefix_path_locale);
   free(pfx);
}
Esempio n. 26
0
/**
 * Sets the given proxy URI to network backend.
 *
 * @param proxy URI.
 */
void ewk_settings_proxy_uri_set(const char* proxy)
{
#if USE(SOUP)
    SoupURI* uri = soup_uri_new(proxy);
    EINA_SAFETY_ON_NULL_RETURN(uri);

    SoupSession* session = WebCore::ResourceHandle::defaultSession();
    g_object_set(session, SOUP_SESSION_PROXY_URI, uri, NULL);
    soup_uri_free(uri);
#elif USE(CURL)
    EINA_SAFETY_ON_TRUE_RETURN(1);
#endif
}
Esempio n. 27
0
void ewk_context_menu_unref(Ewk_Context_Menu* menu)
{
    EINA_SAFETY_ON_NULL_RETURN(menu);
    void* item;

    if (--menu->__ref)
        return;

    EINA_LIST_FREE(menu->items, item)
        ewk_context_menu_item_free(static_cast<Ewk_Context_Menu_Item*>(item));

    free(menu);
}
Esempio n. 28
0
static void
esql_postgresql_res(Esql_Res *res)
{
   Esql_Row *r;
   PGresult *pres;
   int i;

   pres = res->backend.res = PQgetResult(res->e->backend.db);
   EINA_SAFETY_ON_NULL_RETURN(pres);

   switch (PQresultStatus(pres))
     {
      case PGRES_COMMAND_OK:
        {
           const char *a;

           a = PQcmdTuples(pres);
           if (a && (*a))
             res->affected = strtol(a, NULL, 10);
           res->id = PQoidValue(pres);
        }
        return;
      case PGRES_TUPLES_OK:
        break;
      default:
        res->error = PQresultErrorMessage(pres);
        ERR("Error %s:'%s'!", PQresStatus(PQresultStatus(pres)), res->error);
        return;
     }
   res->desc = esql_module_desc_get(PQntuples(pres), (Esql_Module_Setup_Cb)esql_module_setup_cb, res);
   for (i = 0; i < res->row_count; i++)
     {
        r = esql_row_calloc(1);
        EINA_SAFETY_ON_NULL_RETURN(r);
        r->res = res;
        esql_postgresql_row_init(r, i);
        res->rows = eina_inlist_append(res->rows, EINA_INLIST_GET(r));
     }
}
Esempio n. 29
0
/**
 * @internal
 *
 * Appends the WebCore's item to the context menu object.
 *
 * @param menu the context menu object
 * @param core the WebCore's context menu item that will be added to the context menu
 * @note emits a signal "contextmenu,item,appended"
 *
 * @see ewk_context_menu_item_new
 */
void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core)
{
    Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type());
    Ewk_Context_Menu_Action action = static_cast<Ewk_Context_Menu_Action>(core.action());

    Ewk_Context_Menu_Item* menu_item = ewk_context_menu_item_new
                                           (type, action, 0, core.title().utf8().data(), core.checked(),
                                           core.enabled());
    EINA_SAFETY_ON_NULL_RETURN(menu_item);

    menu->items = eina_list_append(menu->items, menu_item);
    evas_object_smart_callback_call(menu->view, "contextmenu,item,appended", menu);
}
Esempio n. 30
0
void ewk_js_variant_free(Ewk_JS_Variant* jsVariant)
{
#if ENABLE(NETSCAPE_PLUGIN_API)
    EINA_SAFETY_ON_NULL_RETURN(jsVariant);
    if (jsVariant->type == EWK_JS_VARIANT_STRING)
        eina_stringshare_del(jsVariant->value.s);
    else if (jsVariant->type == EWK_JS_VARIANT_OBJECT)
        ewk_js_object_free(jsVariant->value.o);
    free(jsVariant);
#else
    UNUSED_PARAM(jsVariant);
#endif
}