;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Some Emacs lisp functions to help write ;; ROOT based classes and applications ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; $Id: root-help.el,v 1.3 2001/07/29 11:27:50 cholm Exp $ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun root-header-skel () "Insert a skeleton for a ROOT based class" (interactive) (setq root-class-name (file-name-sans-extension (buffer-name))) (goto-char (point-min)) (insert "// -*- mode: c++ -*- // // $Id" " $ // #ifndef " (symbol-value 'root-class-name) "_H #define " (symbol-value 'root-class-name) "_H #ifndef ROOT_TObject #include #endif class " (symbol-value 'root-class-name) " : public TObject { private: public: " (symbol-value 'root-class-name) "(); ClassDef(" (symbol-value 'root-class-name) ",0) // }; // // $Log" "$ // ") (goto-char (point-min))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun root-header-skel () "Insert a skeleton for a ROOT based class" (interactive) (setq root-class-name (file-name-sans-extension (buffer-name))) (goto-char (point-min)) (insert "//____________________________________________________________________ // // // //____________________________________________________________________ // // $Id" "$ // #ifndef " (symbol-value 'root-class-name) "_H #include \"" (symbol-value 'root-class-name) ".h\" #endif //____________________________________________________________________ ClassImp(" (symbol-value 'root-class-name) ") //____________________________________________________________________ " (symbol-value 'root-class-name) "::" (symbol-value 'root-class-name) "() { // Default constructor } //____________________________________________________________________ // // $Log" "$ // ") (goto-char (point-min))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun root-include-header (&optional header) "Insert an #include for a ROOT class" (interactive) (if (not header) (setq header (read-string "Class name: "))) (insert "#ifndef ROOT_" (symbol-value 'header) " #include \"" (symbol-value 'header) ".h\" #endif ")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun root-main () "Insert a skeleton for a ROOT based program" (interactive) (setq root-main-name (file-name-sans-extension (buffer-name))) (setq need-application (y-or-n-p "Do you need graphics ")) (goto-char (point-min)) (insert "//\n// $Id" "$\n// $Author" "$\n// $Date" "$\n//\n#ifndef __CINT__\n") (if need-application (root-include-header "TApplication")) (insert "// put headers here\n#endif\n\n") (insert "int " (symbol-value 'root-main-name) "()\n{\n") (insert " // Define your main function here\n\n return 0;\n}\n\n") (insert "#ifndef __CINT__\nint main(int argc, char** argv)\n{\n") (if need-application (insert " TApplication " (symbol-value 'root-main-name) "App(" (symbol-value 'root-main-name) "App, &argc, argv);\n\n")) (insert " int retVal = " (symbol-value 'root-main-name) "();\n\n") (if need-application (insert " " (symbol-value 'root-main-name) "App.Run();\n\n")) (insert " return retVal;\n}\n#endif\n//\n// $Log" "$\n//\n")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun sys-include-header (&optional header) "Insert an #include for a system header" (interactive) (if (not header) (setq header (read-string "Header name: "))) (insert "#ifndef __" (upcase header) "__\n" "#include <" (symbol-value 'header) ">\n" "#endif\n")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'root-help) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; $Id: root-help.el,v 1.3 2001/07/29 11:27:50 cholm Exp $ ;;