Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: ui/views/controls/native/native_view_host_gtk.h

Issue 9728002: Removing deprecated GTK-Views code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_GTK_H_
6 #define UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_GTK_H_
7 #pragma once
8
9 #include <gtk/gtk.h>
10 #include <string>
11
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "ui/gfx/rect.h"
15 #include "ui/views/controls/native/native_view_host_wrapper.h"
16
17 namespace views {
18
19 class View;
20 class NativeWidgetGtk;
21
22 // Note that the NativeViewHostGtk assumes ownership of the GtkWidget attached
23 // to it for the duration of its attachment. This is so the NativeViewHostGtk
24 // can safely reparent the GtkWidget in multiple passes without having to worry
25 // about the GtkWidget's refcnt falling to 0.
26 class NativeViewHostGtk : public NativeViewHostWrapper {
27 public:
28 explicit NativeViewHostGtk(NativeViewHost* host);
29 virtual ~NativeViewHostGtk();
30
31 // Overridden from NativeViewHostWrapper:
32 virtual void NativeViewAttached() OVERRIDE;
33 virtual void NativeViewDetaching(bool destroyed) OVERRIDE;
34 virtual void AddedToWidget() OVERRIDE;
35 virtual void RemovedFromWidget() OVERRIDE;
36 virtual void InstallClip(int x, int y, int w, int h) OVERRIDE;
37 virtual bool HasInstalledClip() OVERRIDE;
38 virtual void UninstallClip() OVERRIDE;
39 virtual void ShowWidget(int x, int y, int w, int h) OVERRIDE;
40 virtual void HideWidget() OVERRIDE;
41 virtual void SetFocus() OVERRIDE;
42 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
43
44 private:
45 // Create and Destroy the GtkFixed that performs clipping on our hosted
46 // GtkWidget. |needs_window| is true when a clip is installed and implies the
47 // fixed is backed by a X Window which actually performs the clipping.
48 // It's kind of retarded that Gtk/Cairo doesn't clip painting of child windows
49 // regardless of whether or not there's an X Window. It's not that hard.
50 void CreateFixed(bool needs_window);
51
52 // Destroys the GtkFixed that performs clipping on our hosted GtkWidget.
53 void DestroyFixed();
54
55 NativeWidgetGtk* GetHostWidget() const;
56
57 // Returns the descendant of fixed_ that has focus, or NULL if focus is not
58 // on a descendant of fixed_.
59 GtkWidget* GetFocusedDescendant();
60
61 // Connects a new host widget.
62 void AttachHostWidget();
63
64 // Invoked from the 'destroy' signal.
65 static void CallDestroy(GtkObject* object, NativeViewHostGtk* host);
66
67 // Invoked from the 'focus-in-event' signal.
68 static gboolean CallFocusIn(GtkWidget* gtk_widget,
69 GdkEventFocus* event,
70 NativeViewHostGtk* button);
71
72 // Our associated NativeViewHost.
73 NativeViewHost* host_;
74
75 // Have we installed a region on the gfx::NativeView used to clip to only the
76 // visible portion of the gfx::NativeView ?
77 bool installed_clip_;
78
79 // The installed clip rect. InstallClip doesn't actually perform the clipping,
80 // a call to ShowWidget will.
81 gfx::Rect installed_clip_bounds_;
82
83 // Signal handle id for 'destroy' signal.
84 gulong destroy_signal_id_;
85
86 // Signal handle id for 'focus-in-event' signal.
87 gulong focus_signal_id_;
88
89 // The GtkFixed that contains the attached gfx::NativeView (used for
90 // clipping).
91 GtkWidget* fixed_;
92
93 DISALLOW_COPY_AND_ASSIGN(NativeViewHostGtk);
94 };
95
96 } // namespace views
97
98 #endif // UI_VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_GTK_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/nested_dispatcher_gtk.cc ('k') | ui/views/controls/native/native_view_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698