This file is indexed.

/usr/include/wxsmith/wxwidgets/wxsdrawingwindow.h is in libwxsmithlib-dev 16.01+dfsg-2.1.

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
/*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2006-2007  Bartlomiej Swiecki
*
* wxSmith 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 3 of the License, or
* (at your option) any later version.
*
* wxSmith 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 wxSmith. If not, see <http://www.gnu.org/licenses/>.
*
* $Revision: 8251 $
* $Id: wxsdrawingwindow.h 8251 2012-08-28 02:31:00Z ollydbg $
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/wxsdrawingwindow.h $
*/

#ifndef WXSDRAWINGWINDOW_H
#define WXSDRAWINGWINDOW_H

#include <wx/scrolwin.h>
#include <wx/timer.h>
#include <wx/event.h>

/** \brief Class allowing drawing over it's surface.
 *
 * This window is upgrade of standard wxScrolledWindow.
 * It allows painting over it's surface and over surface
 * of it's children. It also handles all mouse and keyboard
 * events.
 */
class wxsDrawingWindow: public wxScrolledWindow
{
    public:

        /** \brief Ctor */
        wxsDrawingWindow(wxWindow* Parent,wxWindowID id,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize,long style=wxHSCROLL|wxVSCROLL,const wxString& name=_T("wxsDrawingWindow"));

        /** \brief Dctor */
        virtual ~wxsDrawingWindow();

        /** \brief Function fetching bitmap from this window
         *
         * \note Regions which were not visible to the screen
         *       won't be valid in this bitmap.
         */
        const wxBitmap& GetBitmap() { return *m_Bitmap; }

        /** \brief Function notifying that window's content is going to change
         *
         * This function should be called just before changing content of
         * this window (to be more exact: it's child items). It makes
         * wxsDrawingWindow to prepare for change.
         *
         * \warning Remember to call AfterContentChanged after change
         */
        void BeforeContentChanged();

        /** \brief Function notifying that window's content has been changed
         *
         * This function should be called right after change of window content
         * (to be more exact: after changing window's children). It makes
         * wxsDrawingWindow to fetch children preview and repaint itself
         *
         * \warning Call to this function must be preceded with call to
         *          BeforeContentChange function.
         *
         */
        void AfterContentChanged();

        /** \brief Function repainting window
         *
         * Repainting window content may be done in two ways.
         * First is by raising paint event (so by calling wxWindow::Refresh),
         * in current implementation this require refetching bitmap from
         * window area (just like calling AfterContentChanged). Second way is by
         * calling this function. It does not raise any events if not needed
         * and draws using wxClientDC object. It may be used when extra
         * graphics has been changed only.
         */
        void FastRepaint();

        /** \brief Function (un)blocking background fetching */
        inline void BlockFetch(bool Block=true) { m_IsBlockFetch = Block; }

    protected:

        /** \brief Function used for drawing additional data
         *
         * You should override this function and paint additional
         * graphics inside this.
         */
        virtual void PaintExtra(wxDC* DC) = 0;

        /** \brief Function called right after taking screen shoot and just before hiding children */
        virtual void ScreenShootTaken() {}

    private:

        void OnPaint(wxPaintEvent& event);
        void OnEraseBack(wxEraseEvent& event);
        void OnFetchSequence(wxCommandEvent& event);
        void OnRefreshTimer(wxTimerEvent& event);

        virtual bool Destroy();

        /** \brief Function stating sequence fetching editor's background
         *
         * This sequence may be splitted into few smaller events so it's not
         * granted that after finishing StartFetchingSequence, the content of
         * Bitmap is valid.
         */
        void StartFetchingSequence();

        /** \brief Starting second step of fetch sequence
         *
         * In this step, the screen content is grabbed from the screen
         * and put into internal bitmap.
         */
        void FetchSequencePhase2();

        /** \brief Function copying screen data into bitmap */
        void FetchScreen();

        /** \brief Hiding all children except Panel to avoid some random repaints */
        void HideChildren();

        /** \brief Showing all children except Panel just before fetching preview */
        void ShowChildren();

        /** \brief Checking if there's need to refetch background
         *
         * Screen is not fetched when size of drawing window is
         * the same, sliders were not shifted and there was no
         * call to ContentChanged()
         */
        bool NoNeedToRefetch();

        wxBitmap* m_Bitmap;             ///< \brief Bitmap with fetched window content (may be valid partially)
        bool m_IsBlockFetch;            ///< \brief Flag used to block fetching background (may be set by user)
        bool m_DuringFetch;             ///< \brief Set to true if we're during fetching sequence
        int m_DuringChangeCnt;          ///< \brief When >0, window's content is changed somewhere
        int m_LastSizeX, m_LastSizeY;   ///< \brief client size during last fetch
        int m_LastVirtX, m_LastVirtY;   ///< \brief virtual area shift relative to client area during last fetch
        bool m_WasContentChanged;       ///< \brief If there was a call to WasContentChanged from last fetch
        bool m_IsDestroyed;             ///< \brief Set to true after calling Destroy(), used to track destroyed but not yet deleted windows

        wxTimer m_RefreshTimer;         ///< \brief Timer used while fetching screen content

        DECLARE_EVENT_TABLE()
};

#endif