| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef APP_GTK_UTIL_H_ | 5 #ifndef APP_GTK_UTIL_H_ |
| 6 #define APP_GTK_UTIL_H_ | 6 #define APP_GTK_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <string> | |
| 11 | 10 |
| 12 typedef struct _GtkWidget GtkWidget; | 11 typedef struct _GtkWidget GtkWidget; |
| 13 | 12 |
| 14 namespace gtk_util { | 13 namespace gtk_util { |
| 15 | 14 |
| 16 // Calculates the size of given widget based on the size specified in | 15 // Calculates the size of given widget based on the size specified in |
| 17 // number of characters/lines (in locale specific resource file) and | 16 // number of characters/lines (in locale specific resource file) and |
| 18 // font metrics. | 17 // font metrics. |
| 19 // NOTE: Make sure to realize |widget| before using this method, or a | 18 // NOTE: Make sure to realize |widget| before using this method, or a |
| 20 // default font size will be used instead of the actual font size. | 19 // default font size will be used instead of the actual font size. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 void ApplyMessageDialogQuirks(GtkWidget* dialog); | 33 void ApplyMessageDialogQuirks(GtkWidget* dialog); |
| 35 | 34 |
| 36 // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. | 35 // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. |
| 37 // The caller is responsible for free()ing the data. If |stride| is 0, | 36 // The caller is responsible for free()ing the data. If |stride| is 0, |
| 38 // it's assumed to be 4 * |width|. | 37 // it's assumed to be 4 * |width|. |
| 39 uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); | 38 uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); |
| 40 | 39 |
| 41 } // namespace gtk_util | 40 } // namespace gtk_util |
| 42 | 41 |
| 43 #endif // APP_GTK_UTIL_H_ | 42 #endif // APP_GTK_UTIL_H_ |
| OLD | NEW |