node-tracker.cpp revision 60282e8335d7b6ae7020613bb22c7c69a6909fbb
/**
* Whiteboard session manager
* XML node tracking facility
*
* Authors:
* David Yip <yipdw@rose-hulman.edu>
*
* Copyright (c) 2005 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "sp-object.h"
#include "sp-item-group.h"
#include "document.h"
#include "document-private.h"
#include "util/compose.hpp"
#include "jabber_whiteboard/session-manager.h"
#include "jabber_whiteboard/node-tracker.h"
// TODO: remove redundant calls to isTracking(); it's a rather unnecessary
// performance burden.
namespace Inkscape {
namespace Whiteboard {
// Lookup tables
/**
* Keys for special nodes.
*
* A special node is a node that can only appear once in a document.
*/
char const* specialnodekeys[] = {
};
/**
* Names of special nodes.
*
* A special node is a node that can only appear once in a document.
*/
char const* specialnodenames[] = {
};
{
init();
}
{
init();
}
{
_clear();
}
void
{
_counter = 0;
// Construct special node maps
if (_sm)
reset();
}
void
{
if (_sm)
reset();
}
void
{
}
void
{
// Get the action to perform.
case NODE_ADD:
//g_log(NULL, G_LOG_LEVEL_DEBUG,
//"NODE_ADD event: key %s, node %p",
//action.first.first.c_str(), action.first.second);
break;
case NODE_REMOVE:
//g_log(NULL, G_LOG_LEVEL_DEBUG,
//"NODE_REMOVE event: key %s, node %p",
// action.first.first.c_str(), action.first.second);
//remove(const_cast< XML::Node& >(*action.first.second));
break;
default:
break;
}
}
}
{
if (node)
return node;
return NULL;
}
{
return key;
}
bool
{
}
bool
{
}
bool
{
}
void
{
}
void
{
//g_log(NULL, G_LOG_LEVEL_DEBUG, "Removing node %p", &node);
}
bool
{
}
{
}
{
}
{
if (status[IN_CHATROOM]) {
// This is not strictly required for chatrooms: chatrooms will
// function just fine with the user-to-user ID scheme. However,
// the user-to-user scheme can lead to loss of anonymity
// in anonymous chat rooms, since it contains the real JID
// of a user.
/*
ret = String::compose("%1;%2@%3/%4",
_counter++,
_sm->getClient().getUsername(),
_sm->getClient().getHost(),
sd->chat_handle);
*/
//We need to work on this since Pedro allows multiple chatrooms
_counter++,
} else {
_counter++,
}
return ret;
}
void
{
int const sz = sizeof(specialnodekeys) / sizeof(char const*);
for(int i = 0; i < sz; i++)
}
// rather nasty and crufty debugging function
void
{
keyNodeTable.size());
for (unsigned int i=0 ; i<keyNodeTable.size() ; i++)
{
char *name = "none";
char *content = "none";
if (node)
{
}
}
while(k != _specialnodes.end()) {
k++;
}
}
void XMLNodeTracker::reset()
{
_clear();
// Find and insert special nodes
// root node
// namedview node
if (!namedview) {
g_warning("namedview node does not exist; it will be created during synchronization");
} else {
}
}
void
{
// Remove all keys in both trackers, and delete each key.
}
} // namespace Whiteboard
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :