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

Side by Side Diff: views/widget/widget_gtk.cc

Issue 307030: New widget factories & methods to support desktop notifications, GTK stubs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
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/drag_drop_types.h" 7 #include "app/drag_drop_types.h"
8 #include "app/gfx/path.h" 8 #include "app/gfx/path.h"
9 #include "app/os_exchange_data.h" 9 #include "app/os_exchange_data.h"
10 #include "app/os_exchange_data_provider_gtk.h" 10 #include "app/os_exchange_data_provider_gtk.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 bounds.width(), bounds.height()); 367 bounds.width(), bounds.height());
368 } else { 368 } else {
369 GtkWindow* gtk_window = GTK_WINDOW(widget_); 369 GtkWindow* gtk_window = GTK_WINDOW(widget_);
370 // TODO: this may need to set an initial size if not showing. 370 // TODO: this may need to set an initial size if not showing.
371 // TODO: need to constrain based on screen size. 371 // TODO: need to constrain based on screen size.
372 gtk_window_resize(gtk_window, bounds.width(), bounds.height()); 372 gtk_window_resize(gtk_window, bounds.width(), bounds.height());
373 gtk_window_move(gtk_window, bounds.x(), bounds.y()); 373 gtk_window_move(gtk_window, bounds.x(), bounds.y());
374 } 374 }
375 } 375 }
376 376
377 void WidgetGtk::MoveAbove(Widget* widget) {
378 NOTIMPLEMENTED();
379 }
380
377 void WidgetGtk::SetShape(const gfx::Path& shape) { 381 void WidgetGtk::SetShape(const gfx::Path& shape) {
378 DCHECK(widget_); 382 DCHECK(widget_);
379 DCHECK(widget_->window); 383 DCHECK(widget_->window);
380 384
381 gdk_window_shape_combine_region(widget_->window, NULL, 0, 0); 385 gdk_window_shape_combine_region(widget_->window, NULL, 0, 0);
382 GdkRegion* region = shape.CreateGdkRegion(); 386 GdkRegion* region = shape.CreateGdkRegion();
383 gdk_window_shape_combine_region(widget_->window, region, 0, 0); 387 gdk_window_shape_combine_region(widget_->window, region, 0, 0);
384 gdk_region_destroy(region); 388 gdk_region_destroy(region);
385 } 389 }
386 390
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 434
431 void WidgetGtk::SetOpacity(unsigned char opacity) { 435 void WidgetGtk::SetOpacity(unsigned char opacity) {
432 opacity_ = opacity; 436 opacity_ = opacity;
433 if (widget_) { 437 if (widget_) {
434 // We can only set the opacity when the widget has been realized. 438 // We can only set the opacity when the widget has been realized.
435 gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) / 439 gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) /
436 static_cast<gdouble>(255)); 440 static_cast<gdouble>(255));
437 } 441 }
438 } 442 }
439 443
444 void WidgetGtk::SetAlwaysOnTop(bool on_top) {
445 NOTIMPLEMENTED();
446 }
447
440 RootView* WidgetGtk::GetRootView() { 448 RootView* WidgetGtk::GetRootView() {
441 if (!root_view_.get()) { 449 if (!root_view_.get()) {
442 // First time the root view is being asked for, create it now. 450 // First time the root view is being asked for, create it now.
443 root_view_.reset(CreateRootView()); 451 root_view_.reset(CreateRootView());
444 } 452 }
445 return root_view_.get(); 453 return root_view_.get();
446 } 454 }
447 455
448 Widget* WidgetGtk::GetRootWidget() const { 456 Widget* WidgetGtk::GetRootWidget() const {
449 GtkWidget* parent = widget_; 457 GtkWidget* parent = widget_;
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 is_mouse_down_ = false; 1219 is_mouse_down_ = false;
1212 has_capture_ = false; 1220 has_capture_ = false;
1213 } 1221 }
1214 } 1222 }
1215 1223
1216 1224
1217 //////////////////////////////////////////////////////////////////////////////// 1225 ////////////////////////////////////////////////////////////////////////////////
1218 // Widget, public: 1226 // Widget, public:
1219 1227
1220 // static 1228 // static
1221 Widget* Widget::CreateTransparentPopupWidget(bool delete_on_destroy) { 1229 Widget* Widget::CreatePopupWidget(TransparencyParam transparent,
1230 EventsParam accept_events,
1231 DeleteParam delete_on_destroy) {
1222 WidgetGtk* popup = new WidgetGtk(WidgetGtk::TYPE_POPUP); 1232 WidgetGtk* popup = new WidgetGtk(WidgetGtk::TYPE_POPUP);
1223 popup->set_delete_on_destroy(delete_on_destroy); 1233 popup->set_delete_on_destroy(delete_on_destroy);
1224 popup->MakeTransparent(); 1234 if (transparent == Transparent)
1235 popup->MakeTransparent();
1225 return popup; 1236 return popup;
1226 } 1237 }
1227 1238
1228 } // namespace views 1239 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/widget_gtk.h ('k') | views/widget/widget_win.h » ('j') | views/widget/widget_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698