libyui-gtk  2.49.0
ygtklinklabel.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* A label with embed links. Because we only need a link at the end, that's
6  only what we support.
7 
8  In the future, we may want to use GtkLabel's new link support instead of
9  this custom widget.
10 */
11 
12 #ifndef YGTK_LINK_LABEL_H
13 #define YGTK_LINK_LABEL_H
14 
15 #include <gtk/gtk.h>
16 G_BEGIN_DECLS
17 
18 #define YGTK_TYPE_LINK_LABEL (ygtk_link_label_get_type ())
19 #define YGTK_LINK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
20  YGTK_TYPE_LINK_LABEL, YGtkLinkLabel))
21 #define YGTK_LINK_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
22  YGTK_TYPE_LINK_LABEL, YGtkLinkLabelClass))
23 #define YGTK_IS_LINK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
24  YGTK_TYPE_LINK_LABEL))
25 #define YGTK_IS_LINK_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
26  YGTK_TYPE_LINK_LABEL))
27 #define YGTK_LINK_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
28  YGTK_TYPE_LINK_LABEL, YGtkLinkLabelClass))
29 
30 typedef struct _YGtkLinkLabel YGtkLinkLabel;
32 
34 {
35  GtkWidget parent;
36  // private (read-only):
37  gchar *text, *link;
38  gboolean link_always_visible;
39  PangoLayout *layout, *link_layout;
40  GdkWindow *link_window;
41 };
42 
44 {
45  GtkWidgetClass parent_class;
46  // signals:
47  void (*link_clicked) (YGtkLinkLabel *label);
48 };
49 
50 GtkWidget *ygtk_link_label_new (const gchar *text, const gchar *link);
51 GType ygtk_link_label_get_type (void) G_GNUC_CONST;
52 
53 void ygtk_link_label_set_text (YGtkLinkLabel *label, const gchar *text, const gchar *link,
54  gboolean always_show_link);
55 
56 G_END_DECLS
57 #endif /*YGTK_LINK_LABEL_H*/
58