diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 00:13:36 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 00:13:36 +0000 |
commit | 0117a81cdd68205c03009bed9e9245d179c77b8e (patch) | |
tree | c379b9b9d16f6933ad6c81c4a421a3e72698e7a3 /ui/base/gtk | |
parent | d96ee58230265ed1c61a1e728caee735e5564d40 (diff) | |
download | chromium_src-0117a81cdd68205c03009bed9e9245d179c77b8e.zip chromium_src-0117a81cdd68205c03009bed9e9245d179c77b8e.tar.gz chromium_src-0117a81cdd68205c03009bed9e9245d179c77b8e.tar.bz2 |
Move glib headers in ui/base/gtk/ to ui/base/glib/.
- Moved ui/base/gtk/gtk_integers.h to ui/base/glib/glib_integers.h since the header only contains typedefs in <glib/glibtypes.h> and does not depend Gtk+ at all.
- Moved the first half of ui/base/gtk/gtk_signal.h to ui/base/glib/glib_signal.h since it does not depend on Gtk+ as well.
This CL is part of the Gtk+ removal work (crbug.com/101422)
BUG=chromium:101422
TEST=ran try
Review URL: http://codereview.chromium.org/8494001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/gtk')
-rw-r--r-- | ui/base/gtk/gtk_integers.h | 28 | ||||
-rw-r--r-- | ui/base/gtk/gtk_signal.h | 81 | ||||
-rw-r--r-- | ui/base/gtk/tooltip_window_gtk.h | 2 |
3 files changed, 3 insertions, 108 deletions
diff --git a/ui/base/gtk/gtk_integers.h b/ui/base/gtk/gtk_integers.h deleted file mode 100644 index 41eeb93..0000000 --- a/ui/base/gtk/gtk_integers.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_GTK_GTK_INTEGERS_H_ -#define UI_BASE_GTK_GTK_INTEGERS_H_ -#pragma once - -// GLib/Gobject/Gtk all use their own integer typedefs. They are copied here -// for forward declaration reasons so we don't pull in all of gtk.h when we -// just need a gpointer. -typedef char gchar; -typedef short gshort; -typedef long glong; -typedef int gint; -typedef gint gboolean; -typedef unsigned char guchar; -typedef unsigned short gushort; -typedef unsigned long gulong; -typedef unsigned int guint; - -typedef unsigned short guint16; -typedef unsigned int guint32; - -typedef void* gpointer; -typedef const void *gconstpointer; - -#endif // UI_BASE_GTK_GTK_INTEGERS_H_ diff --git a/ui/base/gtk/gtk_signal.h b/ui/base/gtk/gtk_signal.h index 64d59d6..a6b34cd 100644 --- a/ui/base/gtk/gtk_signal.h +++ b/ui/base/gtk/gtk_signal.h @@ -6,86 +6,9 @@ #define UI_BASE_GTK_GTK_SIGNAL_H_ #pragma once -typedef void* gpointer; -typedef struct _GtkWidget GtkWidget; - -// At the time of writing this, there were two common ways of binding our C++ -// code to the gobject C system. We either defined a whole bunch of "static -// MethodThunk()" which just called nonstatic Method()s on a class (which hurt -// readability of the headers and signal connection code) OR we declared -// "static Method()" and passed in the current object as the gpointer (and hurt -// readability in the implementation by having "context->" before every -// variable). - -// The hopeful result of using these macros is that the code will be more -// readable and regular. There shouldn't be a bunch of static Thunks visible in -// the headers and the implementations shouldn't be filled with "context->" -// de-references. - -#define CHROMEG_CALLBACK_0(CLASS, RETURN, METHOD, SENDER) \ - static RETURN METHOD ## Thunk(SENDER sender, gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)->METHOD(sender); \ - } \ - \ - virtual RETURN METHOD(SENDER); - -#define CHROMEG_CALLBACK_1(CLASS, RETURN, METHOD, SENDER, ARG1) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, \ - gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)->METHOD(sender, one); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1); +#include "ui/base/glib/glib_signal.h" -#define CHROMEG_CALLBACK_2(CLASS, RETURN, METHOD, SENDER, ARG1, ARG2) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, ARG2 two, \ - gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)->METHOD(sender, one, two); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1, ARG2); - -#define CHROMEG_CALLBACK_3(CLASS, RETURN, METHOD, SENDER, ARG1, ARG2, ARG3) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, ARG2 two, \ - ARG3 three, gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)-> \ - METHOD(sender, one, two, three); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1, ARG2, ARG3); - -#define CHROMEG_CALLBACK_4(CLASS, RETURN, METHOD, SENDER, ARG1, ARG2, ARG3, \ - ARG4) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, ARG2 two, \ - ARG3 three, ARG4 four, \ - gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)-> \ - METHOD(sender, one, two, three, four); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1, ARG2, ARG3, ARG4); - -#define CHROMEG_CALLBACK_5(CLASS, RETURN, METHOD, SENDER, ARG1, ARG2, ARG3, \ - ARG4, ARG5) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, ARG2 two, \ - ARG3 three, ARG4 four, ARG5 five, \ - gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)-> \ - METHOD(sender, one, two, three, four, five); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1, ARG2, ARG3, ARG4, ARG5); - -#define CHROMEG_CALLBACK_6(CLASS, RETURN, METHOD, SENDER, ARG1, ARG2, ARG3, \ - ARG4, ARG5, ARG6) \ - static RETURN METHOD ## Thunk(SENDER sender, ARG1 one, ARG2 two, \ - ARG3 three, ARG4 four, ARG5 five, \ - ARG6 six, gpointer userdata) { \ - return reinterpret_cast<CLASS*>(userdata)-> \ - METHOD(sender, one, two, three, four, five, six); \ - } \ - \ - virtual RETURN METHOD(SENDER, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); +typedef struct _GtkWidget GtkWidget; // These macros handle the common case where the sender object will be a // GtkWidget*. diff --git a/ui/base/gtk/tooltip_window_gtk.h b/ui/base/gtk/tooltip_window_gtk.h index 52622a7..8c908e0 100644 --- a/ui/base/gtk/tooltip_window_gtk.h +++ b/ui/base/gtk/tooltip_window_gtk.h @@ -9,7 +9,7 @@ #include <string> #include "base/string16.h" -#include "ui/base/gtk/gtk_integers.h" +#include "ui/base/glib/glib_integers.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/ui_export.h" |