OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_BASE_GTK_TOOLTIP_WINDOW_GTK_H_ | |
6 #define UI_BASE_GTK_TOOLTIP_WINDOW_GTK_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/string16.h" | |
12 #include "ui/base/glib/glib_integers.h" | |
13 #include "ui/base/gtk/gtk_signal.h" | |
14 #include "ui/base/ui_export.h" | |
15 | |
16 typedef struct _GdkEventExpose GdkEventExpose; | |
17 typedef struct _GtkLabel GtkLabel; | |
18 typedef struct _GtkWidget GtkWidget; | |
19 typedef struct _GtkStyle GtkStyle; | |
20 | |
21 namespace ui { | |
22 | |
23 // TooltipWindowGtk provides a customized tooltip window and gives us a | |
24 // chance to apply RGBA colormap on it. This enables the GTK theme engine to | |
25 // draw tooltip with nice shadow and rounded corner on ChromeOS. | |
26 class UI_EXPORT TooltipWindowGtk { | |
27 public: | |
28 explicit TooltipWindowGtk(GtkWidget* widget); | |
29 ~TooltipWindowGtk(); | |
30 | |
31 // Sets tooltip text to display. | |
32 void SetTooltipText(const string16& text); | |
33 | |
34 GtkLabel* label(); | |
35 | |
36 protected: | |
37 CHROMEGTK_CALLBACK_1(TooltipWindowGtk, gboolean, OnPaint, GdkEventExpose*); | |
38 CHROMEGTK_CALLBACK_1(TooltipWindowGtk, void, OnStyleSet, GtkStyle*); | |
39 | |
40 private: | |
41 void Init(); | |
42 | |
43 // Underlying widget of this tooltip window. | |
44 GtkWidget* host_; | |
45 | |
46 // GtkWindow of this tooltip window. | |
47 GtkWidget* window_; | |
48 | |
49 // The alignment and label widgets contained of the tooltip window. | |
50 GtkWidget* alignment_; | |
51 GtkWidget* label_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(TooltipWindowGtk); | |
54 }; | |
55 | |
56 } // namespace ui | |
57 | |
58 #endif // UI_BASE_GTK_TOOLTIP_WINDOW_GTK_H_ | |
OLD | NEW |