adonthell-commits
[Top][All Lists]
Advanced

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

[Adonthell-commits] CVS: adonthell/src atk_border.cc,NONE,1.1.2.1 atk_bo


From: VENNIN Joel <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src atk_border.cc,NONE,1.1.2.1 atk_border.h,NONE,1.1.2.1 atk_border_template.cc,NONE,1.1.2.1 atk_border_template.h,NONE,1.1.2.1 atk_window.cc,NONE,1.1.2.1 Makefile.am,1.80.2.21,1.80.2.22 atk_bin.cc,1.1.2.1,1.1.2.2 atk_bin.h,1.1.2.1,1.1.2.2 atk_box.cc,1.1.2.3,1.1.2.4 atk_box.h,1.1.2.3,1.1.2.4 atk_container.cc,1.1.2.2,1.1.2.3 atk_container.h,1.1.2.3,1.1.2.4 atk_manager.cc,1.1.2.1,1.1.2.2 atk_manager.h,1.1.2.1,1.1.2.2 atk_widget.cc,1.1.2.3,1.1.2.4 atk_widget.h,1.1.2.4,1.1.2.5 atk_window.h,1.1.2.1,1.1.2.2 callback.h,1.4.4.2,1.4.4.3 joltest.cc,1.1.2.6,1.1.2.7
Date: Fri, 05 Apr 2002 14:59:22 -0500

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

Modified Files:
      Tag: Branch_road_to_0-4
        Makefile.am atk_bin.cc atk_bin.h atk_box.cc atk_box.h 
        atk_container.cc atk_container.h atk_manager.cc atk_manager.h 
        atk_widget.cc atk_widget.h atk_window.h callback.h joltest.cc 
Added Files:
      Tag: Branch_road_to_0-4
        atk_border.cc atk_border.h atk_border_template.cc 
        atk_border_template.h atk_window.cc 
Log Message:
Add new components ....



***** Error reading new file: [Errno 2] No such file or directory: 
'atk_border.cc'
***** Error reading new file: [Errno 2] No such file or directory: 
'atk_border.h'
***** Error reading new file: [Errno 2] No such file or directory: 
'atk_border_template.cc'
***** Error reading new file: [Errno 2] No such file or directory: 
'atk_border_template.h'
***** Error reading new file: [Errno 2] No such file or directory: 
'atk_window.cc'
Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Makefile.am,v
retrieving revision 1.80.2.21
retrieving revision 1.80.2.22
diff -C2 -r1.80.2.21 -r1.80.2.22
*** Makefile.am 4 Apr 2002 16:07:49 -0000       1.80.2.21
--- Makefile.am 5 Apr 2002 19:59:19 -0000       1.80.2.22
***************
*** 103,108 ****
        callback_slot.h atk_box.h atk_misc.h atk_container.h \
        atk_label.h atk_font.h atk_widget.h atk_fixed.h \
!       atk_bin.h atk_window.h atk_manager.h \
!       callback_sig.h
  
  libgui_LDADD = $(FT2_LIBS)
--- 103,110 ----
        callback_slot.h atk_box.h atk_misc.h atk_container.h \
        atk_label.h atk_font.h atk_widget.h atk_fixed.h \
!       atk_bin.h atk_window.h atk_manager.h atk_window.cc\
!       atk_border_template.h atk_border_template.cc \
!       atk_border.cc atk_border.h \
!       callback_sig.h 
  
  libgui_LDADD = $(FT2_LIBS)

Index: atk_bin.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_bin.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** atk_bin.cc  3 Apr 2002 16:11:30 -0000       1.1.2.1
--- atk_bin.cc  5 Apr 2002 19:59:19 -0000       1.1.2.2
***************
*** 26,31 ****
  
      child = w;
!     w->set_parent (this); 
! 
      on_add (); 
  }
--- 26,34 ----
  
      child = w;
!     w->set_parent (this);
!     
!     w->set_position (0, 0);
!     
!     
      on_add (); 
  }
***************
*** 53,58 ****
--- 56,73 ----
  
  
+ void atk_bin::set_position (s_int32 x, s_int32 y)
+ {
+     atk_container::set_position (x, y);
+     if (child) child->update_position (); 
+     
+ }
+ 
+ 
+ 
  atk_bin::~atk_bin ()
  {
      clear (); 
  }
+ 
+ 
+ 

Index: atk_bin.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_bin.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** atk_bin.h   3 Apr 2002 16:11:30 -0000       1.1.2.1
--- atk_bin.h   5 Apr 2002 19:59:19 -0000       1.1.2.2
***************
*** 60,63 ****
--- 60,70 ----
      void clear ();
  
+     
+     /** set position of this widget (but the layout can change this value) ,  
position in his parent
+      * @param x
+      * @param y
+      */
+     void set_position (s_int32 x, s_int32 y);
+     
  
      /**destructor
***************
*** 66,73 ****
      ~atk_bin (); 
  protected :
! 
! 
! private : 
!     
      atk_widget * child; 
  }; 
--- 73,77 ----
      ~atk_bin (); 
  protected :
!      
      atk_widget * child; 
  }; 

Index: atk_box.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_box.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** atk_box.cc  1 Mar 2002 21:50:32 -0000       1.1.2.3
--- atk_box.cc  5 Apr 2002 19:59:19 -0000       1.1.2.4
***************
*** 110,115 ****
  
      /* init value with border width */
!     s_int32 x_tmp = border_width_;
!     s_int32 y_tmp = border_width_;
  
      /* calcul the max length for each widget*/
--- 110,115 ----
  
      /* init value with border width */
!     s_int32 x_tmp = 0; // border_width_;
!     s_int32 y_tmp = 0; // border_width_;
  
      /* calcul the max length for each widget*/
***************
*** 167,172 ****
      
      /* init value with border width */
!     s_int32 x_tmp = border_width_;
!     s_int32 y_tmp = border_width_;
  
      /* calcul the max length for each widget*/
--- 167,172 ----
      
      /* init value with border width */
!     s_int32 x_tmp = 0; // border_width_;
!     s_int32 y_tmp = 0; // border_width_;
  
      /* calcul the max length for each widget*/
***************
*** 286,287 ****
--- 286,294 ----
  
  
+ void atk_box::update_position () 
+ {
+     atk_container::update_position (); 
+     
+     for (std::deque <atk_box_struct* >::iterator it = v_widget_.begin (); it 
!= v_widget_.end (); it++)
+         (*it)->widget_->update_position ();
+ }

Index: atk_box.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_box.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** atk_box.h   1 Mar 2002 21:50:32 -0000       1.1.2.3
--- atk_box.h   5 Apr 2002 19:59:19 -0000       1.1.2.4
***************
*** 116,119 ****
--- 116,125 ----
      
  
+     /**
+      * update position
+      */
+     void update_position (); 
+ 
+     
      ~atk_box (); 
      

Index: atk_container.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_container.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** atk_container.cc    26 Feb 2002 12:44:47 -0000      1.1.2.2
--- atk_container.cc    5 Apr 2002 19:59:19 -0000       1.1.2.3
***************
*** 13,22 ****
  */
  
! 
  #include "atk_container.h"
  
  
! atk_container::atk_container () : border_width_ (6)
  { 
  }
  
--- 13,23 ----
  */
  
! #include "atk_border.h"
  #include "atk_container.h"
  
  
! atk_container::atk_container () : border_width_ (5)
  { 
+     border_ = new atk_border (this); 
  }
  
***************
*** 34,37 ****
--- 35,43 ----
  
  
+ 
+ atk_container::~atk_container ()
+ {
+     delete border_; 
+ }
  
  

Index: atk_container.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_container.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** atk_container.h     26 Feb 2002 12:44:47 -0000      1.1.2.3
--- atk_container.h     5 Apr 2002 19:59:19 -0000       1.1.2.4
***************
*** 32,35 ****
--- 32,36 ----
  #include "atk_widget.h"
  
+ class atk_border; 
  
  /** It's an abstract class, it's can contains lots of widget,  there are some 
method,  add,  remove a container...
***************
*** 79,85 ****
  
  
!     virtual ~atk_container ()
!     {
!     }
      
      /* call back */
--- 80,86 ----
  
  
!     virtual ~atk_container (); 
!     
!     
      
      /* call back */
***************
*** 92,95 ****
--- 93,100 ----
      /* the space between container and widgets childs */
      u_int16 border_width_; 
+ 
+ 
+     /* the border used by this container */
+     atk_border * border_; 
      
  private : 

Index: atk_manager.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_manager.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** atk_manager.cc      3 Apr 2002 16:11:30 -0000       1.1.2.1
--- atk_manager.cc      5 Apr 2002 19:59:19 -0000       1.1.2.2
***************
*** 14,32 ****
  
  
! 
  #include "atk_manager.h"
  
  
! atk_manager::atk_manager () : cur_window_ (NULL) 
  {
      il_.connect_function (input_event::KEYBOARD_EVENT,
                            MemberTranslator1wRet<input_event 
*,int,atk_manager,int (atk_manager::*)(input_event *)>
!                           (*this, &atk_manager::keyboard_event));  
  
      
      il_.connect_function (input_event::MOUSE_EVENT,
                            MemberTranslator1wRet<input_event 
*,int,atk_manager,int (atk_manager::*)(input_event *)>
!                           (*this, &atk_manager::mouse_event));  
! 
      input_manager::add(&il_);
  }
--- 14,53 ----
  
  
! #include "screen.h"
  #include "atk_manager.h"
  
  
! //  atk_window *  atk_manager::cur_window_ = NULL;
! //  bool atk_manager::alive_ = true; 
! 
! 
! atk_manager::atk_manager ()
! {
!     init (); 
! }
! 
! 
! 
! void atk_manager::init ()   
  {
+     
+     cur_window_ = NULL;
+     alive_ = true; 
+     
+     
+     // connect keyboard function callback
      il_.connect_function (input_event::KEYBOARD_EVENT,
                            MemberTranslator1wRet<input_event 
*,int,atk_manager,int (atk_manager::*)(input_event *)>
!                           (*this, &atk_manager::input_update));  
!     
  
      
+     //connect mouse function callback 
      il_.connect_function (input_event::MOUSE_EVENT,
                            MemberTranslator1wRet<input_event 
*,int,atk_manager,int (atk_manager::*)(input_event *)>
!                           (*this, &atk_manager::input_update));  
!    
!     
!        
      input_manager::add(&il_);
  }
***************
*** 34,38 ****
  
  void atk_manager::add (atk_window *w)
! {
      v_window_.push_back (w); 
  }
--- 55,59 ----
  
  void atk_manager::add (atk_window *w)
! { 
      v_window_.push_back (w); 
  }
***************
*** 42,51 ****
  void atk_manager::remove (atk_window *w)
  {
! 
  }
  
  void atk_manager::clear () 
  {
! 
  }
  
--- 63,81 ----
  void atk_manager::remove (atk_window *w)
  {
!     std::deque <atk_window * >::iterator it = v_window_.begin ();
!     
!     while (it != v_window_.end () && * it != w)it++;
!     
!     if (it != v_window_.end ()) 
!         v_window_.erase (it);     
  }
  
+ 
  void atk_manager::clear () 
  {
!     for (std::deque <atk_window* >::iterator it = v_window_.begin (); it != 
v_window_.end (); it++)
!         delete *it;
!     
!     v_window_.clear (); 
  }
  
***************
*** 54,62 ****
--- 84,107 ----
  void atk_manager::draw () 
  {
+     for (std::deque <atk_window* >::iterator it = v_window_.begin (); it != 
v_window_.end (); it++)
+         (*it)->draw ();
+ 
  
+     /* draw cursor */
+     // WARNING IMPROVE IT !
+     if (mouse_x_ <=  0 || mouse_y_ <=  0 || mouse_x_ >=  screen::length () - 
5 || mouse_y_ >=  screen::height () - 10  ) return; 
+     screen::display.draw_line (mouse_x_, mouse_y_, mouse_x_ + 5, mouse_y_, 
0x000000); 
+     screen::display.draw_line (mouse_x_, mouse_y_, mouse_x_, mouse_y_ + 5, 
0x000000);
+     screen::display.draw_line (mouse_x_, mouse_y_, mouse_x_ + 10, mouse_y_ + 
10, 0x000000); 
+     
  }
  
  
+ void atk_manager::shutdown ()
+ {
+     alive_ = false; 
+ }
  
+ /*
  int atk_manager::keyboard_event (input_event * ev)
  {
***************
*** 71,75 ****
--- 116,190 ----
      return 1; 
  }
+ */
+ 
+ int atk_manager::input_update (input_event * ev)
+ {
+ 
+     // get mouse position for the cursor
+     mouse_event * mev = (mouse_event*) ev; 
+     mouse_x_ = mev->x ();
+     mouse_y_ = mev->y (); 
+     
+     
+     // if the window is a modal window,  only modal window receive input 
event.
+     // if it is not a modal window all the event are dispatch for all window 
in the deque.
+     // In this way if a window catch an event, the event is not longer 
dispatched 
+     if (cur_window_ && cur_window_->is_modal ())
+     {
+         cur_window_->input_update (ev);  
+     }
+     else
+     {
+         // std::deque <atk_window* >::iterator it = v_window_.rend ();
+         // while (it != v_window_.rbegin () && (*it)->input_update (ev) == 
0)it--;
+         int i = v_window_.size () - 1;
+         while ( i > -1 && v_window_[i]->input_update (ev) == 0) i--;  
+         
+     } 
+     return 1; 
+ }
+ 
+ 
+ void atk_manager::set_focus (atk_window * w)
+ {
+     // WARNING :  call lost focus for the window
+     cur_window_ = w; 
+     remove (w);
+     add (w); 
+ }
+ 
  
+ bool atk_manager::update ()
+ {
+     if (cur_window_ && cur_window_->is_modal ())
+     {
+         if (cur_window_->update () == false) 
+         {
+             remove (cur_window_); 
+             delete cur_window_;
+             cur_window_ = NULL;
+         }  
+     }
+     else
+     {
+         int i = v_window_.size () - 1;
+         atk_window * tmp;
+         
+         while ( i > -1)
+         {
+             if (v_window_[i]->update () == false)
+             {
+                 remove (tmp = v_window_[i]);
+                 delete tmp; 
+             } 
+             i--; 
+         } 
+     } 
+     return alive_; 
+ }
  
+ atk_manager::~atk_manager ()
+ {
+     clear (); 
+ }
  

Index: atk_manager.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_manager.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** atk_manager.h       3 Apr 2002 16:11:30 -0000       1.1.2.1
--- atk_manager.h       5 Apr 2002 19:59:19 -0000       1.1.2.2
***************
*** 38,60 ****
  public :
  
!     /** constructor, init event */
!     atk_manager (); 
  
      
      /** Add at the end of list a atk_window
       * @param widget to add
       */
!     void add (atk_window *w); 
      
      
!     /** Remove a atk_widget
       * @param widget to remove
       */
!     void remove (atk_window * w);
      
      
      /** Clear the atk_manager and remove atk_window of the memory 
       */
!     void clear (); 
      
      
--- 38,65 ----
  public :
  
!     atk_manager ();
!     
  
+     /**
+      * init method
+      */
+     void init (); 
+          
      
      /** Add at the end of list a atk_window
       * @param widget to add
       */
!      void add (atk_window *w); 
      
      
!     /** Remove a atk_window
       * @param widget to remove
       */
!      void remove (atk_window * w);
      
      
      /** Clear the atk_manager and remove atk_window of the memory 
       */
!      void clear (); 
      
      
***************
*** 62,66 ****
       * draw all contains.
       */
!     void draw (); 
      
      
--- 67,78 ----
       * draw all contains.
       */
!      void draw (); 
! 
! 
!     /**
!      * update all the window system
!      * @return false if the system is shutdown 
!      */
!      bool update (); 
      
      
***************
*** 70,74 ****
       * Executed when an keyboard event is processed
       */
!     int keyboard_event (input_event * ev);
      
      
--- 82,86 ----
       * Executed when an keyboard event is processed
       */
!     //     int keyboard_event (input_event * ev);
      
      
***************
*** 76,82 ****
       * Executed when an keyboard event is processed
       */
!     int mouse_event (input_event * ev);
      
  
  private : 
  
--- 88,116 ----
       * Executed when an keyboard event is processed
       */
!     //     int mouse_event (input_event * ev);
! 
!     int input_update (input_event *ev); 
!     
! 
!     /**
!      * If this function is call,  alive_ variable become false and update 
function return  false
!      */
!     void shutdown (); 
      
  
+     /**
+      * set the focus windows,  this function put the window on the foreground 
and cur_window_ at the param, in this contexte it is the first window updated
+      * by input event.
+      * @param a window 
+      */
+     void set_focus (atk_window *); 
+ 
+  
+     /**
+      * Destructor
+      * Delelte from memory all component
+      */
+     ~atk_manager (); 
+     
  private : 
  
***************
*** 90,94 ****
      
      /* list of all window that contain this class */
!     std::deque<atk_window*> v_window_;    
  };
  
--- 124,139 ----
      
      /* list of all window that contain this class */
!     std::deque<atk_window*> v_window_;
! 
!     
!     /* alive,  return by update */
!     bool alive_; 
! 
! 
!     /* mouse position
!        WARNING replace this with a cursor*/
!     u_int16 mouse_x_;
!     u_int16 mouse_y_; 
!     
  };
  

Index: atk_widget.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_widget.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** atk_widget.cc       26 Feb 2002 12:44:47 -0000      1.1.2.3
--- atk_widget.cc       5 Apr 2002 19:59:19 -0000       1.1.2.4
***************
*** 20,24 ****
  
  atk_widget::atk_widget () : parent_ (NULL) 
! { 
  }
  
--- 20,24 ----
  
  atk_widget::atk_widget () : parent_ (NULL) 
! {    
  }
  
***************
*** 32,39 ****
  void atk_widget::set_position (s_int32 x, s_int32 y)
  {
!     if (parent_) drawing_area::move (parent_->get_x_real () + (x_ = x), 
parent_->get_y_real () + (y_ = y));
!     else drawing_area::move (x_ = x, y_ = y); 
  }
  
  
  s_int32 atk_widget::get_x () const
--- 32,46 ----
  void atk_widget::set_position (s_int32 x, s_int32 y)
  {
!     x_ = x; 
!     y_ = y;
! 
!     update_position (); 
  }
  
+ void atk_widget::update_position ()
+ {
+     if (parent_) drawing_area::move (parent_->get_x_real () + x_ + 
parent_->get_border_width (), parent_->get_y_real () + y_ 
+parent_->get_border_width () );
+     else drawing_area::move (x_, y_); 
+ }
  
  s_int32 atk_widget::get_x () const
***************
*** 171,173 ****
--- 178,192 ----
      screen::display.draw_line (get_x_real (), get_y_real (),get_x_real 
(),get_y_real ()+ get_height (),  0xFFFFFF); 
      screen::display.draw_line (get_x_real () + get_length (), get_y_real 
(),get_x_real () + get_length (),get_y_real () + get_height (),  0xFFFFFF);
+ }
+ 
+ 
+ int atk_widget::input_update (input_event * ev)
+ {
+     return 0; 
+ }
+ 
+ 
+ bool atk_widget::update ()
+ {
+     return true; 
  }

Index: atk_widget.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_widget.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** atk_widget.h        3 Apr 2002 16:11:30 -0000       1.1.2.4
--- atk_widget.h        5 Apr 2002 19:59:19 -0000       1.1.2.5
***************
*** 25,28 ****
--- 25,30 ----
  #define ATK_WIDGET_H_
  
+ #include "input_event.h"
+ 
  #include "drawing_area.h"
  #include "surface.h"
***************
*** 41,45 ****
  public : 
      /**
!      * Constructor,  initialise some variable.
       */
       atk_widget (); 
--- 43,47 ----
  public : 
      /**
!      * Constructor,  initialise some variable. 
       */
       atk_widget (); 
***************
*** 62,66 ****
  
  
!     /*draw the widget
       */
      virtual void draw (drawing_area * da = NULL, surface * sf = NULL); 
--- 64,69 ----
  
  
!     /**
!      * draw the widget
       */
      virtual void draw (drawing_area * da = NULL, surface * sf = NULL); 
***************
*** 71,80 ****
       * @param y
       */
!     void set_position (s_int32 x, s_int32 y); 
  
  
      /** get x position
       * @return x position in his parent
!     */
      s_int32 get_x () const; 
  
--- 74,88 ----
       * @param y
       */
!     virtual void set_position (s_int32 x, s_int32 y); 
! 
  
+     /** update position
+      */
+     virtual void update_position (); 
+     
  
      /** get x position
       * @return x position in his parent
!      */
      s_int32 get_x () const; 
  
***************
*** 104,108 ****
       * @param height
       */
!     void set_size (u_int32 length, u_int32 height); 
  
      
--- 112,116 ----
       * @param height
       */
!     virtual void set_size (u_int32 length, u_int32 height); 
  
      
***************
*** 117,122 ****
       */
      u_int32 get_height () const; 
! 
! 
      /** set is this object is visible.
       * An event is executed on_show or on_hide depend on bool value.
--- 125,130 ----
       */
      u_int32 get_height () const; 
!     
!     
      /** set is this object is visible.
       * An event is executed on_show or on_hide depend on bool value.
***************
*** 142,146 ****
       */
      bool is_sensible () const; 
! 
      
      /** set if this object can have focus.
--- 150,154 ----
       */
      bool is_sensible () const; 
!     
      
      /** set if this object can have focus.
***************
*** 161,165 ****
       */
      void set_has_focus (const bool b);
! 
      
      /**
--- 169,173 ----
       */
      void set_has_focus (const bool b);
!     
      
      /**
***************
*** 193,196 ****
--- 201,218 ----
  
  
+     /**
+      * input update function
+      * @return 1 if this object use the event,  else return 0
+      */
+     virtual int input_update (input_event *); 
+ 
+ 
+     /** 
+      * update the widget
+      * @return true if no problem,  it is very usefull in atk_window.
+      */
+     virtual bool update (); 
+     
+     
      /** Execute on_destroy callback 
       */

Index: atk_window.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_window.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** atk_window.h        3 Apr 2002 16:11:30 -0000       1.1.2.1
--- atk_window.h        5 Apr 2002 19:59:19 -0000       1.1.2.2
***************
*** 26,29 ****
--- 26,31 ----
  #define ATK_WINDOW_H_
  
+ #include <string> 
+ 
  #include "atk_widget.h"
  #include "atk_bin.h"
***************
*** 35,44 ****
  {
  public :
      
      
  protected : 
  
  
! private : 
  };
  
--- 37,217 ----
  {
  public :
+ 
+     
+     /**
+      * Constructor
+      * set modal true
+      */ 
+     atk_window (); 
+     
+     
+     /**
+      * Set the title of the window
+      * @param title of the window
+      */
+     void set_title (const std::string &);  
+ 
+     
+     
+     /**
+      * set type of the window
+      * @param type of the window
+      */
+     void set_type (const u_int8); 
+  
+ 
+     /**
+      * set modal
+      * @param true if the window is a modal window
+      */
+     void set_modal (const bool);
+ 
+ 
+     /**
+      * is_modal
+      * @return true if the window is a modal window
+      */
+     bool is_modal ()  const; 
+ 
+ 
+     /**
+      * set deleted with mouse
+      * @param true if can be deleted
+      */
+     void set_deleted (const bool); 
+ 
+ 
      
+     /**
+      * @return if this window can be deleted with mouse
+      */
+     bool is_deleted () const; 
+     
+ 
+ 
+     /**
+      * set moveable with mouse
+      * @param true if can be moved with mouse
+      */
+     void set_moveable (const bool); 
+ 
+ 
+     
+     /**
+      * @return if this window can be moved with mouse
+      */
+     bool is_moveable () const; 
+     
+ 
+ 
+     /**
+      * set resizeable with mouse
+      * @param true if can be resized
+      */
+     void set_resizeable (const bool); 
+     
+     
+     
+     /**
+      * @return if this window can be resized with mouse
+      */
+     bool is_resizeable () const; 
+     
+     
+     
+     /**
+      * input update function
+      * @return 1 if this object use the event,  else return 0
+      */
+     int input_update (input_event *); 
+     
+ 
+     /**
+      * If this function is call,  alive_ variable become false and update 
function return  false
+      */
+     void shutdown ();
+     
+     
+     /**
+      * draw the window
+      */
+     void draw (drawing_area * da = NULL, surface * sf = NULL); 
+     
+ 
+     /** 
+      * update the widget
+      * @return alive_ variable,  if alive_ is false the window manager 
destroy this object
+      */
+     virtual bool update ();
+     
+ 
+     /**
+      * use to build the window.
+      */ 
+     void realize (); 
+         
+     
+     /** set size of the window
+      * @param length
+      * @param height
+      */
+     virtual void set_size (u_int32 length, u_int32 height);
+     
+     
+     /* type of the window,  use for decoration */
+     const static u_int8 TOPLEVEL = 0;
+     const static u_int8 DIALOG = 1;
+     const static u_int8 POPUP = 2;
+ 
+     
+     /* sig */
+     /* this sig is call when you close the window */
+     callback_sig on_delete; 
      
  protected : 
  
  
! private :
!     
!     /* type of the window*/
!     u_int8 type_; 
!     
!     /* title of the window */
!     std::string title_;
! 
!     
!     /* resizeable with the mouse*/
!     bool resizeable_;
! 
!     
!     /* set if the widow can be deleted with the mouse */
!     bool deleted_; 
! 
! 
!     /* set if the window can be move with the mouse */
!     bool moveable_; 
! 
!     
!     /* modal */
!     bool modal_;
!     
!     
!     /* alive */
!     bool alive_; 
! 
! 
!     /* mouse range */
!     u_int16 mouse_range_x_;
!     u_int16 mouse_range_y_; 
! 
!     
! 
!     /* mouse status action */ 
!     typedef enum
!         {
!             ACTION_NONE, ACTION_MOVE, ACTION_RESIZE
!         } mouse_action;
!     mouse_action mouse_action_;
!     
  };
  

Index: callback.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/callback.h,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -C2 -r1.4.4.2 -r1.4.4.3
*** callback.h  20 Feb 2002 16:27:51 -0000      1.4.4.2
--- callback.h  5 Apr 2002 19:59:19 -0000       1.4.4.3
***************
*** 29,33 ****
  
  #include <string.h> 
! #include <stddef.h> 
  
  
--- 29,33 ----
  
  #include <string.h> 
! #include <stddef.h>                     
  
  
***************
*** 36,40 ****
   * callback, so i explain just how use it in example.
   *
!  *  class A{
   *   public:
   *    void print() { cout << "Adonthell callback\n"; }
--- 36,40 ----
   * callback, so i explain just how use it in example.
   *
!  *  class A{                            
   *   public:
   *    void print() { cout << "Adonthell callback\n"; }

Index: joltest.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/joltest.cc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -r1.1.2.6 -r1.1.2.7
*** joltest.cc  3 Apr 2002 16:11:30 -0000       1.1.2.6
--- joltest.cc  5 Apr 2002 19:59:19 -0000       1.1.2.7
***************
*** 10,13 ****
--- 10,14 ----
  #include "atk_fixed.h"
  #include "atk_manager.h"
+ #include "atk_window.h"
  #include "gametime.h"
  
***************
*** 18,37 ****
      screen::set_video_mode (640, 480, 16); 
      screen::clear (); 
  
!     atk_manager manager; 
!      
  
!     while (1)
      {
          input_manager::update(); 
-         gametime::update (); 
  
          
          screen::display.fillrect (0, 0, 640, 480, 127, 127, 127);
          
          
          screen::show ();
          
!         screen::clear ();  
      }
  
--- 19,90 ----
      screen::set_video_mode (640, 480, 16); 
      screen::clear (); 
+     
+     
+     atk_manager manager;  
+     
  
!     atk_window * wnd =  new atk_window; 
!     
!     wnd->set_visible (true);
!     wnd->set_position (20, 40);
!     wnd->set_size (350, 200);
!     wnd->on_delete.connect (new callback_slot (makeFunctor (manager, 
&atk_manager::shutdown))); 
!     
  
!     atk_box * box = new atk_box; 
!     box->set_border_width (10); 
!     box->set_spacing (3); 
!     box->set_visible (true); 
!     box->set_size (200, 60);
!     box->set_position (50, 50); 
!     box->set_geometry (atk_box::VERTICAL); 
!     
!     
!     atk_widget * wid; 
! 
!     wid = new atk_widget;
!     wid->set_size (30, 50);
!     wid->set_visible (true);
!     wid->realize (); 
!     box->add_start (wid, true, true, 0); 
! 
!     
!     wid = new atk_widget;
!     wid->set_size (30, 20);
!     wid->set_visible (true);
!     wid->realize (); 
!     box->add_start (wid, true, true, 0); 
! 
!     wid = new atk_widget;
!     wid->set_size (10, 50);
!     wid->set_visible (true);
!     wid->realize (); 
!     box->add_end (wid, true, true, 15) ; 
!  
!     box->realize ();  
! 
! 
! 
!     wnd->add (box);
!     wnd->set_resizeable (true); 
!     wnd->realize (); 
!     
!     manager.add (wnd); 
!     
!     
!     while (manager.update () )
      {
          input_manager::update(); 
  
+         gametime::update (); 
          
          screen::display.fillrect (0, 0, 640, 480, 127, 127, 127);
          
+ 
+         manager.draw (); 
          
          screen::show ();
          
!         screen::clear ();     
      }
  




reply via email to

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