Skip to content

Commit

Permalink
- work on dbus interface
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Aug 16, 2012
1 parent d215428 commit 20bf287
Show file tree
Hide file tree
Showing 23 changed files with 366 additions and 824 deletions.
86 changes: 0 additions & 86 deletions client/commands.cc
Expand Up @@ -301,92 +301,6 @@ command_get_xfiles(DBus::Connection& conn, const string& config_name, unsigned i
}


vector<string>
command_get_xdiff(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const string& name, const string& options)
{
DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetDiff");

DBus::Hoho hoho(call);
hoho << config_name << number1 << number2 << name << options;

DBus::Message reply = conn.send_with_reply_and_block(call);

vector<string> files;

DBus::Hihi hihi(reply);
hihi >> files;

return files;
}


void
command_set_xundo(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const list<XUndo>& undos)
{
DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "SetUndo");

DBus::Hoho hoho(call);
hoho << config_name << number1 << number2 << undos;

conn.send_with_reply_and_block(call);
}


void
command_set_xundo_all(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, bool undo)
{
DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "SetUndoAll");

DBus::Hoho hoho(call);
hoho << config_name << number1 << number2 << undo;

conn.send_with_reply_and_block(call);
}


vector<XUndoStep>
command_get_xundo_steps(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2)
{
DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetUndoSteps");

DBus::Hoho hoho(call);
hoho << config_name << number1 << number2;

DBus::Message reply = conn.send_with_reply_and_block(call);

vector<XUndoStep> undo_steps;

DBus::Hihi hihi(reply);
hihi >> undo_steps;

return undo_steps;
}


bool
command_do_xundo_step(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const XUndoStep& undo_step)
{
DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DoUndoStep");

DBus::Hoho hoho(call);
hoho << config_name << number1 << number2 << undo_step;

DBus::Message reply = conn.send_with_reply_and_block(call);

bool ret;

DBus::Hihi hihi(reply);
hihi >> ret;

return ret;
}


vector<string>
command_xdebug(DBus::Connection& conn)
{
Expand Down
20 changes: 0 additions & 20 deletions client/commands.h
Expand Up @@ -95,25 +95,5 @@ list<XFile>
command_get_xfiles(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2);

vector<string>
command_get_xdiff(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const string& name, const string& options);

void
command_set_xundo(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const list<XUndo>& undos);

void
command_set_xundo_all(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, bool undo);

vector<XUndoStep>
command_get_xundo_steps(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2);

bool
command_do_xundo_step(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2, const XUndoStep& undo_step);

vector<string>
command_xdebug(DBus::Connection& conn);

0 comments on commit 20bf287

Please sign in to comment.