| 1 | /* This file is part of the Linux Trace Toolkit viewer |
| 2 | * Copyright (C) 2006 Parisa Heidari |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License Version 2 as |
| 6 | * published by the Free Software Foundation; |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
| 16 | * MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef _HISTOBUTTONWIDGET_H |
| 20 | #define _HISTOBUTTONWIDGET_H |
| 21 | |
| 22 | #include <gtk/gtk.h> |
| 23 | #include <lttv/state.h> |
| 24 | #include <ltt/ltt.h> |
| 25 | #include "histocfv.h" |
| 26 | #include "histodrawitem.h" |
| 27 | |
| 28 | |
| 29 | /* The ButtonWidget |
| 30 | * |
| 31 | * Tasks : |
| 32 | * Create a widget |
| 33 | * containing 3 buttons zoomIn,zoonOut and zoomFit to change the vertical scale. |
| 34 | * |
| 35 | */ |
| 36 | #ifndef TYPE_ButtonWidget_DEFINED |
| 37 | #define TYPE_ButtonWidget_DEFINED |
| 38 | typedef struct _ButtonWidget ButtonWidget; |
| 39 | #endif //TYPE_ButtonWidget_DEFINED |
| 40 | |
| 41 | #ifndef TYPE_HistoControlFlowData_DEFINED |
| 42 | #define TYPE_HistoControlFlowData_DEFINED |
| 43 | typedef struct _HistoControlFlowData HistoControlFlowData; |
| 44 | #endif //TYPE_HistoControlFlowData_DEFINED |
| 45 | |
| 46 | struct _ButtonWidget { |
| 47 | |
| 48 | GtkWidget *buttonP; |
| 49 | GtkWidget *buttonM; |
| 50 | GtkWidget *buttonFit; |
| 51 | |
| 52 | GtkWidget *vbox1;//buttons are placed on this vbox |
| 53 | |
| 54 | GtkWidget *hbox;//Parent Widget containing buttons and drawing area. |
| 55 | HistoControlFlowData *histo_control_flow_data; |
| 56 | |
| 57 | }; |
| 58 | |
| 59 | |
| 60 | void histo_copy_pixmap_region(histoDrawing_t *drawing,GdkDrawable *dest, |
| 61 | GdkGC *gc, GdkDrawable *src, |
| 62 | gint xsrc, gint ysrc, |
| 63 | gint xdest, gint ydest, gint width, gint height); |
| 64 | |
| 65 | void histo_rectangle_pixmap (GdkGC *gc,gboolean filled, gint x, gint y, |
| 66 | gint width, gint height,histoDrawing_t *value); |
| 67 | |
| 68 | ButtonWidget *histo_buttonwidget_construct(HistoControlFlowData *histocontrol_flow_data); |
| 69 | |
| 70 | void histo_buttonwidget_destroy(ButtonWidget *buttonwidget); |
| 71 | |
| 72 | |
| 73 | static gboolean gplus( GtkWidget *widget,gpointer user_data);//assigned to zoomIn |
| 74 | static gboolean gMinus( GtkWidget *widget,gpointer user_data );//assigned to zoomOut |
| 75 | static gboolean gFit( GtkWidget *widget,gpointer user_data );//assigned to zoomFit |
| 76 | |
| 77 | GtkWidget *histo_buttonwidget_get_widget(ButtonWidget *button_widget); |
| 78 | void histo_update_pixmap_size(histoDrawing_t *value, |
| 79 | guint width); |
| 80 | #endif //_HISTOBUTTONWIDGET_H |