MyArea.hh
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           WMPSNIFFER          --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V7.0B  11/05/10
00005  *
00006  *
00007  *  File: MyArea.hh
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2012, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
00034  *
00035  *----------------------------------------------------------------------*/
00036 
00037 #ifndef _MYAREA_HH
00038 #define _MYAREA_HH
00039 #include "misc.h"
00040 #include <gtkmm/drawingarea.h>
00041 
00042 
00043 
00044 #define DATA_SIZE 100
00045 
00046 struct Dot{
00047         int node;
00048         int col;
00049         int x_draw;
00050         int y_draw;
00051 };
00052 
00053 
00054 
00055 struct Frame{
00056         unsigned long long time,diff;
00057         int x_draw;
00058         int y1_draw;
00059         int y2_draw;
00060         int src;
00061         int dest;
00062         int col;
00063         int mouseover;
00064         int nt;
00065         int pos_in_file;
00066         unsigned long serial;
00067         std::vector<Dot> dot;
00068         bool mark;
00069         bool cross;
00070         bool left_cross;
00071 };
00072 
00073 
00074 class MyArea : public Gtk::DrawingArea {
00075 private:
00076                   pthread_mutex_t sem;
00077                   int num_nodes, selected;
00078                   double x_max,y_max,y_min,x_min;
00079                   std::vector<Frame> frameVec;
00080                   std::vector<bool> activeVec;
00081               Gdk::Color cols[32];
00082               Glib::RefPtr<Gdk::Window> window;
00083               Glib::RefPtr<Gdk::GC> gc;
00084               int y0,x0;
00085               int step;
00086               unsigned int max,min;
00087               int bytime;
00088               int max_size;
00089               int mouse_on;
00090               void draw_frame(int i);
00091         public:
00092                 MyArea();
00093                 void paint();
00094                 void set_max_size(int _max_size);
00095                 void clean_info();
00096                 void clean_window();
00097             void beginInsert();
00098             int insertOne(int from, int to, long time ,int pos_in_file,int col, int nt);
00099             int insertOne(int from, int to, unsigned long long time ,int pos_in_file,unsigned long serial,int col, int nt);
00100             void endInsert();
00101                 void setNumOfNodes(int n);
00102                 void compute_environment();
00103                 int get_y_pos(int node_id);
00104                 void insert(int from, int to, long time ,int col);
00105                 int get_selected();
00106                 int get_offset_of_selected();
00107                 int get_older_offset();
00108                 void delete_older();
00109             int get_selected(int & from, int& to, int &col);
00110             int set_selected(int n);
00111             long get_selected_time();
00112             long get_mouse_on_time();
00113             int get_mouse_on_serial();
00114             int get_selected_serial();
00115             void addDot(int frame, int node, int color);
00116             void addMark(int frame);
00117             void addCross(int frame);
00118             void addLeftCross(int frame);
00119             void resetActive();
00120             void setActive(int i);
00121         protected:
00122 
00123             bool timer_callback();
00124             virtual void on_realize();
00125                 bool on_MyArea_motion_notify_event(GdkEventMotion* event);
00126             virtual bool on_expose_event(GdkEventExpose* e);
00127             virtual bool on_MyArea_button_press_event(GdkEventButton *ev);
00128             virtual bool on_MyArea_button_release_event(GdkEventButton *ev);
00129 };
00130 
00131 #endif


ros_rt_wmp_sniffer
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:57