X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawing.h;h=19da1678a087434cfa152c25db4dc3804d9a18fa;hb=e800cf849a08893a7325441a9614f018a00b129a;hp=6ffc61a52a624b14e57aafeb03245c8ef03cd500;hpb=88feb618dc79481733516a77f285bb6514bb1d17;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h index 6ffc61a5..19da1678 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h @@ -1,3 +1,22 @@ +/* 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. + */ + + #ifndef _DRAWING_H #define _DRAWING_H @@ -5,12 +24,27 @@ #include #include #include +#include +#include +#include #include "cfv.h" #include "drawitem.h" #define SAFETY 50 // safety pixels at right and bottom of pixmap buffer + +typedef enum _draw_color { COL_BLACK, + COL_WHITE, + COL_WAIT_FORK, + COL_WAIT_CPU, + COL_EXIT, + COL_WAIT, + COL_RUN, + NUM_COLORS } draw_color; + +extern GdkColor drawing_colors[NUM_COLORS]; + /* This part of the viewer does : * Draw horizontal lines, getting graphic context as arg. * Copy region of the screen into another. @@ -36,24 +70,35 @@ typedef struct _Drawing_t Drawing_t; struct _Drawing_t { + GtkWidget *vbox; GtkWidget *drawing_area; + //GtkWidget *scrolled_window; + GtkWidget *hbox; + GtkWidget *viewport; + GtkWidget *scrollbar; + + GtkWidget *ruler_hbox; + GtkWidget *ruler; + GtkWidget *padding; GdkPixmap *pixmap; ControlFlowData *control_flow_data; PangoLayout *pango_layout; - gint height, width, depth; + gint height, width, depth; + /* X coordinate of damaged region */ + gint damage_begin, damage_end; + LttTime last_start; + GdkGC *dotted_gc; + GdkGC *gc; }; Drawing_t *drawing_construct(ControlFlowData *control_flow_data); void drawing_destroy(Drawing_t *drawing); GtkWidget *drawing_get_widget(Drawing_t *drawing); - -//void drawing_Refresh ( Drawing_t *drawing, -// guint x, guint y, -// guint width, guint height); +GtkWidget *drawing_get_drawing_area(Drawing_t *drawing); void drawing_draw_line( Drawing_t *drawing, GdkPixmap *pixmap, @@ -66,6 +111,9 @@ void drawing_draw_line( Drawing_t *drawing, // guint xdest, guint ydest, // guint width, guint height); +/* Clear the drawing : make it 1xwidth. */ +void drawing_clear(Drawing_t *drawing); + /* Insert a square corresponding to a new process in the list */ void drawing_insert_square(Drawing_t *drawing, guint y, @@ -76,14 +124,11 @@ void drawing_remove_square(Drawing_t *drawing, guint y, guint height); - -//void drawing_Resize(Drawing_t *drawing, guint h, guint w); - void convert_pixels_to_time( gint width, guint x, - LttTime *window_time_begin, - LttTime *window_time_end, + LttTime window_time_begin, + LttTime window_time_end, LttTime *time); void convert_time_to_pixels( @@ -93,4 +138,14 @@ void convert_time_to_pixels( gint width, guint *x); +void drawing_update_ruler(Drawing_t *drawing, TimeWindow *time_window); + +void drawing_request_expose(EventsRequest *events_request, + LttvTracesetState *tss, + LttTime end_time); + +void drawing_data_request_begin(EventsRequest *events_request, + LttvTracesetState *tss); +void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss); + #endif // _DRAWING_H