summaryrefslogtreecommitdiff
path: root/src/gtk/post_event.h
blob: c2b666cb1d2cf4a6999b937b6bb0bb10817a68ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/** \file post_event.h */     // -*-c++-*-

// Copyright (C) 2010 Daniel Burrows
// Copyright 2008-2009 Obey Arthur Liu
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING.  If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.

#ifndef POST_EVENT_H
#define POST_EVENT_H

#include <generic/util/safe_slot.h>

namespace gui
{
  namespace globals
  {
    // This code is not in globals.{cc,h] because it's more involved
    // than the other stuff in that file.

    /** \brief Dispatch the given safe thunk to the main loop.
     *
     *  Global because there is only one main loop and IT DOES NOT
     *  SHARE POWER^W^W^W^W^Wit has only one event queue.
     */
    void post_event(const safe_slot0<void> &thunk);

    /** \brief Post an event to the main loop's event queue,
     *  thread-safely.
     *
     *  Global because there is only one main loop and it has only one
     *  event queue.
     */
    void post_thunk(const sigc::slot<void> &thunk);

    /** \brief Initialize support for post_thunk() and
     *  post_event().
     */
    void init_post_event();
  }
}

#endif // POST_EVENT_H