;; -*- scheme -*-
; object definitions ...
(define-object Applet
  (in-module "Panel")
  (parent "GtkEventBox")
  (c-name "PanelApplet")
  (gtype-id "PANEL_TYPE_APPLET")
)

;; Enumerations and flags ...

;(define-enum AppletBackgroundType
;  (in-module "Panel")
;  (c-name "PanelAppletBackgroundType")
;  (gtype-id "PANEL_TYPE_APPLET_BACKGROUND_TYPE")
;  (values
;    '("no-background" "PANEL_NO_BACKGROUND")
;    '("color-background" "PANEL_COLOR_BACKGROUND")
;    '("pixmap-background" "PANEL_PIXMAP_BACKGROUND")
;  )
;)

;(define-flags AppletFlags
;  (in-module "Panel")
;  (c-name "PanelAppletFlags")
;  (gtype-id "PANEL_TYPE_APPLET_FLAGS")
;  (values
;    '("flags-none" "PANEL_APPLET_FLAGS_NONE")
;    '("expand-major" "PANEL_APPLET_EXPAND_MAJOR")
;    '("expand-minor" "PANEL_APPLET_EXPAND_MINOR")
;  )
;)


;; From /home/jdahlin/cvs/gnome2/gnome-panel/libpanel-applet/panel-applet.h

(define-function panel_applet_get_type
  (c-name "panel_applet_get_type")
  (return-type "GType")
)

(define-function panel_applet_new
  (c-name "panel_applet_new")
  (is-constructor-of PanelApplet)
  (return-type "GtkWidget*")
)

(define-method get_orient
  (of-object "PanelApplet")
  (c-name "panel_applet_get_orient")
  (return-type "int") ; "PanelAppletOrient")
)

(define-method get_size
  (of-object "PanelApplet")
  (c-name "panel_applet_get_size")
  (return-type "guint")
)

(define-method get_background
  (of-object "PanelApplet")
  (c-name "panel_applet_get_background")
  (return-type "int") ; "PanelAppletBackgroundType")
  (parameters
    ;'("GdkColor*" "color")
    ;'("GdkPixmap**" "pixmap")
  )
)

(define-method get_preferences_key
  (of-object "PanelApplet")
  (c-name "panel_applet_get_preferences_key")
  (return-type "gchar*")
)

(define-method add_preferences
  (of-object "PanelApplet")
  (c-name "panel_applet_add_preferences")
  (return-type "none")
  (parameters
    '("const-gchar*" "schema_dir")
    '("GError**" "opt_error")
  )
)

(define-method get_applet_flags
  (of-object "PanelApplet")
  (c-name "panel_applet_get_flags")
  (return-type "int") ;"PanelAppletFlags")
)

(define-method set_applet_flags
  (of-object "PanelApplet")
  (c-name "panel_applet_set_flags")
  (return-type "none")
  (parameters
    '("int" "flags") ;'("PanelAppletFlags" "flags")
  )
)

(define-method get_control
  (of-object "PanelApplet")
  (c-name "panel_applet_get_control")
  (return-type "BonoboControl*")
)

(define-method get_popup_component
  (of-object "PanelApplet")
  (c-name "panel_applet_get_popup_component")
  (return-type "BonoboUIComponent*")
)

(define-method request_focus
  (of-object "PanelApplet")
  (c-name "panel_applet_request_focus")
  (return-type "none")
  (parameters
    '("guint32" "timestamp")))

(define-method setup_menu
  (of-object "PanelApplet")
  (c-name "panel_applet_setup_menu")
  (return-type "none")
  (parameters
    '("const-gchar*" "xml")
    '("const-BonoboUIVerb*" "verb_list")
    '("gpointer" "user_data")
  )
)

(define-method setup_menu_from_file
  (of-object "PanelApplet")
  (c-name "panel_applet_setup_menu_from_file")
  (return-type "none")
  (parameters
    '("const-gchar*" "opt_datadir")
    '("const-gchar*" "file")
    '("const-gchar*" "opt_app_name")
    '("const-BonoboUIVerb*" "verb_list")
    '("gpointer" "user_data")
  )
)

(define-method set_background_widget
  (of-object "PanelApplet")
  (c-name "panel_applet_set_background_widget")
  (return-type "none")
  (parameters
    '("GtkWidget*" "widget")
  )
)

(define-function factory_main
  (c-name "panel_applet_factory_main")
  (return-type "int")
  (parameters
    '("const-gchar*" "iid")
    '("GType" "applet_type")
    '("PanelAppletFactoryCallback" "callback")
    '("gpointer" "data")
  )
)

(define-function factory_main
  (c-name "panel_applet_factory_main_closure")
  (return-type "int")
  (parameters
    '("const-gchar*" "iid")
    '("GType" "applet_type")
    '("GClosure*" "closure")
  )
)

(define-function panel_applet_shlib_factory
  (c-name "panel_applet_shlib_factory")
  (return-type "Bonobo_Unknown")
  (parameters
    '("const-char*" "iid")
    '("GType" "applet_type")
    '("PortableServer_POA" "poa")
    '("gpointer" "impl_ptr")
    '("PanelAppletFactoryCallback" "callback")
    '("gpointer" "user_data")
    '("CORBA_Environment*" "ev")
  )
)

(define-function panel_applet_shlib_factory_closure
  (c-name "panel_applet_shlib_factory_closure")
  (return-type "Bonobo_Unknown")
  (parameters
    '("const-char*" "iid")
    '("GType" "applet_type")
    '("PortableServer_POA" "poa")
    '("gpointer" "impl_ptr")
    '("GClosure*" "closure")
    '("CORBA_Environment*" "ev")
  )
)

(define-function main
  (c-name "main")
  (return-type "int")
  (parameters
    '("int" "argc")
    '("char*-argv" "[]")
  )
)

(define-function bonobo_factory
  (c-name "panel__applet_bonobo_factory")
  (return-type "none")
  (parameters
    '("char*" "iid")
    '("GType" "type")
    '("char*" "name")
    '("char*" "version")
    '("PanelAppletFactoryCallback" "callback")
    '("gpointer" "data")    
  )
)


