adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src/gui base.h,1.1.2.1,1.1.2.2 event.


From: VENNIN Joel <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/gui base.h,1.1.2.1,1.1.2.2 event.cc,1.1.2.1,1.1.2.2 event.h,1.1.2.1,1.1.2.2object.h,1.1.2.1,1.1.2.2
Date: Sun, 02 Feb 2003 18:29:14 -0500

Update of /cvsroot/adonthell/adonthell/src/gui
In directory subversions:/tmp/cvs-serv22841/gui

Modified Files:
      Tag: Branch_road_to_0-4
        base.h event.cc event.h object.h 
Log Message:
some minor changes ...



Index: base.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/base.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** base.h      1 Feb 2003 14:45:34 -0000       1.1.2.1
--- base.h      2 Feb 2003 23:29:11 -0000       1.1.2.2
***************
*** 27,32 ****
  #define GUI_BASE_H_
  
! #include "../types.h"
! #include "../input.h"
  #include "event.h"
  #include "border.h"
--- 27,33 ----
  #define GUI_BASE_H_
  
! #include "types.h"
! #include "input/listener.h"
! 
  #include "event.h"
  #include "border.h"
***************
*** 35,38 ****
--- 36,41 ----
  #include "../gfx/drawing_area.h"
  
+ 
+ 
  namespace gui {
   
***************
*** 40,44 ****
    class scroll;
    class select;
!  
    /**
     * Common properties for each base's object
--- 43,47 ----
    class scroll;
    class select;
!   
    /**
     * Common properties for each base's object
***************
*** 49,53 ****
     *      to the surface they should be drawn.
     */ 
!   class base: public event, public border, public gfx::drawing_area, public 
background
      {
      public:
--- 52,56 ----
     *      to the surface they should be drawn.
     */ 
!   class base: public event, public border, public gfx::drawing_area, public 
background, protected input::listener
      {
      public:

Index: event.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/event.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** event.cc    1 Feb 2003 14:45:34 -0000       1.1.2.1
--- event.cc    2 Feb 2003 23:29:12 -0000       1.1.2.2
***************
*** 15,26 ****
  
  #include "event.h"
! #include "../python/callback.h"
  
  using namespace gui;
  
! void event::py_signal_connect (PyObject *pyfunc, int signal, PyObject *args = 
NULL) 
  {
      // create the callback
!   python::py_callback *callback = new python::callback (pyfunc, args);
    py_callbacks.push_back (callback);
  
--- 15,26 ----
  
  #include "event.h"
! #include "python/callback.h"
  
  using namespace gui;
  
! void event::py_signal_connect (PyObject *pyfunc, int signal, PyObject *args ) 
  {
      // create the callback
!   python::callback *callback = new python::callback (pyfunc, args);
    py_callbacks.push_back (callback);
  
***************
*** 30,34 ****
        case CLOSE:
            {
!               set_callback_quit (makeFunctor (*callback, 
&py_callback::callback_func1));
                break;
            }
--- 30,34 ----
        case CLOSE:
            {
!               set_callback_quit (makeFunctor (*callback, 
&python::callback::callback_func1));
                break;
            }
***************
*** 37,42 ****
            {
                set_callback_destroy (
!               MemberTranslator0wRet<bool, py_callback, bool 
(py_callback::*)()> (
!                   *callback, &py_callback::callback_func0ret));
                // makeFunctor (*callback, &py_callback::callback_func0ret));
                break;
--- 37,42 ----
            {
                set_callback_destroy (
!               MemberTranslator0wRet<bool, python::callback, bool 
(python::callback::*)()> (
!                   *callback, &python::callback::callback_func0ret));
                // makeFunctor (*callback, &py_callback::callback_func0ret));
                break;
***************
*** 45,49 ****
            default:
            {
!               set_signal_connect (makeFunctor (*callback, 
&py_callback::callback_func0), signal);
            }
      }
--- 45,49 ----
            default:
            {
!               set_signal_connect (makeFunctor (*callback, 
&python::callback::callback_func0), signal);
            }
      }
***************
*** 64,68 ****
    
    //delete any python callbacks
!   for (std::vector<py_callback *>::iterator i = py_callbacks.begin (); i != 
py_callbacks.end (); i++)
      delete *i;
  }
--- 64,68 ----
    
    //delete any python callbacks
!   for (std::vector<python::callback *>::iterator i = py_callbacks.begin (); i 
!= py_callbacks.end (); i++)
      delete *i;
  }

Index: event.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/event.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** event.h     1 Feb 2003 14:45:34 -0000       1.1.2.1
--- event.h     2 Feb 2003 23:29:12 -0000       1.1.2.2
***************
*** 17,27 ****
  
  #include "Python.h"
  #include <vector>
  
! class py_callback;
! 
! 
! #include "../types.h"
! #include "../callback.h"
  
  
--- 17,25 ----
  
  #include "Python.h"
+ #include "python/callback.h"
  #include <vector>
  
! #include "types.h"
! #include "callback.h"
  
  
***************
*** 102,106 ****
        
        /* this vector contains all python callback connected for this objet */
!       std::vector<py_callback *> py_callbacks;   
    
        /* define C++ callback for this objet */
--- 100,104 ----
        
        /* this vector contains all python callback connected for this objet */
!       std::vector<python::callback *> py_callbacks;   
    
        /* define C++ callback for this objet */

Index: object.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/object.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** object.h    1 Feb 2003 14:45:34 -0000       1.1.2.1
--- object.h    2 Feb 2003 23:29:12 -0000       1.1.2.2
***************
*** 14,62 ****
  
  
! #ifndef _WIN_OBJECT_H_
! #define _WIN_OBJECT_H_
  
! #include "win_base.h" 
! #include "win_container.h"
  
! template<class T>
! class win_object : public win_base, public T
! {
!  public:
!   
!   win_object();
!    
!   
!   ~win_object();
!    
!   bool draw();
!   
!   bool update();
!     
!   
!   bool input_update();
!    
!   
!   void set_brightness(bool b);
!    
!   void set_trans(bool b);
!     
!   
!   void pack();
!    
!   
!   void set_auto_refresh(bool b);
!   
! 
!  protected:
    
!   void refresh();
! 
!   image * img_tmp_;
!   image * img_brightness_;
! 
!   bool auto_refresh_;
!   
! };
  
  
--- 14,64 ----
  
  
! #ifndef GUI_OBJECT_H_
! #define GUI_OBJECT_H_
  
! #include "base.h" 
! #include "container.h"
  
! namespace gui {
    
!   template<class T>
!     class object : public win_base, public T
!     {
!     public:
!       
!       object();
!       
!       
!       ~object();
!       
!       bool draw();
!       
!       bool update();
!       
!       
!       bool input_update();
!       
!       
!       void set_brightness(bool b);
!       
!       void set_trans(bool b);
!       
!       
!       void pack();
!       
!       
!       void set_auto_refresh(bool b);
!       
!       
!     protected:
!       
!       void refresh();
!       
!       image * img_tmp_;
!       image * img_brightness_;
!       
!       bool auto_refresh_;
!       
!     };
  
  
***************
*** 65,69 ****
  
  template<class T> 
! win_object<T>::win_object()
  {
    img_tmp_ = new image();
--- 67,71 ----
  
  template<class T> 
! object<T>::object()
  {
    img_tmp_ = new image();
***************
*** 78,82 ****
  
  template<class T> 
! win_object<T>::~win_object()
  {
    if( img_tmp_ !=NULL ) delete img_tmp_ ;
--- 80,84 ----
  
  template<class T> 
! object<T>::~object()
  {
    if( img_tmp_ !=NULL ) delete img_tmp_ ;
***************
*** 86,96 ****
  
  template<class T> bool
! win_object<T>::draw()
  {
!   if(win_base::draw())
      {
        assign_drawing_area(wb_father_);
        
!       win_background::draw(this);
  
        if( auto_refresh_ ) refresh();
--- 88,98 ----
  
  template<class T> bool
! object<T>::draw()
  {
!   if(base::draw())
      {
        assign_drawing_area(wb_father_);
        
!       background::draw(this);
  
        if( auto_refresh_ ) refresh();
***************
*** 99,109 ****
        {
          
!         if( brightness_ ) img_brightness_->draw(win_base::real_x(), 
win_base::real_y(), this);
!         else img_tmp_->draw(win_base::real_x(), win_base::real_y(), this);
        }
!       else T::draw(win_base::real_x(), win_base::real_y(), this);
          
        
!       win_border::draw(wb_father_);
        
        detach_drawing_area();
--- 101,111 ----
        {
          
!         if( brightness_ ) img_brightness_->draw(base::real_x(), 
base::real_y(), this);
!         else img_tmp_->draw(base::real_x(), base::real_y(), this);
        }
!       else T::draw(base::real_x(), base::real_y(), this);
          
        
!       border::draw(wb_father_);
        
        detach_drawing_area();
***************
*** 116,123 ****
  
  template<class T> bool
! win_object<T>:: update()
  {
    
!   if(win_base::update())
        {
          T::update();
--- 118,125 ----
  
  template<class T> bool
! object<T>:: update()
  {
    
!   if(base::update())
        {
          T::update();
***************
*** 129,138 ****
  
  template<class T> bool
! win_object<T>::input_update()
  {
!   if(win_base::input_update())
      {
        
!       if(input::has_been_pushed(win_keys::KEY_ACTIVATE_ENTRY)) 
on_activate_key();
        T::input_update();
        
--- 131,140 ----
  
  template<class T> bool
! object<T>::input_update()
  {
!   if(base::input_update())
      {
        
!       if(input::has_been_pushed(keys::KEY_ACTIVATE_ENTRY)) on_activate_key();
        T::input_update();
        
***************
*** 144,150 ****
  
  template<class T> void
! win_object<T>::set_brightness(bool b)
  { 
!   win_base::set_brightness(b);
    refresh();
  }
--- 146,152 ----
  
  template<class T> void
! object<T>::set_brightness(bool b)
  { 
!   base::set_brightness(b);
    refresh();
  }
***************
*** 153,168 ****
  
  template<class T> void
! win_object<T>::set_trans(bool b)
  {
!   win_base::set_trans(b);
    refresh();
  }
  
  template<class T> void
! win_object<T>::pack()
  {
!   if(T::length() != win_base::length() || T::height() != win_base::height())
      {
!       win_base::resize(T::length(), T::height());
        img_tmp_->resize(T::length(), T::height());
      }   
--- 155,170 ----
  
  template<class T> void
! object<T>::set_trans(bool b)
  {
!   base::set_trans(b);
    refresh();
  }
  
  template<class T> void
! object<T>::pack()
  {
!   if(T::length() != base::length() || T::height() != base::height())
      {
!       base::resize(T::length(), T::height());
        img_tmp_->resize(T::length(), T::height());
      }   
***************
*** 172,176 ****
  
  template<class T> void
! win_object<T>::set_auto_refresh(bool b)
  {
    auto_refresh_ = b;
--- 174,178 ----
  
  template<class T> void
! object<T>::set_auto_refresh(bool b)
  {
    auto_refresh_ = b;
***************
*** 180,184 ****
  
  template<class T> void
! win_object<T>::refresh()
  {
    //put the T drawable object in image  
--- 182,186 ----
  
  template<class T> void
! object<T>::refresh()
  {
    //put the T drawable object in image  
***************
*** 193,197 ****
        if(brightness_) 
        {
!         img_brightness_->brightness(*img_tmp_,WIN_BRIGHTNESS_LEVEL);
          img_brightness_->set_mask(true);
        }
--- 195,199 ----
        if(brightness_) 
        {
!         img_brightness_->brightness(*img_tmp_,BRIGHTNESS_LEVEL);
          img_brightness_->set_mask(true);
        }
***************
*** 202,205 ****
  }
   
! 
  #endif
--- 204,207 ----
  }
   
! }
  #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]