;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program 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 General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "inventor/xt-config")



#? *** xt_others

;; dummy function that adds Inventor header files in C file
(eval `(de |dummy_xt_others| () ,inventorxt-cpheader-cmd ()))

#? * soxtclipboard
;;.TYPE CLASS
#? (new soxtclipboard <w> <selectionatom> <shellflag>>
#? (==> <soxtclipboard> copy-node <node> <eventtime>)
#? (==> <soxtclipboard> copy-path <path> <eventtime>)
#? (==> <soxtclipboard> copy-pathlist <pathlist> <eventtime>)
#? (==> <soxtclipboard> copy <datatype> <data> <numbytes> <eventtime>)
#? (==> <soxtclipboard> paste <eventtime> <pastedonefunc> <userdata>)
#? (==> <soxtclipboard> addpasteinterest <datatype> <pasteimportfunc> <userdata>)

#? * soxtresource
;;.TYPE CLASS
#? (new soxtresource <w> <shellflag>>
#? (==> <soxtresource> getresource-sbcolor <resname> <resclass> <c>)
#? (==> <soxtresource> getresource-short <resname> <resclass> <i>)
#? (==> <soxtresource> getresource-ushort <resname> <resclass> <u>)
#? (==> <soxtresource> getresource-charptr <resname> <resclass> <s>)
#? (==> <soxtresource> getresource-sbbool <resname> <resclass> <b>)
#? (==> <soxtresource> getresource-float <resname> <resclass> <f>)

#? * (|dummy_xt_others|)

;; ********************************************************


(libload "inventor/xt-config")
(libload "inventor/inventorobject")

;;class SoXtClipboard 
(defclass SoXtClipboard InventorObject)

(defmethod  SoXtClipboard  SoXtClipboard (  w selectionAtom  shellflag)
  
  ((-bool-) shellflag)
  ((-gptr- "Widget") w) 
  ((-int-) selectionAtom)           ;; Atom (unsigned long) -> int
  #{  if($shellflag == false ) {
            $p = new SoXtClipboard( $w  ,$selectionAtom );
            $shell_flag = false;
      }
      else
            $shell_flag = true;
  #} 
  ())

(defmethod  SoXtClipboard  copy_node (  node eventTime )
  
  ((-gptr- "SoNode *") node) 
  ((-int-) eventTime)               ;; Time (unsigned long) -> int
  #{  ((SoXtClipboard *)$p)->copy( $node  ,$eventTime );  #} 
  ())

(defmethod  SoXtClipboard  copy_path (  path eventTime )
  
  ((-gptr- "SoPath *") path) 
  ((-int-) eventTime)                ;; Time (unsigned long) -> int
  #{  ((SoXtClipboard *)$p)->copy( $path  ,$eventTime );  #} 
  ())

(defmethod  SoXtClipboard  copy_pathlist (  pathList eventTime )
  
  ((-gptr- "SoPathList *") pathList) 
  ((-int-) eventTime)                ;; Time (unsigned long) -> int
  #{  ((SoXtClipboard *)$p)->copy( $pathList  ,$eventTime );  #} 
  ())

(defmethod  SoXtClipboard  copy (  dataType data numBytes eventTime )
  
  ((-int-) dataType)           ;; Atom (unsigned long) -> int
  ((-gptr-) data) 
  ((-int-) numBytes)           ;; uint32_t -> int
  ((-int-) eventTime)            ;; Time -> int
  #{  ((SoXtClipboard *)$p)->copy( $dataType  ,$data  ,$numBytes  ,$eventTime );  #} 
  ())

(defmethod  SoXtClipboard  paste (  eventTime pasteDoneFunc userData )
  
  ((-int-) eventTime)           ;; Time -> int
  ((-gptr- "SoXtClipboardPasteCB *") pasteDoneFunc) 
  ((-gptr-) userData) 
  #{  ((SoXtClipboard *)$p)->paste( $eventTime  ,$pasteDoneFunc  ,$userData );  #} 
  ())

(defmethod  SoXtClipboard  addPasteInterest (  dataType pasteImportFunc userData )
  
  ((-int-) dataType)           ;; Atom (unsigned long) -> int
  ((-gptr- "SoXtClipboardImportCB *") pasteImportFunc) 
  ((-gptr-) userData) 
  #{  ((SoXtClipboard *)$p)->addPasteInterest( $dataType  ,$pasteImportFunc  ,$userData );  #} 
  ())




;;class SoXtResource 
(defclass SoXtResource InventorObject)

(defmethod  SoXtResource  SoXtResource ( w  shellflag)
  
  ((-bool-) shellflag)
  ((-gptr- "Widget") w) 
  #{  if($shellflag == false ) {
            $p = new SoXtResource( $w );
            $shell_flag = false;
      }
      else
            $shell_flag = true;
  #} 
  ())


(defmethod  SoXtResource  getResource_sbcolor ( resName resClass c )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "SbColor *") c)        ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$c )  #} ))    ;; SbBool -> int

(defmethod  SoXtResource  getResource_short ( resName resClass i )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "short *") i)           ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$i )  #} ))    ;; SbBool -> int

(defmethod  SoXtResource  getResource_ushort ( resName resClass u )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "unsigned short *") u)        ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$u )  #} ))    ;; SbBool -> int

(defmethod  SoXtResource  getResource_charptr ( resName resClass s )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "char **") s)                 ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$s )  #} ))    ;; SbBool -> int

(defmethod  SoXtResource  getResource_sbbool ( resName resClass b )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "SbBool *") b)               ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$b )  #} ))    ;; SbBool -> int

(defmethod  SoXtResource  getResource_float ( resName resClass f )
  
  ((-gptr- "char *") resName) 
  ((-gptr- "char *") resClass) 
  ((-gptr- "float *") f)                ;; reference -> gptr
  (int #{  ((SoXtResource *)$p)->getResource( $resName  ,$resClass  ,*$f )  #} ))    ;; SbBool -> int

()

;; ********************************************************

(let ((dhc-make-lushflags inventorxt-lushflags))
  (dhc-make-with-c++ () ()
  |dummy_xt_others|
  (soxtclipboard addpasteinterest paste copy copy-pathlist copy-path
		 copy-node soxtclipboard)
  (soxtresource getresource-float getresource-sbbool
		getresource-charptr getresource-ushort getresource-short
		getresource-sbcolor soxtresource) ))
