remove azy code and build/configure checks. after zmike made it plain

azy will never become part of efl, and things like being able to do
http get/posts etc. should be part of efl itself as a core feature,
then we forever will have to choose ecore_con_url or some efl
mechanism OR azy.. or go implement both always, and implementing both
is just stupid. imlementing azy only means we add more dependencies
outside of efl and we repeat the mistakes of the past with the split
tree, or we implement the efl method only (ecore-con-url), so i'm
choosing the one with the least dependencies. call me if this position
on azy outside of efl changes.
This commit is contained in:
Carsten Haitzler 2013-03-27 21:26:15 +09:00
parent 1f0a8801b5
commit 5a86b057b8
4 changed files with 6 additions and 80 deletions

View File

@ -594,25 +594,6 @@ if test "x$want_emotion" != "xno"; then
fi
fi
want_azy=auto
have_azy=no
AC_ARG_ENABLE(azy,
AC_HELP_STRING([--enable-azy], [enable azy support @<:@default=detect@:>@]),
[want_azy=$enableval],
[want_azy=auto]
)
if test "x$want_azy" != "xno"; then
PKG_CHECK_MODULES(AZY, [azy],
[have_azy=yes], [have_azy=no])
if test "x$want_azy" = "xyes" -a "x$have_azy" = "xno"; then
AC_MSG_ERROR([azy support requested but it was not found])
fi
if test "x$have_azy" = "xyes"; then
AC_DEFINE([HAVE_AZY], 1, "Have azy support")
requirements_e="${requirements_e} azy"
fi
fi
PKG_CHECK_MODULES(E_OPEN, [
eina >= ${efl_version}
ecore >= ${efl_version}

View File

@ -13,7 +13,6 @@ AM_CPPFLAGS = \
@VALGRIND_CFLAGS@ \
@EDJE_DEF@ \
@ELM_CFLAGS@ \
@AZY_CFLAGS@ \
@EMOTION_CFLAGS@ \
@WAYLAND_CFLAGS@ \
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
@ -394,7 +393,7 @@ e_main.c \
$(enlightenment_src)
enlightenment_LDFLAGS = -export-dynamic
enlightenment_LDADD = @e_libs@ @ELM_LIBS@ @AZY_LIBS@ @EMOTION_LIBS@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm
enlightenment_LDADD = @e_libs@ @ELM_LIBS@ @EMOTION_LIBS@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm
enlightenment_imc_SOURCES = \
e.h \

View File

@ -13,8 +13,8 @@ AM_CPPFLAGS = -I. \
-I$(top_srcdir)/src/bin \
-I$(top_builddir)/src/bin \
-I$(top_srcdir)/src/modules
AM_CFLAGS = @e_cflags@ @AZY_CFLAGS@
LIBS += @e_libs@ @dlopen_libs@ @AZY_LIBS@
AM_CFLAGS = @e_cflags@
LIBS += @e_libs@ @dlopen_libs@
EDJE_CC = $(EDJE_CC_$(V))
EDJE_CC_ = $(EDJE_CC_$(AM_DEFAULT_VERBOSITY))

View File

@ -10,9 +10,6 @@
*/
#include "e.h"
#include <time.h>
#ifdef HAVE_AZY
# include <Azy.h>
#endif
static E_Module *shot_module = NULL;
static E_Action *border_act = NULL, *act = NULL;
@ -35,11 +32,7 @@ static Evas_Object *o_label = NULL;
static Evas_Object *o_entry = NULL;
static unsigned char *fdata = NULL;
static int fsize = 0;
#ifdef HAVE_AZY
static Azy_Client *client = NULL;
#else
static Ecore_Con_Url *url_up = NULL;
#endif
static Eina_List *handlers = NULL;
static char *url_ret = NULL;
static E_Dialog *fsel_dia = NULL;
@ -313,11 +306,7 @@ _share_done(void)
E_FREE_LIST(handlers, ecore_event_handler_del);
o_label = NULL;
E_FREE(url_ret);
#ifdef HAVE_AZY
E_FREE_FUNC(client, azy_client_free);
#else
E_FREE_FUNC(url_up, ecore_con_url_free);
#endif
}
static void
@ -344,7 +333,6 @@ _upload_cancel_cb(void *data __UNUSED__, E_Dialog *dia)
_share_done();
}
#ifndef HAVE_AZY
static Eina_Bool
_upload_data_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event)
{
@ -356,7 +344,7 @@ _upload_data_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event)
memcpy(txt, ev->data, ev->size);
txt[ev->size] = 0;
/*
/*
printf("GOT %i bytes: '%s'\n", ev->size, txt);
int i;
for (i = 0; i < ev->size; i++) printf("%02x.", ev->data[i]);
@ -364,9 +352,9 @@ _upload_data_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event)
*/
if (!url_ret) url_ret = strdup(txt);
else
{
{
char *n;
n = malloc(strlen(url_ret) + ev->size + 1);
if (n)
{
@ -379,23 +367,15 @@ _upload_data_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event)
}
return EINA_FALSE;
}
#endif
static Eina_Bool
_upload_progress_cb(void *data __UNUSED__, int ev_type __UNUSED__, void *event)
{
size_t total, current;
#ifdef HAVE_AZY
Azy_Event_Client_Transfer_Progress *ev = event;
if (ev->client != client) return ECORE_CALLBACK_RENEW;
total = azy_net_content_length_get(ev->net);
current = ev->current;
#else
Ecore_Con_Event_Url_Progress *ev = event;
if (ev->url_con != url_up) return ECORE_CALLBACK_RENEW;
total = ev->up.total;
current = ev->up.now;
#endif
if (o_label)
{
char buf[1024];
@ -417,19 +397,9 @@ static Eina_Bool
_upload_complete_cb(void *data, int ev_type __UNUSED__, void *event)
{
int status;
#ifdef HAVE_AZY
Azy_Event_Client_Transfer_Complete *ev = event;
Eina_Binbuf *buf;
if (ev->client != client) return ECORE_CALLBACK_RENEW;
status = azy_net_code_get(azy_content_net_get(ev->content));
buf = azy_content_return_get(ev->content, NULL);
eina_binbuf_append_char(buf, 0);
url_ret = (char*)eina_binbuf_string_steal(buf);
#else
Ecore_Con_Event_Url_Complete *ev = event;
if (ev->url_con != url_up) return ECORE_CALLBACK_RENEW;
status = ev->status;
#endif
if (data)
e_widget_disabled_set(data, 1);
@ -537,17 +507,6 @@ _win_share_cb(void *data __UNUSED__, void *data2 __UNUSED__)
_share_done();
#ifdef HAVE_AZY
E_LIST_HANDLER_APPEND(handlers, AZY_EVENT_CLIENT_TRANSFER_PROGRESS, _upload_progress_cb, NULL);
client = azy_client_util_connect("http://www.enlightenment.org/shot.php");
// why use http 1.1? proxies like squid don't handle 1.1 posts with expect
// like curl uses by default, so go to 1.0 and this all works dandily
// out of the box
azy_net_protocol_set(azy_client_net_get(client), AZY_NET_PROTOCOL_HTTP_1_0);
azy_net_header_set(azy_client_net_get(client), "content-type", "application/x-e-shot");
azy_client_blank(client, AZY_NET_TYPE_POST, &(Azy_Net_Data){fdata, fsize}, NULL, NULL);
#else
E_LIST_HANDLER_APPEND(handlers, ECORE_CON_EVENT_URL_DATA, _upload_data_cb, NULL);
E_LIST_HANDLER_APPEND(handlers, ECORE_CON_EVENT_URL_PROGRESS, _upload_progress_cb, NULL);
@ -557,7 +516,6 @@ _win_share_cb(void *data __UNUSED__, void *data2 __UNUSED__)
// out of the box
ecore_con_url_http_version_set(url_up, ECORE_CON_URL_HTTP_VERSION_1_0);
ecore_con_url_post(url_up, fdata, fsize, "application/x-e-shot");
#endif
dia = e_dialog_new(scon, "E", "_e_shot_share");
e_dialog_resizable_set(dia, 1);
e_dialog_title_set(dia, _("Uploading screenshot"));
@ -582,11 +540,7 @@ _win_share_cb(void *data __UNUSED__, void *data2 __UNUSED__)
e_dialog_button_add(dia, _("Hide"), NULL, _upload_ok_cb, NULL);
e_dialog_button_add(dia, _("Cancel"), NULL, _upload_cancel_cb, NULL);
e_object_del_attach_func_set(E_OBJECT(dia), _win_share_del);
#ifdef HAVE_AZY
E_LIST_HANDLER_APPEND(handlers, AZY_EVENT_CLIENT_TRANSFER_COMPLETE, _upload_complete_cb, eina_list_last_data_get(dia->buttons));
#else
E_LIST_HANDLER_APPEND(handlers, ECORE_CON_EVENT_URL_COMPLETE, _upload_complete_cb, eina_list_last_data_get(dia->buttons));
#endif
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
}
@ -1006,11 +960,7 @@ EAPI E_Module_Api e_modapi =
EAPI void *
e_modapi_init(E_Module *m)
{
#ifdef HAVE_AZY
if (!azy_init())
#else
if (!ecore_con_url_init())
#endif
{
e_util_dialog_show(_("Shot Error"),
_("Cannot initialize network"));
@ -1068,11 +1018,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
}
shot_module = NULL;
e_int_border_menu_hook_del(border_hook);
#ifdef HAVE_AZY
azy_shutdown();
#else
ecore_con_url_shutdown();
#endif
return 1;
}