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