~ubuntu-branches/ubuntu/maverick/codelite/maverick

« back to all changes in this revision

Viewing changes to LiteEditor/cl_editor.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-02-10 02:27:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210022755-m5692nfc1t5uf1w9
Tags: 1.0.2759+dfsg-0ubuntu1
* New upstream release (LP: #327216).
* debian/patches/series, debian/patches/00_fix-ia64-build.patch:
  + Dropped, applied upstream already.
* debian/patches/02_fix-desktop.patch,
  debian/patches/03_fix-sh.patch:
  + Refreshed to patch cleanly.
* debian/rules:
  + Make get-orig-source honour UPSTREAM_VERSION if set.
* debian/ctags-le.1,
  debian/codelite_indexer.1,
  debian/codelite.manpages:
  + Dropped ctags-le manpage, since ctags-le was replaced by
    codelite_indexer.
  + Added codelite_indexer manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
class wxFindReplaceDialog;
45
45
class CCBox;
46
46
 
47
 
        // NB The following are sci markers, which are zero based. So smt_bookmark is actually the eighth of them (important when masking it!)
48
 
        // If you add another type here, watch out for smt_LAST_BP_TYPE; and you need also to add to the enum 'marker_mask_type' below
49
 
        // The higher the value, the nearer the top of the pecking order displaywise. So keep the most important breakpoint at the top i.e. smt_breakpoint,
50
 
        // but have smt_breakpointsmt_indicator above it, so you can see the indicator when there's a breakpt too
51
 
        enum sci_marker_types
52
 
                { smt_bookmark=7, smt_FIRST_BP_TYPE=8, smt_cond_bp_disabled = smt_FIRST_BP_TYPE, smt_bp_cmdlist_disabled, smt_bp_disabled,
53
 
                        smt_bp_ignored, smt_cond_bp, smt_bp_cmdlist, smt_breakpoint, smt_LAST_BP_TYPE = smt_breakpoint, smt_indicator, smt_warning, smt_error
54
 
                };
55
 
 
56
 
        // These are bitmap masks of the various margin markers.
57
 
        // So 256 == 0x100 == 100000000, 2^9, and masks the ninth marker, smt_cond_bp_disabled==8 (as the markers are zero-based)
58
 
        // 0x7f00 is binary 111111100000000 and masks all the 7 current breakpoint types. If you add others, change it
59
 
        enum marker_mask_type
60
 
                { mmt_folds=wxSCI_MASK_FOLDERS, mmt_bookmarks=128, mmt_FIRST_BP_TYPE=0x100, mmt_cond_bp_disabled=mmt_FIRST_BP_TYPE, mmt_bp_cmdlist_disabled=0x200, mmt_bp_disabled=0x400,
61
 
                        mmt_bp_ignored=0x800,  mmt_cond_bp=0x1000,mmt_bp_cmdlist=0x2000, mmt_breakpoint=0x4000, mmt_LAST_BP_TYPE=mmt_breakpoint,  mmt_all_breakpoints=0x7f00,   mmt_indicator=0x8000,
62
 
                        mmt_compiler=0x30000 /* masks compiler errors/warnings */
63
 
                };
64
 
 
65
 
 /**
66
 
 * @class BPtoMarker
67
 
 * Holds which marker and mask are associated with each breakpoint type
68
 
 */
 
47
// NB The following are sci markers, which are zero based. So smt_bookmark is actually the eighth of them (important when masking it!)
 
48
// If you add another type here, watch out for smt_LAST_BP_TYPE; and you need also to add to the enum 'marker_mask_type' below
 
49
// The higher the value, the nearer the top of the pecking order displaywise. So keep the most important breakpoint at the top i.e. smt_breakpoint,
 
50
// but have smt_breakpointsmt_indicator above it, so you can see the indicator when there's a breakpt too
 
51
enum sci_marker_types { smt_bookmark=7, smt_FIRST_BP_TYPE=8, smt_cond_bp_disabled = smt_FIRST_BP_TYPE, smt_bp_cmdlist_disabled, smt_bp_disabled,
 
52
                        smt_bp_ignored, smt_cond_bp, smt_bp_cmdlist, smt_breakpoint, smt_LAST_BP_TYPE = smt_breakpoint, smt_indicator, smt_warning, smt_error
 
53
                      };
 
54
 
 
55
// These are bitmap masks of the various margin markers.
 
56
// So 256 == 0x100 == 100000000, 2^9, and masks the ninth marker, smt_cond_bp_disabled==8 (as the markers are zero-based)
 
57
// 0x7f00 is binary 111111100000000 and masks all the 7 current breakpoint types. If you add others, change it
 
58
enum marker_mask_type { mmt_folds=wxSCI_MASK_FOLDERS, mmt_bookmarks=128, mmt_FIRST_BP_TYPE=0x100, mmt_cond_bp_disabled=mmt_FIRST_BP_TYPE, mmt_bp_cmdlist_disabled=0x200, mmt_bp_disabled=0x400,
 
59
                        mmt_bp_ignored=0x800,  mmt_cond_bp=0x1000,mmt_bp_cmdlist=0x2000, mmt_breakpoint=0x4000, mmt_LAST_BP_TYPE=mmt_breakpoint,  mmt_all_breakpoints=0x7f00,   mmt_indicator=0x8000,
 
60
                        mmt_compiler=0x30000 /* masks compiler errors/warnings */
 
61
                      };
 
62
 
 
63
enum calltip_type { ct_function_hover, ct_debugger, ct_function_proto, ct_breakpoint, ct_compiler_msg, ct_none};
 
64
 
 
65
/**
 
66
* @class BPtoMarker
 
67
* Holds which marker and mask are associated with each breakpoint type
 
68
*/
69
69
typedef struct _BPtoMarker {
70
70
        enum BP_type bp_type;   // An enum of possible break/watchpoint types. In debugger.h
71
71
        sci_marker_types marker;
78
78
 * @class LEditorState
79
79
 * a container for the editor state (breakpoints, bookmarks and current position)
80
80
 */
81
 
struct LEditorState
82
 
{
 
81
struct LEditorState {
83
82
        std::vector<int> breakpoints;
84
83
        std::vector<int> markers;
85
84
        int caretPosition;
126
125
        bool m_isVisible;
127
126
        int m_hyperLinkIndicatroStart;
128
127
        int m_hyperLinkIndicatroEnd;
129
 
    int m_hyperLinkType;
 
128
        int m_hyperLinkType;
130
129
        bool m_hightlightMatchedBraces;
131
130
        bool m_autoAddMatchedBrace;
132
131
        std::map<int, std::vector<BreakpointInfo> > m_breakpointsInfo;
133
132
        bool m_autoAdjustHScrollbarWidth;
 
133
        calltip_type m_calltipType;
134
134
 
135
135
public:
136
136
        static FindReplaceData &GetFindReplaceData() {
277
277
 
278
278
        bool FindAndSelect();
279
279
        bool FindAndSelect(const FindReplaceData &data);
280
 
    bool FindAndSelect(const wxString &pattern, const wxString &name);
 
280
        bool FindAndSelect(const wxString &pattern, const wxString &name);
281
281
 
282
282
        bool Replace();
283
283
        bool Replace(const FindReplaceData &data);
364
364
        virtual void HighlightLine(int lineno);
365
365
        virtual void UnHighlightAll();
366
366
 
367
 
    // compiler warnings and errors
368
 
    void SetWarningMarker(int lineno);
369
 
    void SetErrorMarker(int lineno);
370
 
    void DelAllCompilerMarkers();
 
367
        // compiler warnings and errors
 
368
        void SetWarningMarker(int lineno);
 
369
        void SetErrorMarker(int lineno);
 
370
        void DelAllCompilerMarkers();
 
371
        void DoShowCalltip(int pos, const wxString &tip, calltip_type type, int hltPos = wxNOT_FOUND, int hltLen = wxNOT_FOUND);
 
372
        void DoCancelCalltip();
 
373
        int  DoGetOpenBracePos();
 
374
 
 
375
        calltip_type GetCalltipType() const {return m_calltipType;}
371
376
 
372
377
        //----------------------------------
373
378
        //File modifications
374
379
        //----------------------------------
375
380
 
376
 
    /**
377
 
     * return the last modification time (on disk) of editor's underlying file
378
 
     */
379
 
    time_t GetFileLastModifiedTime() const;
 
381
        /**
 
382
         * return the last modification time (on disk) of editor's underlying file
 
383
         */
 
384
        time_t GetFileLastModifiedTime() const;
380
385
 
381
386
        /**
382
387
         * return/set the last modification time that was made by the editor
497
502
         * @param pos from position
498
503
         * @param onlyWordCharacters
499
504
         */
500
 
    virtual int WordEndPos (int pos, bool onlyWordCharacters);
 
505
        virtual int WordEndPos (int pos, bool onlyWordCharacters);
501
506
 
502
507
        /**
503
508
         * Insert text to the editor and keeping the indentation
539
544
        void DoMarkHyperlink(wxMouseEvent &event, bool isMiddle);
540
545
        void DoQuickJump(wxMouseEvent &event, bool isMiddle);
541
546
 
542
 
 
543
547
        DECLARE_EVENT_TABLE()
544
 
    void OnSavePoint(wxScintillaEvent &event);
 
548
        void OnSavePoint(wxScintillaEvent &event);
545
549
        void OnCharAdded(wxScintillaEvent& event);
546
550
        void OnMarginClick(wxScintillaEvent& event);
547
551
        void OnChange(wxScintillaEvent& event);
557
561
        void OnMiddleUp(wxMouseEvent &event);
558
562
        void OnLeftUp(wxMouseEvent &event);
559
563
        void OnLeaveWindow(wxMouseEvent &event);
560
 
    void OnFocusLost(wxFocusEvent &event);
 
564
        void OnFocusLost(wxFocusEvent &event);
561
565
        void OnLeftDClick(wxScintillaEvent &event);
562
566
        void OnPopupMenuUpdateUI(wxUpdateUIEvent &event);
563
567
        void OnDbgQuickWatch(wxCommandEvent &event);