00001 00007 /* 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library; if not, write to the Free Software 00020 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 00022 Copyright (C) 2005 Mart Raudsepp 00023 leio (at) dustbite [dot] net 00024 */ 00025 00026 #ifndef OMGUI_GTK2_WIDGET_H 00027 #define OMGUI_GTK2_WIDGET_H 00028 00029 #include <omgui/gtk2/gtk.h> 00030 00031 #include <omgui/common/widget.h> 00032 00033 // for initializer factory 00034 #include <omgui/widget.h> 00035 00036 namespace omgui { 00037 namespace gtk2 { 00038 00039 class Widget : public virtual omgui::common::Widget 00040 { 00041 public: 00042 virtual ~Widget(); 00043 00044 // object interface 00045 virtual void set_size(const omgui::Size&); 00046 virtual void set_min_size(const omgui::Size&); 00047 virtual void set_max_size(const omgui::Size&) { } 00048 virtual void set_natural_size(const omgui::Size&) { } 00049 virtual void set_position(const omgui::Point&); 00050 virtual omgui::Size get_size() const; 00051 virtual omgui::Size get_min_size() const; 00052 virtual omgui::Size get_max_size() const { return omgui::Size(); } 00053 virtual omgui::Size get_natural_size() const { return omgui::Size(); } 00054 virtual omgui::Point get_position() const { return omgui::Point(); } 00055 virtual void set_rect(const omgui::Rect&); 00056 virtual omgui::Rect get_rect() const; 00057 00058 // widget interface 00059 virtual void destroy(); 00060 virtual void *get_handle() const { return (void*)m_widget; } 00061 virtual void enable(bool sensitive); 00062 virtual void show(bool show, bool activate); 00063 virtual bool is_enabled() const; 00064 virtual bool is_shown() const; 00065 00066 virtual Pointer<omgui::Panel> get_parent() const; 00067 virtual Pointer<omgui::Window> get_parent_window() const; 00068 00069 // implementation specific 00070 void send_event(omgui::event_id); 00071 00072 protected: 00073 Widget(); 00074 void create(const omgui::initializer::WidgetData&, GtkWidget *); 00075 00076 GtkWidget * m_widget; 00077 }; 00078 00079 } // gtk2 00080 } // omgui 00081 00082 #endif // OMGUI_GTK2_WIDGET_H