diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 09:50:52 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 09:50:52 +0000 |
commit | e918f175a6293932fc4c682108cf3c9945671f60 (patch) | |
tree | 3ddf091b7186228813357a87928b099e9372edc8 /chrome/browser/gtk/gtk_chrome_link_button.h | |
parent | ce560f84a2640482e7880cee4d9e4b1661fed3bc (diff) | |
download | chromium_src-e918f175a6293932fc4c682108cf3c9945671f60.zip chromium_src-e918f175a6293932fc4c682108cf3c9945671f60.tar.gz chromium_src-e918f175a6293932fc4c682108cf3c9945671f60.tar.bz2 |
Make LinkButtonGtk into a real widget (GtkChromeLinkButton).
This means there are no longer two objects to keep around, the widget
and the wrapper C++ object. This simplifies ownership in hierarchies.
Review URL: http://codereview.chromium.org/118116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_chrome_link_button.h')
-rw-r--r-- | chrome/browser/gtk/gtk_chrome_link_button.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/chrome/browser/gtk/gtk_chrome_link_button.h b/chrome/browser/gtk/gtk_chrome_link_button.h new file mode 100644 index 0000000..214b142 --- /dev/null +++ b/chrome/browser/gtk/gtk_chrome_link_button.h @@ -0,0 +1,56 @@ +// Copyright (c) 2009 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. + +// Creates a link button that shows |text| in blue and underlined. The cursor +// changes to a hand when over the link. This is like the GTK LinkButton, but +// it doesn't call the global URI link handler, etc. It is a button subclass, +// so you can just handle the clicked signal. + +#ifndef CHROME_BROWSER_GTK_GTK_CHROME_LINK_BUTTON_H_ +#define CHROME_BROWSER_GTK_GTK_CHROME_LINK_BUTTON_H_ + +#include <gdk/gdk.h> +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +#define GTK_TYPE_CHROME_LINK_BUTTON (gtk_chrome_link_button_get_type ()) +#define GTK_CHROME_LINK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + GTK_TYPE_CHROME_LINK_BUTTON, \ + GtkChromeLinkButton)) +#define GTK_CHROME_LINK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + GTK_TYPE_CHROME_LINK_BUTTON, \ + GtkChromeLinkButtonClass)) +#define GTK_IS_CHROME_LINK_BUTTON(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CHROME_LINK_BUTTON)) +#define GTK_IS_CHROME_LINK_BUTTON_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHROME_LINK_BUTTON)) +#define GTK_CHROME_LINK_BUTTON_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + GTK_TYPE_CHROME_LINK_BUTTON, \ + GtkChromeLinkButton)) + +typedef struct _GtkChromeLinkButton GtkChromeLinkButton; +typedef struct _GtkChromeLinkButtonClass GtkChromeLinkButtonClass; + +struct _GtkChromeLinkButton { + GtkButton button; + GtkWidget* label; + char* blue_markup; + char* red_markup; + gboolean is_blue; + GdkCursor* hand_cursor; +}; + +struct _GtkChromeLinkButtonClass { + GtkButtonClass parent_class; +}; + +GtkWidget* gtk_chrome_link_button_new(const char* text); + +GType gtk_chrome_link_button_get_type(); + +G_END_DECLS + +#endif // CHROME_BROWSER_GTK_GTK_CHROME_LINK_BUTTON_H_ |