This file is indexed.

/usr/include/bt/Application.hh is in libbt-dev 0.70.1-34.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
// Application.hh for Blackbox - an X11 Window manager
// Copyright (c) 2001 - 2005 Sean 'Shaleh' Perry <shaleh at debian.org>
// Copyright (c) 1997 - 2000, 2002 - 2005
//         Bradley T Hughes <bhughes at trolltech.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#ifndef __Application_hh
#define __Application_hh

#include "Timer.hh"
#include "Util.hh"

#include <map>

namespace bt {

  // forward declarations
  class Display;
  class EventHandler;
  class Menu;

  /*
    The application object.  It provides event delivery, timer
    activation and signal handling functionality to fit most
    application needs.
  */
  class Application : public TimerQueueManager, public NoCopy {
  protected:
    enum RunState { STARTUP, RUNNING, SHUTDOWN, SIGNALLED };

  private:
    struct {
      bool extensions;
      int event_basep, error_basep;
    } shape;

    Display *_display;
    std::string _app_name;

    RunState run_state;
    Time xserver_time;

    typedef std::map<Window,EventHandler*> EventHandlerMap;
    EventHandlerMap eventhandlers;

    timeval currentTime;
    TimerQueue timerList;
    void adjustTimers(const timeval &offset);

    typedef std::deque<Menu*> MenuStack;
    MenuStack menus;
    bool menu_grab;
    void openMenu(Menu *menu);
    void closeMenu(Menu *menu);
    friend class Menu; // give Menu access to the above 2 functions

    unsigned int MaskList[8];
    size_t MaskListLength;

    // the masks of the modifiers which are ignored in button events.
    unsigned int NumLockMask, ScrollLockMask;

  protected:
    inline RunState runState(void) const
    { return run_state; }
    inline void setRunState(RunState new_state)
    { run_state = new_state; }

    /*
      Called from run() just before the event loop starts.
     */
    virtual void startup(void);
    /*
      Called from shutdown() after the event loop stops.
    */
    virtual void shutdown(void);

    /*
      Processes the X11 event {event} by delivering the event to the
      appropriate EventHandler.

      Reimplement this function if you need to filter/intercept events
      before normal processing.
    */
    virtual void process_event(XEvent *event);

    /*
      Processes the specified signal.  Returns true if the signal was
      handled; otherwise it returns false.

      Reimplement this function if you need to handle signals.
    */
    virtual bool process_signal(int signal);

  public:
    Application(const std::string &app_name, const char *dpy_name = 0,
                bool multi_head = false);
    virtual ~Application(void);

    inline bool hasShapeExtensions(void) const
    { return shape.extensions; }

    inline bool startingUp(void) const
    { return run_state == STARTUP; }
    inline bool running(void) const
    { return run_state == RUNNING; }
    inline bool shuttingDown(void) const
    { return run_state == SHUTDOWN; }

    ::Display *XDisplay(void) const;
    inline const Display& display(void) const
    { return *_display; }
    inline Time XTime() const
    { return xserver_time; }

    inline const std::string &applicationName(void) const
    { return _app_name; }

    void grabButton(unsigned int button, unsigned int modifiers,
                    Window grab_window, bool owner_events,
                    unsigned int event_mask, int pointer_mode,
                    int keyboard_mode, Window confine_to, Cursor cursor,
                    bool allow_scroll_lock) const;
    void ungrabButton(unsigned int button, unsigned int modifiers,
                      Window grab_window) const;

    void run(void);
    inline void quit(void)
    { setRunState( SHUTDOWN ); }

    inline unsigned int scrollLockMask(void) const
    { return ScrollLockMask; }
    inline unsigned int numLockMask(void) const
    { return NumLockMask; }

    // from TimerQueueManager interface
    virtual void addTimer(Timer *timer);
    virtual void removeTimer(Timer *timer);

    /*
      Inserts the EventHandler {handler} for Window {window}.  All
      events generated for {window} will be sent through {handler}.
    */
    void insertEventHandler(Window window, EventHandler *handler);
    /*
      Removes all EventHandlers for Window {window}.
    */
    void removeEventHandler(Window window);
    /*
      Returns the event handler registered for Window {window}.  If no
      handler has been registered, this function returns zero.
    */
    EventHandler *findEventHandler(Window window);
  };

} // namespace bt

#endif // __Application_hh