document-interface.cpp revision 9822058d997835756ca14b7e0334b41bb1c83c29
#include "document-interface.h"
#include <string.h>
#include "verbs.h"
#include "inkscape.h" //inkscape_find_desktop_by_dkey, activate desktops
#include "desktop-handles.h" //sp_desktop_document()
#include "sp-object.h"
#include "document.h" // sp_document_repr_doc
#include "desktop-style.h" //sp_desktop_get_style
#include "selection.h" //selection struct
#include "selection-chemistry.h"// lots of selection functions
#include "sp-ellipse.h"
#include "layer-fns.h" //LPOS_BELOW
#include "style.h" //style_write
#include "file.h" //IO
#include "print.h" //IO
/****************************************************************************
HELPER / SHORTCUT FUNCTIONS
****************************************************************************/
const gchar* intToCString(int i)
{
ss << i;
}
SPObject *
{
}
const gchar *
{
}
void
if (desk != SP_ACTIVE_DESKTOP)
return;
}
}
}
}
//move_to etc
const GSList *
{
return oldsel;
}
void
{
}
{
if (isrect)
else
}
gchar *
finish_create_shape (DocumentInterface *object, GError **error, Inkscape::XML::Node *newNode, gchar *desc)
{
if (style) {
}
else {
newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE);
}
else
}
{
if ( desk2 ) {
if ( verb ) {
if ( action ) {
}
return TRUE;
}
}
}
return FALSE;
}
/****************************************************************************
DOCUMENT INTERFACE CLASS STUFF
****************************************************************************/
static void
{
}
static void
{
}
static void
{
}
document_interface_new (void)
{
}
/****************************************************************************
MISC FUNCTIONS
****************************************************************************/
{
return TRUE;
}
void
{
if ( desk2 ) {
if ( verb ) {
if ( action ) {
}
}
}
}
}
/****************************************************************************
CREATION FUNCTIONS
****************************************************************************/
{
}
{
}
{
}
{
}
{
}
{
}
{
return retval;
}
{
//FIXME: implement.
return NULL;
}
{
else
}
/****************************************************************************
ENVIORNMENT FUNCTIONS
****************************************************************************/
{
}
{
}
gchar *
{
return sp_repr_css_write_string(current);
}
{
return TRUE;
}
{
//Memory leak?
return TRUE;
}
{
return TRUE;
}
/****************************************************************************
OBJECT FUNCTIONS
****************************************************************************/
{
/* ALTERNATIVE
Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
*/
if (newNode)
{
return TRUE;
}
return FALSE;
}
void
{
if (newNode)
}
void
{
if (newNode)
}
gchar *
{
/* WORKS
Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
*/
if (newNode)
return FALSE;
}
{
return TRUE;
}
{
0 - (y - selection_get_center_y(sel)));
return TRUE;
}
void
{
}
{
g_set_error(error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION, "Object is not a path or does not exist.");
return FALSE;
}
//gfree (pathstr);
return TRUE;
}
{
//FIXME: This should merge transformations.
return TRUE;
}
gchar *
{
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
DBUSPoint **
{
//FIXME: implement.
return NULL;
}
/****************************************************************************
FILE I/O FUNCTIONS
****************************************************************************/
{
return FALSE;
}
{
return TRUE;
}
{
#ifdef WITH_GNOME_VFS
#endif
return false;
try {
false, false, true);
} catch (...) {
//SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved."));
return false;
}
//SP_ACTIVE_DESKTOP->event_log->rememberFileSave();
//SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, "Document saved.");
return true;
}
/*
gboolean
document_interface_print_to_file (DocumentInterface *object, GError **error)
{
SPDocument * doc = sp_desktop_document(object->desk);
return TRUE;
}
*/
/****************************************************************************
PROGRAM CONTROL FUNCTIONS
****************************************************************************/
{
}
{
}
{
}
{
}
/****************************************************************************
UPDATE FUNCTIONS
****************************************************************************/
void
{
}
void
{
//sp_desktop_document(object->desk)->_updateDocument();
}
void
{
//sp_document_done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
}
/****************************************************************************
SELECTION FUNCTIONS FIXME: use call_verb where appropriate.
****************************************************************************/
gchar **
{
int i;
printf("premalloc\n");
printf("postmalloc\n");
for(i = 0; i < size; i++)
printf("postmalloc2\n");
i=0;
printf("prealloc\n");
i++;
}
printf("postalloc\n");
for (i=0; i<size; i++) {
}
return list;
}
{
return FALSE;
/* WORKS
Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
selection->add(repr2, TRUE);
*/
return TRUE;
}
{
//FIXME: implement.
return FALSE;
}
{
return TRUE;
}
{
//FIXME: broken array passing.
int i;
}
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
//FIXME: implement.
return FALSE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
{
return TRUE;
}
document_interface_selection_move_to (DocumentInterface *object, gdouble x, gdouble y, GError **error)
{
if (sel_bbox) {
//Geom::Point m( (object->desk)->point() - sel_bbox->midpoint() );
sp_selection_move_relative(sel, m, true);
}
return TRUE;
}
//FIXME: does not paste in new layer.
{
// check if something is selected
return FALSE;
}
return TRUE;
}
{
//FIXME: implement: pass struct.
return FALSE;
}
{
}
gchar *
{
else
return NULL;
//FIXME: this WILL cause problems with division
}
{
return TRUE;
}
/****************************************************************************
LAYER FUNCTIONS
****************************************************************************/
gchar *
{
SPObject *new_layer = Inkscape::create_layer(dt->currentRoot(), dt->currentLayer(), Inkscape::LPOS_BELOW);
}
{
return TRUE;
}
gchar **
{
//FIXME: implement.
return NULL;
}
{
return TRUE;
}
{
}
{
}