00001 /*************************************************************************** 00002 * Copyright (C) 2001 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the bit library. * 00006 * * 00007 * The bit library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The bit library is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef BITGTKBUFFERLIST_H 00020 #define BITGTKBUFFERLIST_H 00021 00022 #include <gtkmm.h> 00023 #include <map> 00024 00025 #include <bit/recordbuffer.h> 00026 00027 namespace bitGtk { 00028 00032 class BufferList : public Gtk::EventBox 00033 { 00034 public: 00035 BufferList(); 00036 00037 ~BufferList(); 00038 00039 bit::RecordBuffer& buffer(); 00040 00041 void set_buffer( bit::RecordBuffer& buffer); 00042 00043 void enable_tooltips(bool b=true); 00044 00045 protected: 00046 bit::RecordBuffer m_buffer; 00047 Gtk::Table* m_table; 00048 int m_mode; 00049 std::map< bit::FieldBase::pointer, Gtk::Label*> m_value_label; 00050 unsigned int m_value_label_left; 00051 Gtk::Tooltips m_tooltips; 00052 00054 Glib::Dispatcher m_record_changed_dispatcher; 00055 00057 Glib::Dispatcher m_field_changed_dispatcher; 00058 00060 Glib::StaticMutex m_record_mutex; 00061 00063 Glib::StaticMutex m_field_queue_mutex; 00064 00066 std::queue<bit::FieldBuffer> m_field_queue; 00067 00069 void on_record_changed(); 00070 00072 void on_record_changed_dispatcher(); 00073 00074 void on_field_value_changed( bit::FieldBuffer fieldbuffer ); 00075 00076 void on_field_value_changed_dispatcher(); 00077 00078 void set_field_value( bit::FieldBase::pointer field ); 00079 00080 void load_all_field_values(); 00081 00082 void load_all_field_values( bit::FieldBase::pointer ); 00083 00084 void create_table(); 00085 00086 void setup_table(); 00087 00088 unsigned int add_field_label(bit::FieldBase::pointer fb, unsigned int row=0, unsigned int depth=0); 00089 00090 unsigned int add_field_value_label(bit::FieldBase::pointer fb, unsigned int row=0); 00091 00092 }; 00093 00094 } 00095 00096 #endif