00001 /*************************************************************************** 00002 * Copyright (C) 2004 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the papyrus library. * 00006 * * 00007 * papyrus is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU Lesser General Public License * 00009 * version 3.0 as published by the Free Software Foundation. * 00010 * * 00011 * papyrus 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 * 00014 * GNU Lesser General Public License version 3.0 for more details. * 00015 * * 00016 * You should have received a copy of the GNU Lesser General Public * 00017 * License along with the papyrus library. If not, see * 00018 * <http://www.gnu.org/licenses/>. * 00019 ***************************************************************************/ 00020 #ifndef PAPYRUSGTKSTROKEWIDGET_H 00021 #define PAPYRUSGTKSTROKEWIDGET_H 00022 00023 #include <gtkmm/table.h> 00024 00025 #include <papyrus/stroke.h> 00026 #include <papyrus/polyline.h> 00027 #include <papyrus-gtkmm/linejoinbuttonbox.h> 00028 #include <papyrus-gtkmm/linecapbuttonbox.h> 00029 #include <papyrus-gtkmm/viewport.h> 00030 00031 namespace Papyrus 00032 { 00033 namespace Gtk 00034 { 00035 00039 class StrokeWidget : public ::Gtk::Table 00040 { 00041 public: 00042 StrokeWidget ( bool use_preview=true ); 00043 00044 ~StrokeWidget(); 00045 00046 Papyrus::Stroke::pointer stroke() const; 00047 00048 bool use_preview(); 00049 void set_use_preview ( bool use=true ); 00050 00051 protected: 00052 ::Gtk::Expander* m_expander; 00053 Papyrus::Gtk::Viewport* m_viewport; 00054 Papyrus::Polyline::pointer m_line; 00055 00056 ::Gtk::ColorButton m_color_button; 00057 ::Gtk::Adjustment m_width_adjustment; 00058 ::Gtk::SpinButton m_width_entry; 00059 ::Gtk::Adjustment m_miter_limit_adjustment; 00060 ::Gtk::SpinButton m_miter_limit_entry; 00061 Papyrus::Gtk::LineJoinButtonBox m_line_join_buttonbox; 00062 Papyrus::Gtk::LineCapButtonBox m_line_cap_buttonbox; 00063 00064 Papyrus::Stroke::pointer m_stroke; 00065 00066 void on_color_changed(); 00067 void on_width_changed(); 00068 void on_line_join_changed ( Cairo::LineJoin ); 00069 void on_line_cap_changed ( Cairo::LineCap ); 00070 00071 }; 00072 00073 } 00074 00075 } 00076 00077 #endif