Index: src/af/gr/gtk/gr_UnixPangoGraphics.h =================================================================== --- src/af/gr/gtk/gr_UnixPangoGraphics.h (révision 24574) +++ src/af/gr/gtk/gr_UnixPangoGraphics.h (copie de travail) @@ -89,6 +89,7 @@ virtual void setCursor(GR_ScreenGraphics::Cursor c); virtual GR_ScreenGraphics::Cursor getCursor() const; + GdkWindow* getWindow () {return m_pWin;} }; #ifdef ENABLE_PRINT Index: src/af/gr/xp/gr_CairoGraphics.h =================================================================== --- src/af/gr/xp/gr_CairoGraphics.h (révision 24574) +++ src/af/gr/xp/gr_CairoGraphics.h (copie de travail) @@ -209,6 +209,7 @@ GR_Graphics::JoinStyle inJoinStyle = JOIN_MITER, GR_Graphics::CapStyle inCapStyle = CAP_BUTT, GR_Graphics::LineStyle inLineStyle = LINE_SOLID); + cairo_t* getCairo () {return m_cr;} protected: GR_CairoGraphics(cairo_t *cr); Index: plugins/goffice/unix/AbiGOffice.cpp =================================================================== --- plugins/goffice/unix/AbiGOffice.cpp (révision 24574) +++ plugins/goffice/unix/AbiGOffice.cpp (copie de travail) @@ -57,13 +57,13 @@ typedef GObjectClass AbiCmdContextClass; static void -abi_error_error (GOCmdContext *cc, GError *error) +abi_error_error (G_GNUC_UNUSED GOCmdContext *cc, GError *error) { fprintf (stderr, "Error: %s\n", error->message); } static void -abi_error_info (GOCmdContext *cc, ErrorInfo *error) +abi_error_info (G_GNUC_UNUSED GOCmdContext *cc, ErrorInfo *error) { error_info_print (error); } @@ -82,12 +82,12 @@ } static void -abi_progress_set (GOCmdContext *cc, gfloat val) +abi_progress_set (G_GNUC_UNUSED GOCmdContext *cc, G_GNUC_UNUSED gfloat val) { } static void -abi_progress_message_set (GOCmdContext *cc, gchar const *msg) +abi_progress_message_set (G_GNUC_UNUSED GOCmdContext *cc, G_GNUC_UNUSED gchar const *msg) { } @@ -503,7 +503,7 @@ } ABI_FAR_CALL -int abi_plugin_supports_version (UT_uint32 major, UT_uint32 minor, UT_uint32 release) +int abi_plugin_supports_version (G_GNUC_UNUSED UT_uint32 major, G_GNUC_UNUSED UT_uint32 minor, G_GNUC_UNUSED UT_uint32 release) { return 1; } Index: plugins/goffice/unix/AbiGOChart.cpp =================================================================== --- plugins/goffice/unix/AbiGOChart.cpp (révision 24574) +++ plugins/goffice/unix/AbiGOChart.cpp (copie de travail) @@ -40,11 +40,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -82,7 +81,7 @@ FREEP(mOldLocale); } -typedef struct _AbiControlGUI +struct _AbiControlGUI { GObject base; char *object_id; @@ -115,7 +114,7 @@ // static void -abi_data_allocator_allocate (GogDataAllocator *dalloc, GogPlot *plot) +abi_data_allocator_allocate (G_GNUC_UNUSED GogDataAllocator *dalloc, G_GNUC_UNUSED GogPlot *plot) { // SheetControlGUI *scg = wbcg_cur_scg (WORKBOOK_CONTROL_GUI (dalloc)); // sv_selection_to_plot (sc_view (SHEET_CONTROL (scg)), plot); @@ -217,10 +216,10 @@ } static gpointer -abi_data_allocator_editor (GogDataAllocator *dalloc, +abi_data_allocator_editor (G_GNUC_UNUSED GogDataAllocator *dalloc, GogDataset *dataset, int dim_i, GogDataType data_type) { - AbiControlGUI *acg = ABI_CONTROL_GUI (dalloc); +// AbiControlGUI *acg = ABI_CONTROL_GUI (dalloc); GraphDimEditor *editor; GOData *val; @@ -333,9 +332,7 @@ else { XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); FV_View* pView = static_cast(pFrame->getCurrentView()); - PT_DocPosition pos = pView->getPoint(); pView->cmdInsertEmbed(&myByteBuf,pView->getPoint(),mimetypeGOChart,szProps); } g_object_unref (xml); @@ -356,27 +353,26 @@ // bool -AbiGOChart_Create(AV_View* v, EV_EditMethodCallData *d) +AbiGOChart_Create(G_GNUC_UNUSED AV_View* v, G_GNUC_UNUSED EV_EditMethodCallData *d) { XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); - FV_View* pView = static_cast(pFrame->getCurrentView()); UT_ByteBuf myByteBuf; - static unsigned id = 0; - AbiControlGUI *acg = ABI_CONTROL_GUI (g_object_new (ABI_CONTROL_GUI_TYPE, NULL)); + AbiControlGUI *acg = ABI_CONTROL_GUI(g_object_new (ABI_CONTROL_GUI_TYPE, NULL)); - GogGraph *graph = (GogGraph *) g_object_new (GOG_GRAPH_TYPE, NULL); + GogGraph *graph = (GogGraph *) g_object_new(GOG_GRAPH_TYPE, NULL); /* by default, create one chart and add it to the graph */ - gog_object_add_by_name (GOG_OBJECT (graph), "Chart", NULL); - GClosure *closure = g_cclosure_new (G_CALLBACK (cb_update_graph), acg, + gog_object_add_by_name(GOG_OBJECT(graph), "Chart", NULL); + GClosure *closure = g_cclosure_new(G_CALLBACK (cb_update_graph), acg, (GClosureNotify) graph_user_config_free_data); - GtkWidget *dialog = gog_guru (graph, GOG_DATA_ALLOCATOR (acg), - NULL /*GO_CMD_CONTEXT (wbcg)*/, GTK_WINDOW(pFrameImpl->getTopLevelWindow()), - closure); - g_closure_sink (closure); + GtkWidget *dialog = gog_guru(graph, GOG_DATA_ALLOCATOR (acg), + NULL /*GO_CMD_CONTEXT (wbcg)*/, closure); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(pFrameImpl->getTopLevelWindow())); + g_closure_sink(closure); + gtk_widget_show_all (dialog); - g_object_unref (G_OBJECT (graph)); + g_object_unref (G_OBJECT(graph)); return true; } @@ -448,7 +444,7 @@ pGOChartView->setDefaultFontSize(iSize); } -UT_sint32 GR_GOChartManager::makeEmbedView(AD_Document * pDoc, UT_uint32 api, const char * szDataID) +UT_sint32 GR_GOChartManager::makeEmbedView(AD_Document * pDoc, UT_uint32 api, G_GNUC_UNUSED const char * szDataID) { if(m_pDoc == NULL) { @@ -480,7 +476,7 @@ bool bHaveProp = m_pDoc->getAttrProp(api, &pSpanAP); UT_return_if_fail(bHaveProp); const char * pszDataID = NULL; - bool bFoundDataID = pSpanAP->getAttribute("dataid", pszDataID); + pSpanAP->getAttribute("dataid", pszDataID); if(pItem->m_bHasSnapshot) { updatePNGSnapshot(static_cast(m_pDoc),rec,pszDataID); @@ -509,8 +505,8 @@ { return false; } - GR_Painter painter(getGraphics()); - GR_Image * pImage = painter.genImageFromRectangle(rec); + // TODO: use the goffice framework to get a high resolution png. + GR_Image * pImage = static_cast(getGraphics())->genImageFromRectangle(rec); if(pImage == NULL) { return false; @@ -539,8 +535,8 @@ { return false; } - GR_Painter painter(getGraphics()); - GR_Image * pImage = painter.genImageFromRectangle(rec); + // TODO: use the goffice framework to get a high resolution png. + GR_Image * pImage = static_cast(getGraphics())->genImageFromRectangle(rec); if(pImage == NULL) { return false; @@ -562,12 +558,12 @@ return false; } -bool GR_GOChartManager::isEdittable(UT_sint32 uid) +bool GR_GOChartManager::isEdittable(G_GNUC_UNUSED UT_sint32 uid) { return true; } -void GR_GOChartManager::initializeEmbedView(UT_sint32 uid) +void GR_GOChartManager::initializeEmbedView(G_GNUC_UNUSED UT_sint32 uid) { // FIXME write code for this. } @@ -603,28 +599,28 @@ _loadGOChartXML(uid, sGOChartXML); } -UT_sint32 GR_GOChartManager::getWidth(UT_sint32 uid) +UT_sint32 GR_GOChartManager::getWidth(G_GNUC_UNUSED UT_sint32 uid) { // FIXME write code this draws a square return 5000; } -UT_sint32 GR_GOChartManager::getAscent(UT_sint32 uid) +UT_sint32 GR_GOChartManager::getAscent(G_GNUC_UNUSED UT_sint32 uid) { // FIXME write code this draws a square return 5000; } -UT_sint32 GR_GOChartManager::getDescent(UT_sint32 uid) +UT_sint32 GR_GOChartManager::getDescent(G_GNUC_UNUSED UT_sint32 uid) { // FIXME write code return 0; } -void GR_GOChartManager::setColor(UT_sint32 uid, UT_RGBColor c) +void GR_GOChartManager::setColor(G_GNUC_UNUSED UT_sint32 uid, G_GNUC_UNUSED UT_RGBColor c) { // FIXME write code } @@ -648,7 +644,7 @@ m_vecGOChartView.setNthItem(uid,NULL,NULL); //NULL it out so we don't affect the other uid's } -bool GR_GOChartManager::convert(UT_uint32 iConType, UT_ByteBuf & From, UT_ByteBuf & To) +bool GR_GOChartManager::convert(G_GNUC_UNUSED UT_uint32 iConType, G_GNUC_UNUSED UT_ByteBuf & From, G_GNUC_UNUSED UT_ByteBuf & To) { return false; } @@ -698,7 +694,6 @@ void GR_GOChartManager::removeContextualMenu () { XAP_App *pApp = XAP_App::getApp(); - EV_Menu_ActionSet* pActionSet = pApp->getMenuActionSet(); XAP_Menu_Factory * pFact = pApp->getMenuFactory(); pFact->removeContextMenu (ChartMenuID); } @@ -707,7 +702,7 @@ { m_Graph = NULL; m_Image = NULL; - m_Renderer = GOG_RENDERER (g_object_new (GOG_RENDERER_CAIRO_TYPE, NULL)); + m_Renderer = GOG_RENDERER(g_object_new(GOG_RENDERER_TYPE, NULL)); pix_width = pix_height = 0; width = height = 0; m_Guru = NULL; @@ -731,8 +726,9 @@ { return; } - GR_Graphics *pUGG = m_pGOMan->getGraphics(); - if (pUGG->queryProperties(GR_Graphics::DGP_PAPER)) + GR_CairoGraphics *pUGG = static_cast(m_pGOMan->getGraphics()); + cairo_t *cr = pUGG->getCairo (); +/* if (pUGG->queryProperties(GR_Graphics::DGP_PAPER)) { GnomePrintContext *ctx = NULL; UT_sint32 myWidth = pUGG->tdu(rec.width); @@ -760,15 +756,15 @@ gnome_print_gsave (ctx); gnome_print_translate (ctx, x, y+myHeight); - gog_graph_print_to_gnome_print(m_Graph,ctx,myWidth,myHeight); +// gog_graph_print_to_gnome_print(m_Graph,ctx,myWidth,myHeight); gnome_print_grestore(ctx); } - else + else */ { UT_sint32 _width = pUGG->tdu(rec.width); UT_sint32 _height = pUGG->tdu(rec.height); UT_sint32 x = pUGG->tdu(rec.left); - UT_sint32 y = pUGG->tdu(rec.top); + UT_sint32 y = pUGG->tdu(rec.top)-pUGG->tdu(rec.height); UT_sint32 zoom = pUGG->getZoomPercentage (); UT_sint32 real_width = _width * 100 / zoom; UT_sint32 real_height = _height * 100 / zoom; @@ -778,21 +774,26 @@ height = real_height; gog_graph_set_size (m_Graph, width, height); } - if (_width != pix_width || _height != pix_height) + cairo_save (cr); + cairo_translate (cr, x, y); + gog_renderer_render_to_cairo (m_Renderer, cr, _width, _height); + cairo_restore (cr); +/* if (_width != pix_width || _height != pix_height) { GdkPixbuf *pixbuf; pix_width = _width; pix_height = _height; - gog_renderer_cairo_update (GOG_RENDERER_CAIRO (m_Renderer), _width, _height, 1.0); + gog_renderer_update (m_Renderer, _width, _height); if (m_Image) delete m_Image; - pixbuf = gog_renderer_cairo_get_pixbuf (GOG_RENDERER_CAIRO (m_Renderer)); + pixbuf = gog_renderer_get_pixbuf (m_Renderer); m_Image = new GR_UnixImage(NULL, pixbuf); g_object_ref(pixbuf); m_Image->scaleImageTo(m_pGOMan->getGraphics(),rec); } GR_Painter painter(m_pGOMan->getGraphics()); - painter.drawImage (m_Image, rec.left, rec.top - rec.height); + painter.drawImage (m_Image, rec.left, rec.top - rec.height);*/ +// gog_renderer } } @@ -811,7 +812,7 @@ } -void GOChartView::setDefaultFontSize( UT_sint32 iSize) +void GOChartView::setDefaultFontSize(G_GNUC_UNUSED UT_sint32 iSize) { } @@ -829,9 +830,10 @@ GClosure *closure = g_cclosure_new (G_CALLBACK (cb_update_graph), acg, (GClosureNotify) graph_user_config_free_data); GtkWidget *dialog = gog_guru (m_Graph, GOG_DATA_ALLOCATOR (acg), - NULL /*GO_CMD_CONTEXT (wbcg)*/, GTK_WINDOW(pFrameImpl->getTopLevelWindow()), - closure); + NULL /*GO_CMD_CONTEXT (wbcg)*/, closure); + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(pFrameImpl->getTopLevelWindow())); g_closure_sink (closure); + acg->pView->SetGuru (dialog); g_signal_connect_swapped (G_OBJECT (dialog), "destroy", G_CALLBACK (guru_destroyed_cb), acg->pView); } Index: plugins/goffice/unix/AbiGOComponent.cpp =================================================================== --- plugins/goffice/unix/AbiGOComponent.cpp (révision 24574) +++ plugins/goffice/unix/AbiGOComponent.cpp (copie de travail) @@ -187,11 +187,10 @@ // data from a file. // bool -AbiGOComponent_FileInsert(AV_View* v, EV_EditMethodCallData *d) +AbiGOComponent_FileInsert(G_GNUC_UNUSED AV_View* v, G_GNUC_UNUSED EV_EditMethodCallData *d) { // Get the current view that the user is in. XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - FV_View* pView = static_cast(pFrame->getCurrentView()); PD_Document * pDoc = static_cast(pFrame->getCurrentDoc()); char* pNewFile = NULL; @@ -230,7 +229,7 @@ // ------------------- // This is the function that we actually call to insert a new intially empty component. bool -AbiGOComponent_Create (AV_View* v, EV_EditMethodCallData *d) +AbiGOComponent_Create (G_GNUC_UNUSED AV_View* v, G_GNUC_UNUSED EV_EditMethodCallData *d) { XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); @@ -270,7 +269,8 @@ GOComponent *component = go_component_new_by_mime_type (mime_type); g_signal_connect (G_OBJECT (component), "changed", G_CALLBACK (changed_cb), NULL); - go_component_edit (component); + GtkWindow *win = go_component_edit(component); + gtk_window_set_transient_for(win, GTK_WINDOW(pFrameImpl->getTopLevelWindow())); } gtk_widget_destroy (GTK_WIDGET (dialog)); return result == GTK_RESPONSE_OK; @@ -350,7 +350,7 @@ pGOComponentView->setDefaultFontSize(iSize); } -UT_sint32 GR_GOComponentManager::makeEmbedView(AD_Document * pDoc, UT_uint32 api, const char * szDataID) +UT_sint32 GR_GOComponentManager::makeEmbedView(AD_Document * pDoc, UT_uint32 api, G_GNUC_UNUSED const char * szDataID) { if(m_pDoc == NULL) { @@ -378,7 +378,7 @@ PT_AttrPropIndex api = pItem->m_iAPI; /* bool b = */ m_pDoc->getAttrProp(api, &pSpanAP); const char * pszDataID = NULL; - bool bFoundDataID = pSpanAP->getAttribute("dataid", pszDataID); + pSpanAP->getAttribute("dataid", pszDataID); UT_ByteBuf *pBuf = NULL; if ((pBuf = pGOComponentView->exportToSVG ())) { UT_UTF8String sID = "snapshot-svg-"; @@ -426,8 +426,8 @@ { return false; } - GR_Painter painter(getGraphics()); - GR_Image * pImage = painter.genImageFromRectangle(rec); + // TODO: use the goffice framework to get a high resolution png. + GR_Image * pImage = static_cast(getGraphics())->genImageFromRectangle(rec); if(pImage == NULL) { return false; @@ -455,8 +455,8 @@ { return false; } - GR_Painter painter(getGraphics()); - GR_Image * pImage = painter.genImageFromRectangle(rec); + // TODO: use the goffice framework to get a high resolution png. + GR_Image * pImage = static_cast(getGraphics())->genImageFromRectangle(rec); if(pImage == NULL) { return false; @@ -478,12 +478,12 @@ return false; } -void GR_GOComponentManager::initializeEmbedView(UT_sint32 uid) +void GR_GOComponentManager::initializeEmbedView(G_GNUC_UNUSED UT_sint32 uid) { // FIXME write code for this. } -void GR_GOComponentManager::loadEmbedData(UT_sint32 uid) +void GR_GOComponentManager::loadEmbedData(G_GNUC_UNUSED UT_sint32 uid) { GOComponentView * pGOComponentView = m_vecGOComponentView.getNthItem(uid); UT_return_if_fail(pGOComponentView); @@ -534,7 +534,7 @@ return pGOComponentView->descent = (UT_sint32) rint (dim * UT_LAYOUT_RESOLUTION); } -void GR_GOComponentManager::setColor(UT_sint32 uid, UT_RGBColor c) +void GR_GOComponentManager::setColor(G_GNUC_UNUSED UT_sint32 uid, G_GNUC_UNUSED UT_RGBColor c) { // FIXME write code } @@ -560,7 +560,7 @@ m_vecGOComponentView.setNthItem(uid,NULL,NULL); //NULL it out so we don't affect the other uid's } -bool GR_GOComponentManager::convert(UT_uint32 iConType, UT_ByteBuf & From, UT_ByteBuf & To) +bool GR_GOComponentManager::convert(G_GNUC_UNUSED UT_uint32 iConType, G_GNUC_UNUSED UT_ByteBuf & From, G_GNUC_UNUSED UT_ByteBuf & To) { return false; } @@ -614,79 +614,35 @@ UT_return_if_fail (component); if (rec.width == 0 || rec.height == 0) // Nothing to render return; - GR_Graphics *pUGG = m_pGOMan->getGraphics(); - if (pUGG->queryProperties(GR_Graphics::DGP_PAPER)) + GR_CairoGraphics *pUGG = static_cast(m_pGOMan->getGraphics()); + cairo_t *cr = pUGG->getCairo (); + UT_sint32 myWidth = pUGG->tdu(rec.width); + UT_sint32 myHeight = pUGG->tdu(rec.height); + UT_sint32 x = pUGG->tdu(rec.left); + UT_sint32 y = pUGG->tdu(rec.top - ascent); + if ((width != rec.width || ascent + descent != rec.height) && go_component_is_resizable (component)) { - GnomePrintContext *ctx = NULL; - UT_sint32 myWidth = pUGG->tdu(rec.width); - UT_sint32 myHeight = pUGG->tdu(rec.height); - UT_sint32 x = pUGG->tdu(rec.left); - UT_sint32 y = pUGG->tdu(rec.top); - // - // gnome_print places y = 0 at the bottom of the page - // and as y increases, it gets placed further from the bottom. - // - // This is the opposite of AbiWord where y = 0 is the top - // and y > 0 is further from the top. - // - // scale_ydir fixes this (and gets the landscape/portrait right - // too). - // -#ifdef ENABLE_PRINT - GR_UnixPangoPrintGraphics *pUPPG = static_cast< GR_UnixPangoPrintGraphics *>(pUGG); - ctx = pUPPG->getGnomePrintContext(); - y = pUPPG->scale_ydir(y); -#endif - if (!ctx) - return; - - gnome_print_gsave (ctx); - - // at that point, ascent and descent might be not valid, so get it from the component - double d; - g_object_get (G_OBJECT (component), "descent", &d, NULL); - descent = pUGG->tdu(static_cast(d * UT_LAYOUT_RESOLUTION)); - gnome_print_translate (ctx, x, y - descent); - go_component_print (component, ctx, myWidth, myHeight); - gnome_print_grestore (ctx); + double _ascent, _descent; + go_component_set_size (component, (double) rec.width / UT_LAYOUT_RESOLUTION, (double) rec.height / UT_LAYOUT_RESOLUTION); + g_object_get (G_OBJECT (component), "ascent", &_ascent, "descent", &_descent, NULL); + ascent = (UT_sint32) rint (_ascent * UT_LAYOUT_RESOLUTION); + descent = (UT_sint32) rint (_descent * UT_LAYOUT_RESOLUTION); } - else + if (window != NULL) { - UT_sint32 myWidth = pUGG->tdu(rec.width); - UT_sint32 myHeight = pUGG->tdu(rec.height); - UT_sint32 x = pUGG->tdu(rec.left); - UT_sint32 y = pUGG->tdu(rec.top); - if ((width != rec.width || ascent + descent != rec.height) && go_component_is_resizable (component)) { - double _ascent, _descent; - go_component_set_size (component, (double) rec.width / UT_LAYOUT_RESOLUTION, (double) rec.height / UT_LAYOUT_RESOLUTION); - g_object_get (G_OBJECT (component), "ascent", &_ascent, "descent", &_descent, NULL); - ascent = (UT_sint32) rint (_ascent * UT_LAYOUT_RESOLUTION); - descent = (UT_sint32) rint (_descent * UT_LAYOUT_RESOLUTION); - } - if (window == NULL && (myWidth != pix_width || myHeight != pix_height)) { - // we have a windowless plugin - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, true, - 8, pix_width = myWidth, pix_height = myHeight); - go_component_set_pixbuf (component, pixbuf); - delete m_Image; - m_Image = NULL; - } - if (window != NULL) { - y -= myHeight; - if (x != attributes.x || y != attributes.y) - gdk_window_move (window, x, y); - if (myWidth != attributes.width || myHeight != attributes.height) - gdk_window_resize (window, myWidth, myHeight); - } else { - if (!m_Image) { - go_component_draw (component, myWidth, myHeight); - m_Image = new GR_UnixImage(NULL, pixbuf); - } - m_Image->scaleImageTo(m_pGOMan->getGraphics(),rec); - GR_Painter painter(m_pGOMan->getGraphics()); - painter.drawImage (m_Image, rec.left, rec.top -ascent); - } + y -= myHeight; + if (x != attributes.x || y != attributes.y) + gdk_window_move (window, x, y); + if (myWidth != attributes.width || myHeight != attributes.height) + gdk_window_resize (window, myWidth, myHeight); } + else + { + cairo_save (cr); + cairo_translate (cr, x, y); + go_component_render (component, cr, myWidth, myHeight); + cairo_restore (cr); + } } static void @@ -700,7 +656,6 @@ else { XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); FV_View* pView = static_cast(pFrame->getCurrentView()); UT_Byte *buf; int length; @@ -713,7 +668,7 @@ UT_String Props=UT_String ("embed-type: GOComponent//") + component->mime_type; guint i, nbprops; GType prop_type; - GValue value = { 0 }; + GValue value; char *prop = NULL; GParamSpec **specs = g_object_class_list_properties ( G_OBJECT_GET_CLASS (component), &nbprops); @@ -733,7 +688,7 @@ case G_TYPE_ULONG: case G_TYPE_FLOAT: case G_TYPE_DOUBLE: { - GValue str = { 0 }; + GValue str; g_value_init (&str, G_TYPE_STRING); g_value_transform (&value, &str); prop = g_strdup (g_value_get_string (&str)); @@ -784,8 +739,8 @@ } go_component_set_default_size (component, 2.5, 2.5, 0.); if (go_component_needs_window (component)) { - GR_Graphics *pUGG = m_pGOMan->getGraphics(); - GdkWindow *parent = ((GR_UnixPangoGraphics*) pUGG)->getWindow (); + GR_UnixCairoScreenGraphics *pUGG = static_cast(m_pGOMan->getGraphics()); + GdkWindow *parent = pUGG->getWindow (); attributes.x = 0; // we do not know where the window should be at the moment attributes.y = 0; attributes.width = pUGG->tdu ((UT_sint32)(2.5 * UT_LAYOUT_RESOLUTION)); @@ -803,7 +758,7 @@ PP_AttrProp const *Props = m_pRun->getSpanAP (); GParamSpec *prop_spec; int i = 0; - GValue res = { 0 }; + GValue res; gchar const *szName, *szValue; while (Props->getNthProperty (i++, szName, szValue)) { prop_spec = g_object_class_find_property ( @@ -831,7 +786,7 @@ } -void GOComponentView::setDefaultFontSize( UT_sint32 iSize) +void GOComponentView::setDefaultFontSize(G_GNUC_UNUSED UT_sint32 iSize) { } @@ -856,7 +811,7 @@ UT_String Props=UT_String ("embed-type: GOComponent//") + mime_type; guint i, nbprops; GType prop_type; - GValue value = { 0 }; + GValue value; char *prop = NULL; GParamSpec **specs = g_object_class_list_properties ( G_OBJECT_GET_CLASS (component), &nbprops); @@ -876,7 +831,7 @@ case G_TYPE_ULONG: case G_TYPE_FLOAT: case G_TYPE_DOUBLE: { - GValue str = { 0 }; + GValue str; g_value_init (&str, G_TYPE_STRING); g_value_transform (&value, &str); prop = g_strdup (g_value_get_string (&str)); @@ -912,12 +867,12 @@ UT_ByteBuf *GOComponentView::exportToSVG () { UT_return_val_if_fail (component, NULL); - char *svg = go_component_export_to_svg (component); +// char *svg = go_component_export_to_svg (component); UT_ByteBuf *pBuf = NULL; - if (svg) { +/* if (svg) { pBuf = new UT_ByteBuf (); pBuf->append (reinterpret_cast (svg), strlen (svg)); g_free (svg); - } + }*/ return pBuf; } Index: plugins/goffice/unix/ie_imp_GOChart.cpp =================================================================== --- plugins/goffice/unix/ie_imp_GOChart.cpp (révision 24574) +++ plugins/goffice/unix/ie_imp_GOChart.cpp (copie de travail) @@ -82,7 +82,7 @@ the Encoded Text importer. */ UT_Confidence_t IE_Imp_Object_Sniffer::recognizeContents(const char * szBuf, - UT_uint32 iNumbytes) + G_GNUC_UNUSED UT_uint32 iNumbytes) { const char * magic1 = ""; @@ -104,9 +104,9 @@ return UT_OK; } -bool IE_Imp_Object_Sniffer::getDlgLabels(const char ** pszDesc, - const char ** pszSuffixList, - IEFileType * ft) +bool IE_Imp_Object_Sniffer::getDlgLabels(G_GNUC_UNUSED const char ** pszDesc, + G_GNUC_UNUSED const char ** pszSuffixList, + G_GNUC_UNUSED IEFileType * ft) { /* *pszDesc = "GNOME Office Chart (.xml)"; *pszSuffixList = "*.xml"; @@ -178,10 +178,8 @@ { UT_return_val_if_fail(pStream, UT_ERROR); XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); FV_View* pView = static_cast(pFrame->getCurrentView()); - bool bFirstChar = true; UT_UCSChar c; unsigned char uc; while (pStream->getChar(c)) Index: plugins/goffice/unix/ie_imp_GOComponent.cpp =================================================================== --- plugins/goffice/unix/ie_imp_GOComponent.cpp (révision 24574) +++ plugins/goffice/unix/ie_imp_GOComponent.cpp (copie de travail) @@ -135,9 +135,9 @@ return UT_OK; } -bool IE_Imp_Component_Sniffer::getDlgLabels(const char ** pszDesc, - const char ** pszSuffixList, - IEFileType * ft) +bool IE_Imp_Component_Sniffer::getDlgLabels(G_GNUC_UNUSED const char ** pszDesc, + G_GNUC_UNUSED const char ** pszSuffixList, + G_GNUC_UNUSED IEFileType * ft) { return false; } @@ -207,10 +207,8 @@ { UT_return_val_if_fail(pStream, UT_ERROR); XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - XAP_UnixFrameImpl *pFrameImpl = static_cast(pFrame->getFrameImpl()); FV_View* pView = static_cast(pFrame->getCurrentView()); - bool bFirstChar = true; UT_UCSChar c; unsigned char uc; while (pStream->getChar(c)) Index: plugins/goffice/plugin.m4 =================================================================== --- plugins/goffice/plugin.m4 (révision 24574) +++ plugins/goffice/plugin.m4 (copie de travail) @@ -1,4 +1,16 @@ +goffice_req= +for ver in 0.8 0.6 ; do + if test "x$goffice_req" = x; then + if pkg-config --exists libgoffice-$ver; then + goffice_req=libgoffice-$ver + fi + fi +done +if test "x$goffice_req" = x; then + goffice_req=libgoffice-0.6 +fi + goffice_pkgs="$goffice_req" goffice_deps="no"