Update of /cvsroot/planeshift/planeshift/src/client/paws In directory sc8-pr-cvs1:/tmp/cvs-serv4090/src/client/paws Modified Files: chatwindow.h inventorywindow.h pawsbutton.h pawscontrolwindow.h pawscrollbar.h pawsexchangewindow.h pawsglyphwindow.h pawsgroupwindow.h pawsinfowindow.h pawsinteractwindow.h pawsitemdescriptionwindow.h pawslistbox.h pawsobjectview.h pawsradio.h pawstextbox.h pawswidget.h pawsyesnobox.h Log Message: Added CREATE_PAWS_FACTORY macro to make it easy to create widget factories. Index: chatwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/chatwindow.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** chatwindow.h 20 Jun 2003 21:08:32 -0000 1.7 --- chatwindow.h 3 Jul 2003 21:33:27 -0000 1.8 *************** *** 141,158 **** //-------------------------------------------------------------------------- ! class pawsChatWindowFactory : public pawsWidgetFactory ! { ! public: ! pawsChatWindowFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsChatWindow" ); ! } - pawsWidget* Create() - { - return new pawsChatWindow( mainManager ); - } - }; //-------------------------------------------------------------------------- --- 141,146 ---- //-------------------------------------------------------------------------- ! CREATE_PAWS_FACTORY( pawsChatWindow ); //-------------------------------------------------------------------------- Index: inventorywindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/inventorywindow.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inventorywindow.h 21 Jun 2003 23:05:34 -0000 1.3 --- inventorywindow.h 3 Jul 2003 21:33:27 -0000 1.4 *************** *** 61,80 **** static float ratioY; }; ! ! class pawsItemSlotFactory : public pawsWidgetFactory ! { ! public: ! pawsItemSlotFactory( psPawsManager* manager ) : pawsWidgetFactory(manager) ! { ! Register( "pawsItemSlot" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsItemSlot( mainManager ); ! } ! }; ! class pawsInventoryWindow : public pawsWidget, public iNetSubscriber --- 61,67 ---- static float ratioY; }; + CREATE_PAWS_FACTORY( pawsItemSlot ); ! //--------------------------------------------------------------------------- class pawsInventoryWindow : public pawsWidget, public iNetSubscriber *************** *** 117,139 **** void ClearInventory(); }; ! //-------------------------------------------------------------------------- - - class pawsInventoryWindowFactory : public pawsWidgetFactory - { - public: - pawsInventoryWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsInventoryWindow" ); - } - - pawsWidget* Create() - { - return new pawsInventoryWindow( mainManager ); - } - }; - #endif --- 104,110 ---- void ClearInventory(); }; ! CREATE_PAWS_FACTORY( pawsInventoryWindow ); //-------------------------------------------------------------------------- #endif Index: pawsbutton.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsbutton.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsbutton.h 4 May 2003 00:09:12 -0000 1.2 --- pawsbutton.h 3 Jul 2003 21:33:27 -0000 1.3 *************** *** 58,75 **** //---------------------------------------------------------------------- - class pawsButtonFactory : public pawsWidgetFactory - { - public: - pawsButtonFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsButton" ); - } - - pawsWidget* Create() - { - return new pawsButton( mainManager ); - } - }; #endif --- 58,62 ---- //---------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsButton ); #endif Index: pawscontrolwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawscontrolwindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawscontrolwindow.h 2 Jun 2003 03:33:33 -0000 1.1 --- pawscontrolwindow.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 38,56 **** }; ! ! class pawsControlWindowFactory : public pawsWidgetFactory ! { ! public: ! pawsControlWindowFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsControlWindow" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsControlWindow( mainManager ); ! } ! }; #endif --- 38,42 ---- }; ! CREATE_PAWS_FACTORY( pawsControlWindow ); #endif Index: pawscrollbar.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawscrollbar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawscrollbar.h 27 Apr 2003 03:48:45 -0000 1.1 --- pawscrollbar.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 76,95 **** //-------------------------------------------------------------------------------- ! ! class pawsScrollBarFactory : public pawsWidgetFactory ! { ! public: ! pawsScrollBarFactory( psPawsManager* manager ) : ! pawsWidgetFactory ( manager ) ! { ! Register( "pawsScrollBar" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsScrollBar( mainManager ); ! ! } ! }; --- 76,80 ---- //-------------------------------------------------------------------------------- ! CREATE_PAWS_FACTORY( pawsScrollBar ); Index: pawsexchangewindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsexchangewindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsexchangewindow.h 19 Jun 2003 17:35:06 -0000 1.2 --- pawsexchangewindow.h 3 Jul 2003 21:33:27 -0000 1.3 *************** *** 129,147 **** //-------------------------------------------------------------------------- - class pawsExchangeWindowFactory : public pawsWidgetFactory - { - public: - pawsExchangeWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsExchangeWindow" ); - } - - pawsWidget* Create() - { - return new pawsExchangeWindow( mainManager ); - } - }; --- 129,134 ---- //-------------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsExchangeWindow ); Index: pawsglyphwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsglyphwindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsglyphwindow.h 17 Jun 2003 21:08:36 -0000 1.2 --- pawsglyphwindow.h 3 Jul 2003 21:33:27 -0000 1.3 *************** *** 72,90 **** //-------------------------------------------------------------------------- - class pawsGlyphWindowFactory : public pawsWidgetFactory - { - public: - pawsGlyphWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsGlyphWindow" ); - } - - pawsWidget* Create() - { - return new pawsGlyphWindow( mainManager ); - } - }; --- 72,77 ---- //-------------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsGlyphWindow ); Index: pawsgroupwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsgroupwindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawsgroupwindow.h 9 Jun 2003 21:55:43 -0000 1.1 --- pawsgroupwindow.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 69,87 **** //-------------------------------------------------------------------------- - class pawsGroupWindowFactory : public pawsWidgetFactory - { - public: - pawsGroupWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsGroupWindow" ); - } - - pawsWidget* Create() - { - return new pawsGroupWindow( mainManager ); - } - }; #endif --- 69,74 ---- //-------------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsGroupWindow ); #endif Index: pawsinfowindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsinfowindow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pawsinfowindow.h 29 May 2003 23:57:04 -0000 1.4 --- pawsinfowindow.h 3 Jul 2003 21:33:27 -0000 1.5 *************** *** 53,71 **** }; - class pawsInfoWindowFactory : public pawsWidgetFactory - { - public: - pawsInfoWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsInfoWindow" ); - } - - pawsWidget* Create() - { - return new pawsInfoWindow( mainManager ); - } - }; #endif --- 53,58 ---- }; + CREATE_PAWS_FACTORY( pawsInfoWindow ); #endif Index: pawsinteractwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsinteractwindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawsinteractwindow.h 29 May 2003 23:57:04 -0000 1.1 --- pawsinteractwindow.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 48,66 **** //-------------------------------------------------------------------------- - class pawsInteractWindowFactory : public pawsWidgetFactory - { - public: - pawsInteractWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsInteractWindow" ); - } - - pawsWidget* Create() - { - return new pawsInteractWindow( mainManager ); - } - }; #endif --- 48,53 ---- //-------------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsInteractWindow ); #endif Index: pawsitemdescriptionwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsitemdescriptionwindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawsitemdescriptionwindow.h 26 May 2003 17:46:48 -0000 1.1 --- pawsitemdescriptionwindow.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 48,67 **** }; - - class pawsItemDescriptionWindowFactory : public pawsWidgetFactory - { - public: - pawsItemDescriptionWindowFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsItemDescriptionWindow" ); - } - - pawsWidget* Create() - { - return new pawsItemDescriptionWindow( mainManager ); - } - }; #endif --- 48,53 ---- }; + CREATE_PAWS_FACTORY( pawsItemDescriptionWindow ); #endif Index: pawslistbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawslistbox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pawslistbox.h 3 Jul 2003 19:11:48 -0000 1.3 --- pawslistbox.h 3 Jul 2003 21:33:27 -0000 1.4 *************** *** 115,132 **** //---------------------------------------------------------------------- - class pawsListBoxFactory : public pawsWidgetFactory - { - public: - pawsListBoxFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsListBox" ); - } - pawsWidget* Create() - { - return new pawsListBox( mainManager ); - } - }; #endif --- 115,120 ---- //---------------------------------------------------------------------- + CREATE_PAWS_FACTORY ( pawsListBox ); #endif Index: pawsobjectview.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsobjectview.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawsobjectview.h 19 May 2003 22:50:09 -0000 1.1 --- pawsobjectview.h 3 Jul 2003 21:33:27 -0000 1.2 *************** *** 44,62 **** csVector3 objectPos; }; - class pawsObjectViewFactory : public pawsWidgetFactory - { - public: - pawsObjectViewFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsObjectView" ); - } - - pawsWidget* Create() - { - return new pawsObjectView( mainManager ); - } - }; #endif --- 44,49 ---- csVector3 objectPos; }; + CREATE_PAWS_FACTORY( pawsObjectView ); #endif Index: pawsradio.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsradio.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsradio.h 3 Jul 2003 19:11:48 -0000 1.2 --- pawsradio.h 3 Jul 2003 21:33:27 -0000 1.3 *************** *** 36,54 **** }; ! ! class pawsRadioButtonFactory : public pawsWidgetFactory ! { ! public: ! pawsRadioButtonFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsRadioButton" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsRadioButton( mainManager ); ! } ! }; //--------------------------------------------------------------------------- --- 36,40 ---- }; ! CREATE_PAWS_FACTORY( pawsRadioButton ); //--------------------------------------------------------------------------- *************** *** 65,84 **** void SetActive( const char* widgetName ); }; - - class pawsRadioButtonGroupFactory : public pawsWidgetFactory - { - public: - pawsRadioButtonGroupFactory( psPawsManager* manager ) : - pawsWidgetFactory ( manager ) - { - Register( "pawsRadioButtonGroup" ); - } - - pawsWidget* Create() - { - return new pawsRadioButtonGroup( mainManager ); - } - }; --- 51,56 ---- void SetActive( const char* widgetName ); }; + CREATE_PAWS_FACTORY( pawsRadioButtonGroup ); Index: pawstextbox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawstextbox.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pawstextbox.h 3 Jul 2003 19:11:48 -0000 1.7 --- pawstextbox.h 3 Jul 2003 21:33:27 -0000 1.8 *************** *** 68,86 **** //-------------------------------------------------------------------------- - class pawsTextBoxFactory : public pawsWidgetFactory - { - public: - pawsTextBoxFactory( psPawsManager* manager ) : - pawsWidgetFactory( manager ) - { - Register( "pawsTextBox" ); - } - - pawsWidget* Create() - { - return new pawsTextBox( mainManager ); - } - }; --- 68,73 ---- //-------------------------------------------------------------------------- + CREATE_PAWS_FACTORY( pawsTextBox ); *************** *** 136,154 **** }; ! ! class pawsMessageTextBoxFactory : public pawsWidgetFactory ! { ! public: ! pawsMessageTextBoxFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsMessageTextBox" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsMessageTextBox( mainManager ); ! } ! }; #define BLINK_TICKS 1000 --- 123,127 ---- }; ! CREATE_PAWS_FACTORY( pawsMessageTextBox ); #define BLINK_TICKS 1000 *************** *** 200,219 **** }; ! ! class pawsEditTextBoxFactory : public pawsWidgetFactory ! { ! public: ! pawsEditTextBoxFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsEditTextBox" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsEditTextBox( mainManager ); ! } ! }; ! #endif --- 173,177 ---- }; ! CREATE_PAWS_FACTORY( pawsEditTextBox ); #endif Index: pawswidget.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawswidget.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pawswidget.h 3 Jul 2003 19:11:48 -0000 1.15 --- pawswidget.h 3 Jul 2003 21:33:27 -0000 1.16 *************** *** 327,330 **** --- 327,331 ---- //--------------------------------------------------------------------------- + class pawsBaseWidgetFactory : public pawsWidgetFactory { *************** *** 341,344 **** --- 342,363 ---- } }; + + + #define CREATE_PAWS_FACTORY( factoryName ) \ + class factoryName##Factory : public pawsWidgetFactory \ + { \ + public: \ + factoryName##Factory( psPawsManager* manager ) : pawsWidgetFactory( manager ) \ + { \ + Register( #factoryName ); \ + } \ + \ + pawsWidget* Create() \ + { \ + return new factoryName( mainManager ); \ + } \ + }; + + Index: pawsyesnobox.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsyesnobox.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsyesnobox.h 9 Jun 2003 21:55:43 -0000 1.2 --- pawsyesnobox.h 3 Jul 2003 21:33:27 -0000 1.3 *************** *** 59,77 **** }; ! ! class pawsYesNoBoxFactory : public pawsWidgetFactory ! { ! public: ! pawsYesNoBoxFactory( psPawsManager* manager ) : ! pawsWidgetFactory( manager ) ! { ! Register( "pawsYesNoBox" ); ! } ! ! pawsWidget* Create() ! { ! return new pawsYesNoBox( mainManager ); ! } ! }; #endif --- 59,63 ---- }; ! CREATE_PAWS_FACTORY( pawsYesNoBox ); #endif |