|
From: | VENNIN Joel <address@hidden> |
Subject: | [Adonthell-commits] CVS: adonthell/src/gui Makefile.am,NONE,1.1.2.1 background_template.cc,NONE,1.1.2.1 background_template.h,NONE,1.1.2.1 background_ui.cc,NONE,1.1.2.1 background_ui.h,NONE,1.1.2.1 bin.cc,NONE,1.1.2.1 bin.h,NONE,1.1.2.1 border.cc,NONE,1.1.2.1 border.h,NONE,1.1.2.1 border_template.cc,NONE,1.1.2.1 border_template.h,NONE,1.1.2.1 border_ui.cc,NONE,1.1.2.1 border_ui.h,NONE,1.1.2.1 box.cc,NONE,1.1.2.1 box.h,NONE,1.1.2.1 button.cc,NONE,1.1.2.1 button.h,NONE,1.1.2.1 button_template.cc,NONE,1.1.2.1 button_template.h,NONE,1.1.2.1 button_ui.cc,NONE,1.1.2.1 button_ui.h,NONE,1.1.2.1 container.cc,NONE,1.1.2.1 container.h,NONE,1.1.2.1 fixed.cc,NONE,1.1.2.1 fixed.h,NONE,1.1.2.1 font.cc,NONE,1.1.2.1 font.h,NONE,1.1.2.1 label.cc,NONE,1.1.2.1 label.h,NONE,1.1.2.1 manager.cc,NONE,1.1.2.1 manager.h,NONE,1.1.2.1 misc.cc,NONE,1.1.2.1 misc.h,NONE,1.1.2.1 object_ui.h,NONE,1.1.2.1 table.h,NONE,1.1.2.1 theme.cc,NONE,1.1.2.1 theme.h,NONE,1.1.2.1 widget.cc,NONE,1.1.2.1 widget.h,NONE,1.1.2.1 window.cc,NONE,1.1.2.1 window.h,NONE,1.1.2.1 |
Date: | Tue, 02 Jul 2002 03:20:32 -0400 |
Update of /cvsroot/adonthell/adonthell/src/gui In directory subversions:/tmp/cvs-serv6040/gui Added Files: Tag: Branch_road_to_0-4 Makefile.am background_template.cc background_template.h background_ui.cc background_ui.h bin.cc bin.h border.cc border.h border_template.cc border_template.h border_ui.cc border_ui.h box.cc box.h button.cc button.h button_template.cc button_template.h button_ui.cc button_ui.h container.cc container.h fixed.cc fixed.h font.cc font.h label.cc label.h manager.cc manager.h misc.cc misc.h object_ui.h table.h theme.cc theme.h widget.cc widget.h window.cc window.h Log Message: Add gui namespace --- NEW FILE --- noinst_LIBRARIES = libgui.a libgui_a_SOURCES = box.cc misc.cc container.cc label.cc \ font.cc widget.cc fixed.cc \ bin.cc window.cc manager.cc border_template.cc \ border_ui.cc theme.cc background_template.cc \ button_template.cc button.cc button_ui.cc \ background_ui.cc \ box.h misc.h container.h label.h \ font.h widget.h fixed.h \ bin.h window.h manager.h border_template.h \ border_ui.h theme.h background_template.h \ button_template.h button.h button_ui.h \ background_ui.h CPPFLAGS += -I$(srcdir)/.. $(SDL_DEFS) $(SDL_CFLAGS) $(FT2_CFLAGS) --- NEW FILE --- #include "background_template.h" using namespace gui; background_template::background_template(): imgback_(NULL) { type_ = NOTHING; } void background_template::load( igzstream & is) { if (imgback_) { delete imgback_; imgback_ = NULL; } name_ << is; type_ << is; switch (type_) { case NOTHING: break; case COLOR: r_ << is; g_ << is; b_ << is; break; case IMAGE: imgback_ = new gfx::image(); imgback_->get (is); break; } } void background_template::save (ogzstream & os) { name_ >> os; type_ >> os; if (type_ == COLOR) { r_ >> os; g_ >> os; b_ >> os; } else imgback_->put (os); } std::string background_template::get_name () const { return name_; } void background_template::set_name (const std::string & name) { name_ = name; } gfx::image * background_template::get_image() { return imgback_; } /* u_int32 background_template::get_color() { return colorback_; } */ u_int8 background_template::get_r() { return r_; } u_int8 background_template::get_g() { return g_; } u_int8 background_template::get_b() { return b_; } void background_template::set_image (gfx::image * tmp) { if ( imgback_) delete imgback_; imgback_ = tmp; if (tmp ) type_= IMAGE; else type_ = COLOR; } void background_template::set_color (u_int8 r, u_int8 g, u_int8 b) { type_ = COLOR; r_ = r; g_ = g; b_ = b; } u_int8 background_template::get_type() { return type_; } ***** Error reading new file: [Errno 2] No such file or directory: 'background_template.h' --- NEW FILE --- #include <iostream> #include "background_ui.h" using namespace gui; background_ui::background_ui (container * tmp) : btmpl_ (NULL) { container_ = tmp; } void background_ui::draw (gfx::drawing_area * da, gfx::surface * sf) { if (!container_ || !btmpl_ ) return; switch (btmpl_->get_type()) { case background_template::COLOR: gfx::screen::display.fillrect (container_->get_x_real(), container_->get_y_real(), container_->get_length(), container_->get_height(), btmpl_->get_r(),btmpl_->get_g(), btmpl_->get_b(), da); // cout << container_->get_x_real() << " " << container_->get_y_real() <<" " << container_->get_length() << " " << container_->get_height() << endl; break; } } void background_ui::resize () { } void background_ui::move() { } void background_ui::set_background( background_template * btmp) { btmpl_ = btmp; } ***** Error reading new file: [Errno 2] No such file or directory: 'background_ui.h' ***** Error reading new file: [Errno 2] No such file or directory: 'bin.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'bin.h' ***** Error reading new file: [Errno 2] No such file or directory: 'border.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'border.h' ***** Error reading new file: [Errno 2] No such file or directory: 'border_template.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'border_template.h' ***** Error reading new file: [Errno 2] No such file or directory: 'border_ui.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'border_ui.h' ***** Error reading new file: [Errno 2] No such file or directory: 'box.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'box.h' --- NEW FILE --- #include "input/mouse_event.h" #include "label.h" #include "button_ui.h" #include "button.h" using namespace gui; button::button (): pressed_ (false) { set_sensible (true); set_border_width (0); } bool button::get_pressed() const { return pressed_; } void button::set_button_ui (button_template * but) { if (object_ui_) delete object_ui_; object_ui_ = new button_ui (this); ((button_ui*)object_ui_)->set_button (but); } int button::input_update (input::event * ev) { if (!is_sensible () ) return 0; input::mouse_event * me = (input::mouse_event *) ev; /* test if mouse position is inside this button */ if (!point_belong (me->x (), me->y ())) { if (pressed_) pressed_ = false; return 0; } /* the mouse is inside the button */ if (me->type () == input::mouse_event::BUTTON_PUSHED) { on_pressed(); pressed_ = true; } else if (me->type () == input::mouse_event::BUTTON_RELEASED) { on_released(); if( pressed_ ) on_clicked(); pressed_ = false; } return 1; } button::~button () { } void button::set_text (const std::string & text, font * font) { /* destroy child */ clear(); label * lab = new label; lab->set_font (*font); lab->set_text (text); lab->set_visible (true); // lab->set_alignment ( misc::CENTER, misc::CENTER ); add ( lab ); lab->realize(); } ***** Error reading new file: [Errno 2] No such file or directory: 'button.h' ***** Error reading new file: [Errno 2] No such file or directory: 'button_template.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'button_template.h' ***** Error reading new file: [Errno 2] No such file or directory: 'button_ui.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'button_ui.h' ***** Error reading new file: [Errno 2] No such file or directory: 'container.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'container.h' ***** Error reading new file: [Errno 2] No such file or directory: 'fixed.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'fixed.h' ***** Error reading new file: [Errno 2] No such file or directory: 'font.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'font.h' ***** Error reading new file: [Errno 2] No such file or directory: 'label.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'label.h' ***** Error reading new file: [Errno 2] No such file or directory: 'manager.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'manager.h' ***** Error reading new file: [Errno 2] No such file or directory: 'misc.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'misc.h' ***** Error reading new file: [Errno 2] No such file or directory: 'object_ui.h' ***** Error reading new file: [Errno 2] No such file or directory: 'table.h' ***** Error reading new file: [Errno 2] No such file or directory: 'theme.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'theme.h' ***** Error reading new file: [Errno 2] No such file or directory: 'widget.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'widget.h' ***** Error reading new file: [Errno 2] No such file or directory: 'window.cc' ***** Error reading new file: [Errno 2] No such file or directory: 'window.h'
[Prev in Thread] | Current Thread | [Next in Thread] |