# WARNING : ltt must come before lttv, so that the traceread library is
# up to date
-SUBDIRS = ltt include lttv lttd
+SUBDIRS = ltt lttv lttd
AC_SUBST(lttlibdir)
+top_lttvdir="\$(top_srcdir)/lttv"
+AC_SUBST(top_lttvdir)
+
top_guidir="\$(top_srcdir)/lttv/modules/gui"
AC_SUBST(top_guidir)
-DEFAULT_INCLUDES="-I\$(top_guidir) -I\$(top_srcdir)"
+DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_lttvdir) -I\$(top_guidir)"
AC_SUBST(DEFAULT_INCLUDES)
#CPPFLAGS="${GLIB_CFLAGS}"
# WARNING : modules must be done at the end, so modules can dynamically link
# themselves to libraries compiled here but not installed in the system.
-SUBDIRS = main modules
+SUBDIRS = lttv modules
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Michel Dagenais
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-
-#include <lttv/tracecontext.h>
-#include <ltt/event.h>
-#include <ltt/facility.h>
-#include <ltt/trace.h>
-#include <ltt/type.h>
-
-void lttv_context_init(LttvTracesetContext *self, LttvTraceset *ts)
-{
- LTTV_TRACESET_CONTEXT_GET_CLASS(self)->init(self, ts);
-}
-
-
-void lttv_context_fini(LttvTracesetContext *self)
-{
- LTTV_TRACESET_CONTEXT_GET_CLASS(self)->fini(self);
-}
-
-
-LttvTracesetContext *
-lttv_context_new_traceset_context(LttvTracesetContext *self)
-{
- return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_traceset_context(self);
-}
-
-
-
-
-LttvTraceContext *
-lttv_context_new_trace_context(LttvTracesetContext *self)
-{
- return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
-}
-
-
-LttvTracefileContext *
-lttv_context_new_tracefile_context(LttvTracesetContext *self)
-{
- return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
-}
-
-/****************************************************************************
- * lttv_traceset_context_compute_time_span
- *
- * Keep the Time_Span is sync with on the fly addition and removal of traces
- * in a trace set. It must be called each time a trace is added/removed from
- * the traceset. It could be more efficient to call it only once a bunch
- * of traces are loaded, but the calculation is not long, so it's not
- * critical.
- *
- * Author : Xang Xiu Yang
- * Imported from gtkTraceSet.c by Mathieu Desnoyers
- ***************************************************************************/
-static void lttv_traceset_context_compute_time_span(
- LttvTracesetContext *self,
- TimeInterval *Time_Span)
-{
- LttvTraceset * traceset = self->ts;
- int numTraces = lttv_traceset_number(traceset);
- int i;
- LttTime s, e;
- LttvTraceContext *tc;
- LttTrace * trace;
-
- Time_Span->startTime.tv_sec = 0;
- Time_Span->startTime.tv_nsec = 0;
- Time_Span->endTime.tv_sec = 0;
- Time_Span->endTime.tv_nsec = 0;
-
- for(i=0; i<numTraces;i++){
- tc = self->traces[i];
- trace = tc->t;
-
- ltt_trace_time_span_get(trace, &s, &e);
-
- if(i==0){
- Time_Span->startTime = s;
- Time_Span->endTime = e;
- }else{
- if(s.tv_sec < Time_Span->startTime.tv_sec ||
- (s.tv_sec == Time_Span->startTime.tv_sec
- && s.tv_nsec < Time_Span->startTime.tv_nsec))
- Time_Span->startTime = s;
- if(e.tv_sec > Time_Span->endTime.tv_sec ||
- (e.tv_sec == Time_Span->endTime.tv_sec &&
- e.tv_nsec > Time_Span->endTime.tv_nsec))
- Time_Span->endTime = e;
- }
- }
-}
-
-
-static void
-init(LttvTracesetContext *self, LttvTraceset *ts)
-{
- guint i, j, nb_trace, nb_control, nb_per_cpu, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- LttTime null_time = {0, 0};
-
- nb_trace = lttv_traceset_number(ts);
- self->ts = ts;
- self->traces = g_new(LttvTraceContext *, nb_trace);
- self->before = lttv_hooks_new();
- self->after = lttv_hooks_new();
- self->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
- self->ts_a = lttv_traceset_attribute(ts);
- for(i = 0 ; i < nb_trace ; i++) {
- tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
- self->traces[i] = tc;
-
- tc->ts_context = self;
- tc->index = i;
- tc->vt = lttv_traceset_get(ts, i);
- tc->t = lttv_trace(tc->vt);
- tc->check = lttv_hooks_new();
- tc->before = lttv_hooks_new();
- tc->after = lttv_hooks_new();
- tc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
- tc->t_a = lttv_trace_attribute(tc->vt);
- nb_control = ltt_trace_control_tracefile_number(tc->t);
- nb_per_cpu = ltt_trace_per_cpu_tracefile_number(tc->t);
- nb_tracefile = nb_control + nb_per_cpu;
- tc->tracefiles = g_new(LttvTracefileContext *, nb_tracefile);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
- tc->tracefiles[j] = tfc;
- tfc->index = j;
-
- if(j < nb_control) {
- tfc->control = TRUE;
- tfc->tf = ltt_trace_control_tracefile_get(tc->t, j);
- }
- else {
- tfc->control = FALSE;
- tfc->tf = ltt_trace_per_cpu_tracefile_get(tc->t, j - nb_control);
- }
- tfc->t_context = tc;
- tfc->check = lttv_hooks_new();
- tfc->before = lttv_hooks_new();
- tfc->after = lttv_hooks_new();
- tfc->check_event = lttv_hooks_new();
- tfc->before_event = lttv_hooks_new();
- tfc->before_event_by_id = lttv_hooks_by_id_new();
- tfc->after_event = lttv_hooks_new();
- tfc->after_event_by_id = lttv_hooks_by_id_new();
- tfc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
- }
- }
- lttv_process_traceset_seek_time(self, null_time);
- /*CHECK why dynamically allocate the time span... and the casing is wroNg*/
- self->Time_Span = g_new(TimeInterval,1);
- lttv_traceset_context_compute_time_span(self, self->Time_Span);
-}
-
-
-void fini(LttvTracesetContext *self)
-{
- guint i, j, nb_trace, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- LttvTraceset *ts = self->ts;
-
- g_free(self->Time_Span);
-
- lttv_hooks_destroy(self->before);
- lttv_hooks_destroy(self->after);
- //FIXME : segfault
- g_object_unref(self->a);
-
- nb_trace = lttv_traceset_number(ts);
-
- for(i = 0 ; i < nb_trace ; i++) {
- tc = self->traces[i];
-
- lttv_hooks_destroy(tc->check);
- lttv_hooks_destroy(tc->before);
- lttv_hooks_destroy(tc->after);
- g_object_unref(tc->a);
-
- nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
- ltt_trace_per_cpu_tracefile_number(tc->t);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = tc->tracefiles[j];
- lttv_hooks_destroy(tfc->check);
- lttv_hooks_destroy(tfc->before);
- lttv_hooks_destroy(tfc->after);
- lttv_hooks_destroy(tfc->check_event);
- lttv_hooks_destroy(tfc->before_event);
- lttv_hooks_by_id_destroy(tfc->before_event_by_id);
- lttv_hooks_destroy(tfc->after_event);
- lttv_hooks_by_id_destroy(tfc->after_event_by_id);
- g_object_unref(tfc->a);
- g_object_unref(tfc);
- }
- g_free(tc->tracefiles);
- g_object_unref(tc);
- }
- g_free(self->traces);
-}
-
-
-void lttv_traceset_context_add_hooks(LttvTracesetContext *self,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- LttvTraceset *ts = self->ts;
-
- guint i, j, nb_trace, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- void *hook_data;
-
- lttv_hooks_add_list(self->before, before_traceset);
- lttv_hooks_add_list(self->after, after_traceset);
- nb_trace = lttv_traceset_number(ts);
-
- for(i = 0 ; i < nb_trace ; i++) {
- tc = self->traces[i];
- lttv_hooks_add_list(tc->check, check_trace);
- lttv_hooks_add_list(tc->before, before_trace);
- lttv_hooks_add_list(tc->after, after_trace);
- nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
- ltt_trace_per_cpu_tracefile_number(tc->t);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = tc->tracefiles[j];
- lttv_hooks_add_list(tfc->check, check_tracefile);
- lttv_hooks_add_list(tfc->before, before_tracefile);
- lttv_hooks_add_list(tfc->after, after_tracefile);
- lttv_hooks_add_list(tfc->check_event, check_event);
- lttv_hooks_add_list(tfc->before_event, before_event);
- lttv_hooks_add_list(tfc->after_event, after_event);
- }
- }
-}
-
-
-void lttv_traceset_context_remove_hooks(LttvTracesetContext *self,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- LttvTraceset *ts = self->ts;
-
- guint i, j, nb_trace, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- void *hook_data;
-
- lttv_hooks_remove_list(self->before, before_traceset);
- lttv_hooks_remove_list(self->after, after_traceset);
- nb_trace = lttv_traceset_number(ts);
-
- for(i = 0 ; i < nb_trace ; i++) {
- tc = self->traces[i];
- lttv_hooks_remove_list(tc->check, check_trace);
- lttv_hooks_remove_list(tc->before, before_trace);
- lttv_hooks_remove_list(tc->after, after_trace);
- nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
- ltt_trace_per_cpu_tracefile_number(tc->t);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = tc->tracefiles[j];
- lttv_hooks_remove_list(tfc->check, check_tracefile);
- lttv_hooks_remove_list(tfc->before, before_tracefile);
- lttv_hooks_remove_list(tfc->after, after_tracefile);
- lttv_hooks_remove_list(tfc->check_event, check_event);
- lttv_hooks_remove_list(tfc->before_event, before_event);
- lttv_hooks_remove_list(tfc->after_event, after_event);
- }
- }
-}
-
-void lttv_trace_context_add_hooks(LttvTraceContext *tc,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace)
-{
- lttv_hooks_add_list(tc->check, check_trace);
- lttv_hooks_add_list(tc->before, before_trace);
- lttv_hooks_add_list(tc->after, after_trace);
-}
-
-void lttv_trace_context_remove_hooks(LttvTraceContext *tc,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace)
-{
- lttv_hooks_remove_list(tc->check, check_trace);
- lttv_hooks_remove_list(tc->before, before_trace);
- lttv_hooks_remove_list(tc->after, after_trace);
-}
-
-void lttv_tracefile_context_add_hooks(LttvTracefileContext *tfc,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- lttv_hooks_add_list(tfc->check, check_tracefile);
- lttv_hooks_add_list(tfc->before, before_tracefile);
- lttv_hooks_add_list(tfc->after, after_tracefile);
- lttv_hooks_add_list(tfc->check_event, check_event);
- lttv_hooks_add_list(tfc->before_event, before_event);
- lttv_hooks_add_list(tfc->after_event, after_event);
-}
-
-void lttv_tracefile_context_remove_hooks(LttvTracefileContext *tfc,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- lttv_hooks_remove_list(tfc->check, check_tracefile);
- lttv_hooks_remove_list(tfc->before, before_tracefile);
- lttv_hooks_remove_list(tfc->after, after_tracefile);
- lttv_hooks_remove_list(tfc->check_event, check_event);
- lttv_hooks_remove_list(tfc->before_event, before_event);
- lttv_hooks_remove_list(tfc->after_event, after_event);
-}
-
-void lttv_tracefile_context_add_hooks_by_id(LttvTracefileContext *tfc,
- unsigned i,
- LttvHooks *before_event_by_id,
- LttvHooks *after_event_by_id)
-{
- LttvHooks * h;
- h = lttv_hooks_by_id_find(tfc->before_event_by_id, i);
- lttv_hooks_add_list(h, before_event_by_id);
- h = lttv_hooks_by_id_find(tfc->after_event_by_id, i);
- lttv_hooks_add_list(h, after_event_by_id);
-}
-
-void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *tfc,
- unsigned i)
-{
- lttv_hooks_by_id_remove(tfc->before_event_by_id, i);
- lttv_hooks_by_id_remove(tfc->after_event_by_id, i);
-}
-
-static LttvTracesetContext *
-new_traceset_context(LttvTracesetContext *self)
-{
- return g_object_new(LTTV_TRACESET_CONTEXT_TYPE, NULL);
-}
-
-
-static LttvTraceContext *
-new_trace_context(LttvTracesetContext *self)
-{
- return g_object_new(LTTV_TRACE_CONTEXT_TYPE, NULL);
-}
-
-
-static LttvTracefileContext *
-new_tracefile_context(LttvTracesetContext *self)
-{
- return g_object_new(LTTV_TRACEFILE_CONTEXT_TYPE, NULL);
-}
-
-
-static void
-traceset_context_instance_init (GTypeInstance *instance, gpointer g_class)
-{
- /* Be careful of anything which would not work well with shallow copies */
-}
-
-
-static void
-traceset_context_finalize (LttvTracesetContext *self)
-{
- G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACESET_CONTEXT_TYPE)))
- ->finalize(G_OBJECT(self));
-}
-
-
-static void
-traceset_context_class_init (LttvTracesetContextClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->finalize = (void (*)(GObject *self))traceset_context_finalize;
- klass->init = init;
- klass->fini = fini;
- klass->new_traceset_context = new_traceset_context;
- klass->new_trace_context = new_trace_context;
- klass->new_tracefile_context = new_tracefile_context;
-}
-
-
-GType
-lttv_traceset_context_get_type(void)
-{
- static GType type = 0;
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (LttvTracesetContextClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) traceset_context_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (LttvTracesetContext),
- 0, /* n_preallocs */
- (GInstanceInitFunc) traceset_context_instance_init /* instance_init */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "LttvTracesetContextType",
- &info, 0);
- }
- return type;
-}
-
-
-static void
-trace_context_instance_init (GTypeInstance *instance, gpointer g_class)
-{
- /* Be careful of anything which would not work well with shallow copies */
-}
-
-
-static void
-trace_context_finalize (LttvTraceContext *self)
-{
- G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACE_CONTEXT_TYPE)))->
- finalize(G_OBJECT(self));
-}
-
-
-static void
-trace_context_class_init (LttvTraceContextClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->finalize = (void (*)(GObject *self)) trace_context_finalize;
-}
-
-
-GType
-lttv_trace_context_get_type(void)
-{
- static GType type = 0;
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (LttvTraceContextClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) trace_context_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (LttvTraceContext),
- 0, /* n_preallocs */
- (GInstanceInitFunc) trace_context_instance_init /* instance_init */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "LttvTraceContextType",
- &info, 0);
- }
- return type;
-}
-
-
-static void
-tracefile_context_instance_init (GTypeInstance *instance, gpointer g_class)
-{
- /* Be careful of anything which would not work well with shallow copies */
-}
-
-
-static void
-tracefile_context_finalize (LttvTracefileContext *self)
-{
- G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACEFILE_CONTEXT_TYPE)))
- ->finalize(G_OBJECT(self));
-}
-
-
-static void
-tracefile_context_class_init (LttvTracefileContextClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->finalize = (void (*)(GObject *self))tracefile_context_finalize;
-}
-
-
-GType
-lttv_tracefile_context_get_type(void)
-{
- static GType type = 0;
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (LttvTracefileContextClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tracefile_context_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (LttvTracefileContext),
- 0, /* n_preallocs */
- (GInstanceInitFunc) tracefile_context_instance_init /* instance_init */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "LttvTracefileContextType",
- &info, 0);
- }
- return type;
-}
-
-
-gint compare_tracefile(gconstpointer a, gconstpointer b)
-{
- gint comparison;
-
- LttvTracefileContext *trace_a = (LttvTracefileContext *)a;
-
- LttvTracefileContext *trace_b = (LttvTracefileContext *)b;
-
- if(trace_a == trace_b) return 0;
- comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp);
- if(comparison != 0) return comparison;
- if(trace_a->index < trace_b->index) return -1;
- else if(trace_a->index > trace_b->index) return 1;
- if(trace_a->t_context->index < trace_b->t_context->index) return -1;
- else if(trace_a->t_context->index > trace_b->t_context->index) return 1;
- g_assert(FALSE);
-}
-
-
-gboolean get_first(gpointer key, gpointer value, gpointer user_data) {
- *((LttvTracefileContext **)user_data) = (LttvTracefileContext *)value;
- return TRUE;
-}
-
-
-void lttv_process_traceset_begin(LttvTracesetContext *self, LttTime end)
-{
- guint i, j, nbi, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- /* Call all before_traceset, before_trace, and before_tracefile hooks.
- For all qualifying tracefiles, seek to the start time, create a context,
- read one event and insert in the pqueue based on the event time. */
-
- lttv_hooks_call(self->before, self);
- nbi = lttv_traceset_number(self->ts);
- self->pqueue = g_tree_new(compare_tracefile);
-
- for(i = 0 ; i < nbi ; i++) {
- tc = self->traces[i];
-
- if(!lttv_hooks_call_check(tc->check, tc)) {
- lttv_hooks_call(tc->before, tc);
- nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
- ltt_trace_per_cpu_tracefile_number(tc->t);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = tc->tracefiles[j];
-
- if(!lttv_hooks_call_check(tfc->check, tfc)) {
- lttv_hooks_call(tfc->before, tfc);
-
- if(tfc->e != NULL) {
- if(tfc->timestamp.tv_sec < end.tv_sec ||
- (tfc->timestamp.tv_sec == end.tv_sec &&
- tfc->timestamp.tv_nsec <= end.tv_nsec)) {
- g_tree_insert(self->pqueue, tfc, tfc);
- }
- }
- }
- }
- }
- }
-}
-
-
-guint lttv_process_traceset_middle(LttvTracesetContext *self, LttTime end,
- unsigned nb_events)
-{
- GTree *pqueue = self->pqueue;
-
- guint id;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- LttEvent *event;
-
- unsigned count = 0;
-
- LttTime previous_timestamp = {0, 0};
-
- /* Get the next event from the pqueue, call its hooks,
- reinsert in the pqueue the following event from the same tracefile
- unless the tracefile is finished or the event is later than the
- start time. */
-
- while(TRUE) {
- tfc = NULL;
- g_tree_foreach(pqueue, get_first, &tfc);
- if(tfc == NULL) return count;
-
- /* Have we reached the maximum number of events specified? However,
- continue for all the events with the same time stamp (CHECK?). Then,
- empty the queue and break from the loop. */
-
- if(count >= nb_events &&
- ltt_time_compare(tfc->timestamp, previous_timestamp) != 0)
- return count;
-
- previous_timestamp = tfc->timestamp;
-
-
- /* Get the tracefile with an event for the smallest time found. If two
- or more tracefiles have events for the same time, hope that lookup
- and remove are consistent. */
-
- g_tree_remove(pqueue, tfc);
- count++;
-
- if(!lttv_hooks_call(tfc->check_event, tfc)) {
- id = ltt_event_eventtype_id(tfc->e);
- lttv_hooks_call(lttv_hooks_by_id_get(tfc->before_event_by_id, id), tfc);
- lttv_hooks_call(tfc->before_event, tfc);
- lttv_hooks_call(lttv_hooks_by_id_get(tfc->after_event_by_id, id), tfc);
- lttv_hooks_call(tfc->after_event, tfc);
- }
-
- event = ltt_tracefile_read(tfc->tf);
- if(event != NULL) {
- tfc->e = event;
- tfc->timestamp = ltt_event_time(event);
- if(tfc->timestamp.tv_sec < end.tv_sec ||
- (tfc->timestamp.tv_sec == end.tv_sec && tfc->timestamp.tv_nsec <= end.tv_nsec))
- g_tree_insert(pqueue, tfc, tfc);
- }
- }
-}
-
-
-void lttv_process_traceset_end(LttvTracesetContext *self)
-{
- guint i, j, nbi, nb_tracefile;
-
- LttvTraceContext *tc;
-
- LttvTracefileContext *tfc;
-
- /* Call all after_traceset, after_trace, and after_tracefile hooks. */
-
- nbi = lttv_traceset_number(self->ts);
-
- for(i = 0 ; i < nbi ; i++) {
- tc = self->traces[i];
-
- /* The check hooks are called again to avoid memorizing the results
- obtained at the beginning. CHECK if it poses a problem */
-
- if(!lttv_hooks_call_check(tc->check, tc)) {
- nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
- ltt_trace_per_cpu_tracefile_number(tc->t);
-
- for(j = 0 ; j < nb_tracefile ; j++) {
- tfc = tc->tracefiles[j];
-
- if(!lttv_hooks_call_check(tfc->check, tfc)) {
- lttv_hooks_call(tfc->after, tfc);
- }
- }
- lttv_hooks_call(tc->after, tc);
- }
- }
- lttv_hooks_call(self->after, self);
-
- /* Empty and free the pqueue */
-
- while(TRUE){
- tfc = NULL;
- g_tree_foreach(self->pqueue, get_first, &tfc);
- if(tfc == NULL) break;
- g_tree_remove(self->pqueue, &(tfc->timestamp));
- }
- g_tree_destroy(self->pqueue);
-}
-
-
-void lttv_process_traceset(LttvTracesetContext *self, LttTime end,
- unsigned nb_events)
-{
- lttv_process_traceset_begin(self, end);
- lttv_process_traceset_middle(self, end, nb_events);
- lttv_process_traceset_end(self);
-}
-
-
-void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
-{
- guint i, nb_tracefile;
-
- LttvTracefileContext *tfc;
-
- LttEvent *event;
-
- nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
- ltt_trace_per_cpu_tracefile_number(self->t);
-
- for(i = 0 ; i < nb_tracefile ; i++) {
- tfc = self->tracefiles[i];
- ltt_tracefile_seek_time(tfc->tf, start);
- event = ltt_tracefile_read(tfc->tf);
- tfc->e = event;
- if(event != NULL) tfc->timestamp = ltt_event_time(event);
- }
-}
-
-
-void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start)
-{
- guint i, nb_trace;
-
- LttvTraceContext *tc;
-
- nb_trace = lttv_traceset_number(self->ts);
- for(i = 0 ; i < nb_trace ; i++) {
- tc = self->traces[i];
- lttv_process_trace_seek_time(tc, start);
- }
-}
-
-
-static LttField *
-find_field(LttEventType *et, const char *field)
-{
- LttType *t;
-
- LttField *f;
-
- guint i, nb;
-
- char *name;
-
- if(field == NULL) return NULL;
-
- f = ltt_eventtype_field(et);
- t = ltt_eventtype_type(et);
- g_assert(ltt_type_class(t) == LTT_STRUCT);
- nb = ltt_type_member_number(t);
- for(i = 0 ; i < nb ; i++) {
- ltt_type_member_type(t, i, &name);
- if(strcmp(name, field) == 0) break;
- }
- g_assert(i < nb);
- return ltt_field_member(f, i);
-}
-
-
-void
-lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type,
- char *field1, char *field2, char *field3, LttvHook h, LttvTraceHook *th)
-{
- LttFacility *f;
-
- LttEventType *et;
-
- guint nb, pos, i;
-
- char *name;
-
- nb = ltt_trace_facility_find(t, facility, &pos);
- if(nb < 1) g_error("No %s facility", facility);
- f = ltt_trace_facility_get(t, pos);
- et = ltt_facility_eventtype_get_by_name(f, event_type);
- if(et == NULL) g_error("Event %s does not exist", event_type);
-
- th->h = h;
- th->id = ltt_eventtype_id(et);
- th->f1 = find_field(et, field1);
- th->f2 = find_field(et, field2);
- th->f3 = find_field(et, field3);
-}
-
-
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Michel Dagenais
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+
+#include <lttv/tracecontext.h>
+#include <ltt/event.h>
+#include <ltt/facility.h>
+#include <ltt/trace.h>
+#include <ltt/type.h>
+
+void lttv_context_init(LttvTracesetContext *self, LttvTraceset *ts)
+{
+ LTTV_TRACESET_CONTEXT_GET_CLASS(self)->init(self, ts);
+}
+
+
+void lttv_context_fini(LttvTracesetContext *self)
+{
+ LTTV_TRACESET_CONTEXT_GET_CLASS(self)->fini(self);
+}
+
+
+LttvTracesetContext *
+lttv_context_new_traceset_context(LttvTracesetContext *self)
+{
+ return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_traceset_context(self);
+}
+
+
+
+
+LttvTraceContext *
+lttv_context_new_trace_context(LttvTracesetContext *self)
+{
+ return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
+}
+
+
+LttvTracefileContext *
+lttv_context_new_tracefile_context(LttvTracesetContext *self)
+{
+ return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
+}
+
+/****************************************************************************
+ * lttv_traceset_context_compute_time_span
+ *
+ * Keep the Time_Span is sync with on the fly addition and removal of traces
+ * in a trace set. It must be called each time a trace is added/removed from
+ * the traceset. It could be more efficient to call it only once a bunch
+ * of traces are loaded, but the calculation is not long, so it's not
+ * critical.
+ *
+ * Author : Xang Xiu Yang
+ * Imported from gtkTraceSet.c by Mathieu Desnoyers
+ ***************************************************************************/
+static void lttv_traceset_context_compute_time_span(
+ LttvTracesetContext *self,
+ TimeInterval *Time_Span)
+{
+ LttvTraceset * traceset = self->ts;
+ int numTraces = lttv_traceset_number(traceset);
+ int i;
+ LttTime s, e;
+ LttvTraceContext *tc;
+ LttTrace * trace;
+
+ Time_Span->startTime.tv_sec = 0;
+ Time_Span->startTime.tv_nsec = 0;
+ Time_Span->endTime.tv_sec = 0;
+ Time_Span->endTime.tv_nsec = 0;
+
+ for(i=0; i<numTraces;i++){
+ tc = self->traces[i];
+ trace = tc->t;
+
+ ltt_trace_time_span_get(trace, &s, &e);
+
+ if(i==0){
+ Time_Span->startTime = s;
+ Time_Span->endTime = e;
+ }else{
+ if(s.tv_sec < Time_Span->startTime.tv_sec ||
+ (s.tv_sec == Time_Span->startTime.tv_sec
+ && s.tv_nsec < Time_Span->startTime.tv_nsec))
+ Time_Span->startTime = s;
+ if(e.tv_sec > Time_Span->endTime.tv_sec ||
+ (e.tv_sec == Time_Span->endTime.tv_sec &&
+ e.tv_nsec > Time_Span->endTime.tv_nsec))
+ Time_Span->endTime = e;
+ }
+ }
+}
+
+
+static void
+init(LttvTracesetContext *self, LttvTraceset *ts)
+{
+ guint i, j, nb_trace, nb_control, nb_per_cpu, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ LttTime null_time = {0, 0};
+
+ nb_trace = lttv_traceset_number(ts);
+ self->ts = ts;
+ self->traces = g_new(LttvTraceContext *, nb_trace);
+ self->before = lttv_hooks_new();
+ self->after = lttv_hooks_new();
+ self->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+ self->ts_a = lttv_traceset_attribute(ts);
+ for(i = 0 ; i < nb_trace ; i++) {
+ tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
+ self->traces[i] = tc;
+
+ tc->ts_context = self;
+ tc->index = i;
+ tc->vt = lttv_traceset_get(ts, i);
+ tc->t = lttv_trace(tc->vt);
+ tc->check = lttv_hooks_new();
+ tc->before = lttv_hooks_new();
+ tc->after = lttv_hooks_new();
+ tc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+ tc->t_a = lttv_trace_attribute(tc->vt);
+ nb_control = ltt_trace_control_tracefile_number(tc->t);
+ nb_per_cpu = ltt_trace_per_cpu_tracefile_number(tc->t);
+ nb_tracefile = nb_control + nb_per_cpu;
+ tc->tracefiles = g_new(LttvTracefileContext *, nb_tracefile);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
+ tc->tracefiles[j] = tfc;
+ tfc->index = j;
+
+ if(j < nb_control) {
+ tfc->control = TRUE;
+ tfc->tf = ltt_trace_control_tracefile_get(tc->t, j);
+ }
+ else {
+ tfc->control = FALSE;
+ tfc->tf = ltt_trace_per_cpu_tracefile_get(tc->t, j - nb_control);
+ }
+ tfc->t_context = tc;
+ tfc->check = lttv_hooks_new();
+ tfc->before = lttv_hooks_new();
+ tfc->after = lttv_hooks_new();
+ tfc->check_event = lttv_hooks_new();
+ tfc->before_event = lttv_hooks_new();
+ tfc->before_event_by_id = lttv_hooks_by_id_new();
+ tfc->after_event = lttv_hooks_new();
+ tfc->after_event_by_id = lttv_hooks_by_id_new();
+ tfc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+ }
+ }
+ lttv_process_traceset_seek_time(self, null_time);
+ /*CHECK why dynamically allocate the time span... and the casing is wroNg*/
+ self->Time_Span = g_new(TimeInterval,1);
+ lttv_traceset_context_compute_time_span(self, self->Time_Span);
+}
+
+
+void fini(LttvTracesetContext *self)
+{
+ guint i, j, nb_trace, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ LttvTraceset *ts = self->ts;
+
+ g_free(self->Time_Span);
+
+ lttv_hooks_destroy(self->before);
+ lttv_hooks_destroy(self->after);
+ //FIXME : segfault
+ g_object_unref(self->a);
+
+ nb_trace = lttv_traceset_number(ts);
+
+ for(i = 0 ; i < nb_trace ; i++) {
+ tc = self->traces[i];
+
+ lttv_hooks_destroy(tc->check);
+ lttv_hooks_destroy(tc->before);
+ lttv_hooks_destroy(tc->after);
+ g_object_unref(tc->a);
+
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = tc->tracefiles[j];
+ lttv_hooks_destroy(tfc->check);
+ lttv_hooks_destroy(tfc->before);
+ lttv_hooks_destroy(tfc->after);
+ lttv_hooks_destroy(tfc->check_event);
+ lttv_hooks_destroy(tfc->before_event);
+ lttv_hooks_by_id_destroy(tfc->before_event_by_id);
+ lttv_hooks_destroy(tfc->after_event);
+ lttv_hooks_by_id_destroy(tfc->after_event_by_id);
+ g_object_unref(tfc->a);
+ g_object_unref(tfc);
+ }
+ g_free(tc->tracefiles);
+ g_object_unref(tc);
+ }
+ g_free(self->traces);
+}
+
+
+void lttv_traceset_context_add_hooks(LttvTracesetContext *self,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ LttvTraceset *ts = self->ts;
+
+ guint i, j, nb_trace, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ void *hook_data;
+
+ lttv_hooks_add_list(self->before, before_traceset);
+ lttv_hooks_add_list(self->after, after_traceset);
+ nb_trace = lttv_traceset_number(ts);
+
+ for(i = 0 ; i < nb_trace ; i++) {
+ tc = self->traces[i];
+ lttv_hooks_add_list(tc->check, check_trace);
+ lttv_hooks_add_list(tc->before, before_trace);
+ lttv_hooks_add_list(tc->after, after_trace);
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = tc->tracefiles[j];
+ lttv_hooks_add_list(tfc->check, check_tracefile);
+ lttv_hooks_add_list(tfc->before, before_tracefile);
+ lttv_hooks_add_list(tfc->after, after_tracefile);
+ lttv_hooks_add_list(tfc->check_event, check_event);
+ lttv_hooks_add_list(tfc->before_event, before_event);
+ lttv_hooks_add_list(tfc->after_event, after_event);
+ }
+ }
+}
+
+
+void lttv_traceset_context_remove_hooks(LttvTracesetContext *self,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ LttvTraceset *ts = self->ts;
+
+ guint i, j, nb_trace, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ void *hook_data;
+
+ lttv_hooks_remove_list(self->before, before_traceset);
+ lttv_hooks_remove_list(self->after, after_traceset);
+ nb_trace = lttv_traceset_number(ts);
+
+ for(i = 0 ; i < nb_trace ; i++) {
+ tc = self->traces[i];
+ lttv_hooks_remove_list(tc->check, check_trace);
+ lttv_hooks_remove_list(tc->before, before_trace);
+ lttv_hooks_remove_list(tc->after, after_trace);
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = tc->tracefiles[j];
+ lttv_hooks_remove_list(tfc->check, check_tracefile);
+ lttv_hooks_remove_list(tfc->before, before_tracefile);
+ lttv_hooks_remove_list(tfc->after, after_tracefile);
+ lttv_hooks_remove_list(tfc->check_event, check_event);
+ lttv_hooks_remove_list(tfc->before_event, before_event);
+ lttv_hooks_remove_list(tfc->after_event, after_event);
+ }
+ }
+}
+
+void lttv_trace_context_add_hooks(LttvTraceContext *tc,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace)
+{
+ lttv_hooks_add_list(tc->check, check_trace);
+ lttv_hooks_add_list(tc->before, before_trace);
+ lttv_hooks_add_list(tc->after, after_trace);
+}
+
+void lttv_trace_context_remove_hooks(LttvTraceContext *tc,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace)
+{
+ lttv_hooks_remove_list(tc->check, check_trace);
+ lttv_hooks_remove_list(tc->before, before_trace);
+ lttv_hooks_remove_list(tc->after, after_trace);
+}
+
+void lttv_tracefile_context_add_hooks(LttvTracefileContext *tfc,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ lttv_hooks_add_list(tfc->check, check_tracefile);
+ lttv_hooks_add_list(tfc->before, before_tracefile);
+ lttv_hooks_add_list(tfc->after, after_tracefile);
+ lttv_hooks_add_list(tfc->check_event, check_event);
+ lttv_hooks_add_list(tfc->before_event, before_event);
+ lttv_hooks_add_list(tfc->after_event, after_event);
+}
+
+void lttv_tracefile_context_remove_hooks(LttvTracefileContext *tfc,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ lttv_hooks_remove_list(tfc->check, check_tracefile);
+ lttv_hooks_remove_list(tfc->before, before_tracefile);
+ lttv_hooks_remove_list(tfc->after, after_tracefile);
+ lttv_hooks_remove_list(tfc->check_event, check_event);
+ lttv_hooks_remove_list(tfc->before_event, before_event);
+ lttv_hooks_remove_list(tfc->after_event, after_event);
+}
+
+void lttv_tracefile_context_add_hooks_by_id(LttvTracefileContext *tfc,
+ unsigned i,
+ LttvHooks *before_event_by_id,
+ LttvHooks *after_event_by_id)
+{
+ LttvHooks * h;
+ h = lttv_hooks_by_id_find(tfc->before_event_by_id, i);
+ lttv_hooks_add_list(h, before_event_by_id);
+ h = lttv_hooks_by_id_find(tfc->after_event_by_id, i);
+ lttv_hooks_add_list(h, after_event_by_id);
+}
+
+void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *tfc,
+ unsigned i)
+{
+ lttv_hooks_by_id_remove(tfc->before_event_by_id, i);
+ lttv_hooks_by_id_remove(tfc->after_event_by_id, i);
+}
+
+static LttvTracesetContext *
+new_traceset_context(LttvTracesetContext *self)
+{
+ return g_object_new(LTTV_TRACESET_CONTEXT_TYPE, NULL);
+}
+
+
+static LttvTraceContext *
+new_trace_context(LttvTracesetContext *self)
+{
+ return g_object_new(LTTV_TRACE_CONTEXT_TYPE, NULL);
+}
+
+
+static LttvTracefileContext *
+new_tracefile_context(LttvTracesetContext *self)
+{
+ return g_object_new(LTTV_TRACEFILE_CONTEXT_TYPE, NULL);
+}
+
+
+static void
+traceset_context_instance_init (GTypeInstance *instance, gpointer g_class)
+{
+ /* Be careful of anything which would not work well with shallow copies */
+}
+
+
+static void
+traceset_context_finalize (LttvTracesetContext *self)
+{
+ G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACESET_CONTEXT_TYPE)))
+ ->finalize(G_OBJECT(self));
+}
+
+
+static void
+traceset_context_class_init (LttvTracesetContextClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+ gobject_class->finalize = (void (*)(GObject *self))traceset_context_finalize;
+ klass->init = init;
+ klass->fini = fini;
+ klass->new_traceset_context = new_traceset_context;
+ klass->new_trace_context = new_trace_context;
+ klass->new_tracefile_context = new_tracefile_context;
+}
+
+
+GType
+lttv_traceset_context_get_type(void)
+{
+ static GType type = 0;
+ if (type == 0) {
+ static const GTypeInfo info = {
+ sizeof (LttvTracesetContextClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) traceset_context_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (LttvTracesetContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) traceset_context_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "LttvTracesetContextType",
+ &info, 0);
+ }
+ return type;
+}
+
+
+static void
+trace_context_instance_init (GTypeInstance *instance, gpointer g_class)
+{
+ /* Be careful of anything which would not work well with shallow copies */
+}
+
+
+static void
+trace_context_finalize (LttvTraceContext *self)
+{
+ G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACE_CONTEXT_TYPE)))->
+ finalize(G_OBJECT(self));
+}
+
+
+static void
+trace_context_class_init (LttvTraceContextClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+ gobject_class->finalize = (void (*)(GObject *self)) trace_context_finalize;
+}
+
+
+GType
+lttv_trace_context_get_type(void)
+{
+ static GType type = 0;
+ if (type == 0) {
+ static const GTypeInfo info = {
+ sizeof (LttvTraceContextClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) trace_context_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (LttvTraceContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) trace_context_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "LttvTraceContextType",
+ &info, 0);
+ }
+ return type;
+}
+
+
+static void
+tracefile_context_instance_init (GTypeInstance *instance, gpointer g_class)
+{
+ /* Be careful of anything which would not work well with shallow copies */
+}
+
+
+static void
+tracefile_context_finalize (LttvTracefileContext *self)
+{
+ G_OBJECT_CLASS(g_type_class_peek(g_type_parent(LTTV_TRACEFILE_CONTEXT_TYPE)))
+ ->finalize(G_OBJECT(self));
+}
+
+
+static void
+tracefile_context_class_init (LttvTracefileContextClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+
+ gobject_class->finalize = (void (*)(GObject *self))tracefile_context_finalize;
+}
+
+
+GType
+lttv_tracefile_context_get_type(void)
+{
+ static GType type = 0;
+ if (type == 0) {
+ static const GTypeInfo info = {
+ sizeof (LttvTracefileContextClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tracefile_context_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (LttvTracefileContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) tracefile_context_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "LttvTracefileContextType",
+ &info, 0);
+ }
+ return type;
+}
+
+
+gint compare_tracefile(gconstpointer a, gconstpointer b)
+{
+ gint comparison;
+
+ LttvTracefileContext *trace_a = (LttvTracefileContext *)a;
+
+ LttvTracefileContext *trace_b = (LttvTracefileContext *)b;
+
+ if(trace_a == trace_b) return 0;
+ comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp);
+ if(comparison != 0) return comparison;
+ if(trace_a->index < trace_b->index) return -1;
+ else if(trace_a->index > trace_b->index) return 1;
+ if(trace_a->t_context->index < trace_b->t_context->index) return -1;
+ else if(trace_a->t_context->index > trace_b->t_context->index) return 1;
+ g_assert(FALSE);
+}
+
+
+gboolean get_first(gpointer key, gpointer value, gpointer user_data) {
+ *((LttvTracefileContext **)user_data) = (LttvTracefileContext *)value;
+ return TRUE;
+}
+
+
+void lttv_process_traceset_begin(LttvTracesetContext *self, LttTime end)
+{
+ guint i, j, nbi, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ /* Call all before_traceset, before_trace, and before_tracefile hooks.
+ For all qualifying tracefiles, seek to the start time, create a context,
+ read one event and insert in the pqueue based on the event time. */
+
+ lttv_hooks_call(self->before, self);
+ nbi = lttv_traceset_number(self->ts);
+ self->pqueue = g_tree_new(compare_tracefile);
+
+ for(i = 0 ; i < nbi ; i++) {
+ tc = self->traces[i];
+
+ if(!lttv_hooks_call_check(tc->check, tc)) {
+ lttv_hooks_call(tc->before, tc);
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = tc->tracefiles[j];
+
+ if(!lttv_hooks_call_check(tfc->check, tfc)) {
+ lttv_hooks_call(tfc->before, tfc);
+
+ if(tfc->e != NULL) {
+ if(tfc->timestamp.tv_sec < end.tv_sec ||
+ (tfc->timestamp.tv_sec == end.tv_sec &&
+ tfc->timestamp.tv_nsec <= end.tv_nsec)) {
+ g_tree_insert(self->pqueue, tfc, tfc);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+guint lttv_process_traceset_middle(LttvTracesetContext *self, LttTime end,
+ unsigned nb_events)
+{
+ GTree *pqueue = self->pqueue;
+
+ guint id;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ LttEvent *event;
+
+ unsigned count = 0;
+
+ LttTime previous_timestamp = {0, 0};
+
+ /* Get the next event from the pqueue, call its hooks,
+ reinsert in the pqueue the following event from the same tracefile
+ unless the tracefile is finished or the event is later than the
+ start time. */
+
+ while(TRUE) {
+ tfc = NULL;
+ g_tree_foreach(pqueue, get_first, &tfc);
+ if(tfc == NULL) return count;
+
+ /* Have we reached the maximum number of events specified? However,
+ continue for all the events with the same time stamp (CHECK?). Then,
+ empty the queue and break from the loop. */
+
+ if(count >= nb_events &&
+ ltt_time_compare(tfc->timestamp, previous_timestamp) != 0)
+ return count;
+
+ previous_timestamp = tfc->timestamp;
+
+
+ /* Get the tracefile with an event for the smallest time found. If two
+ or more tracefiles have events for the same time, hope that lookup
+ and remove are consistent. */
+
+ g_tree_remove(pqueue, tfc);
+ count++;
+
+ if(!lttv_hooks_call(tfc->check_event, tfc)) {
+ id = ltt_event_eventtype_id(tfc->e);
+ lttv_hooks_call(lttv_hooks_by_id_get(tfc->before_event_by_id, id), tfc);
+ lttv_hooks_call(tfc->before_event, tfc);
+ lttv_hooks_call(lttv_hooks_by_id_get(tfc->after_event_by_id, id), tfc);
+ lttv_hooks_call(tfc->after_event, tfc);
+ }
+
+ event = ltt_tracefile_read(tfc->tf);
+ if(event != NULL) {
+ tfc->e = event;
+ tfc->timestamp = ltt_event_time(event);
+ if(tfc->timestamp.tv_sec < end.tv_sec ||
+ (tfc->timestamp.tv_sec == end.tv_sec && tfc->timestamp.tv_nsec <= end.tv_nsec))
+ g_tree_insert(pqueue, tfc, tfc);
+ }
+ }
+}
+
+
+void lttv_process_traceset_end(LttvTracesetContext *self)
+{
+ guint i, j, nbi, nb_tracefile;
+
+ LttvTraceContext *tc;
+
+ LttvTracefileContext *tfc;
+
+ /* Call all after_traceset, after_trace, and after_tracefile hooks. */
+
+ nbi = lttv_traceset_number(self->ts);
+
+ for(i = 0 ; i < nbi ; i++) {
+ tc = self->traces[i];
+
+ /* The check hooks are called again to avoid memorizing the results
+ obtained at the beginning. CHECK if it poses a problem */
+
+ if(!lttv_hooks_call_check(tc->check, tc)) {
+ nb_tracefile = ltt_trace_control_tracefile_number(tc->t) +
+ ltt_trace_per_cpu_tracefile_number(tc->t);
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ tfc = tc->tracefiles[j];
+
+ if(!lttv_hooks_call_check(tfc->check, tfc)) {
+ lttv_hooks_call(tfc->after, tfc);
+ }
+ }
+ lttv_hooks_call(tc->after, tc);
+ }
+ }
+ lttv_hooks_call(self->after, self);
+
+ /* Empty and free the pqueue */
+
+ while(TRUE){
+ tfc = NULL;
+ g_tree_foreach(self->pqueue, get_first, &tfc);
+ if(tfc == NULL) break;
+ g_tree_remove(self->pqueue, &(tfc->timestamp));
+ }
+ g_tree_destroy(self->pqueue);
+}
+
+
+void lttv_process_traceset(LttvTracesetContext *self, LttTime end,
+ unsigned nb_events)
+{
+ lttv_process_traceset_begin(self, end);
+ lttv_process_traceset_middle(self, end, nb_events);
+ lttv_process_traceset_end(self);
+}
+
+
+void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
+{
+ guint i, nb_tracefile;
+
+ LttvTracefileContext *tfc;
+
+ LttEvent *event;
+
+ nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
+ ltt_trace_per_cpu_tracefile_number(self->t);
+
+ for(i = 0 ; i < nb_tracefile ; i++) {
+ tfc = self->tracefiles[i];
+ ltt_tracefile_seek_time(tfc->tf, start);
+ event = ltt_tracefile_read(tfc->tf);
+ tfc->e = event;
+ if(event != NULL) tfc->timestamp = ltt_event_time(event);
+ }
+}
+
+
+void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start)
+{
+ guint i, nb_trace;
+
+ LttvTraceContext *tc;
+
+ nb_trace = lttv_traceset_number(self->ts);
+ for(i = 0 ; i < nb_trace ; i++) {
+ tc = self->traces[i];
+ lttv_process_trace_seek_time(tc, start);
+ }
+}
+
+
+static LttField *
+find_field(LttEventType *et, const char *field)
+{
+ LttType *t;
+
+ LttField *f;
+
+ guint i, nb;
+
+ char *name;
+
+ if(field == NULL) return NULL;
+
+ f = ltt_eventtype_field(et);
+ t = ltt_eventtype_type(et);
+ g_assert(ltt_type_class(t) == LTT_STRUCT);
+ nb = ltt_type_member_number(t);
+ for(i = 0 ; i < nb ; i++) {
+ ltt_type_member_type(t, i, &name);
+ if(strcmp(name, field) == 0) break;
+ }
+ g_assert(i < nb);
+ return ltt_field_member(f, i);
+}
+
+
+void
+lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type,
+ char *field1, char *field2, char *field3, LttvHook h, LttvTraceHook *th)
+{
+ LttFacility *f;
+
+ LttEventType *et;
+
+ guint nb, pos, i;
+
+ char *name;
+
+ nb = ltt_trace_facility_find(t, facility, &pos);
+ if(nb < 1) g_error("No %s facility", facility);
+ f = ltt_trace_facility_get(t, pos);
+ et = ltt_facility_eventtype_get_by_name(f, event_type);
+ if(et == NULL) g_error("Event %s does not exist", event_type);
+
+ th->h = h;
+ th->id = ltt_eventtype_id(et);
+ th->f1 = find_field(et, field1);
+ th->f2 = find_field(et, field2);
+ th->f3 = find_field(et, field3);
+}
+
+
# WARNING : subdirs order is important : mainWin depends on API
-SUBDIRS = mainlib main icons controlflow detailedevents statistics
+SUBDIRS = lttvgui lttvwindow controlflow detailedevents statistics
noinst_HEADERS = eventhooks.h cfv.h cfv-private.h processlist.h\
drawing.h drawitem.h
+
+EXTRA_DIST = \
+ hGuiControlFlowInsert.xpm
\ No newline at end of file
#define _CFV_H
#include <gtk/gtk.h>
-#include <lttv/common.h>
-#include <lttv/mainwindow.h>
+#include <lttvgui/common.h>
+#include <lttvgui/mainwindow.h>
#include "processlist.h"
typedef struct _ControlFlowData ControlFlowData;
#include <lttv/lttv.h>
#include <lttv/tracecontext.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/gtktraceset.h>
#include <lttv/hook.h>
#include "drawing.h"
#include <lttv/lttv.h>
#include <lttv/hook.h>
-#include <lttv/common.h>
+#include <lttvgui/common.h>
#include <lttv/state.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/gtktraceset.h>
#include "eventhooks.h"
#define _EVENT_HOOKS_H
#include <gtk/gtk.h>
-#include <lttv/mainwindow.h>
+#include <lttvgui/mainwindow.h>
#include <ltt/time.h>
#include "processlist.h"
--- /dev/null
+/* XPM */
+static char * hGuiControlFlowInsert_xpm[] = {
+"22 22 3 1",
+" c None",
+". c #0DF904",
+"+ c #F90404",
+" ",
+" . ",
+" .. ",
+" ... ",
+" .... ",
+" ... ",
+" .. ",
+" . ",
+" ",
+"++++++++++............",
+"++++++++++............",
+" ",
+" ++++++ ",
+" ++++++ ",
+" ++++++ ",
+" ++++++ ",
+" ++++++ ",
+" ++++++ ",
+" ",
+"..........++++++++++++",
+"..........++++++++++++",
+" "};
#include <glib.h>
#include <lttv/lttv.h>
#include <lttv/module.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/gtktraceset.h>
#include "cfv.h"
#include "eventhooks.h"
-#include "../icons/hGuiControlFlowInsert.xpm"
+#include "hGuiControlFlowInsert.xpm"
static LttvModule *Main_Win_Module;
libguievents_la_SOURCES = events.c
noinst_HEADERS = gtkrbtree.h gtktreeprivate.h
+EXTRA_DIST = \
+ hGuiEventsInsert.xpm
\ No newline at end of file
#include <lttv/module.h>
#include <lttv/hook.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/gtktraceset.h>
#include <lttv/tracecontext.h>
#include <lttv/state.h>
#include <ltt/ltt.h>
//#include "mw_api.h"
#include "gtktreeprivate.h"
-#include "../icons/hGuiEventsInsert.xpm"
+#include "hGuiEventsInsert.xpm"
static LttvHooks *before_event;
--- /dev/null
+/* XPM */
+static char * hGuiEventsInsert_xpm[] = {
+"22 22 205 2",
+" c None",
+". c #3995E5",
+"+ c #449DE8",
+"@ c #4BA0EA",
+"# c #479BE7",
+"$ c #4395E5",
+"% c #3F8FE2",
+"& c #3A89E0",
+"* c #3683DD",
+"= c #327DDB",
+"- c #2D77D8",
+"; c #2971D6",
+"> c #246BD3",
+", c #2065D1",
+"' c #1B5FCE",
+") c #1759CC",
+"! c #1253C9",
+"~ c #0E4DC7",
+"{ c #0A47C4",
+"] c #0742C2",
+"^ c #053FBF",
+"/ c #0238B2",
+"( c #0032A4",
+"_ c #8BCFFF",
+": c #84C9FF",
+"< c #7DC1FF",
+"[ c #75BAFF",
+"} c #6DB2FF",
+"| c #65AAFF",
+"1 c #5DA1FF",
+"2 c #5499FF",
+"3 c #4B90FF",
+"4 c #4287FF",
+"5 c #397FFF",
+"6 c #3076FF",
+"7 c #276DFF",
+"8 c #1E64FF",
+"9 c #155BFF",
+"0 c #0C52FF",
+"a c #044AFF",
+"b c #0349FF",
+"c c #0340F1",
+"d c #0032AB",
+"e c #4DA3EC",
+"f c #84C8FF",
+"g c #7EC2FF",
+"h c #77BBFF",
+"i c #70B4FF",
+"j c #68ADFF",
+"k c #60A5FF",
+"l c #589DFF",
+"m c #5095FF",
+"n c #488DFF",
+"o c #3F84FF",
+"p c #367BFF",
+"q c #2D73FF",
+"r c #246AFF",
+"s c #1C61FF",
+"t c #1358FF",
+"u c #0A4FFF",
+"v c #0343F6",
+"w c #0132B1",
+"x c #5BA8EB",
+"y c #BFE1FF",
+"z c #BCDEFF",
+"A c #B9DBFF",
+"B c #B5D7FF",
+"C c #B1D4FF",
+"D c #AED0FF",
+"E c #AACCFF",
+"F c #A6C8FF",
+"G c #A2C4FF",
+"H c #9DC0FF",
+"I c #99BCFF",
+"J c #95B8FF",
+"K c #90B3FF",
+"L c #8CAFFF",
+"M c #87AAFF",
+"N c #82A5FE",
+"O c #7FA2FE",
+"P c #7EA1FD",
+"Q c #7DA0FD",
+"R c #7A9AF5",
+"S c #1D48B3",
+"T c #6AAFEB",
+"U c #FFFFFF",
+"V c #FEFEFF",
+"W c #FDFDFE",
+"X c #FBFBFC",
+"Y c #F9F9FB",
+"Z c #F7F7FA",
+"` c #F6F6F9",
+" . c #F0EFF4",
+".. c #385EB5",
+"+. c #69AEEA",
+"@. c #F4F4F8",
+"#. c #EEEDF3",
+"$. c #385DB4",
+"%. c #69ACE9",
+"&. c #848484",
+"*. c #7F7F7F",
+"=. c #808080",
+"-. c #7E7E7F",
+";. c #7D7D7E",
+">. c #7C7C7D",
+",. c #7B7B7D",
+"'. c #7B7B7C",
+"). c #7A7A7C",
+"!. c #F2F2F7",
+"~. c #ECEBF2",
+"{. c #375CB4",
+"]. c #68AAE8",
+"^. c #FBFBFD",
+"/. c #F1F1F6",
+"(. c #E9E9F0",
+"_. c #365BB3",
+":. c #67A9E7",
+"<. c #F8F8FB",
+"[. c #F3F3F7",
+"}. c #EFEFF5",
+"|. c #E7E7EE",
+"1. c #355AB2",
+"2. c #66A7E6",
+"3. c #858585",
+"4. c #7C7C7E",
+"5. c #79797B",
+"6. c #78787B",
+"7. c #7B7B7E",
+"8. c #EDEDF4",
+"9. c #E5E5ED",
+"0. c #3459B2",
+"a. c #65A6E5",
+"b. c #F9F9FC",
+"c. c #ECECF3",
+"d. c #E3E3EC",
+"e. c #3358B1",
+"f. c #64A5E4",
+"g. c #F6F6FA",
+"h. c #EAEAF2",
+"i. c #E1E1EA",
+"j. c #3358B0",
+"k. c #63A3E3",
+"l. c #8D8D8D",
+"m. c #8A8A8C",
+"n. c #77777A",
+"o. c #76767A",
+"p. c #767679",
+"q. c #808085",
+"r. c #E8E8F1",
+"s. c #DFDFE9",
+"t. c #3257B0",
+"u. c #62A2E2",
+"v. c #FAFAFC",
+"w. c #F4F4F9",
+"x. c #EEEEF4",
+"y. c #E7E7F0",
+"z. c #DEDDE8",
+"A. c #62A0E1",
+"B. c #E5E5EF",
+"C. c #DCDCE7",
+"D. c #619FE1",
+"E. c #8A8A8B",
+"F. c #87878A",
+"G. c #757579",
+"H. c #747478",
+"I. c #737378",
+"J. c #7E7E83",
+"K. c #E3E3EE",
+"L. c #DBDBE6",
+"M. c #609DDF",
+"N. c #F3F3F8",
+"O. c #F1F1F7",
+"P. c #E2E2ED",
+"Q. c #DAD9E6",
+"R. c #5E9ADE",
+"S. c #FAFAFB",
+"T. c #F9F9FA",
+"U. c #F7F6F9",
+"V. c #F5F4F7",
+"W. c #F2F2F6",
+"X. c #F1F0F5",
+"Y. c #EFEEF3",
+"Z. c #EDECF2",
+"`. c #EBEAF1",
+" + c #E9E8EF",
+".+ c #E7E6EE",
+"++ c #E4E4ED",
+"@+ c #E3E2EB",
+"#+ c #E1E0EA",
+"$+ c #D4D3E0",
+"%+ c #357FD4",
+"&+ c #5791D7",
+"*+ c #548CD4",
+"=+ c #5188D1",
+"-+ c #4E83CE",
+";+ c #4B7ECA",
+">+ c #487AC7",
+",+ c #4575C4",
+"'+ c #4271C1",
+")+ c #406CBE",
+"!+ c #3D68BB",
+"~+ c #3A63B8",
+"{+ c #375FB5",
+"]+ c #345AB2",
+"^+ c #0C3BA7",
+" ",
+". + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / ( ",
+"+ _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b b c d ",
+"e f g h i j k l m n o p q r s t u b b b v w ",
+"x y z A B C D E F G H I J K L M N O P Q R S ",
+"T U U U U U U U U U U U U U V W X Y Z ` ...",
+"+.U U U U U U U U U U U U V W X Y Z ` @.#.$.",
+"%.U U &.*.*.*.U U =.=.*.*.-.;.>.,.'.).!.~.{.",
+"].U U U U U U U U U U V W ^.Y Z ` @.!./.(._.",
+":.U U U U U U U U U V W ^.Y <.` @.[./.}.|.1.",
+"2.U U 3.*.*.*.U U *.=.;.4.>.'.).5.6.7.8.9.0.",
+"a.U U U U U U U U W ^.b.<.` @.[./.}.8.c.d.e.",
+"f.U U U U U U U W ^.b.<.g.@.[./.}.8.c.h.i.j.",
+"k.U U *.*.*.l.W ^.4.m.,.).5.6.n.o.p.q.r.s.t.",
+"u.U U U U U W ^.v.<.g.w.[./.}.x.c.h.r.y.z.t.",
+"A.U U U U W ^.v.<.g.w.[./.}.x.c.h.r.y.B.C.t.",
+"D.U U *.-.;.E.<.g.).F.6.n.n.p.G.H.I.J.K.L.t.",
+"M.U U W ^.v.<.g.w.N.O.}.x.c.h.r.y.B.K.P.Q.t.",
+"R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+s.z.C.L.Q.$+t.",
+"%+&+*+=+-+;+>+,+'+)+!+~+{+]+t.t.t.t.t.t.t.^+",
+" ",
+" "};
+++ /dev/null
-# This file is part of the Linux Trace Toolkit viewer
-# Copyright (C) 2003-2004 Mathieu Desnoyers
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License Version 2 as
-# published by the Free Software Foundation;
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-
-#
-# Makefile for LTT New generation user interface.
-#
-# Created by Mathieu Desnoyers on May 6, 2003
-#
-
-EXTRA_DIST = \
- hGuiControlFlowInsert.xpm\
- hGuiEventsInsert.xpm\
- hGuiStatisticInsert.xpm
-
+++ /dev/null
-/* XPM */
-static char * hGuiControlFlowInsert_xpm[] = {
-"22 22 3 1",
-" c None",
-". c #0DF904",
-"+ c #F90404",
-" ",
-" . ",
-" .. ",
-" ... ",
-" .... ",
-" ... ",
-" .. ",
-" . ",
-" ",
-"++++++++++............",
-"++++++++++............",
-" ",
-" ++++++ ",
-" ++++++ ",
-" ++++++ ",
-" ++++++ ",
-" ++++++ ",
-" ++++++ ",
-" ",
-"..........++++++++++++",
-"..........++++++++++++",
-" "};
+++ /dev/null
-/* XPM */
-static char * hGuiEventsInsert_xpm[] = {
-"22 22 205 2",
-" c None",
-". c #3995E5",
-"+ c #449DE8",
-"@ c #4BA0EA",
-"# c #479BE7",
-"$ c #4395E5",
-"% c #3F8FE2",
-"& c #3A89E0",
-"* c #3683DD",
-"= c #327DDB",
-"- c #2D77D8",
-"; c #2971D6",
-"> c #246BD3",
-", c #2065D1",
-"' c #1B5FCE",
-") c #1759CC",
-"! c #1253C9",
-"~ c #0E4DC7",
-"{ c #0A47C4",
-"] c #0742C2",
-"^ c #053FBF",
-"/ c #0238B2",
-"( c #0032A4",
-"_ c #8BCFFF",
-": c #84C9FF",
-"< c #7DC1FF",
-"[ c #75BAFF",
-"} c #6DB2FF",
-"| c #65AAFF",
-"1 c #5DA1FF",
-"2 c #5499FF",
-"3 c #4B90FF",
-"4 c #4287FF",
-"5 c #397FFF",
-"6 c #3076FF",
-"7 c #276DFF",
-"8 c #1E64FF",
-"9 c #155BFF",
-"0 c #0C52FF",
-"a c #044AFF",
-"b c #0349FF",
-"c c #0340F1",
-"d c #0032AB",
-"e c #4DA3EC",
-"f c #84C8FF",
-"g c #7EC2FF",
-"h c #77BBFF",
-"i c #70B4FF",
-"j c #68ADFF",
-"k c #60A5FF",
-"l c #589DFF",
-"m c #5095FF",
-"n c #488DFF",
-"o c #3F84FF",
-"p c #367BFF",
-"q c #2D73FF",
-"r c #246AFF",
-"s c #1C61FF",
-"t c #1358FF",
-"u c #0A4FFF",
-"v c #0343F6",
-"w c #0132B1",
-"x c #5BA8EB",
-"y c #BFE1FF",
-"z c #BCDEFF",
-"A c #B9DBFF",
-"B c #B5D7FF",
-"C c #B1D4FF",
-"D c #AED0FF",
-"E c #AACCFF",
-"F c #A6C8FF",
-"G c #A2C4FF",
-"H c #9DC0FF",
-"I c #99BCFF",
-"J c #95B8FF",
-"K c #90B3FF",
-"L c #8CAFFF",
-"M c #87AAFF",
-"N c #82A5FE",
-"O c #7FA2FE",
-"P c #7EA1FD",
-"Q c #7DA0FD",
-"R c #7A9AF5",
-"S c #1D48B3",
-"T c #6AAFEB",
-"U c #FFFFFF",
-"V c #FEFEFF",
-"W c #FDFDFE",
-"X c #FBFBFC",
-"Y c #F9F9FB",
-"Z c #F7F7FA",
-"` c #F6F6F9",
-" . c #F0EFF4",
-".. c #385EB5",
-"+. c #69AEEA",
-"@. c #F4F4F8",
-"#. c #EEEDF3",
-"$. c #385DB4",
-"%. c #69ACE9",
-"&. c #848484",
-"*. c #7F7F7F",
-"=. c #808080",
-"-. c #7E7E7F",
-";. c #7D7D7E",
-">. c #7C7C7D",
-",. c #7B7B7D",
-"'. c #7B7B7C",
-"). c #7A7A7C",
-"!. c #F2F2F7",
-"~. c #ECEBF2",
-"{. c #375CB4",
-"]. c #68AAE8",
-"^. c #FBFBFD",
-"/. c #F1F1F6",
-"(. c #E9E9F0",
-"_. c #365BB3",
-":. c #67A9E7",
-"<. c #F8F8FB",
-"[. c #F3F3F7",
-"}. c #EFEFF5",
-"|. c #E7E7EE",
-"1. c #355AB2",
-"2. c #66A7E6",
-"3. c #858585",
-"4. c #7C7C7E",
-"5. c #79797B",
-"6. c #78787B",
-"7. c #7B7B7E",
-"8. c #EDEDF4",
-"9. c #E5E5ED",
-"0. c #3459B2",
-"a. c #65A6E5",
-"b. c #F9F9FC",
-"c. c #ECECF3",
-"d. c #E3E3EC",
-"e. c #3358B1",
-"f. c #64A5E4",
-"g. c #F6F6FA",
-"h. c #EAEAF2",
-"i. c #E1E1EA",
-"j. c #3358B0",
-"k. c #63A3E3",
-"l. c #8D8D8D",
-"m. c #8A8A8C",
-"n. c #77777A",
-"o. c #76767A",
-"p. c #767679",
-"q. c #808085",
-"r. c #E8E8F1",
-"s. c #DFDFE9",
-"t. c #3257B0",
-"u. c #62A2E2",
-"v. c #FAFAFC",
-"w. c #F4F4F9",
-"x. c #EEEEF4",
-"y. c #E7E7F0",
-"z. c #DEDDE8",
-"A. c #62A0E1",
-"B. c #E5E5EF",
-"C. c #DCDCE7",
-"D. c #619FE1",
-"E. c #8A8A8B",
-"F. c #87878A",
-"G. c #757579",
-"H. c #747478",
-"I. c #737378",
-"J. c #7E7E83",
-"K. c #E3E3EE",
-"L. c #DBDBE6",
-"M. c #609DDF",
-"N. c #F3F3F8",
-"O. c #F1F1F7",
-"P. c #E2E2ED",
-"Q. c #DAD9E6",
-"R. c #5E9ADE",
-"S. c #FAFAFB",
-"T. c #F9F9FA",
-"U. c #F7F6F9",
-"V. c #F5F4F7",
-"W. c #F2F2F6",
-"X. c #F1F0F5",
-"Y. c #EFEEF3",
-"Z. c #EDECF2",
-"`. c #EBEAF1",
-" + c #E9E8EF",
-".+ c #E7E6EE",
-"++ c #E4E4ED",
-"@+ c #E3E2EB",
-"#+ c #E1E0EA",
-"$+ c #D4D3E0",
-"%+ c #357FD4",
-"&+ c #5791D7",
-"*+ c #548CD4",
-"=+ c #5188D1",
-"-+ c #4E83CE",
-";+ c #4B7ECA",
-">+ c #487AC7",
-",+ c #4575C4",
-"'+ c #4271C1",
-")+ c #406CBE",
-"!+ c #3D68BB",
-"~+ c #3A63B8",
-"{+ c #375FB5",
-"]+ c #345AB2",
-"^+ c #0C3BA7",
-" ",
-". + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / ( ",
-"+ _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b b c d ",
-"e f g h i j k l m n o p q r s t u b b b v w ",
-"x y z A B C D E F G H I J K L M N O P Q R S ",
-"T U U U U U U U U U U U U U V W X Y Z ` ...",
-"+.U U U U U U U U U U U U V W X Y Z ` @.#.$.",
-"%.U U &.*.*.*.U U =.=.*.*.-.;.>.,.'.).!.~.{.",
-"].U U U U U U U U U U V W ^.Y Z ` @.!./.(._.",
-":.U U U U U U U U U V W ^.Y <.` @.[./.}.|.1.",
-"2.U U 3.*.*.*.U U *.=.;.4.>.'.).5.6.7.8.9.0.",
-"a.U U U U U U U U W ^.b.<.` @.[./.}.8.c.d.e.",
-"f.U U U U U U U W ^.b.<.g.@.[./.}.8.c.h.i.j.",
-"k.U U *.*.*.l.W ^.4.m.,.).5.6.n.o.p.q.r.s.t.",
-"u.U U U U U W ^.v.<.g.w.[./.}.x.c.h.r.y.z.t.",
-"A.U U U U W ^.v.<.g.w.[./.}.x.c.h.r.y.B.C.t.",
-"D.U U *.-.;.E.<.g.).F.6.n.n.p.G.H.I.J.K.L.t.",
-"M.U U W ^.v.<.g.w.N.O.}.x.c.h.r.y.B.K.P.Q.t.",
-"R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+s.z.C.L.Q.$+t.",
-"%+&+*+=+-+;+>+,+'+)+!+~+{+]+t.t.t.t.t.t.t.^+",
-" ",
-" "};
+++ /dev/null
-/* XPM */
-static char * hGuiStatisticInsert_xpm[] = {
-"22 22 2 1",
-" c None",
-". c #800080",
-" ",
-" ",
-" ",
-" .............. ",
-" .... ... ",
-" .... . ",
-" .... . ",
-" .... ",
-" .... ",
-" .... ",
-" .... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... . ",
-" ... . ",
-" ... ... ",
-" .............. ",
-" ",
-" "};
--- /dev/null
+#
+# Makefile for LTT New generation user interface : plugins.
+#
+# Created by Mathieu Desnoyers on May 6, 2003
+#
+
+libdir = ${lttvlibdir}
+
+AM_CFLAGS = $(GLIB_CFLAGS)
+AM_CFLAGS += $(GTK_CFLAGS)
+LIBS += $(GLIB_LIBS)
+LIBS += $(GTK_LIBS)
+
+lib_LTLIBRARIES = libmainwinapi.la
+libmainwinapi_la_SOURCES = toolbar.c menu.c gtktraceset.c
+#libmainwinapi_la_LDFLAGS = -L${top_srcdir}/lttv/modules/gui/API -lcustomBox
+
+lttvguiinclude_HEADERS = \
+ common.h\
+ gtkdirsel.h\
+ gtkmultivpaned.h\
+ gtktraceset.h\
+ lttvfilter.h\
+ mainwindow.h\
+ menu.h\
+ toolbar.h
+
+EXTRA_DIST =
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef COMMON_H
+#define COMMON_H
+
+#include <stdio.h>
+#include <ltt/ltt.h>
+#include <gtk/gtk.h>
+#include <lttvgui/lttvfilter.h>
+
+#define MAX_NUMBER_EVENT "MAX_NUMBER_EVENT"
+#define TRACESET_TIME_SPAN "TRACESET_TIME_SPAN"
+
+typedef struct _MainWindow MainWindow;
+typedef struct _Tab Tab;
+
+/* constructor of the viewer */
+typedef GtkWidget * (*lttv_constructor)(MainWindow * main_window,
+ LttvTracesetSelector * s, char *key);
+typedef lttv_constructor view_constructor;
+
+typedef struct _TimeWindow {
+ LttTime start_time;
+ LttTime time_width;
+} TimeWindow;
+
+#endif // COMMON_H
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+
+#ifndef __GTK_DIR_SEL_H__
+#define __GTK_DIR_SEL_H__
+
+
+#include <gdk/gdk.h>
+#include <gtk/gtkdialog.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#define GTK_TYPE_DIR_SELECTION (gtk_dir_selection_get_type ())
+#define GTK_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelection))
+#define GTK_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
+#define GTK_IS_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIR_SELECTION))
+#define GTK_IS_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIR_SELECTION))
+#define GTK_DIR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
+
+
+typedef struct _GtkDirSelection GtkDirSelection;
+typedef struct _GtkDirSelectionClass GtkDirSelectionClass;
+
+struct _GtkDirSelection
+{
+ GtkDialog parent_instance;
+
+ GtkWidget *dir_list;
+ GtkWidget *file_list;
+ GtkWidget *selection_entry;
+ GtkWidget *selection_text;
+ GtkWidget *main_vbox;
+ GtkWidget *ok_button;
+ GtkWidget *cancel_button;
+ GtkWidget *help_button;
+ GtkWidget *history_pulldown;
+ GtkWidget *history_menu;
+ GList *history_list;
+ GtkWidget *fileop_dialog;
+ GtkWidget *fileop_entry;
+ gchar *fileop_file;
+ gpointer cmpl_state;
+
+ GtkWidget *fileop_c_dir;
+ GtkWidget *fileop_del_file;
+ GtkWidget *fileop_ren_file;
+
+ GtkWidget *button_area;
+ GtkWidget *action_area;
+
+ GPtrArray *selected_names;
+ gchar *last_selected;
+};
+
+struct _GtkDirSelectionClass
+{
+ GtkDialogClass parent_class;
+
+ /* Padding for future expansion */
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+};
+
+
+GType gtk_dir_selection_get_type (void) G_GNUC_CONST;
+GtkWidget* gtk_dir_selection_new (const gchar *title);
+void gtk_dir_selection_set_filename (GtkDirSelection *filesel,
+ const gchar *filename);
+/* This function returns the selected filename in the C runtime's
+ * multibyte string encoding, which may or may not be the same as that
+ * used by GDK (UTF-8). To convert to UTF-8, call g_filename_to_utf8().
+ * The returned string points to a statically allocated buffer and
+ * should be copied away.
+ */
+G_CONST_RETURN gchar* gtk_dir_selection_get_filename (GtkDirSelection *filesel);
+
+void gtk_dir_selection_complete (GtkDirSelection *filesel,
+ const gchar *pattern);
+void gtk_dir_selection_show_fileop_buttons (GtkDirSelection *filesel);
+void gtk_dir_selection_hide_fileop_buttons (GtkDirSelection *filesel);
+
+gchar** gtk_dir_selection_get_selections (GtkDirSelection *filesel);
+const gchar * gtk_dir_selection_get_dir (GtkDirSelection *filesel);
+void gtk_dir_selection_set_select_multiple (GtkDirSelection *filesel,
+ gboolean select_multiple);
+gboolean gtk_dir_selection_get_select_multiple (GtkDirSelection *filesel);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __GTK_DIR_SEL_H__ */
--- /dev/null
+
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_MULTI_VPANED_H__
+#define __GTK_MULTI_VPANED_H__
+
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkcontainer.h>
+#include <lttvgui/common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#define GTK_TYPE_MULTI_VPANED (gtk_multi_vpaned_get_type ())
+#define GTK_MULTI_VPANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MULTI_VPANED, GtkMultiVPaned))
+#define GTK_MULTI_VPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MULTI_VPANED, GtkMultiVPanedClass))
+#define GTK_IS_MULTI_VPANED(obj ) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MULTI_VPANED))
+#define GTK_IS_MULTI_VPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MULTI_VPANED))
+#define GTK_MULTI_VPANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MULTI_VPANED, GtkMultiVPanedClass))
+
+
+typedef struct _GtkMultiVPaned GtkMultiVPaned;
+typedef struct _GtkMultiVPanedClass GtkMultiVPanedClass;
+
+struct _GtkMultiVPaned
+{
+ GtkPaned container;
+
+ /*< public >*/
+ GtkPaned * first_pane;
+ GtkPaned * last_pane;
+ GtkPaned * focused_pane;
+ GtkPaned * iter;
+ guint num_children;
+
+ GtkWidget * vbox;
+ // GtkWidget * scrollWindow;
+ // GtkWidget * viewport;
+ GtkWidget * hscrollbar;
+ GtkAdjustment *hadjust;
+ MainWindow * mw;
+};
+
+struct _GtkMultiVPanedClass
+{
+ GtkPanedClass parent_class;
+};
+
+
+GType gtk_multi_vpaned_get_type (void) G_GNUC_CONST;
+GtkWidget* gtk_multi_vpaned_new (void);
+
+void gtk_multi_vpaned_set_focus (GtkWidget * widget, gpointer user_data);
+void gtk_multi_vpaned_widget_add(GtkMultiVPaned * multi_vpaned, GtkWidget * widget1);
+void gtk_multi_vpaned_widget_delete(GtkMultiVPaned * multi_vpaned);
+void gtk_multi_vpaned_widget_move_up(GtkMultiVPaned * multi_vpaned);
+void gtk_multi_vpaned_widget_move_down(GtkMultiVPaned * multi_vpaned);
+void gtk_multi_vpaned_set_adjust(GtkMultiVPaned * multi_vpaned, gboolean first_time);
+void gtk_multi_vpaned_set_data(GtkMultiVPaned * multi_vpaned, char * key, gpointer value);
+gpointer gtk_multi_vpaned_get_data(GtkMultiVPaned * multi_vpaned, char * key);
+GtkWidget * gtk_multi_vpaned_get_widget(GtkMultiVPaned * multi_vpaned);
+GtkWidget * gtk_multi_vpaned_get_first_widget(GtkMultiVPaned * multi_vpaned);
+GtkWidget * gtk_multi_vpaned_get_next_widget(GtkMultiVPaned * multi_vpaned);
+void gtk_multi_vpaned_set_scroll_value(GtkMultiVPaned * multi_vpaned, double value);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __GTK_MULTI_VPANED_H__ */
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 XangXiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+/*! \file gtktraceset.h
+ * \brief API used by the graphical viewers to interact with their top window.
+ *
+ * Main window (gui module) is the place to contain and display viewers.
+ * Viewers (lttv plugins) interacte with main window through this API and
+ * events sent by gtk.
+ * This header file should be included in each graphic module.
+ * This library is used by graphical modules to interact with the
+ * tracesetWindow.
+ *
+ */
+
+#include <lttvgui/common.h>
+#include <ltt/ltt.h>
+#include <lttv/lttv.h>
+#include <lttvgui/mainwindow.h>
+#include <lttvgui/gtktraceset.h>
+#include <lttv/tracecontext.h>
+#include <lttvgui/toolbar.h>
+#include <lttvgui/menu.h>
+#include <lttv/state.h>
+#include <lttv/stats.h>
+
+
+/**
+ * Internal function parts
+ */
+
+/**
+ * Function to set/update traceset for the viewers
+ * @param main_win main window
+ * @param traceset traceset of the main window.
+ */
+
+void SetTraceset(MainWindow * main_win, gpointer traceset)
+{
+ LttvHooks * tmp;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ "hooks/updatetraceset", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL)return;
+ lttv_hooks_call(tmp,traceset);
+}
+
+
+/**
+ * Function to set/update filter for the viewers
+ * @param main_win main window
+ * @param filter filter of the main window.
+ */
+
+void SetFilter(MainWindow * main_win, gpointer filter)
+{
+ LttvHooks * tmp;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ "hooks/updatefilter", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+
+ if(tmp == NULL)return;
+ lttv_hooks_call(tmp,filter);
+}
+
+
+
+/**
+ * API parts
+ */
+
+/**
+ * Function to register a view constructor so that main window can generate
+ * a toolbar item for the viewer in order to generate a new instance easily.
+ * It will be called by init function of the module.
+ * @param ButtonPixmap image shown on the toolbar item.
+ * @param tooltip tooltip of the toolbar item.
+ * @param view_constructor constructor of the viewer.
+ */
+
+void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor)
+{
+ LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
+ LttvToolbars * toolbar;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(attributes_global,
+ "viewers/toolbar", LTTV_POINTER, &value));
+ toolbar = (LttvToolbars*)*(value.v_pointer);
+
+ if(toolbar == NULL){
+ toolbar = lttv_toolbars_new();
+ *(value.v_pointer) = toolbar;
+ }
+ lttv_toolbars_add(toolbar, view_constructor, tooltip, pixmap);
+}
+
+
+/**
+ * Function to unregister the viewer's constructor, release the space
+ * occupied by pixmap, tooltip and constructor of the viewer.
+ * It will be called when a module is unloaded.
+ * @param view_constructor constructor of the viewer which is used as
+ * a reference to find out where the pixmap and tooltip are.
+ */
+
+void toolbar_item_unreg(lttv_constructor view_constructor)
+{
+ LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
+ LttvToolbars * toolbar;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(attributes_global,
+ "viewers/toolbar", LTTV_POINTER, &value));
+ toolbar = (LttvToolbars*)*(value.v_pointer);
+
+ main_window_remove_toolbar_item(view_constructor);
+
+ lttv_toolbars_remove(toolbar, view_constructor);
+}
+
+
+/**
+ * Function to register a view constructor so that main window can generate
+ * a menu item for the viewer in order to generate a new instance easily.
+ * It will be called by init function of the module.
+ * @param menu_path path of the menu item.
+ * @param menu_text text of the menu item.
+ * @param view_constructor constructor of the viewer.
+ */
+
+void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor)
+{
+ LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
+ LttvMenus * menu;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(attributes_global,
+ "viewers/menu", LTTV_POINTER, &value));
+ menu = (LttvMenus*)*(value.v_pointer);
+
+ if(menu == NULL){
+ menu = lttv_menus_new();
+ *(value.v_pointer) = menu;
+ }
+ lttv_menus_add(menu, view_constructor, menu_path, menu_text);
+}
+
+/**
+ * Function to unregister the viewer's constructor, release the space
+ * occupied by menu_path, menu_text and constructor of the viewer.
+ * It will be called when a module is unloaded.
+ * @param view_constructor constructor of the viewer which is used as
+ * a reference to find out where the menu_path and menu_text are.
+ */
+
+void menu_item_unreg(lttv_constructor view_constructor)
+{
+ LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
+ LttvMenus * menu;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(attributes_global,
+ "viewers/menu", LTTV_POINTER, &value));
+ menu = (LttvMenus*)*(value.v_pointer);
+
+ main_window_remove_menu_item(view_constructor);
+
+ lttv_menus_remove(menu, view_constructor);
+}
+
+
+/**
+ * Update the status bar whenever something changed in the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param info the message which will be shown in the status bar.
+ */
+
+void update_status(MainWindow *main_win, char *info)
+{
+}
+
+
+/**
+ * Function to get the current time interval shown on the current tab.
+ * It will be called by a viewer's hook function to update the
+ * shown time interval of the viewer and also be called by the constructor
+ * of the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval will be stored.
+ */
+
+void get_time_window(MainWindow *main_win, TimeWindow *time_window)
+{
+ //time_window->start_time = main_win->current_tab->time_window.start_time;
+ //time_window->time_width = main_win->current_tab->time_window.time_width;
+ *time_window = main_win->current_tab->time_window;
+}
+
+/**
+ * Function to get the current time interval of the current traceset.
+ * It will be called by a viewer's hook function to update the
+ * time interval of the viewer and also be called by the constructor
+ * of the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval will be stored.
+ */
+
+void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_interval)
+{
+ //time_window->start_time = main_win->current_tab->time_window.start_time;
+ //time_window->time_width = main_win->current_tab->time_window.time_width;
+ *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context)->Time_Span);
+}
+
+
+
+/**
+ * Function to set the time interval of the current tab.
+ * It will be called by a viewer's signal handle associated with
+ * the move_slider signal
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval is stored.
+ */
+
+void set_time_window(MainWindow *main_win, TimeWindow *time_window)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ main_win->current_tab->time_window = *time_window;
+ gtk_multi_vpaned_set_scroll_value(main_win->current_tab->multi_vpaned,
+ ltt_time_to_double(time_window->start_time)
+ * NANOSECONDS_PER_SECOND );
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, time_window);
+}
+
+
+/**
+ * Function to get the current time/event of the current tab.
+ * It will be called by a viewer's hook function to update the
+ * current time/event of the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param time a pointer where time will be stored.
+ */
+
+void get_current_time(MainWindow *main_win, LttTime *time)
+{
+ time = &main_win->current_tab->current_time;
+}
+
+
+/**
+ * Function to set the current time/event of the current tab.
+ * It will be called by a viewer's signal handle associated with
+ * the button-release-event signal
+ * @param main_win the main window the viewer belongs to.
+ * @param time a pointer where time is stored.
+ */
+
+void set_current_time(MainWindow *main_win, LttTime *time)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ main_win->current_tab->current_time = *time;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatecurrenttime", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+
+ if(tmp == NULL)return;
+ lttv_hooks_call(tmp, time);
+}
+
+
+/**
+ * Function to get the traceset from the current tab.
+ * It will be called by the constructor of the viewer and also be
+ * called by a hook funtion of the viewer to update its traceset.
+ * @param main_win the main window the viewer belongs to.
+ * @param traceset a pointer to a traceset.
+ */
+/*
+void get_traceset(MainWindow *main_win, Traceset *traceset)
+{
+}
+*/
+
+/**
+ * Function to get the filter of the current tab.
+ * It will be called by the constructor of the viewer and also be
+ * called by a hook funtion of the viewer to update its filter.
+ * @param main_win, the main window the viewer belongs to.
+ * @param filter, a pointer to a filter.
+ */
+/*
+void get_filter(MainWindow *main_win, Filter *filter)
+{
+}
+*/
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * time interval.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_time_window(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook,hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the time interval of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_time_window(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * traceset.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_traceset(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetraceset", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the traceset of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_traceset(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetraceset", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to redraw each viewer belonging to the current tab
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void update_traceset(MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetraceset", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, NULL);
+}
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * filter.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_filter(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ "hooks/updatefilter", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the filter of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_filter(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ "hooks/updatefilter", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * current time.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_current_time(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatecurrenttime", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the current time of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_current_time(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatecurrenttime", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to register a hook function for a viewer to show
+ *the content of the viewer.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * show the content of the viewer..
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to show each viewer in the current tab.
+ * It will be called by main window after it called process_traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void show_viewer(MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, NULL);
+}
+
+
+/**
+ * Function to set the focused pane (viewer).
+ * It will be called by a viewer's signal handle associated with
+ * the grab_focus signal
+ * @param main_win the main window the viewer belongs to.
+ * @param paned a pointer to a pane where the viewer is contained.
+ */
+
+void set_focused_pane(MainWindow *main_win, gpointer paned)
+{
+ gtk_multi_vpaned_set_focus((GtkWidget*)main_win->current_tab->multi_vpaned,paned);
+}
+
+
+/**
+ * Function to register a hook function for a viewer to set/update the
+ * dividor of the hpane.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_dividor(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/hpanedividor", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update hpane's dividor of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_dividor(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/hpanedividor", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to set the position of the hpane's dividor (viewer).
+ * It will be called by a viewer's signal handle associated with
+ * the motion_notify_event event/signal
+ * @param main_win the main window the viewer belongs to.
+ * @param position position of the hpane's dividor.
+ */
+
+void set_hpane_dividor(MainWindow *main_win, gint position)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/hpanedividor", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, &position);
+}
+
+
+/**
+ * Function to process traceset. It will call lttv_process_trace,
+ * each view will call this api to get events.
+ * @param main_win the main window the viewer belongs to.
+ * @param start the start time of the first event to be processed.
+ * @param end the end time of the last event to be processed.
+ */
+
+void process_traceset_api(MainWindow *main_win, LttTime start,
+ LttTime end, unsigned maxNumEvents)
+{
+ lttv_process_traceset_seek_time(
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context),
+ start);
+ lttv_process_traceset(
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context),
+ end,
+ maxNumEvents);
+}
+
+/**
+ * Function to add hooks into the context of a traceset,
+ * before reading events from traceset, viewer will call this api to
+ * register hooks
+ * @param main_win the main window the viewer belongs to.
+ * @param LttvHooks hooks to be registered.
+ */
+
+void context_add_hooks_api(MainWindow *main_win ,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ LttvTracesetContext * tsc =
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context);
+ lttv_traceset_context_add_hooks(tsc,before_traceset,after_traceset,
+ check_trace,before_trace,after_trace,
+ check_tracefile,before_tracefile,after_tracefile,
+ check_event,before_event, after_event);
+}
+
+
+/**
+ * Function to remove hooks from the context of a traceset,
+ * before reading events from traceset, viewer will call this api to
+ * unregister hooks
+ * @param main_win the main window the viewer belongs to.
+ * @param LttvHooks hooks to be registered.
+ */
+
+void context_remove_hooks_api(MainWindow *main_win ,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event)
+{
+ LttvTracesetContext * tsc =
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->traceset_context);
+ lttv_traceset_context_remove_hooks(tsc,before_traceset,after_traceset,
+ check_trace,before_trace,after_trace,
+ check_tracefile,before_tracefile,after_tracefile,
+ check_event,before_event, after_event);
+}
+
+
+/**
+ * Function to add/remove event hooks for state
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void state_add_event_hooks_api(MainWindow *main_win )
+{
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+void state_remove_event_hooks_api(MainWindow *main_win )
+{
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+
+/**
+ * Function to add/remove event hooks for stats
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void stats_add_event_hooks_api(MainWindow *main_win )
+{
+ lttv_stats_add_event_hooks(
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+void stats_remove_event_hooks_api(MainWindow *main_win )
+{
+ lttv_stats_remove_event_hooks(
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
+}
+
+/**
+ * Function to get the stats of the traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win)
+{
+ return main_win->current_tab->traceset_info->traceset_context;
+}
+
+
+LttvTracesetContext* get_traceset_context(MainWindow *main_win)
+{
+ return (LttvTracesetContext*)main_win->current_tab->traceset_info->traceset_context;
+}
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+/*
+CHECK Rename to viewer.h
+
+Things that can happen to a viewer:
+
+update_time_window
+update_current_time
+update_traceset
+update_filter
+show_viewer
+update_dividor
+?? Reshape, damage ??
+
+Things that a viewer can do:
+
+update_status
+set_time_window
+set_current_time
+update_traceset?
+update_filter?
+show_viewer?
+set_focused_pane
+set_hpane_dividor
+*/
+
+
+
+
+/*! \file gtktraceset.h
+ * \brief API used by the graphical viewers to interact with their top window.
+ *
+ * Main window (gui module) is the place to contain and display viewers.
+ * Viewers (lttv plugins) interacte with main window through this API and
+ * events sent by gtk.
+ * This header file should be included in each graphic module.
+ * This library is used by graphical modules to interact with the
+ * tracesetWindow.
+ *
+ */
+
+#include <gtk/gtk.h>
+#include <ltt/ltt.h>
+#include <lttv/hook.h>
+#include <lttvgui/common.h>
+#include <lttv/stats.h>
+
+/**
+ * Function to register a view constructor so that main window can generate
+ * a toolbar item for the viewer in order to generate a new instance easily.
+ * It will be called by init function of the module.
+ * @param ButtonPixmap image shown on the toolbar item.
+ * @param tooltip tooltip of the toolbar item.
+ * @param view_constructor constructor of the viewer.
+ */
+
+void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
+
+
+/**
+ * Function to unregister the viewer's constructor, release the space
+ * occupied by pixmap, tooltip and constructor of the viewer.
+ * It will be called when a module is unloaded.
+ * @param view_constructor constructor of the viewer which is used as
+ * a reference to find out where the pixmap and tooltip are.
+ */
+
+void toolbar_item_unreg(lttv_constructor view_constructor);
+
+
+/**
+ * Function to register a view constructor so that main window can generate
+ * a menu item for the viewer in order to generate a new instance easily.
+ * It will be called by init function of the module.
+ * @param menu_path path of the menu item.
+ * @param menu_text text of the menu item.
+ * @param view_constructor constructor of the viewer.
+ */
+
+void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
+
+
+/**
+ * Function to unregister the viewer's constructor, release the space
+ * occupied by menu_path, menu_text and constructor of the viewer.
+ * It will be called when a module is unloaded.
+ * @param view_constructor constructor of the viewer which is used as
+ * a reference to find out where the menu_path and menu_text are.
+ */
+
+void menu_item_unreg(lttv_constructor view_constructor);
+
+
+/**
+ * Update the status bar whenever something changed in the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param info the message which will be shown in the status bar.
+ */
+
+void update_status(MainWindow *main_win, char *info);
+
+
+/**
+ * Function to get the current time window of the current tab.
+ * It will be called by a viewer's hook function to update the
+ * time window of the viewer and also be called by the constructor
+ * of the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval will be stored.
+ */
+
+void get_time_window(MainWindow *main_win, TimeWindow *time_window);
+
+
+/**
+ * Function to set the time interval of the current tab.
+ * It will be called by a viewer's signal handle associated with
+ * the move_slider signal
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval is stored.
+ */
+
+void set_time_window(MainWindow *main_win, TimeWindow *time_window);
+
+/**
+ * Function to get the current time/event of the current tab.
+ * It will be called by a viewer's hook function to update the
+ * current time/event of the viewer.
+ * @param main_win the main window the viewer belongs to.
+ * @param time a pointer where time will be stored.
+ */
+
+void get_current_time(MainWindow *main_win, LttTime *time);
+
+
+/**
+ * Function to set the current time/event of the current tab.
+ * It will be called by a viewer's signal handle associated with
+ * the button-release-event signal
+ * @param main_win the main window the viewer belongs to.
+ * @param time a pointer where time is stored.
+ */
+
+void set_current_time(MainWindow *main_win, LttTime *time);
+
+
+/**
+ * Function to get the traceset from the current tab.
+ * It will be called by the constructor of the viewer and also be
+ * called by a hook funtion of the viewer to update its traceset.
+ * @param main_win the main window the viewer belongs to.
+ * @param traceset a pointer to a traceset.
+ */
+
+//void get_traceset(MainWindow *main_win, Traceset *traceset);
+
+
+/**
+ * Function to get the filter of the current tab.
+ * It will be called by the constructor of the viewer and also be
+ * called by a hook funtion of the viewer to update its filter.
+ * @param main_win, the main window the viewer belongs to.
+ * @param filter, a pointer to a filter.
+ */
+
+//void get_filter(MainWindow *main_win, Filter *filter);
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * time interval.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer. Takes a TimeInterval* as call_data.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_time_window(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the time interval of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer. Takes a TimeInterval as call_data.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_time_window(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * traceset.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_traceset(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the traceset of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_traceset(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to redraw each viewer belonging to the current tab
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void update_traceset(MainWindow * main_win);
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * filter.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_filter(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the filter of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_filter(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * current time.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_current_time(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update the current time of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_current_time(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to register a hook function for a viewer to show
+ *the content of the viewer.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * show the content of the viewer..
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win);
+
+
+/**
+ * Function to show each viewer in the current tab.
+ * It will be called by main window after it called process_traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void show_viewer(MainWindow *main_win);
+
+
+/**
+ * Function to set the focused pane (viewer).
+ * It will be called by a viewer's signal handle associated with
+ * the grab_focus signal
+ * @param main_win the main window the viewer belongs to.
+ * @param paned a pointer to a pane where the viewer is contained.
+ */
+
+void set_focused_pane(MainWindow *main_win, gpointer paned);
+
+
+/**
+ * Function to register a hook function for a viewer to set/update the
+ * dividor of the hpane.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_update_dividor(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win);
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * set/update hpane's dividor of the viewer.
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_update_dividor(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win);
+
+
+/**
+ * Function to set the position of the hpane's dividor (viewer).
+ * It will be called by a viewer's signal handle associated with
+ * the motion_notify_event event/signal
+ * @param main_win the main window the viewer belongs to.
+ * @param position position of the hpane's dividor.
+ */
+
+void set_hpane_dividor(MainWindow *main_win, gint position);
+
+
+/*
+CHECK These functions really should not appear here. Directr calls would
+be OK unless there is a linker problem.
+*/
+/**
+ * Function to process traceset. It will call lttv_process_trace,
+ * each view will call this api to get events.
+ * @param main_win the main window the viewer belongs to.
+ * @param start the start time of the first event to be processed.
+ * @param end the end time of the last event to be processed.
+ */
+
+void process_traceset_api(MainWindow *main_win, LttTime start,
+ LttTime end, unsigned maxNumEvents);
+
+
+/**
+ * Function to add hooks into the context of a traceset,
+ * before reading events from traceset, viewer will call this api to
+ * register hooks
+ * @param main_win the main window the viewer belongs to.
+ * @param LttvHooks hooks to be registered.
+ */
+
+void context_add_hooks_api(MainWindow *main_win ,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event);
+
+
+/**
+ * Function to remove hooks from the context of a traceset,
+ * before reading events from traceset, viewer will call this api to
+ * unregister hooks
+ * @param main_win the main window the viewer belongs to.
+ * @param LttvHooks hooks to be registered.
+ */
+
+void context_remove_hooks_api(MainWindow *main_win ,
+ LttvHooks *before_traceset,
+ LttvHooks *after_traceset,
+ LttvHooks *check_trace,
+ LttvHooks *before_trace,
+ LttvHooks *after_trace,
+ LttvHooks *check_tracefile,
+ LttvHooks *before_tracefile,
+ LttvHooks *after_tracefile,
+ LttvHooks *check_event,
+ LttvHooks *before_event,
+ LttvHooks *after_event);
+
+
+/**
+ * Function to get the life span of the traceset
+ * @param main_win the main window the viewer belongs to.
+ * @param start start time of the traceset.
+ * @param end end time of the traceset.
+ */
+
+void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_span);
+
+
+/**
+ * Function to add/remove event hooks for state
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void state_add_event_hooks_api(MainWindow *main_win );
+void state_remove_event_hooks_api(MainWindow *main_win );
+
+
+/**
+ * Function to add/remove event hooks for stats
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void stats_add_event_hooks_api(MainWindow *main_win );
+void stats_remove_event_hooks_api(MainWindow *main_win );
+
+
+/**
+ * Function to get the stats of the traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win);
+
+LttvTracesetContext* get_traceset_context(MainWindow *main_win);
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef LTTV_FILTER_H
+#define LTTV_FILTER_H
+
+#include <ltt/ltt.h>
+
+
+typedef struct _LttvTracesetSelector LttvTracesetSelector;
+typedef struct _LttvTraceSelector LttvTraceSelector;
+typedef struct _LttvTracefileSelector LttvTracefileSelector;
+typedef struct _LttvEventtypeSelector LttvEventtypeSelector;
+
+
+LttvTracesetSelector *lttv_traceset_selector_new(char * name);
+LttvTraceSelector *lttv_trace_selector_new(LttTrace *t);
+LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t);
+LttvEventtypeSelector *lttv_eventtype_selector_new(LttEventType * et);
+void lttv_traceset_selector_destroy(LttvTracesetSelector *s);
+void lttv_trace_selector_destroy(LttvTraceSelector *t);
+void lttv_tracefile_selector_destroy(LttvTracefileSelector *t);
+void lttv_eventtype_selector_destroy(LttvEventtypeSelector *t);
+
+
+void lttv_traceset_selector_trace_add(LttvTracesetSelector *s,
+ LttvTraceSelector *t);
+unsigned lttv_traceset_selector_trace_number(LttvTracesetSelector *s);
+LttvTraceSelector *lttv_traceset_selector_trace_get(LttvTracesetSelector *s,
+ unsigned i);
+void lttv_traceset_selector_trace_remove(LttvTracesetSelector *s,
+ unsigned i);
+
+
+void lttv_trace_selector_tracefile_add(LttvTraceSelector *s,
+ LttvTracefileSelector *t);
+unsigned lttv_trace_selector_tracefile_number(LttvTraceSelector *s);
+LttvTracefileSelector *lttv_trace_selector_tracefile_get(LttvTraceSelector *s,
+ unsigned i);
+void lttv_trace_selector_tracefile_remove(LttvTraceSelector *s, unsigned i);
+
+void lttv_trace_selector_eventtype_add(LttvTraceSelector *s,
+ LttvEventtypeSelector *et);
+unsigned lttv_trace_selector_eventtype_number(LttvTraceSelector *s);
+LttvEventtypeSelector *lttv_trace_selector_eventtype_get(LttvTraceSelector *s,
+ unsigned i);
+void lttv_trace_selector_eventtype_remove(LttvTraceSelector *s, unsigned i);
+
+
+void lttv_tracefile_selector_eventtype_add(LttvTracefileSelector *s,
+ LttvEventtypeSelector *et);
+unsigned lttv_tracefile_selector_eventtype_number(LttvTracefileSelector *s);
+LttvEventtypeSelector *lttv_tracefile_selector_eventtype_get(LttvTracefileSelector *s,
+ unsigned i);
+void lttv_tracefile_selector_eventtype_remove(LttvTracefileSelector *s, unsigned i);
+
+
+void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g);
+void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g);
+void lttv_eventtype_selector_set_selected(LttvEventtypeSelector *s, gboolean g);
+gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s);
+gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s);
+gboolean lttv_eventtype_selector_get_selected(LttvEventtypeSelector *s);
+char * lttv_traceset_selector_get_name(LttvTracesetSelector *s);
+char * lttv_trace_selector_get_name(LttvTraceSelector *s);
+char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s);
+char * lttv_eventtype_selector_get_name(LttvEventtypeSelector *s);
+
+LttvEventtypeSelector * lttv_eventtype_selector_clone(LttvEventtypeSelector * s);
+void lttv_eventtype_selector_copy(LttvTraceSelector *s, LttvTracefileSelector *d);
+
+
+#endif // LTTV_FILTER_H
+
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef _MAIN_WINDOW_
+#define _MAIN_WINDOW_
+
+#include <gtk/gtk.h>
+
+#include <ltt/ltt.h>
+#include <lttv/attribute.h>
+#include <lttv/traceset.h>
+#include <lttv/tracecontext.h>
+
+#include <lttvgui/common.h>
+#include <lttvgui/gtkmultivpaned.h>
+#include <lttv/hook.h>
+#include <lttv/stats.h>
+
+typedef struct _TracesetInfo {
+ //FIXME? TracesetContext and stats in same or different variable ?
+ LttvTracesetStats * traceset_context;
+ LttvTraceset * traceset;
+} TracesetInfo ;
+
+
+struct _MainWindow{
+ GtkWidget* mwindow; /* Main Window */
+ int window_width;
+
+ /* Status bar information */
+ // guint MainSBarContextID; /* Context ID of main status bar */
+ // guint BegTimeSBarContextID; /* Context ID of BegTime status bar */
+ // guint EndTimeSBarContextID; /* Context ID of EndTime status bar */
+
+ /* Child windows */
+ //openTracesetWindow* OpenTracesetWindow;/* Window to get prof and proc file*/
+ //viewTimeFrameWindow* ViewTimeFrameWindow;/*Window to select time frame */
+ //gotoEventWindow* GotoEventWindow; /*search for event description*/
+ //openFilterWindow* OpenFilterWindow; /* Open a filter selection window */
+ GtkWidget* help_contents;/* Window to display help contents */
+ GtkWidget* about_box; /* Window about information */
+
+ // lttv_trace_filter * filter; /* trace filter associated with the window */
+
+ /* Attributes for trace reading hooks local to the main window */
+ LttvIAttribute * attributes;
+
+ Tab * tab;
+ Tab * current_tab;
+
+ GHashTable * hash_menu_item;
+ GHashTable * hash_toolbar_item;
+};
+
+
+struct _Tab{
+ GtkWidget * label;
+ GtkMultiVPaned * multi_vpaned;
+
+ // startTime is the left of the visible area. Corresponds to the scrollbar
+ // value.
+ // Time_Width is a zoom dependant value (corresponding to page size)
+ TimeWindow time_window;
+
+ // The current time is the time selected in the visible area by the user,
+ // not the scrollbar value.
+ LttTime current_time;
+ LttvIAttribute * attributes;
+
+ struct _Tab * next;
+ MainWindow * mw;
+
+ /* Traceset related information */
+ TracesetInfo * traceset_info;
+};
+
+/**
+ * Remove menu and toolbar item when a module unloaded
+ */
+void main_window_remove_menu_item(lttv_constructor view_constructor);
+void main_window_remove_toolbar_item(lttv_constructor view_constructor);
+
+#endif /* _MAIN_WINDOW_ */
+
+
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 XangXiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#include <lttv/lttv.h>
+#include <lttvgui/menu.h>
+
+
+inline LttvMenus *lttv_menus_new() {
+ return g_array_new(FALSE, FALSE, sizeof(lttv_menu_closure));
+}
+
+/* MD: delete elements of the array also, but don't free pointed addresses
+ * (functions).
+ */
+inline void lttv_menus_destroy(LttvMenus *h) {
+ g_debug("lttv_menus_destroy()");
+ g_array_free(h, TRUE);
+}
+
+inline void lttv_menus_add(LttvMenus *h, lttv_constructor f, char* menuPath, char* menuText)
+{
+ lttv_menu_closure c;
+
+ /* if h is null, do nothing, or popup a warning message */
+ if(h == NULL)return;
+
+ c.con = f;
+ c.menuPath = menuPath;
+ c.menuText = menuText;
+ g_array_append_val(h,c);
+}
+
+gboolean lttv_menus_remove(LttvMenus *h, lttv_constructor f)
+{
+ lttv_menu_closure * tmp;
+ gint i;
+ for(i=0;i<h->len;i++){
+ tmp = & g_array_index(h, lttv_menu_closure, i);
+ if(tmp->con == f)break;
+ }
+ if(i<h->len){
+ g_array_remove_index(h, i);
+ return TRUE;
+ }else return FALSE;
+
+}
+
+unsigned lttv_menus_number(LttvMenus *h)
+{
+ return h->len;
+}
+
+
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef MENU_H
+#define MENU_H
+
+#include <lttvgui/common.h>
+
+/* constructor of the viewer */
+//typedef GtkWidget* (*lttv_constructor)(void * main_window);
+
+
+typedef GArray LttvMenus;
+
+typedef struct _lttv_menu_closure {
+ lttv_constructor con;
+ char * menuPath;
+ char * menuText;
+} lttv_menu_closure;
+
+
+LttvMenus *lttv_menus_new();
+
+void lttv_menus_destroy(LttvMenus *h);
+
+void lttv_menus_add(LttvMenus *h, lttv_constructor f, char* menuPath, char * menuText);
+
+gboolean lttv_menus_remove(LttvMenus *h, lttv_constructor f);
+
+unsigned lttv_menus_number(LttvMenus *h);
+
+#endif // MENU_H
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 XangXiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#include <lttv/lttv.h>
+#include <lttvgui/toolbar.h>
+
+
+inline LttvToolbars *lttv_toolbars_new() {
+ return g_array_new(FALSE, FALSE, sizeof(lttv_toolbar_closure));
+}
+
+/* MD: delete elements of the array also, but don't free pointed addresses
+ * (functions).
+ */
+inline void lttv_toolbars_destroy(LttvToolbars *h) {
+ g_debug("lttv_toolbars_destroy");
+ g_array_free(h, TRUE);
+}
+
+inline void lttv_toolbars_add(LttvToolbars *h, lttv_constructor f, char* tooltip, char ** pixmap)
+{
+ lttv_toolbar_closure c;
+
+ /* if h is null, do nothing, or popup a warning message */
+ if(h == NULL)return;
+
+ c.con = f;
+ c.tooltip = tooltip;
+ c.pixmap = pixmap;
+ g_array_append_val(h,c);
+}
+
+gboolean lttv_toolbars_remove(LttvToolbars *h, lttv_constructor f)
+{
+ lttv_toolbar_closure * tmp;
+ gint i;
+ for(i=0;i<h->len;i++){
+ tmp = & g_array_index(h, lttv_toolbar_closure, i);
+ if(tmp->con == f)break;
+ }
+ if(i<h->len){
+ g_array_remove_index(h, i);
+ return TRUE;
+ }else return FALSE;
+}
+
+unsigned lttv_toolbars_number(LttvToolbars *h)
+{
+ return h->len;
+}
+
+
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ */
+
+#ifndef TOOLBAR_H
+#define TOOLBAR_H
+
+#include <lttvgui/common.h>
+
+/* constructor of the viewer */
+//typedef GtkWidget* (*lttv_constructor)(void * main_window);
+
+
+typedef GArray LttvToolbars;
+
+typedef struct _lttv_toolbar_closure {
+ lttv_constructor con;
+ char * tooltip;
+ char ** pixmap;
+} lttv_toolbar_closure;
+
+LttvToolbars *lttv_toolbars_new();
+
+void lttv_toolbars_destroy(LttvToolbars *h);
+
+void lttv_toolbars_add(LttvToolbars *h, lttv_constructor f, char* tooltip, char ** pixmap);
+
+gboolean lttv_toolbars_remove(LttvToolbars *h, lttv_constructor f);
+
+unsigned lttv_toolbars_number(LttvToolbars *h);
+
+#endif // TOOLBAR_H
## Process this file with automake to produce Makefile.in
-SUBDIRS = src
-
-EXTRA_DIST = \
- mainwin.glade \
- mainwin.gladep
+SUBDIRS = src glade
install-data-local:
@$(NORMAL_INSTALL)
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+EXTRA_DIST = \
+ mainwin.glade \
+ mainwin.gladep
--- /dev/null
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="MWindow">
+ <property name="width_request">100</property>
+ <property name="height_request">50</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Main window</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_width">600</property>
+ <property name="default_height">400</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <signal name="destroy" handler="on_MWindow_destroy" last_modification_time="Tue, 10 Jun 2003 16:31:35 GMT"/>
+
+ <child>
+ <widget class="GtkVBox" id="MVbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="MMenuBox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkMenuBar" id="MenuMain">
+ <property name="visible">True</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="FileMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="FileMenuTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="FileMenuNewTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">New</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="FileMenuNewTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="EmptyTraceset">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Empty trace set</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_empty_traceset_activate" last_modification_time="Tue, 10 Jun 2003 15:03:01 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="CloneTraceset">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Clone trace set</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_clone_traceset_activate" last_modification_time="Tue, 10 Jun 2003 15:03:22 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="FileMenuNewSep">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="Tab">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Tab</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_tab_activate" last_modification_time="Tue, 10 Jun 2003 15:03:37 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="OpenTraceset">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Open</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_open_activate" last_modification_time="Tue, 10 Jun 2003 15:03:47 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="Close">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Close</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_close_activate" last_modification_time="Tue, 10 Jun 2003 15:03:56 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="CloseTab">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Close Tab</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_close_tab_activate" last_modification_time="Tue, 10 Jun 2003 15:04:06 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="FileMenuSeparator1">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="AddTrace">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Add Trace</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_add_trace_activate" last_modification_time="Tue, 10 Jun 2003 15:04:14 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="RemoveTrace">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Remove Trace</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_remove_trace_activate" last_modification_time="Tue, 10 Jun 2003 15:04:24 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="Save">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_save_activate" last_modification_time="Tue, 10 Jun 2003 15:04:36 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="SaveAs">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save As</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_save_as_activate" last_modification_time="Tue, 10 Jun 2003 15:04:45 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="FileMenuSeparator2">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="Quit">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Quit</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_quit_activate" last_modification_time="Tue, 10 Jun 2003 15:04:53 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="EditMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="EditMenuTitle_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="Cut">
+ <property name="visible">True</property>
+ <property name="label">gtk-cut</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_cut_activate" last_modification_time="Tue, 10 Jun 2003 15:05:00 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="Copy">
+ <property name="visible">True</property>
+ <property name="label">gtk-copy</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_copy_activate" last_modification_time="Tue, 10 Jun 2003 15:05:06 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="Paste">
+ <property name="visible">True</property>
+ <property name="label">gtk-paste</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_paste_activate" last_modification_time="Tue, 10 Jun 2003 15:05:14 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkImageMenuItem" id="Delete">
+ <property name="visible">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_delete_activate" last_modification_time="Tue, 10 Jun 2003 15:05:22 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ViewMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="ViewMenuTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="ZoomIn">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Zoom in</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_zoom_in_activate" last_modification_time="Tue, 10 Jun 2003 15:05:30 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ZoomOut">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Zoom out</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_zoom_out_activate" last_modification_time="Tue, 10 Jun 2003 15:05:37 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ZoomExtended">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Zoom extended</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_zoom_extended_activate" last_modification_time="Tue, 10 Jun 2003 15:05:44 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ViewMenuSeparator">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="GoToTime">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Go to time</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_go_to_time_activate" last_modification_time="Tue, 10 Jun 2003 15:05:50 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ShowTimeFrame">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show time frame</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_show_time_frame_activate" last_modification_time="Tue, 10 Jun 2003 15:06:00 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ToolMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Tools</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="ToolMenuTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="MoveViewerUp">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Move viewer up</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_move_viewer_up_activate" last_modification_time="Tue, 10 Jun 2003 15:06:05 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="MoveViewerDown">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Move viewer down</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_move_viewer_down_activate" last_modification_time="Tue, 10 Jun 2003 15:06:14 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="RemoveViewer">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Remove viewer</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_remove_viewer_activate" last_modification_time="Tue, 10 Jun 2003 15:06:21 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="ToolMenuSeparator">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="insert_viewer_test">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Insert viewer test</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_insert_viewer_test_activate" last_modification_time="Mon, 16 Jun 2003 16:43:52 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="PluginMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Plugins</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="PluginMenuTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="LoadModule">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Load module</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_load_module_activate" last_modification_time="Tue, 10 Jun 2003 15:06:30 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="UnloadModule">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Unload module</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_unload_module_activate" last_modification_time="Tue, 10 Jun 2003 15:06:39 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="AddModuleSearchPath">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Add module search path</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_add_module_search_path_activate" last_modification_time="Tue, 10 Jun 2003 15:06:50 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="OptionMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Options</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="OptionMenuTitle_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="Color">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Color</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_color_activate" last_modification_time="Tue, 10 Jun 2003 15:06:58 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="OptMenuSeparator">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="OpenFilter">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Filter</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_filter_activate" last_modification_time="Tue, 10 Jun 2003 15:07:04 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="SaveConfiguration">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save configuration</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_save_configuration_activate" last_modification_time="Tue, 10 Jun 2003 15:07:12 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkMenuBar" id="MenuHelp">
+ <property name="visible">True</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="HelpMenuTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="HelpMenu">
+
+ <child>
+ <widget class="GtkMenuItem" id="Content">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Content</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_content_activate" last_modification_time="Tue, 10 Jun 2003 15:07:19 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="HelpmenuSeparator">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="About">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">About...</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_about_activate" last_modification_time="Tue, 10 Jun 2003 15:07:28 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolbar" id="MToolbar1">
+ <property name="visible">True</property>
+ <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+ <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
+ <property name="tooltips">True</property>
+
+ <child>
+ <widget class="button" id="tlbEmptyTraceset">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">New window with empty trace set</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">filenew.png</property>
+ <signal name="clicked" handler="on_button_new_clicked" last_modification_time="Thu, 05 Jun 2003 18:24:14 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbOpenTraceset">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">open a trace set</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">fileopen.png</property>
+ <signal name="clicked" handler="on_button_open_clicked" last_modification_time="Thu, 05 Jun 2003 18:24:37 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbAddTrace">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Add a trace </property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">edit_add_22.png</property>
+ <signal name="clicked" handler="on_button_add_trace_clicked" last_modification_time="Thu, 05 Jun 2003 18:30:00 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbRemoveTrace">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Remove a trace</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">edit_remove_22.png</property>
+ <signal name="clicked" handler="on_button_remove_trace_clicked" last_modification_time="Thu, 05 Jun 2003 18:30:09 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbSave">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">save the current trace set</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">filesave.png</property>
+ <signal name="clicked" handler="on_button_save_clicked" last_modification_time="Thu, 05 Jun 2003 18:25:30 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbSaveAs">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">save as </property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">filesaveas.png</property>
+ <signal name="clicked" handler="on_button_save_as_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:10 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbZoomIn">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Zoom in</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">stock_zoom_in_24.png</property>
+ <property name="new_group">True</property>
+ <signal name="clicked" handler="on_button_zoom_in_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:01 GMT"/>
+ </widget>
+ <packing>
+ <property name="new_group">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbZoomOut">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Zoom out</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">stock_zoom_out_24.png</property>
+ <signal name="clicked" handler="on_button_zoom_out_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:32 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbZoomExtended">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Zoom extended</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">stock_zoom_fit_24.png</property>
+ <signal name="clicked" handler="on_button_zoom_extended_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:48 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbGoToTime">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Go to time</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">gtk-jump-to.png</property>
+ <signal name="clicked" handler="on_button_go_to_time_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:07 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbShowTimeFrame">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Show time frame</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">mini-display.xpm</property>
+ <signal name="clicked" handler="on_button_show_time_frame_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:21 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbMoveViewerUp">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Move up current viewer</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">1uparrow.png</property>
+ <property name="new_group">True</property>
+ <signal name="clicked" handler="on_button_move_up_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:41 GMT"/>
+ </widget>
+ <packing>
+ <property name="new_group">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbMoveViewerDown">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Move down current viewer</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">1downarrow.png</property>
+ <signal name="clicked" handler="on_button_move_down_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:59 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="button" id="tlbRemoveViewer">
+ <property name="border_width">1</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Delete current viewer</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">True</property>
+ <property name="icon">remove.png</property>
+ <signal name="clicked" handler="on_button_delete_viewer_clicked" last_modification_time="Thu, 05 Jun 2003 18:29:26 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkToolbar" id="MToolbar2">
+ <property name="visible">True</property>
+ <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+ <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+ <property name="tooltips">True</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkNotebook" id="MNotebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">True</property>
+ <property name="show_border">True</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+ <signal name="switch_page" handler="on_MNotebook_switch_page" last_modification_time="Tue, 17 Jun 2003 17:00:29 GMT"/>
+
+ <child>
+ <placeholder/>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkStatusbar" id="MStatusbar">
+ <property name="visible">True</property>
+ <property name="has_resize_grip">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
--- /dev/null
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+ <name>MainWin</name>
+ <program_name>mainwin</program_name>
+ <gnome_support>FALSE</gnome_support>
+ <gettext_support>FALSE</gettext_support>
+ <output_build_files>FALSE</output_build_files>
+ <backup_source_files>FALSE</backup_source_files>
+</glade-project>
+++ /dev/null
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="MWindow">
- <property name="width_request">100</property>
- <property name="height_request">50</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Main window</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">600</property>
- <property name="default_height">400</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <signal name="destroy" handler="on_MWindow_destroy" last_modification_time="Tue, 10 Jun 2003 16:31:35 GMT"/>
-
- <child>
- <widget class="GtkVBox" id="MVbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="MMenuBox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkMenuBar" id="MenuMain">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="FileMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="FileMenuTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="FileMenuNewTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="FileMenuNewTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="EmptyTraceset">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Empty trace set</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_empty_traceset_activate" last_modification_time="Tue, 10 Jun 2003 15:03:01 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="CloneTraceset">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Clone trace set</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_clone_traceset_activate" last_modification_time="Tue, 10 Jun 2003 15:03:22 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="FileMenuNewSep">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="Tab">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Tab</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_tab_activate" last_modification_time="Tue, 10 Jun 2003 15:03:37 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="OpenTraceset">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Open</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_open_activate" last_modification_time="Tue, 10 Jun 2003 15:03:47 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="Close">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Close</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_close_activate" last_modification_time="Tue, 10 Jun 2003 15:03:56 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="CloseTab">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Close Tab</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_close_tab_activate" last_modification_time="Tue, 10 Jun 2003 15:04:06 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="FileMenuSeparator1">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="AddTrace">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Add Trace</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_add_trace_activate" last_modification_time="Tue, 10 Jun 2003 15:04:14 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="RemoveTrace">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Remove Trace</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_remove_trace_activate" last_modification_time="Tue, 10 Jun 2003 15:04:24 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="Save">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Save</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_save_activate" last_modification_time="Tue, 10 Jun 2003 15:04:36 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="SaveAs">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Save As</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_save_as_activate" last_modification_time="Tue, 10 Jun 2003 15:04:45 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="FileMenuSeparator2">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="Quit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Quit</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_quit_activate" last_modification_time="Tue, 10 Jun 2003 15:04:53 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="EditMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="EditMenuTitle_menu">
-
- <child>
- <widget class="GtkImageMenuItem" id="Cut">
- <property name="visible">True</property>
- <property name="label">gtk-cut</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_cut_activate" last_modification_time="Tue, 10 Jun 2003 15:05:00 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="Copy">
- <property name="visible">True</property>
- <property name="label">gtk-copy</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_copy_activate" last_modification_time="Tue, 10 Jun 2003 15:05:06 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="Paste">
- <property name="visible">True</property>
- <property name="label">gtk-paste</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_paste_activate" last_modification_time="Tue, 10 Jun 2003 15:05:14 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkImageMenuItem" id="Delete">
- <property name="visible">True</property>
- <property name="label">gtk-delete</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_delete_activate" last_modification_time="Tue, 10 Jun 2003 15:05:22 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ViewMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_View</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="ViewMenuTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="ZoomIn">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Zoom in</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_zoom_in_activate" last_modification_time="Tue, 10 Jun 2003 15:05:30 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ZoomOut">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Zoom out</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_zoom_out_activate" last_modification_time="Tue, 10 Jun 2003 15:05:37 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ZoomExtended">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Zoom extended</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_zoom_extended_activate" last_modification_time="Tue, 10 Jun 2003 15:05:44 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ViewMenuSeparator">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="GoToTime">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Go to time</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_go_to_time_activate" last_modification_time="Tue, 10 Jun 2003 15:05:50 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ShowTimeFrame">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show time frame</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_show_time_frame_activate" last_modification_time="Tue, 10 Jun 2003 15:06:00 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ToolMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Tools</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="ToolMenuTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="MoveViewerUp">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Move viewer up</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_move_viewer_up_activate" last_modification_time="Tue, 10 Jun 2003 15:06:05 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="MoveViewerDown">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Move viewer down</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_move_viewer_down_activate" last_modification_time="Tue, 10 Jun 2003 15:06:14 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="RemoveViewer">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Remove viewer</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_remove_viewer_activate" last_modification_time="Tue, 10 Jun 2003 15:06:21 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="ToolMenuSeparator">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="insert_viewer_test">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Insert viewer test</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_insert_viewer_test_activate" last_modification_time="Mon, 16 Jun 2003 16:43:52 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="PluginMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Plugins</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="PluginMenuTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="LoadModule">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Load module</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_load_module_activate" last_modification_time="Tue, 10 Jun 2003 15:06:30 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="UnloadModule">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Unload module</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_unload_module_activate" last_modification_time="Tue, 10 Jun 2003 15:06:39 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="AddModuleSearchPath">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Add module search path</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_add_module_search_path_activate" last_modification_time="Tue, 10 Jun 2003 15:06:50 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="OptionMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Options</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="OptionMenuTitle_menu">
-
- <child>
- <widget class="GtkMenuItem" id="Color">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Color</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_color_activate" last_modification_time="Tue, 10 Jun 2003 15:06:58 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="OptMenuSeparator">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="OpenFilter">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Filter</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_filter_activate" last_modification_time="Tue, 10 Jun 2003 15:07:04 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="SaveConfiguration">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Save configuration</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_save_configuration_activate" last_modification_time="Tue, 10 Jun 2003 15:07:12 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkMenuBar" id="MenuHelp">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="HelpMenuTitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
-
- <child>
- <widget class="GtkMenu" id="HelpMenu">
-
- <child>
- <widget class="GtkMenuItem" id="Content">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Content</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_content_activate" last_modification_time="Tue, 10 Jun 2003 15:07:19 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="HelpmenuSeparator">
- <property name="visible">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="About">
- <property name="visible">True</property>
- <property name="label" translatable="yes">About...</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_about_activate" last_modification_time="Tue, 10 Jun 2003 15:07:28 GMT"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkToolbar" id="MToolbar1">
- <property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
- <property name="tooltips">True</property>
-
- <child>
- <widget class="button" id="tlbEmptyTraceset">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">New window with empty trace set</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">filenew.png</property>
- <signal name="clicked" handler="on_button_new_clicked" last_modification_time="Thu, 05 Jun 2003 18:24:14 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbOpenTraceset">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">open a trace set</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">fileopen.png</property>
- <signal name="clicked" handler="on_button_open_clicked" last_modification_time="Thu, 05 Jun 2003 18:24:37 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbAddTrace">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Add a trace </property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">edit_add_22.png</property>
- <signal name="clicked" handler="on_button_add_trace_clicked" last_modification_time="Thu, 05 Jun 2003 18:30:00 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbRemoveTrace">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Remove a trace</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">edit_remove_22.png</property>
- <signal name="clicked" handler="on_button_remove_trace_clicked" last_modification_time="Thu, 05 Jun 2003 18:30:09 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbSave">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">save the current trace set</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">filesave.png</property>
- <signal name="clicked" handler="on_button_save_clicked" last_modification_time="Thu, 05 Jun 2003 18:25:30 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbSaveAs">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">save as </property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">filesaveas.png</property>
- <signal name="clicked" handler="on_button_save_as_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:10 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbZoomIn">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Zoom in</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">stock_zoom_in_24.png</property>
- <property name="new_group">True</property>
- <signal name="clicked" handler="on_button_zoom_in_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:01 GMT"/>
- </widget>
- <packing>
- <property name="new_group">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="button" id="tlbZoomOut">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Zoom out</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">stock_zoom_out_24.png</property>
- <signal name="clicked" handler="on_button_zoom_out_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:32 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbZoomExtended">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Zoom extended</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">stock_zoom_fit_24.png</property>
- <signal name="clicked" handler="on_button_zoom_extended_clicked" last_modification_time="Thu, 05 Jun 2003 18:26:48 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbGoToTime">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Go to time</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">gtk-jump-to.png</property>
- <signal name="clicked" handler="on_button_go_to_time_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:07 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbShowTimeFrame">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Show time frame</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">mini-display.xpm</property>
- <signal name="clicked" handler="on_button_show_time_frame_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:21 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbMoveViewerUp">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Move up current viewer</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">1uparrow.png</property>
- <property name="new_group">True</property>
- <signal name="clicked" handler="on_button_move_up_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:41 GMT"/>
- </widget>
- <packing>
- <property name="new_group">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="button" id="tlbMoveViewerDown">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Move down current viewer</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">1downarrow.png</property>
- <signal name="clicked" handler="on_button_move_down_clicked" last_modification_time="Thu, 05 Jun 2003 18:28:59 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="button" id="tlbRemoveViewer">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Delete current viewer</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">True</property>
- <property name="icon">remove.png</property>
- <signal name="clicked" handler="on_button_delete_viewer_clicked" last_modification_time="Thu, 05 Jun 2003 18:29:26 GMT"/>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkToolbar" id="MToolbar2">
- <property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
- <property name="tooltips">True</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="MNotebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
- <signal name="switch_page" handler="on_MNotebook_switch_page" last_modification_time="Tue, 17 Jun 2003 17:00:29 GMT"/>
-
- <child>
- <placeholder/>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkStatusbar" id="MStatusbar">
- <property name="visible">True</property>
- <property name="has_resize_grip">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
+++ /dev/null
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
-
-<glade-project>
- <name>MainWin</name>
- <program_name>mainwin</program_name>
- <gnome_support>FALSE</gnome_support>
- <gettext_support>FALSE</gettext_support>
- <output_build_files>FALSE</output_build_files>
- <backup_source_files>FALSE</backup_source_files>
-</glade-project>
#include "interface.h"
#include "support.h"
#include <lttv/lttv.h>
-#include <lttv/mainwindow.h>
-#include <lttv/menu.h>
-#include <lttv/toolbar.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/mainwindow.h>
+#include <lttvgui/menu.h>
+#include <lttvgui/toolbar.h>
+#include <lttvgui/gtktraceset.h>
#include <lttv/module.h>
-#include <lttv/gtkdirsel.h>
+#include <lttvgui/gtkdirsel.h>
#include <lttv/iattribute.h>
-#include <lttv/lttvfilter.h>
+#include <lttvgui/lttvfilter.h>
#include <ltt/trace.h>
#include <ltt/facility.h>
*/
#include <gtk/gtk.h>
-#include <lttv/common.h>
-#include <lttv/mainwindow.h>
+#include <lttvgui/common.h>
+#include <lttvgui/mainwindow.h>
/* internal functions */
#include "gdk/gdkkeysyms.h"
#include <gtk/gtk.h>
-#include <lttv/gtkdirsel.h>
+#include <lttvgui/gtkdirsel.h>
#define _(A) A
#define WANT_HPANED 1
#include <gtk/gtk.h>
-#include <lttv/gtkmultivpaned.h>
+#include <lttvgui/gtkmultivpaned.h>
//#include "gtkintl.h"
-#include <lttv/mainwindow.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/mainwindow.h>
+#include <lttvgui/gtktraceset.h>
static void gtk_multi_vpaned_class_init (GtkMultiVPanedClass *klass);
static void gtk_multi_vpaned_init (GtkMultiVPaned *multi_vpaned);
#include <lttv/tracecontext.h>
#include <lttv/state.h>
#include <lttv/stats.h>
-#include <lttv/menu.h>
-#include <lttv/toolbar.h>
+#include <lttvgui/menu.h>
+#include <lttvgui/toolbar.h>
#include "interface.h"
#include "support.h"
-#include <lttv/mainwindow.h>
+#include <lttvgui/mainwindow.h>
#include "callbacks.h"
#include <ltt/trace.h>
*/
-#include <lttv/lttvfilter.h>
+#include <lttvgui/lttvfilter.h>
#include <stdio.h>
#include <ltt/trace.h>
#include <ltt/type.h>
#include "interface.h"
#include "support.h"
-#include <lttv/mainWindow.h>
+#include <lttvgui/mainWindow.h>
#include "callbacks.h"
/* global variable */
+++ /dev/null
-#
-# Makefile for LTT New generation user interface : plugins.
-#
-# Created by Mathieu Desnoyers on May 6, 2003
-#
-
-libdir = ${lttvlibdir}
-
-AM_CFLAGS = $(GLIB_CFLAGS)
-AM_CFLAGS += $(GTK_CFLAGS)
-LIBS += $(GLIB_LIBS)
-LIBS += $(GTK_LIBS)
-
-lib_LTLIBRARIES = libmainwinapi.la
-libmainwinapi_la_SOURCES = toolbar.c menu.c gtktraceset.c
-#libmainwinapi_la_LDFLAGS = -L${top_srcdir}/lttv/modules/gui/API -lcustomBox
-
-lttvguiinclude_HEADERS = \
- common.h\
- gtkdirsel.h\
- gtkmultivpaned.h\
- gtktraceset.h\
- lttvfilter.h\
- mainwindow.h\
- menu.h\
- toolbar.h
-
-EXTRA_DIST =
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef COMMON_H
-#define COMMON_H
-
-#include <stdio.h>
-#include <ltt/ltt.h>
-#include <gtk/gtk.h>
-#include <lttv/lttvfilter.h>
-
-#define MAX_NUMBER_EVENT "MAX_NUMBER_EVENT"
-#define TRACESET_TIME_SPAN "TRACESET_TIME_SPAN"
-
-typedef struct _MainWindow MainWindow;
-typedef struct _Tab Tab;
-
-/* constructor of the viewer */
-typedef GtkWidget * (*lttv_constructor)(MainWindow * main_window,
- LttvTracesetSelector * s, char *key);
-typedef lttv_constructor view_constructor;
-
-typedef struct _TimeWindow {
- LttTime start_time;
- LttTime time_width;
-} TimeWindow;
-
-#endif // COMMON_H
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-
-#ifndef __GTK_DIR_SEL_H__
-#define __GTK_DIR_SEL_H__
-
-
-#include <gdk/gdk.h>
-#include <gtk/gtkdialog.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#define GTK_TYPE_DIR_SELECTION (gtk_dir_selection_get_type ())
-#define GTK_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelection))
-#define GTK_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
-#define GTK_IS_DIR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIR_SELECTION))
-#define GTK_IS_DIR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIR_SELECTION))
-#define GTK_DIR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIR_SELECTION, GtkDirSelectionClass))
-
-
-typedef struct _GtkDirSelection GtkDirSelection;
-typedef struct _GtkDirSelectionClass GtkDirSelectionClass;
-
-struct _GtkDirSelection
-{
- GtkDialog parent_instance;
-
- GtkWidget *dir_list;
- GtkWidget *file_list;
- GtkWidget *selection_entry;
- GtkWidget *selection_text;
- GtkWidget *main_vbox;
- GtkWidget *ok_button;
- GtkWidget *cancel_button;
- GtkWidget *help_button;
- GtkWidget *history_pulldown;
- GtkWidget *history_menu;
- GList *history_list;
- GtkWidget *fileop_dialog;
- GtkWidget *fileop_entry;
- gchar *fileop_file;
- gpointer cmpl_state;
-
- GtkWidget *fileop_c_dir;
- GtkWidget *fileop_del_file;
- GtkWidget *fileop_ren_file;
-
- GtkWidget *button_area;
- GtkWidget *action_area;
-
- GPtrArray *selected_names;
- gchar *last_selected;
-};
-
-struct _GtkDirSelectionClass
-{
- GtkDialogClass parent_class;
-
- /* Padding for future expansion */
- void (*_gtk_reserved1) (void);
- void (*_gtk_reserved2) (void);
- void (*_gtk_reserved3) (void);
- void (*_gtk_reserved4) (void);
-};
-
-
-GType gtk_dir_selection_get_type (void) G_GNUC_CONST;
-GtkWidget* gtk_dir_selection_new (const gchar *title);
-void gtk_dir_selection_set_filename (GtkDirSelection *filesel,
- const gchar *filename);
-/* This function returns the selected filename in the C runtime's
- * multibyte string encoding, which may or may not be the same as that
- * used by GDK (UTF-8). To convert to UTF-8, call g_filename_to_utf8().
- * The returned string points to a statically allocated buffer and
- * should be copied away.
- */
-G_CONST_RETURN gchar* gtk_dir_selection_get_filename (GtkDirSelection *filesel);
-
-void gtk_dir_selection_complete (GtkDirSelection *filesel,
- const gchar *pattern);
-void gtk_dir_selection_show_fileop_buttons (GtkDirSelection *filesel);
-void gtk_dir_selection_hide_fileop_buttons (GtkDirSelection *filesel);
-
-gchar** gtk_dir_selection_get_selections (GtkDirSelection *filesel);
-const gchar * gtk_dir_selection_get_dir (GtkDirSelection *filesel);
-void gtk_dir_selection_set_select_multiple (GtkDirSelection *filesel,
- gboolean select_multiple);
-gboolean gtk_dir_selection_get_select_multiple (GtkDirSelection *filesel);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GTK_DIR_SEL_H__ */
+++ /dev/null
-
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef __GTK_MULTI_VPANED_H__
-#define __GTK_MULTI_VPANED_H__
-
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gdk/gdk.h>
-#include <gtk/gtkcontainer.h>
-#include <lttv/common.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#define GTK_TYPE_MULTI_VPANED (gtk_multi_vpaned_get_type ())
-#define GTK_MULTI_VPANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MULTI_VPANED, GtkMultiVPaned))
-#define GTK_MULTI_VPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MULTI_VPANED, GtkMultiVPanedClass))
-#define GTK_IS_MULTI_VPANED(obj ) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MULTI_VPANED))
-#define GTK_IS_MULTI_VPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MULTI_VPANED))
-#define GTK_MULTI_VPANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MULTI_VPANED, GtkMultiVPanedClass))
-
-
-typedef struct _GtkMultiVPaned GtkMultiVPaned;
-typedef struct _GtkMultiVPanedClass GtkMultiVPanedClass;
-
-struct _GtkMultiVPaned
-{
- GtkPaned container;
-
- /*< public >*/
- GtkPaned * first_pane;
- GtkPaned * last_pane;
- GtkPaned * focused_pane;
- GtkPaned * iter;
- guint num_children;
-
- GtkWidget * vbox;
- // GtkWidget * scrollWindow;
- // GtkWidget * viewport;
- GtkWidget * hscrollbar;
- GtkAdjustment *hadjust;
- MainWindow * mw;
-};
-
-struct _GtkMultiVPanedClass
-{
- GtkPanedClass parent_class;
-};
-
-
-GType gtk_multi_vpaned_get_type (void) G_GNUC_CONST;
-GtkWidget* gtk_multi_vpaned_new (void);
-
-void gtk_multi_vpaned_set_focus (GtkWidget * widget, gpointer user_data);
-void gtk_multi_vpaned_widget_add(GtkMultiVPaned * multi_vpaned, GtkWidget * widget1);
-void gtk_multi_vpaned_widget_delete(GtkMultiVPaned * multi_vpaned);
-void gtk_multi_vpaned_widget_move_up(GtkMultiVPaned * multi_vpaned);
-void gtk_multi_vpaned_widget_move_down(GtkMultiVPaned * multi_vpaned);
-void gtk_multi_vpaned_set_adjust(GtkMultiVPaned * multi_vpaned, gboolean first_time);
-void gtk_multi_vpaned_set_data(GtkMultiVPaned * multi_vpaned, char * key, gpointer value);
-gpointer gtk_multi_vpaned_get_data(GtkMultiVPaned * multi_vpaned, char * key);
-GtkWidget * gtk_multi_vpaned_get_widget(GtkMultiVPaned * multi_vpaned);
-GtkWidget * gtk_multi_vpaned_get_first_widget(GtkMultiVPaned * multi_vpaned);
-GtkWidget * gtk_multi_vpaned_get_next_widget(GtkMultiVPaned * multi_vpaned);
-void gtk_multi_vpaned_set_scroll_value(GtkMultiVPaned * multi_vpaned, double value);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GTK_MULTI_VPANED_H__ */
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 XangXiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-/*! \file gtktraceset.h
- * \brief API used by the graphical viewers to interact with their top window.
- *
- * Main window (gui module) is the place to contain and display viewers.
- * Viewers (lttv plugins) interacte with main window through this API and
- * events sent by gtk.
- * This header file should be included in each graphic module.
- * This library is used by graphical modules to interact with the
- * tracesetWindow.
- *
- */
-
-#include <lttv/common.h>
-#include <ltt/ltt.h>
-#include <lttv/lttv.h>
-#include <lttv/mainwindow.h>
-#include <lttv/gtktraceset.h>
-#include <lttv/tracecontext.h>
-#include <lttv/toolbar.h>
-#include <lttv/menu.h>
-#include <lttv/state.h>
-#include <lttv/stats.h>
-
-
-/**
- * Internal function parts
- */
-
-/**
- * Function to set/update traceset for the viewers
- * @param main_win main window
- * @param traceset traceset of the main window.
- */
-
-void SetTraceset(MainWindow * main_win, gpointer traceset)
-{
- LttvHooks * tmp;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
- "hooks/updatetraceset", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL)return;
- lttv_hooks_call(tmp,traceset);
-}
-
-
-/**
- * Function to set/update filter for the viewers
- * @param main_win main window
- * @param filter filter of the main window.
- */
-
-void SetFilter(MainWindow * main_win, gpointer filter)
-{
- LttvHooks * tmp;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
- "hooks/updatefilter", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
-
- if(tmp == NULL)return;
- lttv_hooks_call(tmp,filter);
-}
-
-
-
-/**
- * API parts
- */
-
-/**
- * Function to register a view constructor so that main window can generate
- * a toolbar item for the viewer in order to generate a new instance easily.
- * It will be called by init function of the module.
- * @param ButtonPixmap image shown on the toolbar item.
- * @param tooltip tooltip of the toolbar item.
- * @param view_constructor constructor of the viewer.
- */
-
-void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor)
-{
- LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
- LttvToolbars * toolbar;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(attributes_global,
- "viewers/toolbar", LTTV_POINTER, &value));
- toolbar = (LttvToolbars*)*(value.v_pointer);
-
- if(toolbar == NULL){
- toolbar = lttv_toolbars_new();
- *(value.v_pointer) = toolbar;
- }
- lttv_toolbars_add(toolbar, view_constructor, tooltip, pixmap);
-}
-
-
-/**
- * Function to unregister the viewer's constructor, release the space
- * occupied by pixmap, tooltip and constructor of the viewer.
- * It will be called when a module is unloaded.
- * @param view_constructor constructor of the viewer which is used as
- * a reference to find out where the pixmap and tooltip are.
- */
-
-void toolbar_item_unreg(lttv_constructor view_constructor)
-{
- LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
- LttvToolbars * toolbar;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(attributes_global,
- "viewers/toolbar", LTTV_POINTER, &value));
- toolbar = (LttvToolbars*)*(value.v_pointer);
-
- main_window_remove_toolbar_item(view_constructor);
-
- lttv_toolbars_remove(toolbar, view_constructor);
-}
-
-
-/**
- * Function to register a view constructor so that main window can generate
- * a menu item for the viewer in order to generate a new instance easily.
- * It will be called by init function of the module.
- * @param menu_path path of the menu item.
- * @param menu_text text of the menu item.
- * @param view_constructor constructor of the viewer.
- */
-
-void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor)
-{
- LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
- LttvMenus * menu;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(attributes_global,
- "viewers/menu", LTTV_POINTER, &value));
- menu = (LttvMenus*)*(value.v_pointer);
-
- if(menu == NULL){
- menu = lttv_menus_new();
- *(value.v_pointer) = menu;
- }
- lttv_menus_add(menu, view_constructor, menu_path, menu_text);
-}
-
-/**
- * Function to unregister the viewer's constructor, release the space
- * occupied by menu_path, menu_text and constructor of the viewer.
- * It will be called when a module is unloaded.
- * @param view_constructor constructor of the viewer which is used as
- * a reference to find out where the menu_path and menu_text are.
- */
-
-void menu_item_unreg(lttv_constructor view_constructor)
-{
- LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
- LttvMenus * menu;
- LttvAttributeValue value;
-
- g_assert(lttv_iattribute_find_by_path(attributes_global,
- "viewers/menu", LTTV_POINTER, &value));
- menu = (LttvMenus*)*(value.v_pointer);
-
- main_window_remove_menu_item(view_constructor);
-
- lttv_menus_remove(menu, view_constructor);
-}
-
-
-/**
- * Update the status bar whenever something changed in the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param info the message which will be shown in the status bar.
- */
-
-void update_status(MainWindow *main_win, char *info)
-{
-}
-
-
-/**
- * Function to get the current time interval shown on the current tab.
- * It will be called by a viewer's hook function to update the
- * shown time interval of the viewer and also be called by the constructor
- * of the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param time_interval a pointer where time interval will be stored.
- */
-
-void get_time_window(MainWindow *main_win, TimeWindow *time_window)
-{
- //time_window->start_time = main_win->current_tab->time_window.start_time;
- //time_window->time_width = main_win->current_tab->time_window.time_width;
- *time_window = main_win->current_tab->time_window;
-}
-
-/**
- * Function to get the current time interval of the current traceset.
- * It will be called by a viewer's hook function to update the
- * time interval of the viewer and also be called by the constructor
- * of the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param time_interval a pointer where time interval will be stored.
- */
-
-void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_interval)
-{
- //time_window->start_time = main_win->current_tab->time_window.start_time;
- //time_window->time_width = main_win->current_tab->time_window.time_width;
- *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
- traceset_context)->Time_Span);
-}
-
-
-
-/**
- * Function to set the time interval of the current tab.
- * It will be called by a viewer's signal handle associated with
- * the move_slider signal
- * @param main_win the main window the viewer belongs to.
- * @param time_interval a pointer where time interval is stored.
- */
-
-void set_time_window(MainWindow *main_win, TimeWindow *time_window)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- main_win->current_tab->time_window = *time_window;
- gtk_multi_vpaned_set_scroll_value(main_win->current_tab->multi_vpaned,
- ltt_time_to_double(time_window->start_time)
- * NANOSECONDS_PER_SECOND );
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetimewindow", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_call(tmp, time_window);
-}
-
-
-/**
- * Function to get the current time/event of the current tab.
- * It will be called by a viewer's hook function to update the
- * current time/event of the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param time a pointer where time will be stored.
- */
-
-void get_current_time(MainWindow *main_win, LttTime *time)
-{
- time = &main_win->current_tab->current_time;
-}
-
-
-/**
- * Function to set the current time/event of the current tab.
- * It will be called by a viewer's signal handle associated with
- * the button-release-event signal
- * @param main_win the main window the viewer belongs to.
- * @param time a pointer where time is stored.
- */
-
-void set_current_time(MainWindow *main_win, LttTime *time)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- main_win->current_tab->current_time = *time;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatecurrenttime", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
-
- if(tmp == NULL)return;
- lttv_hooks_call(tmp, time);
-}
-
-
-/**
- * Function to get the traceset from the current tab.
- * It will be called by the constructor of the viewer and also be
- * called by a hook funtion of the viewer to update its traceset.
- * @param main_win the main window the viewer belongs to.
- * @param traceset a pointer to a traceset.
- */
-/*
-void get_traceset(MainWindow *main_win, Traceset *traceset)
-{
-}
-*/
-
-/**
- * Function to get the filter of the current tab.
- * It will be called by the constructor of the viewer and also be
- * called by a hook funtion of the viewer to update its filter.
- * @param main_win, the main window the viewer belongs to.
- * @param filter, a pointer to a filter.
- */
-/*
-void get_filter(MainWindow *main_win, Filter *filter)
-{
-}
-*/
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * time interval.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_time_window(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetimewindow", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook,hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the time interval of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_time_window(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetimewindow", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * traceset.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_traceset(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetraceset", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the traceset of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_traceset(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetraceset", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to redraw each viewer belonging to the current tab
- * @param main_win the main window the viewer belongs to.
- */
-
-void update_traceset(MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatetraceset", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_call(tmp, NULL);
-}
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * filter.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_filter(LttvHook hook, gpointer hook_data,
- MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
- "hooks/updatefilter", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the filter of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_filter(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
- "hooks/updatefilter", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * current time.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_current_time(LttvHook hook, gpointer hook_data,
- MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatecurrenttime", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the current time of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_current_time(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/updatecurrenttime", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to register a hook function for a viewer to show
- *the content of the viewer.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_show_viewer(LttvHook hook, gpointer hook_data,
- MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/showviewer", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * show the content of the viewer..
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_show_viewer(LttvHook hook, gpointer hook_data,
- MainWindow * main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/showviewer", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to show each viewer in the current tab.
- * It will be called by main window after it called process_traceset
- * @param main_win the main window the viewer belongs to.
- */
-
-void show_viewer(MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/showviewer", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_call(tmp, NULL);
-}
-
-
-/**
- * Function to set the focused pane (viewer).
- * It will be called by a viewer's signal handle associated with
- * the grab_focus signal
- * @param main_win the main window the viewer belongs to.
- * @param paned a pointer to a pane where the viewer is contained.
- */
-
-void set_focused_pane(MainWindow *main_win, gpointer paned)
-{
- gtk_multi_vpaned_set_focus((GtkWidget*)main_win->current_tab->multi_vpaned,paned);
-}
-
-
-/**
- * Function to register a hook function for a viewer to set/update the
- * dividor of the hpane.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_dividor(LttvHook hook, gpointer hook_data,
- MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/hpanedividor", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL){
- tmp = lttv_hooks_new();
- *(value.v_pointer) = tmp;
- }
- lttv_hooks_add(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update hpane's dividor of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_dividor(LttvHook hook, gpointer hook_data,
- MainWindow *main_win)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/hpanedividor", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_remove_data(tmp, hook, hook_data);
-}
-
-
-/**
- * Function to set the position of the hpane's dividor (viewer).
- * It will be called by a viewer's signal handle associated with
- * the motion_notify_event event/signal
- * @param main_win the main window the viewer belongs to.
- * @param position position of the hpane's dividor.
- */
-
-void set_hpane_dividor(MainWindow *main_win, gint position)
-{
- LttvAttributeValue value;
- LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
- "hooks/hpanedividor", LTTV_POINTER, &value));
- tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL) return;
- lttv_hooks_call(tmp, &position);
-}
-
-
-/**
- * Function to process traceset. It will call lttv_process_trace,
- * each view will call this api to get events.
- * @param main_win the main window the viewer belongs to.
- * @param start the start time of the first event to be processed.
- * @param end the end time of the last event to be processed.
- */
-
-void process_traceset_api(MainWindow *main_win, LttTime start,
- LttTime end, unsigned maxNumEvents)
-{
- lttv_process_traceset_seek_time(
- LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
- traceset_context),
- start);
- lttv_process_traceset(
- LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
- traceset_context),
- end,
- maxNumEvents);
-}
-
-/**
- * Function to add hooks into the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * register hooks
- * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
- */
-
-void context_add_hooks_api(MainWindow *main_win ,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- LttvTracesetContext * tsc =
- LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
- traceset_context);
- lttv_traceset_context_add_hooks(tsc,before_traceset,after_traceset,
- check_trace,before_trace,after_trace,
- check_tracefile,before_tracefile,after_tracefile,
- check_event,before_event, after_event);
-}
-
-
-/**
- * Function to remove hooks from the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * unregister hooks
- * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
- */
-
-void context_remove_hooks_api(MainWindow *main_win ,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event)
-{
- LttvTracesetContext * tsc =
- LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->traceset_context);
- lttv_traceset_context_remove_hooks(tsc,before_traceset,after_traceset,
- check_trace,before_trace,after_trace,
- check_tracefile,before_tracefile,after_tracefile,
- check_event,before_event, after_event);
-}
-
-
-/**
- * Function to add/remove event hooks for state
- * @param main_win the main window the viewer belongs to.
- */
-
-void state_add_event_hooks_api(MainWindow *main_win )
-{
- lttv_state_add_event_hooks(
- (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
-}
-
-void state_remove_event_hooks_api(MainWindow *main_win )
-{
- lttv_state_remove_event_hooks(
- (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
-}
-
-
-/**
- * Function to add/remove event hooks for stats
- * @param main_win the main window the viewer belongs to.
- */
-
-void stats_add_event_hooks_api(MainWindow *main_win )
-{
- lttv_stats_add_event_hooks(
- (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
-}
-
-void stats_remove_event_hooks_api(MainWindow *main_win )
-{
- lttv_stats_remove_event_hooks(
- (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
-}
-
-/**
- * Function to get the stats of the traceset
- * @param main_win the main window the viewer belongs to.
- */
-
-LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win)
-{
- return main_win->current_tab->traceset_info->traceset_context;
-}
-
-
-LttvTracesetContext* get_traceset_context(MainWindow *main_win)
-{
- return (LttvTracesetContext*)main_win->current_tab->traceset_info->traceset_context;
-}
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-/*
-CHECK Rename to viewer.h
-
-Things that can happen to a viewer:
-
-update_time_window
-update_current_time
-update_traceset
-update_filter
-show_viewer
-update_dividor
-?? Reshape, damage ??
-
-Things that a viewer can do:
-
-update_status
-set_time_window
-set_current_time
-update_traceset?
-update_filter?
-show_viewer?
-set_focused_pane
-set_hpane_dividor
-*/
-
-
-
-
-/*! \file gtktraceset.h
- * \brief API used by the graphical viewers to interact with their top window.
- *
- * Main window (gui module) is the place to contain and display viewers.
- * Viewers (lttv plugins) interacte with main window through this API and
- * events sent by gtk.
- * This header file should be included in each graphic module.
- * This library is used by graphical modules to interact with the
- * tracesetWindow.
- *
- */
-
-#include <gtk/gtk.h>
-#include <ltt/ltt.h>
-#include <lttv/hook.h>
-#include <lttv/common.h>
-#include <lttv/stats.h>
-
-/**
- * Function to register a view constructor so that main window can generate
- * a toolbar item for the viewer in order to generate a new instance easily.
- * It will be called by init function of the module.
- * @param ButtonPixmap image shown on the toolbar item.
- * @param tooltip tooltip of the toolbar item.
- * @param view_constructor constructor of the viewer.
- */
-
-void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
-
-
-/**
- * Function to unregister the viewer's constructor, release the space
- * occupied by pixmap, tooltip and constructor of the viewer.
- * It will be called when a module is unloaded.
- * @param view_constructor constructor of the viewer which is used as
- * a reference to find out where the pixmap and tooltip are.
- */
-
-void toolbar_item_unreg(lttv_constructor view_constructor);
-
-
-/**
- * Function to register a view constructor so that main window can generate
- * a menu item for the viewer in order to generate a new instance easily.
- * It will be called by init function of the module.
- * @param menu_path path of the menu item.
- * @param menu_text text of the menu item.
- * @param view_constructor constructor of the viewer.
- */
-
-void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
-
-
-/**
- * Function to unregister the viewer's constructor, release the space
- * occupied by menu_path, menu_text and constructor of the viewer.
- * It will be called when a module is unloaded.
- * @param view_constructor constructor of the viewer which is used as
- * a reference to find out where the menu_path and menu_text are.
- */
-
-void menu_item_unreg(lttv_constructor view_constructor);
-
-
-/**
- * Update the status bar whenever something changed in the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param info the message which will be shown in the status bar.
- */
-
-void update_status(MainWindow *main_win, char *info);
-
-
-/**
- * Function to get the current time window of the current tab.
- * It will be called by a viewer's hook function to update the
- * time window of the viewer and also be called by the constructor
- * of the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param time_interval a pointer where time interval will be stored.
- */
-
-void get_time_window(MainWindow *main_win, TimeWindow *time_window);
-
-
-/**
- * Function to set the time interval of the current tab.
- * It will be called by a viewer's signal handle associated with
- * the move_slider signal
- * @param main_win the main window the viewer belongs to.
- * @param time_interval a pointer where time interval is stored.
- */
-
-void set_time_window(MainWindow *main_win, TimeWindow *time_window);
-
-/**
- * Function to get the current time/event of the current tab.
- * It will be called by a viewer's hook function to update the
- * current time/event of the viewer.
- * @param main_win the main window the viewer belongs to.
- * @param time a pointer where time will be stored.
- */
-
-void get_current_time(MainWindow *main_win, LttTime *time);
-
-
-/**
- * Function to set the current time/event of the current tab.
- * It will be called by a viewer's signal handle associated with
- * the button-release-event signal
- * @param main_win the main window the viewer belongs to.
- * @param time a pointer where time is stored.
- */
-
-void set_current_time(MainWindow *main_win, LttTime *time);
-
-
-/**
- * Function to get the traceset from the current tab.
- * It will be called by the constructor of the viewer and also be
- * called by a hook funtion of the viewer to update its traceset.
- * @param main_win the main window the viewer belongs to.
- * @param traceset a pointer to a traceset.
- */
-
-//void get_traceset(MainWindow *main_win, Traceset *traceset);
-
-
-/**
- * Function to get the filter of the current tab.
- * It will be called by the constructor of the viewer and also be
- * called by a hook funtion of the viewer to update its filter.
- * @param main_win, the main window the viewer belongs to.
- * @param filter, a pointer to a filter.
- */
-
-//void get_filter(MainWindow *main_win, Filter *filter);
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * time interval.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer. Takes a TimeInterval* as call_data.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_time_window(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the time interval of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer. Takes a TimeInterval as call_data.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_time_window(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * traceset.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_traceset(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the traceset of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_traceset(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to redraw each viewer belonging to the current tab
- * @param main_win the main window the viewer belongs to.
- */
-
-void update_traceset(MainWindow * main_win);
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * filter.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_filter(LttvHook hook, gpointer hook_data,
- MainWindow *main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the filter of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_filter(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
- * current time.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_current_time(LttvHook hook, gpointer hook_data,
- MainWindow *main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update the current time of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_current_time(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to register a hook function for a viewer to show
- *the content of the viewer.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_show_viewer(LttvHook hook, gpointer hook_data,
- MainWindow *main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * show the content of the viewer..
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_show_viewer(LttvHook hook, gpointer hook_data,
- MainWindow * main_win);
-
-
-/**
- * Function to show each viewer in the current tab.
- * It will be called by main window after it called process_traceset
- * @param main_win the main window the viewer belongs to.
- */
-
-void show_viewer(MainWindow *main_win);
-
-
-/**
- * Function to set the focused pane (viewer).
- * It will be called by a viewer's signal handle associated with
- * the grab_focus signal
- * @param main_win the main window the viewer belongs to.
- * @param paned a pointer to a pane where the viewer is contained.
- */
-
-void set_focused_pane(MainWindow *main_win, gpointer paned);
-
-
-/**
- * Function to register a hook function for a viewer to set/update the
- * dividor of the hpane.
- * It will be called by the constructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void reg_update_dividor(LttvHook hook, gpointer hook_data,
- MainWindow *main_win);
-
-
-/**
- * Function to unregister a viewer's hook function which is used to
- * set/update hpane's dividor of the viewer.
- * It will be called by the destructor of the viewer.
- * @param hook hook function of the viewer.
- * @param hook_data hook data associated with the hook function.
- * @param main_win the main window the viewer belongs to.
- */
-
-void unreg_update_dividor(LttvHook hook, gpointer hook_data,
- MainWindow *main_win);
-
-
-/**
- * Function to set the position of the hpane's dividor (viewer).
- * It will be called by a viewer's signal handle associated with
- * the motion_notify_event event/signal
- * @param main_win the main window the viewer belongs to.
- * @param position position of the hpane's dividor.
- */
-
-void set_hpane_dividor(MainWindow *main_win, gint position);
-
-
-/*
-CHECK These functions really should not appear here. Directr calls would
-be OK unless there is a linker problem.
-*/
-/**
- * Function to process traceset. It will call lttv_process_trace,
- * each view will call this api to get events.
- * @param main_win the main window the viewer belongs to.
- * @param start the start time of the first event to be processed.
- * @param end the end time of the last event to be processed.
- */
-
-void process_traceset_api(MainWindow *main_win, LttTime start,
- LttTime end, unsigned maxNumEvents);
-
-
-/**
- * Function to add hooks into the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * register hooks
- * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
- */
-
-void context_add_hooks_api(MainWindow *main_win ,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event);
-
-
-/**
- * Function to remove hooks from the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * unregister hooks
- * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
- */
-
-void context_remove_hooks_api(MainWindow *main_win ,
- LttvHooks *before_traceset,
- LttvHooks *after_traceset,
- LttvHooks *check_trace,
- LttvHooks *before_trace,
- LttvHooks *after_trace,
- LttvHooks *check_tracefile,
- LttvHooks *before_tracefile,
- LttvHooks *after_tracefile,
- LttvHooks *check_event,
- LttvHooks *before_event,
- LttvHooks *after_event);
-
-
-/**
- * Function to get the life span of the traceset
- * @param main_win the main window the viewer belongs to.
- * @param start start time of the traceset.
- * @param end end time of the traceset.
- */
-
-void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_span);
-
-
-/**
- * Function to add/remove event hooks for state
- * @param main_win the main window the viewer belongs to.
- */
-
-void state_add_event_hooks_api(MainWindow *main_win );
-void state_remove_event_hooks_api(MainWindow *main_win );
-
-
-/**
- * Function to add/remove event hooks for stats
- * @param main_win the main window the viewer belongs to.
- */
-
-void stats_add_event_hooks_api(MainWindow *main_win );
-void stats_remove_event_hooks_api(MainWindow *main_win );
-
-
-/**
- * Function to get the stats of the traceset
- * @param main_win the main window the viewer belongs to.
- */
-
-LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win);
-
-LttvTracesetContext* get_traceset_context(MainWindow *main_win);
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef LTTV_FILTER_H
-#define LTTV_FILTER_H
-
-#include <ltt/ltt.h>
-
-
-typedef struct _LttvTracesetSelector LttvTracesetSelector;
-typedef struct _LttvTraceSelector LttvTraceSelector;
-typedef struct _LttvTracefileSelector LttvTracefileSelector;
-typedef struct _LttvEventtypeSelector LttvEventtypeSelector;
-
-
-LttvTracesetSelector *lttv_traceset_selector_new(char * name);
-LttvTraceSelector *lttv_trace_selector_new(LttTrace *t);
-LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t);
-LttvEventtypeSelector *lttv_eventtype_selector_new(LttEventType * et);
-void lttv_traceset_selector_destroy(LttvTracesetSelector *s);
-void lttv_trace_selector_destroy(LttvTraceSelector *t);
-void lttv_tracefile_selector_destroy(LttvTracefileSelector *t);
-void lttv_eventtype_selector_destroy(LttvEventtypeSelector *t);
-
-
-void lttv_traceset_selector_trace_add(LttvTracesetSelector *s,
- LttvTraceSelector *t);
-unsigned lttv_traceset_selector_trace_number(LttvTracesetSelector *s);
-LttvTraceSelector *lttv_traceset_selector_trace_get(LttvTracesetSelector *s,
- unsigned i);
-void lttv_traceset_selector_trace_remove(LttvTracesetSelector *s,
- unsigned i);
-
-
-void lttv_trace_selector_tracefile_add(LttvTraceSelector *s,
- LttvTracefileSelector *t);
-unsigned lttv_trace_selector_tracefile_number(LttvTraceSelector *s);
-LttvTracefileSelector *lttv_trace_selector_tracefile_get(LttvTraceSelector *s,
- unsigned i);
-void lttv_trace_selector_tracefile_remove(LttvTraceSelector *s, unsigned i);
-
-void lttv_trace_selector_eventtype_add(LttvTraceSelector *s,
- LttvEventtypeSelector *et);
-unsigned lttv_trace_selector_eventtype_number(LttvTraceSelector *s);
-LttvEventtypeSelector *lttv_trace_selector_eventtype_get(LttvTraceSelector *s,
- unsigned i);
-void lttv_trace_selector_eventtype_remove(LttvTraceSelector *s, unsigned i);
-
-
-void lttv_tracefile_selector_eventtype_add(LttvTracefileSelector *s,
- LttvEventtypeSelector *et);
-unsigned lttv_tracefile_selector_eventtype_number(LttvTracefileSelector *s);
-LttvEventtypeSelector *lttv_tracefile_selector_eventtype_get(LttvTracefileSelector *s,
- unsigned i);
-void lttv_tracefile_selector_eventtype_remove(LttvTracefileSelector *s, unsigned i);
-
-
-void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g);
-void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g);
-void lttv_eventtype_selector_set_selected(LttvEventtypeSelector *s, gboolean g);
-gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s);
-gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s);
-gboolean lttv_eventtype_selector_get_selected(LttvEventtypeSelector *s);
-char * lttv_traceset_selector_get_name(LttvTracesetSelector *s);
-char * lttv_trace_selector_get_name(LttvTraceSelector *s);
-char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s);
-char * lttv_eventtype_selector_get_name(LttvEventtypeSelector *s);
-
-LttvEventtypeSelector * lttv_eventtype_selector_clone(LttvEventtypeSelector * s);
-void lttv_eventtype_selector_copy(LttvTraceSelector *s, LttvTracefileSelector *d);
-
-
-#endif // LTTV_FILTER_H
-
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef _MAIN_WINDOW_
-#define _MAIN_WINDOW_
-
-#include <gtk/gtk.h>
-
-#include <ltt/ltt.h>
-#include <lttv/attribute.h>
-#include <lttv/traceset.h>
-#include <lttv/tracecontext.h>
-
-#include <lttv/common.h>
-#include <lttv/gtkmultivpaned.h>
-#include <lttv/hook.h>
-#include <lttv/stats.h>
-
-typedef struct _TracesetInfo {
- //FIXME? TracesetContext and stats in same or different variable ?
- LttvTracesetStats * traceset_context;
- LttvTraceset * traceset;
-} TracesetInfo ;
-
-
-struct _MainWindow{
- GtkWidget* mwindow; /* Main Window */
- int window_width;
-
- /* Status bar information */
- // guint MainSBarContextID; /* Context ID of main status bar */
- // guint BegTimeSBarContextID; /* Context ID of BegTime status bar */
- // guint EndTimeSBarContextID; /* Context ID of EndTime status bar */
-
- /* Child windows */
- //openTracesetWindow* OpenTracesetWindow;/* Window to get prof and proc file*/
- //viewTimeFrameWindow* ViewTimeFrameWindow;/*Window to select time frame */
- //gotoEventWindow* GotoEventWindow; /*search for event description*/
- //openFilterWindow* OpenFilterWindow; /* Open a filter selection window */
- GtkWidget* help_contents;/* Window to display help contents */
- GtkWidget* about_box; /* Window about information */
-
- // lttv_trace_filter * filter; /* trace filter associated with the window */
-
- /* Attributes for trace reading hooks local to the main window */
- LttvIAttribute * attributes;
-
- Tab * tab;
- Tab * current_tab;
-
- GHashTable * hash_menu_item;
- GHashTable * hash_toolbar_item;
-};
-
-
-struct _Tab{
- GtkWidget * label;
- GtkMultiVPaned * multi_vpaned;
-
- // startTime is the left of the visible area. Corresponds to the scrollbar
- // value.
- // Time_Width is a zoom dependant value (corresponding to page size)
- TimeWindow time_window;
-
- // The current time is the time selected in the visible area by the user,
- // not the scrollbar value.
- LttTime current_time;
- LttvIAttribute * attributes;
-
- struct _Tab * next;
- MainWindow * mw;
-
- /* Traceset related information */
- TracesetInfo * traceset_info;
-};
-
-/**
- * Remove menu and toolbar item when a module unloaded
- */
-void main_window_remove_menu_item(lttv_constructor view_constructor);
-void main_window_remove_toolbar_item(lttv_constructor view_constructor);
-
-#endif /* _MAIN_WINDOW_ */
-
-
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 XangXiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#include <lttv/lttv.h>
-#include <lttv/menu.h>
-
-
-inline LttvMenus *lttv_menus_new() {
- return g_array_new(FALSE, FALSE, sizeof(lttv_menu_closure));
-}
-
-/* MD: delete elements of the array also, but don't free pointed addresses
- * (functions).
- */
-inline void lttv_menus_destroy(LttvMenus *h) {
- g_debug("lttv_menus_destroy()");
- g_array_free(h, TRUE);
-}
-
-inline void lttv_menus_add(LttvMenus *h, lttv_constructor f, char* menuPath, char* menuText)
-{
- lttv_menu_closure c;
-
- /* if h is null, do nothing, or popup a warning message */
- if(h == NULL)return;
-
- c.con = f;
- c.menuPath = menuPath;
- c.menuText = menuText;
- g_array_append_val(h,c);
-}
-
-gboolean lttv_menus_remove(LttvMenus *h, lttv_constructor f)
-{
- lttv_menu_closure * tmp;
- gint i;
- for(i=0;i<h->len;i++){
- tmp = & g_array_index(h, lttv_menu_closure, i);
- if(tmp->con == f)break;
- }
- if(i<h->len){
- g_array_remove_index(h, i);
- return TRUE;
- }else return FALSE;
-
-}
-
-unsigned lttv_menus_number(LttvMenus *h)
-{
- return h->len;
-}
-
-
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef MENU_H
-#define MENU_H
-
-#include <lttv/common.h>
-
-/* constructor of the viewer */
-//typedef GtkWidget* (*lttv_constructor)(void * main_window);
-
-
-typedef GArray LttvMenus;
-
-typedef struct _lttv_menu_closure {
- lttv_constructor con;
- char * menuPath;
- char * menuText;
-} lttv_menu_closure;
-
-
-LttvMenus *lttv_menus_new();
-
-void lttv_menus_destroy(LttvMenus *h);
-
-void lttv_menus_add(LttvMenus *h, lttv_constructor f, char* menuPath, char * menuText);
-
-gboolean lttv_menus_remove(LttvMenus *h, lttv_constructor f);
-
-unsigned lttv_menus_number(LttvMenus *h);
-
-#endif // MENU_H
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 XangXiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#include <lttv/lttv.h>
-#include <lttv/toolbar.h>
-
-
-inline LttvToolbars *lttv_toolbars_new() {
- return g_array_new(FALSE, FALSE, sizeof(lttv_toolbar_closure));
-}
-
-/* MD: delete elements of the array also, but don't free pointed addresses
- * (functions).
- */
-inline void lttv_toolbars_destroy(LttvToolbars *h) {
- g_debug("lttv_toolbars_destroy");
- g_array_free(h, TRUE);
-}
-
-inline void lttv_toolbars_add(LttvToolbars *h, lttv_constructor f, char* tooltip, char ** pixmap)
-{
- lttv_toolbar_closure c;
-
- /* if h is null, do nothing, or popup a warning message */
- if(h == NULL)return;
-
- c.con = f;
- c.tooltip = tooltip;
- c.pixmap = pixmap;
- g_array_append_val(h,c);
-}
-
-gboolean lttv_toolbars_remove(LttvToolbars *h, lttv_constructor f)
-{
- lttv_toolbar_closure * tmp;
- gint i;
- for(i=0;i<h->len;i++){
- tmp = & g_array_index(h, lttv_toolbar_closure, i);
- if(tmp->con == f)break;
- }
- if(i<h->len){
- g_array_remove_index(h, i);
- return TRUE;
- }else return FALSE;
-}
-
-unsigned lttv_toolbars_number(LttvToolbars *h)
-{
- return h->len;
-}
-
-
+++ /dev/null
-/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2003-2004 Xiangxiu Yang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-#ifndef TOOLBAR_H
-#define TOOLBAR_H
-
-#include <lttv/common.h>
-
-/* constructor of the viewer */
-//typedef GtkWidget* (*lttv_constructor)(void * main_window);
-
-
-typedef GArray LttvToolbars;
-
-typedef struct _lttv_toolbar_closure {
- lttv_constructor con;
- char * tooltip;
- char ** pixmap;
-} lttv_toolbar_closure;
-
-LttvToolbars *lttv_toolbars_new();
-
-void lttv_toolbars_destroy(LttvToolbars *h);
-
-void lttv_toolbars_add(LttvToolbars *h, lttv_constructor f, char* tooltip, char ** pixmap);
-
-gboolean lttv_toolbars_remove(LttvToolbars *h, lttv_constructor f);
-
-unsigned lttv_toolbars_number(LttvToolbars *h);
-
-#endif // TOOLBAR_H
lib_LTLIBRARIES = libguistatistics.la
libguistatistics_la_LDFLAGS = -module
libguistatistics_la_SOURCES = statistics.c
+
+EXTRA_DIST = \
+ hGuiStatisticInsert.xpm
\ No newline at end of file
--- /dev/null
+/* XPM */
+static char * hGuiStatisticInsert_xpm[] = {
+"22 22 2 1",
+" c None",
+". c #800080",
+" ",
+" ",
+" ",
+" .............. ",
+" .... ... ",
+" .... . ",
+" .... . ",
+" .... ",
+" .... ",
+" .... ",
+" .... ",
+" ... ",
+" ... ",
+" ... ",
+" ... ",
+" ... ",
+" ... . ",
+" ... . ",
+" ... ... ",
+" .............. ",
+" ",
+" "};
#include <lttv/lttv.h>
#include <lttv/module.h>
-#include <lttv/gtktraceset.h>
+#include <lttvgui/gtktraceset.h>
#include <lttv/tracecontext.h>
#include <lttv/hook.h>
-#include <lttv/common.h>
+#include <lttvgui/common.h>
#include <lttv/state.h>
#include <lttv/stats.h>
#include <string.h>
-#include "../icons/hGuiStatisticInsert.xpm"
+#include "hGuiStatisticInsert.xpm"
#define PATH_LENGTH 256 /* CHECK */