Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

vos/gui/gui/menu.cc

Go to the documentation of this file.
00001 /* $Id: menu.cc,v 1.5 2003/07/23 00:17:20 reed Exp $ */
00002 
00003 
00004 /*
00005  Copyright (C) 2002 Peter Amstutz <tetron@interreality.org>
00006 
00007  This library is free software; you can redistribute it and/or
00008  modify it under the terms of the GNU Lesser General Public
00009  License as published by the Free Software Foundation; either
00010  version 2 of the License, or (at your option) any later version.
00011 
00012  This library is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public
00018  License along with this library; if not, write to the Free Software
00019  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 */
00021 
00022 /** @file menu.cc Code: a MetaObject for Menu object types. */
00023 
00024 #include <vos/corelibs/vos/vos.hh>
00025 #include <vos/metaobjects/property/property.hh>
00026 #include "menu.hh"
00027 
00028 using namespace VOSGUI;
00029 
00030 /* Constructor */
00031 Menu::Menu(MetaObject* s) : MetaObject(s)
00032 {
00033 }
00034 
00035 /* Destructor */
00036 Menu::~Menu() {
00037 }
00038 
00039 /* Get/Set default AC */
00040 void Menu::setPropertyAccessControl(PropertyAccessControl* ac) {
00041     accessControl = ac;
00042 }
00043 
00044 PropertyAccessControl* Menu::getPropertyAccessControl() {
00045     return accessControl;
00046 }
00047 
00048 LocalMenu::LocalMenu(MetaObject* s) : Menu(s), MetaObject(s)
00049 {
00050     accessControl = &NoPropertyAccessControl::static_;
00051 }
00052 
00053 LocalMenu::~LocalMenu() {
00054 }
00055 
00056 /* Initialize required subobjects: */
00057 
00058 void LocalMenu::initialize(PropertyAccessControl* ac) {
00059     accessControl = ac;
00060 }
00061 
00062 void LocalMenu::initialize() {
00063     initialize(&NoPropertyAccessControl::static_);
00064 }
00065 
00066 RemoteMenu::RemoteMenu(MetaObject* s) : Menu(s), MetaObject(s)
00067 {
00068 }
00069 
00070 RemoteMenu::~RemoteMenu() {
00071 }
00072 
00073 /* Return type string ("gui:menu") */
00074 
00075 const string Menu::getType() {
00076     return string("gui:menu");
00077 }
00078 
00079 /* Register extenders with libvos MetaFactory */
00080 void Menu::registerExtenders() {
00081     LocalSite::addLocalObjectExtension(typeid(LocalMenu).name(), &LocalMenu::new_LocalMenu);
00082     LocalSite::addLocalObjectExtension(typeid(Menu).name(), &LocalMenu::new_LocalMenu);
00083     LocalSite::addLocalObjectExtension("gui:menu", &LocalMenu::new_LocalMenu);
00084     RemoteSite::addRemoteObjectExtension(typeid(RemoteMenu).name(), &RemoteMenu::new_RemoteMenu);
00085     RemoteSite::addRemoteObjectExtension(typeid(Menu).name(), &RemoteMenu::new_RemoteMenu);
00086     RemoteSite::addRemoteObjectExtension("gui:menu", &RemoteMenu::new_RemoteMenu);
00087 }
00088 
00089 /* Get and set Subproperties and other Subobjects */
00090 
00091 
00092 /* Process local object messages */
00093 /* XXX probably not necesary, since handler methods are registered
00094    in the generator (new_*)
00095 */
00096 void LocalMenu::sendMessage(Message* m) {
00097 
00098     /* Let superclass have message */
00099     Menu::sendMessage(m);
00100 }
00101 
00102 
00103 
00104 
00105 
00106 /* Process remote update messages */
00107 void RemoteMenu::sendUpdateMessage(Message* m) {
00108 
00109 
00110     /* branch to update message handlers specific to RemoteMenu 
00111 
00112     This method is very redundant if handlers have already been registered as 
00113     callbacks, but here is how you would do it: */
00114 
00115     /* let superclass have message... */
00116     Menu::sendUpdateMessage(m);
00117 }
00118 
00119 
00120 
00121 /* Generators for factory */
00122 
00123 
00124 MetaObject* LocalMenu::new_LocalMenu(MetaObject *s, const string& type) {
00125     LocalMenu* o = new LocalMenu(s);
00126     return o;
00127 }
00128 
00129 MetaObject* RemoteMenu::new_RemoteMenu(MetaObject *s, const string& type) {
00130     return new RemoteMenu(s);
00131 }
00132 

Generated on Tue Aug 12 03:55:43 2003 for Interreality Project - VOS by doxygen 1.3.2