2 /* This file is part of the Linux Trace Toolkit viewer
3 * Copyright (C) 2010 Yannick Brosseau
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License Version 2 as
7 * published by the Free Software Foundation;
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 #include <gtk/gtkhbox.h>
25 #include <gtk/gtkspinbutton.h>
26 #include <gtk/gtklabel.h>
30 #define TIMEENTRY_TYPE (timeentry_get_type ())
31 #define TIMEENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TIMEENTRY_TYPE, Timeentry))
32 #define TIMEENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TIMEENTRY_TYPE, TimeentryClass))
33 #define IS_TIMEENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TIMEENTRY_TYPE))
34 #define IS_TIMEENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TIMEENTRY_TYPE))
36 typedef struct _Timeentry Timeentry
;
37 typedef struct _TimeentryClass TimeentryClass
;
42 GtkWidget
*main_label
;
43 GtkWidget
*main_label_box
;
44 GtkWidget
*main_label_context_menu
;
45 GtkWidget
*seconds_spinner
;
46 GtkWidget
*nanoseconds_spinner
;
50 int seconds_changed_handler_id
;
51 int nanoseconds_changed_handler_id
;
53 unsigned long min_seconds
;
54 unsigned long min_nanoseconds
;
55 unsigned long max_seconds
;
56 unsigned long max_nanoseconds
;
59 struct _TimeentryClass
{
60 GtkHBoxClass parent_class
;
62 void (*timeentry
) (Timeentry
*timeentry
);
65 GType
timeentry_get_type(void);
66 GtkWidget
*timeentry_new(const gchar
*label
);
68 void timeentry_set_main_label(Timeentry
*timeentry
,
70 void timeentry_set_minmax_time(Timeentry
*timeentry
,
71 unsigned long min_seconds
,
72 unsigned long min_nanoseconds
,
73 unsigned long max_seconds
,
74 unsigned long max_nanoseconds
);
76 void timeentry_set_time(Timeentry
*timeentry
,
77 unsigned long seconds
,
78 unsigned long nanoseconds
);
80 void timeentry_get_time(Timeentry
*timeentry
,
81 unsigned long *seconds
,
82 unsigned long *nanoseconds
);
85 #endif /* _TIME_ENTRY_ */