5
#include "Nux/BaseWindow.h"
6
#include "NuxGraphics/OpenGLEngine.h"
7
#include "NuxGraphics/GfxEventsX11.h"
8
#include "NuxGraphics/GfxSetupX11.h"
9
#include "Nux/TextureArea.h"
10
#include "NuxImage/CairoGraphics.h"
12
#include <pango/pango.h>
13
#include <pango/pangocairo.h>
15
#if defined(NUX_OS_LINUX)
19
#define ANCHOR_WIDTH 10.0f
20
#define ANCHOR_HEIGHT 18.0f
21
#define HIGH_LIGHT_Y -30.0f
22
#define HIGH_LIGHT_MIN_WIDTH 200.0f
24
#define BLUR_INTENSITY 8
25
#define LINE_WIDTH 1.0f
26
#define PADDING_SIZE 1
29
#define FONT_FACE "Ubuntu 13"
33
class Tooltip : public BaseWindow
35
NUX_DECLARE_OBJECT_TYPE (Tooltip, BaseWindow);
41
long ProcessEvent (IEvent& iEvent,
43
long processEventInfo);
45
void Draw (GraphicsContext& gfxContext,
48
void DrawContent (GraphicsContext& gfxContext,
51
void SetText (NString text);
54
void PreLayoutManagement ();
56
long PostLayoutManagement (long layoutResult);
58
void PositionChildLayout (float offsetX,
61
void LayoutWindowElements ();
63
void NotifyConfigurationChange (int width,
66
nux::CairoGraphics* _cairo_graphics;
67
nux::BaseTexture* _texture2D;
70
nux::NString _labelText;
73
cairo_font_options_t* _fontOpts;
76
void UpdateTexture ();
78
void ComputeFullMaskPath (cairo_t* cr,
87
void DrawDraw (cairo_t* cr,
94
void DrawTintDotHighlight (cairo_t* cr,
103
void DrawOutlineShadow (cairo_t* cr,
107
gfloat anchor_height,
109
gfloat corner_radius,
116
void ComputeOutline (cairo_t* cr,
121
gfloat corner_radius,
124
void DrawMask (cairo_t* cr,
130
gfloat anchor_height,
140
void GetTextExtents (char* font,
144
void DrawLabel (cairo_t* cr,