| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/widget/widget_gtk.h" | 5 #include "views/widget/widget_gtk.h" |
| 6 | 6 |
| 7 #include "app/gfx/path.h" | 7 #include "app/gfx/path.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "views/widget/default_theme_provider.h" | 9 #include "views/widget/default_theme_provider.h" |
| 10 #include "views/widget/drop_target_gtk.h" | 10 #include "views/widget/drop_target_gtk.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 void WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) { | 654 void WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) { |
| 655 // NOTE: for reasons I don't understand this code is never hit. It should | 655 // NOTE: for reasons I don't understand this code is never hit. It should |
| 656 // be hit when transparent_, but we never get the expose-event for the | 656 // be hit when transparent_, but we never get the expose-event for the |
| 657 // window in this case, even though a stand alone test case triggers it. I'm | 657 // window in this case, even though a stand alone test case triggers it. I'm |
| 658 // leaving it in just in case. | 658 // leaving it in just in case. |
| 659 | 659 |
| 660 // Fill the background totally transparent. We don't need to paint the root | 660 // Fill the background totally transparent. We don't need to paint the root |
| 661 // view here as that is done by OnPaint. | 661 // view here as that is done by OnPaint. |
| 662 DCHECK(transparent_); | 662 DCHECK(transparent_); |
| 663 int width, height; | 663 int width, height; |
| 664 gtk_window_get_size (GTK_WINDOW (widget), &width, &height); | 664 gtk_window_get_size(GTK_WINDOW (widget), &width, &height); |
| 665 cairo_t* cr = gdk_cairo_create(widget->window); | 665 cairo_t* cr = gdk_cairo_create(widget->window); |
| 666 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); | 666 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); |
| 667 cairo_set_source_rgba(cr, 0, 0, 0, 0); | 667 cairo_set_source_rgba(cr, 0, 0, 0, 0); |
| 668 cairo_rectangle(cr, 0, 0, width, height); | 668 cairo_rectangle(cr, 0, 0, width, height); |
| 669 cairo_fill(cr); | 669 cairo_fill(cr); |
| 670 } | 670 } |
| 671 | 671 |
| 672 bool WidgetGtk::ProcessMousePressed(GdkEventButton* event) { | 672 bool WidgetGtk::ProcessMousePressed(GdkEventButton* event) { |
| 673 if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS) { | 673 if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS) { |
| 674 // The sequence for double clicks is press, release, press, 2press, release. | 674 // The sequence for double clicks is press, release, press, 2press, release. |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 | 971 |
| 972 // static | 972 // static |
| 973 Widget* Widget::CreateTransparentPopupWidget(bool delete_on_destroy) { | 973 Widget* Widget::CreateTransparentPopupWidget(bool delete_on_destroy) { |
| 974 WidgetGtk* popup = new WidgetGtk(WidgetGtk::TYPE_POPUP); | 974 WidgetGtk* popup = new WidgetGtk(WidgetGtk::TYPE_POPUP); |
| 975 popup->set_delete_on_destroy(delete_on_destroy); | 975 popup->set_delete_on_destroy(delete_on_destroy); |
| 976 popup->MakeTransparent(); | 976 popup->MakeTransparent(); |
| 977 return popup; | 977 return popup; |
| 978 } | 978 } |
| 979 | 979 |
| 980 } // namespace views | 980 } // namespace views |
| OLD | NEW |