summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield/gtk_views_entry.h
blob: e5b370d3bb5b054c18e408c423612738e0af83f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2010 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 VIEWS_WIDGET_GTK_VIEWS_ENTRY_H_
#define VIEWS_WIDGET_GTK_VIEWS_ENTRY_H_

#include <gdk/gdk.h>
#include <gtk/gtkentry.h>

namespace views {
class NativeTextfieldGtk;
}

// GtkViewsEntry is a subclass of GtkEntry that can draw text when the text in
// the entry is empty. For example, this could show the text 'password' in a
// password field when the text is empty. GtkViewsEntry is used internally by
// NativeTextfieldGtk.

G_BEGIN_DECLS

#define GTK_TYPE_VIEWS_ENTRY        (gtk_views_entry_get_type ())
#define GTK_VIEWS_ENTRY(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_VIEWS_ENTRY, GtkViewsEntry))
#define GTK_VIEWS_ENTRY_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_VIEWS_ENTRY, GtkViewsEntryClass))
#define GTK_IS_VIEWS_ENTRY(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWS_ENTRY))
#define GTK_IS_VIEWS_ENTRY_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VIEWS_ENTRY))
#define GTK_VIEWS_ENTRY_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VIEWS_ENTRY, GtkViewsEntry))

typedef struct _GtkViewsEntry        GtkViewsEntry;
typedef struct _GtkViewsEntryClass   GtkViewsEntryClass;

struct _GtkViewsEntry {
  GtkEntry entry;
  views::NativeTextfieldGtk* host;
};

struct _GtkViewsEntryClass {
  GtkEntryClass parent_class;
};

GtkWidget* gtk_views_entry_new(views::NativeTextfieldGtk* host);

GType gtk_views_entry_get_type();

G_END_DECLS

#endif  // VIEWS_WIDGET_GTK_VIEWS_ENTRY_H