This file is indexed.

/usr/include/wx-3.0/wx/generic/headerctrlg.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
 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
177
178
179
180
///////////////////////////////////////////////////////////////////////////////
// Name:        wx/generic/headerctrlg.h
// Purpose:     Generic wxHeaderCtrl implementation
// Author:      Vadim Zeitlin
// Created:     2008-12-01
// Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence:     wxWindows licence
///////////////////////////////////////////////////////////////////////////////

#ifndef _WX_GENERIC_HEADERCTRLG_H_
#define _WX_GENERIC_HEADERCTRLG_H_

#include "wx/event.h"
#include "wx/vector.h"
#include "wx/overlay.h"

// ----------------------------------------------------------------------------
// wxHeaderCtrl
// ----------------------------------------------------------------------------

class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
{
public:
    wxHeaderCtrl()
    {
        Init();
    }

    wxHeaderCtrl(wxWindow *parent,
                 wxWindowID id = wxID_ANY,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxHD_DEFAULT_STYLE,
                 const wxString& name = wxHeaderCtrlNameStr)
    {
        Init();

        Create(parent, id, pos, size, style, name);
    }

    bool Create(wxWindow *parent,
                wxWindowID id = wxID_ANY,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                long style = wxHD_DEFAULT_STYLE,
                const wxString& name = wxHeaderCtrlNameStr);

    virtual ~wxHeaderCtrl();

protected:
    virtual wxSize DoGetBestSize() const;

    
private:
    // implement base class pure virtuals
    virtual void DoSetCount(unsigned int count);
    virtual unsigned int DoGetCount() const;
    virtual void DoUpdate(unsigned int idx);

    virtual void DoScrollHorz(int dx);

    virtual void DoSetColumnsOrder(const wxArrayInt& order);
    virtual wxArrayInt DoGetColumnsOrder() const;

    // common part of all ctors
    void Init();

    // event handlers
    void OnPaint(wxPaintEvent& event);
    void OnMouse(wxMouseEvent& event);
    void OnKeyDown(wxKeyEvent& event);
    void OnCaptureLost(wxMouseCaptureLostEvent& event);

    // move the column with given idx at given position (this doesn't generate
    // any events but does refresh the display)
    void DoMoveCol(unsigned int idx, unsigned int pos);

    // return the horizontal start position of the given column in physical
    // coordinates
    int GetColStart(unsigned int idx) const;

    // and the end position
    int GetColEnd(unsigned int idx) const;

    // refresh the given column [only]; idx must be valid
    void RefreshCol(unsigned int idx);

    // refresh the given column if idx is valid
    void RefreshColIfNotNone(unsigned int idx);

    // refresh all the controls starting from (and including) the given one
    void RefreshColsAfter(unsigned int idx);

    // return the column at the given position or -1 if it is beyond the
    // rightmost column and put true into onSeparator output parameter if the
    // position is near the divider at the right end of this column (notice
    // that this means that we return column 0 even if the position is over
    // column 1 but close enough to the divider separating it from column 0)
    unsigned int FindColumnAtPoint(int x, bool *onSeparator = NULL) const;

    // return true if a drag resizing operation is currently in progress
    bool IsResizing() const;

    // return true if a drag reordering operation is currently in progress
    bool IsReordering() const;

    // return true if any drag operation is currently in progress
    bool IsDragging() const { return IsResizing() || IsReordering(); }

    // end any drag operation currently in progress (resizing or reordering)
    void EndDragging();

    // cancel the drag operation currently in progress and generate an event
    // about it
    void CancelDragging();

    // start (if m_colBeingResized is -1) or continue resizing the column
    //
    // this generates wxEVT_HEADER_BEGIN_RESIZE/RESIZING events and can
    // cancel the operation if the user handler decides so
    void StartOrContinueResizing(unsigned int col, int xPhysical);

    // end the resizing operation currently in progress and generate an event
    // about it with its cancelled flag set if xPhysical is -1
    void EndResizing(int xPhysical);

    // same functions as above but for column moving/reordering instead of
    // resizing
    void StartReordering(unsigned int col, int xPhysical);

    // returns true if we did drag the column somewhere else or false if we
    // didn't really move it -- in this case we consider that no reordering
    // took place and that a normal column click event should be generated
    bool EndReordering(int xPhysical);

    // constrain the given position to be larger than the start position of the
    // given column plus its minimal width and return the effective width
    int ConstrainByMinWidth(unsigned int col, int& xPhysical);

    // update the information displayed while a column is being moved around
    void UpdateReorderingMarker(int xPhysical);

    // clear any overlaid markers
    void ClearMarkers();


    // number of columns in the control currently
    unsigned int m_numColumns;

    // index of the column under mouse or -1 if none
    unsigned int m_hover;

    // the column being resized or -1 if there is no resizing operation in
    // progress
    unsigned int m_colBeingResized;

    // the column being moved or -1 if there is no reordering operation in
    // progress
    unsigned int m_colBeingReordered;

    // the distance from the start of m_colBeingReordered and the mouse
    // position when the user started to drag it
    int m_dragOffset;

    // the horizontal scroll offset
    int m_scrollOffset;

    // the overlay display used during the dragging operations
    wxOverlay m_overlay;

    // the indices of the column appearing at the given position on the display
    // (its size is always m_numColumns)
    wxArrayInt m_colIndices;


    DECLARE_EVENT_TABLE()
    wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
};

#endif // _WX_GENERIC_HEADERCTRLG_H_