~unity-2d-team/unity-2d/shortcut-hint-overlay

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/gobjectcallback.h

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-19 15:28:41 UTC
  • mfrom: (771.40.182 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120319152841-2hfflo67muks7gca
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
// Handy macros to declare GObject callbacks. The 'n' in CALLBACKn refers to
 
18
// the number of dummy arguments the callback returns
 
19
#define GOBJECT_CALLBACK0(callbackName, slot) \
 
20
static void \
 
21
callbackName(GObject* src, QObject* dst) \
 
22
{ \
 
23
    QMetaObject::invokeMethod(dst, slot); \
 
24
}
 
25
 
 
26
#define GOBJECT_CALLBACK1(callbackName, slot) \
 
27
static void \
 
28
callbackName(GObject* src, void* dummy1, QObject* dst) \
 
29
{ \
 
30
    QMetaObject::invokeMethod(dst, slot); \
 
31
}
 
32
 
 
33
#define GOBJECT_CALLBACK2(callbackName, slot) \
 
34
static void \
 
35
callbackName(GObject* src, void* dummy1, void* dummy2, QObject* dst) \
 
36
{ \
 
37
    QMetaObject::invokeMethod(dst, slot); \
 
38
}