This file is indexed.

/usr/include/wx-3.0/wx/generic/custombgwin.h is in wx3.0-headers 3.0.0-2.

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
///////////////////////////////////////////////////////////////////////////////
// Name:        wx/generic/custombgwin.h
// Purpose:     Generic implementation of wxCustomBackgroundWindow.
// Author:      Vadim Zeitlin
// Created:     2011-10-10
// Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence:     wxWindows licence
///////////////////////////////////////////////////////////////////////////////

#ifndef _WX_GENERIC_CUSTOMBGWIN_H_
#define _WX_GENERIC_CUSTOMBGWIN_H_

#include "wx/bitmap.h"

// A helper to avoid template bloat: this class contains all type-independent
// code of wxCustomBackgroundWindow<> below.
class wxCustomBackgroundWindowGenericBase : public wxCustomBackgroundWindowBase
{
public:
    wxCustomBackgroundWindowGenericBase() { }

protected:
    void DoEraseBackground(wxEraseEvent& event, wxWindow* win)
    {
        wxDC& dc = *event.GetDC();

        const wxSize clientSize = win->GetClientSize();
        const wxSize bitmapSize = m_bitmapBg.GetSize();

        for ( int x = 0; x < clientSize.x; x += bitmapSize.x )
        {
            for ( int y = 0; y < clientSize.y; y += bitmapSize.y )
            {
                dc.DrawBitmap(m_bitmapBg, x, y);
            }
        }
    }


    // The bitmap used for painting the background if valid.
    wxBitmap m_bitmapBg;


    wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowGenericBase);
};

// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow
// ----------------------------------------------------------------------------

template <class W>
class wxCustomBackgroundWindow : public W,
                                 public wxCustomBackgroundWindowGenericBase
{
public:
    typedef W BaseWindowClass;

    wxCustomBackgroundWindow() { }

protected:
    virtual void DoSetBackgroundBitmap(const wxBitmap& bmp)
    {
        m_bitmapBg = bmp;

        if ( m_bitmapBg.IsOk() )
        {
            BaseWindowClass::Connect
            (
                wxEVT_ERASE_BACKGROUND,
                wxEraseEventHandler(wxCustomBackgroundWindow::OnEraseBackground)
            );
        }
        else
        {
            BaseWindowClass::Disconnect
            (
                wxEVT_ERASE_BACKGROUND,
                wxEraseEventHandler(wxCustomBackgroundWindow::OnEraseBackground)
            );
        }
    }

private:
    // Event handler for erasing the background which is only used when we have
    // a valid background bitmap.
    void OnEraseBackground(wxEraseEvent& event)
    {
        DoEraseBackground(event, this);
    }


    wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCustomBackgroundWindow, W);
};

#endif // _WX_GENERIC_CUSTOMBGWIN_H_