| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/gtk_views_fixed.h" | 5 #include "ui/views/widget/gtk_views_fixed.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 // We store whether we use the widget's allocated size as a property. Ideally | 9 // We store whether we use the widget's allocated size as a property. Ideally |
| 10 // we would stash this in GtkFixedChild, but GtkFixed doesn't allow subclassing | 10 // we would stash this in GtkFixedChild, but GtkFixed doesn't allow subclassing |
| 11 // gtk_fixed_put. Alternatively we could subclass GtkContainer and use our own | 11 // gtk_fixed_put. Alternatively we could subclass GtkContainer and use our own |
| 12 // API (effectively duplicating GtkFixed), but that means folks could no longer | 12 // API (effectively duplicating GtkFixed), but that means folks could no longer |
| 13 // use the GtkFixed API else where in Chrome. For now I'm going with this route. | 13 // use the GtkFixed API else where in Chrome. For now I'm going with this route. |
| 14 static const char* kUseAllocatedSize = "__VIEWS_USE_ALLOCATED_SIZE__"; | 14 static const char* kUseAllocatedSize = "__VIEWS_USE_ALLOCATED_SIZE__"; |
| 15 static const char* kRequisitionWidth = "__VIEWS_REQUISITION_WIDTH__"; | 15 static const char* kRequisitionWidth = "__VIEWS_REQUISITION_WIDTH__"; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 DCHECK(width); | 96 DCHECK(width); |
| 97 DCHECK(height); | 97 DCHECK(height); |
| 98 *width = reinterpret_cast<glong>(g_object_get_data(G_OBJECT(widget), | 98 *width = reinterpret_cast<glong>(g_object_get_data(G_OBJECT(widget), |
| 99 kRequisitionWidth)); | 99 kRequisitionWidth)); |
| 100 *height = reinterpret_cast<glong>(g_object_get_data(G_OBJECT(widget), | 100 *height = reinterpret_cast<glong>(g_object_get_data(G_OBJECT(widget), |
| 101 kRequisitionHeight)); | 101 kRequisitionHeight)); |
| 102 return (g_object_get_data(G_OBJECT(widget), kUseAllocatedSize) != 0); | 102 return (g_object_get_data(G_OBJECT(widget), kUseAllocatedSize) != 0); |
| 103 } | 103 } |
| 104 | 104 |
| 105 G_END_DECLS | 105 G_END_DECLS |
| OLD | NEW |