EOLIAN static Efl_Object *
_efl_net_dialer_simple_efl_object_finalize(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
   if (efl_io_buffered_stream_inner_io_get(o)) goto end;

   if (!pd->inner_class)
     {
        ERR("no valid dialer was set with efl_io_buffered_stream_inner_io_set() and no class set with efl_net_dialer_simple_inner_class_set()!");
        return NULL;
     }
   else
     {
        Eo *dialer = efl_add(pd->inner_class, o);
        EINA_SAFETY_ON_NULL_RETURN_VAL(dialer, NULL);

        if (!efl_isa(dialer, EFL_NET_DIALER_INTERFACE))
          {
             ERR("class %s=%p doesn't implement Efl.Net.Dialer interface!", efl_class_name_get(pd->inner_class), pd->inner_class);
             efl_del(dialer);
             return NULL;
          }
        DBG("created new inner dialer %p (%s)", dialer, efl_class_name_get(efl_class_get(dialer)));

        efl_io_buffered_stream_inner_io_set(o, dialer);
     }

 end:
   return efl_finalize(efl_super(o, MY_CLASS));
}
Beispiel #2
0
EOLIAN static void
_xml_sax_base_document_end(Eo *obj, Xml_Base_Data *pd, void *data)
{
    const Efl_Class *current_class = efl_class_get(obj);
    LOGF("Document End called in:'%s'\n", efl_class_name_get(current_class));

    Eo *handler = pd->handler;

    if (handler)
    {
        xml_sax_base_document_end(handler, data);
    }
}
Beispiel #3
0
EOLIAN static void
_xml_sax_base_element_char(Eo *obj, Xml_Base_Data *pd, void *data, const char *string, int string_len)
{
    const Efl_Class *current_class = efl_class_get(obj);
    LOGF("Element Char called in:'%s'\n", efl_class_name_get(current_class));

    Eo *handler = pd->handler;

    if (handler)
    {
        xml_sax_base_element_char(handler, data, string, string_len);
    }
}
Beispiel #4
0
EOLIAN static void
_xml_sax_base_element_start(Eo *obj, Xml_Base_Data *pd, Element *data)
{
    const Efl_Class *current_class = efl_class_get(obj);
    LOGF("Element Start called in:'%s'\n", efl_class_name_get(current_class));

    Eo *handler = pd->handler;

    if (handler)
    {
        xml_sax_base_element_start(handler, data);
    }
}
Beispiel #5
0
EOLIAN static Efl_Object *
_xml_sax_base_parse_string(Eo *obj, Xml_Base_Data *pd, const char* document)
{
    EINA_LOG_DBG("Parsing document: %s", document);
    const Efl_Class *current_class = efl_class_get(obj);
    EINA_LOG_DBG("obj-type referenced:'%s'\n", efl_class_name_get(current_class));
    // Create a parser instance for this request.
    // TODO this currently is here as having one setup in the constructor
    // results in function references being lost in transit...
    xmlSAXHandler parser;
    memset(&parser, 0, sizeof(xmlSAXHandler));
    parser.initialized = XML_SAX2_MAGIC;

    // Setup parser callbacks and start parsing
    parser.startDocument = _libxml2_document_start;
    parser.endDocument = _libxml2_document_end;
    parser.startElementNs = _libxml2_start;
    parser.endElementNs = _libxml2_end;
    parser.characters = _libxml2_char;
    // TODO fix get location issues in XInclude filter.

    // TODO Work out why this goes to town and kills the parser....
    // parser.setDocumentLocator = _libxml2_set_document_locator;

    // Just in for debugging at the moment.
    parser.error = _error;
    parser.warning = _warning;
    parser.fatalError = _fatalError;

    if (xmlSAXUserParseMemory(&parser, obj, document, (int) strlen(document)) < 0 )
    {
        EINA_LOG_ERR("Issue parsing XML document");
    };

    // Make sure we cleanup the current parser.
    xmlCleanupParser();

    return NULL; //pd->result;
}
Beispiel #6
0
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "Eo.h"
#include "function_overrides_simple.h"
#include "function_overrides_inherit2.h"
#include "function_overrides_inherit3.h"

#define MY_CLASS INHERIT3_CLASS

static void
_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
{
   printf("%s %d\n", efl_class_name_get(MY_CLASS), a);
   simple_a_set(efl_super(obj, MY_CLASS), a + 1);
}

static Eina_Bool
_class_initializer(Efl_Class *klass)
{
   EFL_OPS_DEFINE(ops,
         EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
   );

   return efl_class_functions_set(klass, &ops, NULL);
}

static const Efl_Class_Description class_desc = {
     EO_VERSION,
     "Inherit3",