pre3 updates
[dia.git] / lib / dialinechooser.h
blob5a70104f25539130593c3b1e9ea54b8858eacbad
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * dialinechooser.h -- Copyright (C) 1999 James Henstridge.
5 * Copyright (C) 2004 Hubert Figuiere
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef DIALINECHOOSER_H
23 #define DIALINECHOOSER_H
25 #include "arrows.h"
27 #include <gtk/gtk.h>
29 /* --------------- DiaLinePreview -------------------------------- */
30 GType dia_line_preview_get_type (void);
32 #define DIA_TYPE_LINE_PREVIEW (dia_line_preview_get_type ())
33 #define DIA_LINE_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_LINE_PREVIEW, DiaLinePreview))
34 #define DIA_LINE_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIA_TYPE_LINE_PREVIEW, DiaLinePreviewClass))
35 #define DIA_IS_LINE_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_LINE_PREVIEW))
36 #define DIA_IS_LINE_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIA_TYPE_LINE_PREVIEW))
37 #define DIA_LINE_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIA_TYPE_LINE_PREVIEW, DiaLinePreviewClass))
39 typedef struct _DiaLinePreview DiaLinePreview;
40 typedef struct _DiaLinePreviewClass DiaLinePreviewClass;
42 struct _DiaLinePreview
44 GtkMisc misc;
45 LineStyle lstyle;
48 struct _DiaLinePreviewClass
50 GtkMiscClass parent_class;
53 GtkWidget *dia_line_preview_new (LineStyle lstyle);
56 /* ------- Code for DiaLineChooser ---------------------- */
57 GType dia_line_chooser_get_type (void);
59 #define DIA_TYPE_LINE_CHOOSER (dia_line_chooser_get_type ())
60 #define DIA_LINE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_LINE_CHOOSER, DiaLineChooser))
61 #define DIA_LINE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIA_TYPE_LINE_CHOOSER, DiaLineChooserClass))
62 #define DIA_IS_LINE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIA_TYPE_LINE_CHOOSER))
63 #define DIA_IS_LINE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIA_TYPE_LINE_CHOOSER))
64 #define DIA_LINE_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIA_TYPE_LINE_CHOOSER, DiaLineChooserClass))
66 typedef struct _DiaLineChooser DiaLineChooser;
67 typedef struct _DiaLineChooserClass DiaLineChooserClass;
69 typedef void (*DiaChangeLineCallback) (LineStyle lstyle, real dash_length,
70 gpointer user_data);
72 struct _DiaLineChooser
74 GtkButton button;
75 DiaLinePreview *preview;
76 LineStyle lstyle;
77 real dash_length;
79 DiaChangeLineCallback callback;
80 gpointer user_data;
82 GtkWidget *dialog;
83 DiaLineStyleSelector *selector;
86 struct _DiaLineChooserClass
88 GtkButtonClass parent_class;
91 void dia_line_chooser_set_line_style(DiaLineChooser *lchooser,
92 LineStyle style,
93 real dashlength);
94 GtkWidget *dia_line_chooser_new (DiaChangeLineCallback callback,
95 gpointer user_data);
98 #endif /* DIALINECHOOSER_H */