Example #1
0
static PyObject *
_wrap_gnc_html_webkit_show_data(PyObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "html", "data", "datalen", NULL };
    PyGObject *html;
    char *data;
    int datalen;
    GncHtmlPrivate *priv_html;
    GncHtmlWebkitPrivate *priv;

    //fprintf(stderr,"webkit show data called 1\n");

    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Osi:Gnc.HtmlWebkit.show_data", kwlist, &html, &data, &datalen))
        return NULL;

    //fprintf(stderr,"webkit show data called 2\n");

    // we now call the gnc-html class pointer
    //gnc_html_webkit_show_data(GNC_HTML_WEBKIT(html->obj), data, datalen);

    GncHtml* gself_html = GNC_HTML(html->obj);
    GncHtmlWebkit* gself = GNC_HTML_WEBKIT(html->obj);

    fprintf(stderr,"html self is %p\n",(void *)gself_html);
    fprintf(stderr,"html self is %d\n",GNC_IS_HTML(gself_html));
    fprintf(stderr,"html self class is %p\n",(void *)GNC_HTML_GET_CLASS(gself_html));
    fprintf(stderr,"html self show_data is %p\n",(void *)(GNC_HTML_GET_CLASS(gself_html)->show_data));

    fprintf(stderr,"webkit self is %p\n",(void *)gself);
    fprintf(stderr,"webkit self is %d\n",GNC_IS_HTML(gself));
    fprintf(stderr,"webkit self class is %p\n",(void *)GNC_HTML_WEBKIT_GET_CLASS(gself));
    // so this does not exist - only the parent class GncHtml defines the show_data!!
    //fprintf(stderr,"webkit self show_data is %p\n",(void *)(GNC_HTML_WEBKIT_GET_CLASS(gself)->show_data));

    // this appears to be the way we call should call it rather than
    // direct pointer call
    // great - inspection of code show this only displays stuff if priv->html_string is set
    // note that the dispose function frees this

    priv_html = GNC_HTML_GET_PRIVATE(gself_html);
    fprintf(stderr,"html self priv %p\n",(char *)&(gself_html->priv));
    fprintf(stderr,"html self priv is %p\n",(void *)priv_html);

    priv = GNC_HTML_WEBKIT_GET_PRIVATE(gself);
    priv->html_string = g_strdup(data);

    fprintf(stderr,"html self html struct len %lx\n", sizeof(GncHtml));
    fprintf(stderr,"html self htmlwebkitstruct len %lx\n", sizeof(GncHtmlWebkit));
    fprintf(stderr,"webkit self priv %p\n",(char *)&(gself->priv));
    fprintf(stderr,"webkit self priv offset %llx\n",((char *)((char *)&(gself->priv)-(char *)gself)));
    fprintf(stderr,"webkit self priv is %p\n",(void *)priv);
    fprintf(stderr,"webkit self priv html_string is %p\n",(void *)&(priv->html_string));
    fprintf(stderr,"webkit self priv html_string offset %llx\n",((char *)&(priv->html_string)-(char *)priv));

    gnc_html_show_data( GNC_HTML(gself), data, datalen );

    Py_INCREF(Py_None);
    return Py_None;
}
Example #2
0
void
gnc_html_set_parent( GncHtml* self, GtkWindow* parent )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->set_parent != NULL )
    {
        GNC_HTML_GET_CLASS(self)->set_parent( self, parent );
    }
    else
    {
        DEBUG( "'set_parent' not implemented" );
    }
}
Example #3
0
void
gnc_html_print( GncHtml* self )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->print != NULL )
    {
        GNC_HTML_GET_CLASS(self)->print( self );
    }
    else
    {
        DEBUG( "'print' not implemented" );
    }
}
Example #4
0
void
gnc_html_copy_to_clipboard( GncHtml* self )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->copy_to_clipboard != NULL )
    {
        GNC_HTML_GET_CLASS(self)->copy_to_clipboard( self );
    }
    else
    {
        DEBUG( "'copy_to_clipboard' not implemented" );
    }
}
Example #5
0
void
gnc_html_cancel( GncHtml* self )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->cancel != NULL )
    {
        GNC_HTML_GET_CLASS(self)->cancel( self );
    }
    else
    {
        DEBUG( "'cancel' not implemented" );
    }
}
Example #6
0
void
gnc_html_reload( GncHtml* self )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->reload != NULL )
    {
        GNC_HTML_GET_CLASS(self)->reload( self );
    }
    else
    {
        DEBUG( "'reload' not implemented" );
    }
}
Example #7
0
void
gnc_html_show_data( GncHtml* self, const gchar* data, int datalen )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->show_data != NULL )
    {
        GNC_HTML_GET_CLASS(self)->show_data( self, data, datalen );
    }
    else
    {
        DEBUG( "'show_data' not implemented" );
    }
}
Example #8
0
void
gnc_html_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->print != NULL )
    {
        GNC_HTML_GET_CLASS(self)->print( self, jobname, export_pdf );
    }
    else
    {
        DEBUG( "'print' not implemented" );
    }
}
Example #9
0
gboolean
gnc_html_export_to_file( GncHtml* self, const gchar* filepath )
{
    g_return_val_if_fail( self != NULL, FALSE );
    g_return_val_if_fail( GNC_IS_HTML(self), FALSE );

    if ( GNC_HTML_GET_CLASS(self)->export_to_file != NULL )
    {
        return GNC_HTML_GET_CLASS(self)->export_to_file( self, filepath );
    }
    else
    {
        DEBUG( "'export_to_file' not implemented" );
        return FALSE;
    }
}
Example #10
0
void
gnc_html_show_url( GncHtml* self, URLType type,
                   const gchar* location, const gchar* label,
                   gboolean new_window_hint )
{
    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    if ( GNC_HTML_GET_CLASS(self)->show_url != NULL )
    {
        GNC_HTML_GET_CLASS(self)->show_url( self, type, location, label, new_window_hint );
    }
    else
    {
        DEBUG( "'show_url' not implemented" );
    }
}
Example #11
0
void
gnc_html_show_url( GncHtml* self, URLType type,
                   const gchar* location, const gchar* label,
                   gboolean new_window_hint )
{
    URLType lc_type = NULL;

    g_return_if_fail( self != NULL );
    g_return_if_fail( GNC_IS_HTML(self) );

    lc_type = g_ascii_strdown (type, -1);
    if ( GNC_HTML_GET_CLASS(self)->show_url != NULL )
    {
        GNC_HTML_GET_CLASS(self)->show_url( self, lc_type, location, label, new_window_hint );
    }
    else
    {
        DEBUG( "'show_url' not implemented" );
    }

    g_free (lc_type);
}