~ubuntu-branches/ubuntu/trusty/presage/trusty-proposed

« back to all changes in this revision

Viewing changes to apps/gtk/gprompter/scintilla/src/CallTip.h

  • Committer: Bazaar Package Importer
  • Author(s): Matteo Vescovi
  • Date: 2011-08-06 09:26:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110806092615-0wvhajaht9974ncx
Tags: upstream-0.8.6
ImportĀ upstreamĀ versionĀ 0.8.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Scintilla source code edit control
 
2
/** @file CallTip.h
 
3
 ** Interface to the call tip control.
 
4
 **/
 
5
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
 
6
// The License.txt file describes the conditions under which this software may be distributed.
 
7
 
 
8
#ifndef CALLTIP_H
 
9
#define CALLTIP_H
 
10
 
 
11
#ifdef SCI_NAMESPACE
 
12
namespace Scintilla {
 
13
#endif
 
14
 
 
15
/**
 
16
 */
 
17
class CallTip {
 
18
        int startHighlight;    // character offset to start and...
 
19
        int endHighlight;      // ...end of highlighted text
 
20
        char *val;
 
21
        Font font;
 
22
        PRectangle rectUp;      // rectangle of last up angle in the tip
 
23
        PRectangle rectDown;    // rectangle of last down arrow in the tip
 
24
        int lineHeight;         // vertical line spacing
 
25
        int offsetMain;         // The alignment point of the call tip
 
26
        int tabSize;            // Tab size in pixels, <=0 no TAB expand
 
27
        bool useStyleCallTip;   // if true, STYLE_CALLTIP should be used
 
28
 
 
29
        // Private so CallTip objects can not be copied
 
30
        CallTip(const CallTip &);
 
31
        CallTip &operator=(const CallTip &);
 
32
        void DrawChunk(Surface *surface, int &x, const char *s,
 
33
                int posStart, int posEnd, int ytext, PRectangle rcClient,
 
34
                bool highlight, bool draw);
 
35
        int PaintContents(Surface *surfaceWindow, bool draw);
 
36
        bool IsTabCharacter(char c) const;
 
37
        int NextTabPos(int x);
 
38
 
 
39
public:
 
40
        Window wCallTip;
 
41
        Window wDraw;
 
42
        bool inCallTipMode;
 
43
        int posStartCallTip;
 
44
        ColourPair colourBG;
 
45
        ColourPair colourUnSel;
 
46
        ColourPair colourSel;
 
47
        ColourPair colourShade;
 
48
        ColourPair colourLight;
 
49
        int codePage;
 
50
        int clickPlace;
 
51
 
 
52
        CallTip();
 
53
        ~CallTip();
 
54
 
 
55
        /// Claim or accept palette entries for the colours required to paint a calltip.
 
56
        void RefreshColourPalette(Palette &pal, bool want);
 
57
 
 
58
        void PaintCT(Surface *surfaceWindow);
 
59
 
 
60
        void MouseClick(Point pt);
 
61
 
 
62
        /// Setup the calltip and return a rectangle of the area required.
 
63
        PRectangle CallTipStart(int pos, Point pt, const char *defn,
 
64
                const char *faceName, int size, int codePage_,
 
65
                int characterSet, Window &wParent);
 
66
 
 
67
        void CallTipCancel();
 
68
 
 
69
        /// Set a range of characters to be displayed in a highlight style.
 
70
        /// Commonly used to highlight the current parameter.
 
71
        void SetHighlight(int start, int end);
 
72
 
 
73
        /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand.
 
74
        void SetTabSize(int tabSz);
 
75
 
 
76
        /// Used to determine which STYLE_xxxx to use for call tip information
 
77
        bool UseStyleCallTip() const { return useStyleCallTip;}
 
78
 
 
79
        // Modify foreground and background colours
 
80
        void SetForeBack(const ColourPair &fore, const ColourPair &back);
 
81
};
 
82
 
 
83
#ifdef SCI_NAMESPACE
 
84
}
 
85
#endif
 
86
 
 
87
#endif