# Copyright (C) 2001 Tobias Peters # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # the prefix used by gdome's class identifiers Gdome_class_prefix = "Gdome" # the prefix used by gdome's method identifiers Gdome_method_prefix = Gdome_class_prefix.downcase() + "_" # gdome2 abbreviates all interface names in method names. Here is how: Gdome_ABBREVIATIONS = { "DOMString" => "str", "Node" => "n" , "Element" => "el" , "Attr" => "a" , "CharacterData" => "cd" , "Text" => "t" , "CDATASection" => "cds", "Comment" => "c" , "DOMImplementation" => "di" , "Document" => "doc", "DocumentFragment" => "df" , "DocumentType" => "dt" , "Entity" => "ent", "EntityReference" => "er" , "NamedNodeMap" => "nnm", "NodeList" => "nl" , "Notation" => "not", "ProcessingInstruction" => "pi" } # The name used by libgdome for the C struct providing this interface. # interface might be a string containing the name of the interface or # an object that responds to to_s def gdome_class_name(interface) " " + Gdome_class_prefix + interface.to_s() + " " end # The name used by libgdome for the C function providing this method of this # interface. # interface and methods might be a strings containing the names of the # interface or method, or they might be objects of type Idl_Interface or # Idl_Method, respectively def gdome_method_name(interface, method) " " + Gdome_method_prefix + Gdome_ABBREVIATIONS[interface.to_s()] + "_" + method.to_s() + " " end