~ubuntu-branches/ubuntu/saucy/filezilla/saucy-proposed

« back to all changes in this revision

Viewing changes to src/dbus/wxdbusconnection.h

  • Committer: Package Import Robot
  • Author(s): Adrien Cunin
  • Date: 2012-12-07 17:17:17 UTC
  • mfrom: (1.1.31)
  • Revision ID: package-import@ubuntu.com-20121207171717-nt6as62u4pa1uv11
Tags: 3.6.0.2-1ubuntu1
* Merge from Debian experimental. Remaining Ubuntu change:
   - Added debian/patches/11_use-decimal-si-by-default.patch in order to
     comply with UnitsPolicy

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
****************************************************************************/
24
24
 
25
 
#ifndef WX_DBUSCONNECTION 
 
25
#ifndef WX_DBUSCONNECTION
26
26
#define WX_DBUSCONNECTION
27
27
 
28
28
#include "wx/wx.h"
48
48
class wxDBusConnectionEvent : public wxNotifyEvent
49
49
{
50
50
public:
51
 
    wxDBusConnectionEvent(wxEventType commandType = wxEVT_NULL,
52
 
      int id = 0, DBusMessage * message = NULL): wxNotifyEvent(commandType, id)
 
51
        wxDBusConnectionEvent(wxEventType commandType = wxEVT_NULL,
 
52
          int id = 0, DBusMessage * message = NULL): wxNotifyEvent(commandType, id)
53
53
                {m_message = message; };
54
54
 
55
55
        wxDBusConnectionEvent(const wxDBusConnectionEvent &event): wxNotifyEvent(event)
56
56
                {m_message = event.m_message;};
57
57
 
58
 
    virtual wxEvent *Clone() const
 
58
        virtual wxEvent *Clone() const
59
59
                {return new wxDBusConnectionEvent(*this);};
60
60
 
61
61
        DBusMessage * GetMessage()
67
67
};
68
68
 
69
69
typedef void (wxEvtHandler::*wxDBusConnectionEventFunction)
70
 
                                        (wxDBusConnectionEvent&);
 
70
                                                                                (wxDBusConnectionEvent&);
71
71
/*
72
 
  There are three events declared for the wxDBusConnection object. 
 
72
  There are three events declared for the wxDBusConnection object.
73
73
  wxEVT_DBUS_SIGNAL informs the application about any signal that appearrs on the bus.
74
 
  wxEVT_DBUS_NOTIFICATION informs the application about any messages that it 
 
74
  wxEVT_DBUS_NOTIFICATION informs the application about any messages that it
75
75
  is has registered to recieve by calling RegisterObjectPath.
76
76
  These messages may be either signals or method calls.
77
77
  Note that all the messages that raise wxEVT_DBUS_NOTIFICATION also
78
78
  raise wxEVT_DBUS_SIGNAL.
79
79
  Your app may be uninterested in processing wxEVT_DBUS_SIGNAL, but it is
80
 
  a good practice to process it anyway. Each time the event is called a copy of a D-Bus 
 
80
  a good practice to process it anyway. Each time the event is called a copy of a D-Bus
81
81
  message is allocated for it.
82
82
  This copy should be freed in the event's handler. There are two ways to do it.
83
83
  the two following handlers do nothing else but release a copy of D-BUS message:
92
92
 
93
93
void MainFrame::OnSignal(wxDBusConnectionEvent& event)
94
94
{
95
 
        dbus_message_unref(event.GetMessage()); // here we call a low level D-Bus function to release the message. 
 
95
        dbus_message_unref(event.GetMessage()); // here we call a low level D-Bus function to release the message.
96
96
}
97
97
 
98
98
  The wxEVT_DBUS_ASYNC_RESPONSE event is raised when a response to an asynchronous