;;; -*- scheme -*- ;;; gnome.defs - Export Gnome interfaces to Guile. ;;; ;;; Copyright (C) 1998 Tom Tromey ;;; ;;; 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, 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-1307, USA. */ (import "gtk-1.2.defs") ;; ;; Gnome util. ;; (define-func gnome_libdir_file string ((string filename))) (define-func gnome_datadir_file string ((string filename))) (define-func gnome_pixmap_file string ((string filename))) (define-func gnome_unconditional_libdir_file string ((string filename))) (define-func gnome_unconditional_datadir_file string ((string filename))) (define-func gnome_unconditional_pixmap_file string ((string filename))) ;; ;; Gnome config. ;; (define-func gnome_config_get_string string ((string path))) (define-func gnome_config_get_string_with_default (string (values (def))) ((string path) (bool def))) (define-func gnome_config_get_translated_string string ((string path))) (define-func gnome_config_get_translated_string_with_default (string (values (def))) ((string path) (bool def))) (define-func gnome_config_get_int int ((string path))) (define-func gnome_config_get_int_with_default (int (values (def))) ((string path) (bool def))) (define-func gnome_config_get_bool bool ((string path))) (define-func gnome_config_get_bool_with_default (bool (values (def))) ((string path) (bool def))) (define-func gnome_config_get_float double ((string path))) (define-func gnome_config_get_float_with_default (double (values (def))) ((string path) (bool def))) (define-func gnome_config_get_vector (none (values (vect))) ((string path) ((cvec string) vect))) (define-func gnome_config_get_vector_with_default (none (values (vect def))) ((string path) ((cvec string) vect) (bool def))) (define-func gnome_config_private_get_string string ((string path))) (define-func gnome_config_private_get_string_with_default (string (values (def))) ((string path) (bool def))) (define-func gnome_config_private_get_translated_string string ((string path))) (define-func gnome_config_private_get_translated_string_with_default (string (values (def))) ((string path) (bool def))) (define-func gnome_config_private_get_int int ((string path))) (define-func gnome_config_private_get_int_with_default (int (values (def))) ((string path) (bool def))) (define-func gnome_config_private_get_bool bool ((string path))) (define-func gnome_config_private_get_bool_with_default (bool (values (def))) ((string path) (bool def))) (define-func gnome_config_private_get_float double ((string path))) (define-func gnome_config_private_get_float_with_default (double (values (def))) ((string path) (bool def))) (define-func gnome_config_private_get_vector (none (values (vect))) ((string path) ((cvec string) vect))) (define-func gnome_config_private_get_vector_with_default (none (values (vect def))) ((string path) ((cvec string) vect) (bool def))) (define-func gnome_config_set_string none ((string path) (string value))) (define-func gnome_config_set_translated_string none ((string path) (string value))) (define-func gnome_config_set_int none ((string path) (int value))) (define-func gnome_config_set_float none ((string path) (double value))) (define-func gnome_config_set_bool none ((string path) (bool value))) (define-func gnome_config_set_vector none ((string path) ((cvec string) values))) (define-func gnome_config_private_set_string none ((string path) (string value))) (define-func gnome_config_private_set_translated_string none ((string path) (string value))) (define-func gnome_config_private_set_int none ((string path) (int value))) (define-func gnome_config_private_set_float none ((string path) (double value))) (define-func gnome_config_private_set_bool none ((string path) (bool value))) (define-func gnome_config_private_set_vector none ((string path) ((cvec string) values))) (if gnome-config-typo () ((define-func gnome_config_has_section bool ((string Path))))) (define-func gnome_config_private_has_section bool ((string Path))) (define-func gnome_config_drop_all none ()) (define-func gnome_config_sync none ()) (define-func gnome_config_sync_file none ((string path))) (define-func gnome_config_private_sync_file none ((string path))) (define-func gnome_config_drop_file none ((string path))) (define-func gnome_config_private_drop_file none ((string path))) (define-func gnome_config_clean_file none ((string path))) (define-func gnome_config_private_clean_file none ((string path))) (define-func gnome_config_clean_section none ((string path))) (if gnome-config-typo () ((define-func gnome_config_private_clean_section none ((string path))))) (define-func gnome_config_clean_key none ((string path))) (define-func gnome_config_private_clean_key none ((string path))) (define-finc gnome_config_get_real_path string ((string path))) (define-finc gnome_config_private_get_real_path string ((string path))) (define-func gnome_config_push_prefix none ((string path))) (define-func gnome_config_pop_prefix none ()) (define-func gnome_config_make_vector (none (values (vect))) ((string val) ((cvec string) vect))) (define-func gnome_config_assemble_vector string (((cvec string) vect))) ;; ;; gnome-dentry ;; (define-boxed GnomeDesktopEntry (copy gnome_desktop_entry_copy) (free gnome_desktop_entry_destroy)) (define-func gnome_desktop_entry_load GnomeDesktopEntry ((string file))) (define-func gnome_desktop_entry_load_flags GnomeDesktopEntry ((string file) (bool clean))) (define-func gnome_desktop_entry_load_flags_conditional GnomeDesktopEntry ((string file) (bool clean) (bool uncond))) (define-func gnome_desktop_entry_load_unconditional GnomeDesktopEntry ((string file))) (define-func gnome_desktop_entry_save none ((GnomeDesktopEntry entry))) (define-func gnome_desktop_entry_launch none ((GnomeDesktopEntry item))) (define-func gnome_desktop_entry_launch_with_args none ((GnomeDesktopEntry item) ((cvec string) args))) (define-func gnome_is_program_in_path string ((string program))) ;; ;; GnomeApp. ;; (define-object GnomeApp (GtkWindow)) (define-func gnome_app_new GtkWidget ((string appname) (string title))) (define-func gnome_app_set_menus none ((GnomeApp app) (GtkMenuBar menubar))) (define-func gnome_app_set_toolbar none ((GnomeApp app) (GtkToolbar toolbar))) (define-func gnome_app_set_statusbar none ((GnomeApp app) (GtkWidget statusbar))) (define-func gnome_app_set_statusbar_custom none ((GnomeApp app) (GtkWidget container) (GtkWidget statusbar))) (define-func gnome_app_set_contents none ((GnomeApp app) (GtkWidget contents))) (define-enum GnomeDockItemBehavior (normal GNOME_DOCK_ITEM_BEH_NORMAL) (exclusive GNOME_DOCK_ITEM_BEH_EXCLUSIVE) (floating GNOME_DOCK_ITEM_BEH_NEVER_FLOATING) (vertical GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL) (horizontal GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL) (locked GNOME_DOCK_ITEM_BEH_LOCKED)) (define-enum GnomeDockPlacement (top GNOME_DOCK_TOP) (right GNOME_DOCK_RIGHT) (bottom GNOME_DOCK_BOTTOM) (left GNOME_DOCK_LEFT) (floating GNOME_DOCK_FLOATING)) (define-func gnome_app_add_toolbar none ((GnomeApp app) (GtkToolbar toolbar) (string name) (GnomeDockItemBehavior behavior) (GnomeDockPlacement placement) (int band_num) (int band_position) (int offset))) (define-func gnome_app_add_docked none ((GnomeApp app) (GtkWidget widget) (string name) (GnomeDockItemBehavior behavior) (GnomeDockPlacement placement) (int band_num) (int band_position) (int offset))) (define-object GnomeDockItem (GtkObject) ;; FIXME: no contents ) (define-object GnomeDock (GtkContainer) ;; FIXME: no contents ) (define-func gnome_app_add_dock_item none ((GnomeApp app) (GnomeDockItem item) (GnomeDockPlacement placement) (int band_num) (int band_position) (int offset))) (define-func gnome_app_enable_layout_config none ((GnomeApp app) (bool enable))) (define-func gnome_app_get_dock GnomeDock ((GnomeApp app))) (define-func gnome_app_get_dock_item_by_name GnomeDockItem ((GnomeApp app) (string name))) ;; ;; History. ;; FIXME: other functions done by hand due to build-guile-gtk limitations. ;; (define-func gnome_history_recently_used none ((string filename) (string filetype) (string creator) (string desc))) ;; ;; Stock widgets. ;; (define-string-enum GnomeStockButtonNameType (ok GNOME_STOCK_BUTTON_OK) (cancel GNOME_STOCK_BUTTON_CANCEL) (yes GNOME_STOCK_BUTTON_YES) (no GNOME_STOCK_BUTTON_NO) (close GNOME_STOCK_BUTTON_CLOSE) (apply GNOME_STOCK_BUTTON_APPLY) (help GNOME_STOCK_BUTTON_HELP)) (define-string-enum GnomeStockMenuNameType (blank GNOME_STOCK_MENU_BLANK) (new GNOME_STOCK_MENU_NEW) (save GNOME_STOCK_MENU_SAVE) (save-as GNOME_STOCK_MENU_SAVE_AS) (open GNOME_STOCK_MENU_OPEN) (quit GNOME_STOCK_MENU_QUIT) (cut GNOME_STOCK_MENU_CUT) (copy GNOME_STOCK_MENU_COPY) (paste GNOME_STOCK_MENU_PASTE) (prop GNOME_STOCK_MENU_PROP) (pref GNOME_STOCK_MENU_PREF) (about GNOME_STOCK_MENU_ABOUT) (scores GNOME_STOCK_MENU_SCORES) (undo GNOME_STOCK_MENU_UNDO) (print GNOME_STOCK_MENU_PRINT) (search GNOME_STOCK_MENU_SEARCH) (back GNOME_STOCK_MENU_BACK) (forward GNOME_STOCK_MENU_FORWARD) (home GNOME_STOCK_MENU_HOME) (stop GNOME_STOCK_MENU_STOP) (refresh GNOME_STOCK_MENU_REFRESH) (mail GNOME_STOCK_MENU_MAIL) (mail-receive GNOME_STOCK_MENU_MAIL_RCV) (mail-send GNOME_STOCK_MENU_MAIL_SND) (trash GNOME_STOCK_MENU_TRASH) (trash-full GNOME_STOCK_MENU_TRASH_FULL) ;; This is an alias for Quit for now. (exit GNOME_STOCK_MENU_QUIT)) (define-func gnome_stock_button GtkWidget ((GnomeStockButtonNameType type))) (define-func gnome_stock_or_ordinary_button GtkWidget ((GnomeStockButtonNameType type))) (define-func gnome_stock_menu_item GtkWidget ((GnomeStockMenuNameType type) (string text))) ;; ;; Messagebox. ;; (define-object GnomeMessageBox (GtkWindow) ;; FIXME: can't represent contents. ) ; gnome_message_box_new (define-func gnome_message_box_set_modal none ((GnomeMessageBox message_box))) (define-func gnome_message_box_set_default none ((GnomeMessageBox message_box) (int button))) ;; ;; Property box. ;; (define-object GnomePropertyBox (GtkWindow) (fields (GtkWidget notebook) (GtkWidget ok_button) (GtkWidget apply_button) (GtkWidget cancel_button) (GtkWidget help_button) ;; FIXME: can't represent `items'. ) ) (define-func gnome_property_box_new GtkWidget ()) (define-func gnome_property_box_changed none ((GnomePropertyBox box))) (define-func gnome_property_box_append_page int ((GnomePropertyBox box) (GtkWidget child) (GtkWidget tab_label))) ;; ;; Client code. ;; FIXME: Some functions still live in client.c, until argc/argv supported. ;; (define-enum GnomeInteractStyle (none GNOME_INTERACT_NONE) (errors GNOME_INTERACT_ERRORS) (any GNOME_INTERACT_ANY)) (define-enum GnomeDialogType (error GNOME_DIALOG_ERROR) (normal GNOME_DIALOG_NORMAL)) (define-enum GnomeSaveStyle (global GNOME_SAVE_GLOBAL) (local GNOME_SAVE_LOCAL) (both GNOME_SAVE_BOTH)) (define-enum GnomeRestartStyle (if-running GNOME_RESTART_IF_RUNNING) (anyway GNOME_RESTART_ANYWAY) (immediately GNOME_RESTART_IMMEDIATELY) (never GNOME_RESTART_NEVER)) (define-object GnomeClient (GtkObject)) (define-func gnome_client_disable_master_connection none ()) (define-func gnome_master_client GnomeClient ()) (define-func gnome_cloned_client GnomeClient ()) (define-func gnome_client_new GnomeClient ()) (define-func gnome_client_new_without_connection GnomeClient ()) (define-func gnome_client_connect none ((GnomeClient client))) (define-func gnome_client_disconnect none ((GnomeClient client))) (define-func gnome_client_flush none ((GnomeClient client))) (define-func gnome_client_set_id none ((GnomeClient client) (string id))) ; gnome_client_set_clone_command (define-func gnome_client_set_current_directory none ((GnomeClient client) (string dir))) ; gnome_client_set_environment (define-func gnome_client_set_process_id none ((GnomeClient client) (int id))) (define-func gnome_client_set_program none ((GnomeClient client) (string program))) ; gnome_client_set_restart_command ; gnome_client_set_resign_command (define-func gnome_client_set_restart_style none ((GnomeClient client) (GnomeRestartStyle style))) ; gnome_client_set_shutdown_command (define-func gnome_client_set_user_id none ((GnomeClient client) (string id))) (define-func gnome_client_request_phase_2 none ((GnomeClient client))) (define-func gnome_client_request_save none ((GnomeClient client) (GnomeSaveStyle save_style) (bool shutdown) (GnomeInteractStyle interact_style) (bool fast) (bool global))) (define-func gnome_client_request_interaction_interp none ((GnomeClient client) (GnomeDialogType dialog_type) (callback function)) (protection client)) (define-func gnome_interaction_key_return none ((int key) (bool cancel_shutdown))) ;; Canvas (define-object GnomeCanvas (GtkContainer)) (define-object GnomeCanvasItem (GtkObject) (fields (GnomeCanvas canvas) (GnomeCanvasItem parent) (int x1) (int y1) (int x2) (int y2))) (define-object GnomeCanvasGroup (GnomeCanvasItem)) ;; XXX - build-guile-gtk needs varargs and GtkType to support these. ;; For now, there are `hand tweaked' versions in gnomeg.c ;;(define-func gnome_canvas_item_new ;; GnomeCanvasItem ;; ((GnomeCanvas canvas) ;; (GnomeCanvasGroup group) ;; (GtkType type) ;; (args ...))) ;;(define-func gnome_canvas_item_set ;; none ;; ((GnomeCanvasItem item) ;; (args ...))) (define-func gnome_canvas_item_move none ((GnomeCanvasItem canvas) (double dx) (double dy))) (define-func gdk_imlib_get_visual GdkVisual ()) (define-func gdk_imlib_get_colormap GdkColormap ()) (define-func gnome_canvas_new GtkWidget ()) (define-func gnome_canvas_root GnomeCanvasGroup ((GnomeCanvas canvas))) (define-func gnome_canvas_update_now none ((GnomeCanvas canvas))) (define-func gnome_canvas_set_pixels_per_unit none ((GnomeCanvas canvas) (double n))) (define-object GnomeCanvasRE (GnomeCanvasItem)) (define-object GnomeCanvasRect (GnomeCanvasRE)) (define-object GnomeCanvasEllipse (GnomeCanvasRE)) (define-boxed GnomeCanvasPoints (copy gnome_canvas_points_ref) (free gnome_canvas_points_unref)) (add-options GnomeCanvasPoints (conversion "sgnome_canvas_points_conversion")) (define-func gnome_canvas_points_from_coords (GnomeCanvasPoints (copy #f)) (((cvec double) coords))) (define-func gnome_canvas_points_intern GnomeCanvasPoints ((GnomeCanvasPoints points))) (define-object GnomeCanvasLine (GnomeCanvasItem)) ;;; app helper ;; C support routines are in gnomeg.c (define-enum GnomeUIInfoType (item GNOME_APP_UI_ITEM) (toggleitem GNOME_APP_UI_TOGGLEITEM) (radioitems GNOME_APP_UI_RADIOITEMS) (subtree GNOME_APP_UI_SUBTREE) (separator GNOME_APP_UI_SEPARATOR) (help GNOME_APP_UI_HELP) (configurable GNOME_APP_UI_ITEM_CONFIGURABLE) (subtree-stock GNOME_APP_UI_SUBTREE_STOCK)) (define-enum GnomeUIInfoConfigurableTypes (new GNOME_APP_CONFIGURABLE_ITEM_NEW) (open GNOME_APP_CONFIGURABLE_ITEM_OPEN) (save GNOME_APP_CONFIGURABLE_ITEM_SAVE) (save-as GNOME_APP_CONFIGURABLE_ITEM_SAVE_AS) (revert GNOME_APP_CONFIGURABLE_ITEM_REVERT) (print GNOME_APP_CONFIGURABLE_ITEM_PRINT) (print-setup GNOME_APP_CONFIGURABLE_ITEM_PRINT_SETUP) (close GNOME_APP_CONFIGURABLE_ITEM_CLOSE) (exit GNOME_APP_CONFIGURABLE_ITEM_EXIT) (cut GNOME_APP_CONFIGURABLE_ITEM_CUT) (copy GNOME_APP_CONFIGURABLE_ITEM_COPY) (paste GNOME_APP_CONFIGURABLE_ITEM_PASTE) (clear GNOME_APP_CONFIGURABLE_ITEM_CLEAR) (undo GNOME_APP_CONFIGURABLE_ITEM_UNDO) (redo GNOME_APP_CONFIGURABLE_ITEM_REDO) (find GNOME_APP_CONFIGURABLE_ITEM_FIND) (find-again GNOME_APP_CONFIGURABLE_ITEM_FIND_AGAIN) (replace GNOME_APP_CONFIGURABLE_ITEM_REPLACE) (properties GNOME_APP_CONFIGURABLE_ITEM_PROPERTIES) (preferences GNOME_APP_CONFIGURABLE_ITEM_PREFERENCES) (about GNOME_APP_CONFIGURABLE_ITEM_ABOUT) (select-all GNOME_APP_CONFIGURABLE_ITEM_SELECT_ALL) (new-window GNOME_APP_CONFIGURABLE_ITEM_NEW_WINDOW) (close-window GNOME_APP_CONFIGURABLE_ITEM_CLOSE_WINDOW) (new-game GNOME_APP_CONFIGURABLE_ITEM_NEW_GAME) (pause-game GNOME_APP_CONFIGURABLE_ITEM_PAUSE_GAME) (restart-game GNOME_APP_CONFIGURABLE_ITEM_RESTART_GAME) (undo-move GNOME_APP_CONFIGURABLE_ITEM_UNDO_MOVE) (redo-move GNOME_APP_CONFIGURABLE_ITEM_REDO_MOVE) (hint GNOME_APP_CONFIGURABLE_ITEM_HINT) (scores GNOME_APP_CONFIGURABLE_ITEM_SCORES) (end-game GNOME_APP_CONFIGURABLE_ITEM_END_GAME)) (define-object GnomeUIInfos (GtkData)) (add-options GnomeUIInfos (conversion "sgnome_uiinfos_conversion")) (define-func gnome_uiinfos_intern GnomeUIInfos ((GnomeUIInfos desc))) ;;(define-func gnome_uiinfos_get_widgets SCM ((GnomeUIInfos desc))) (define-func gnome_app_create_menus_from_uiinfos none ((GnomeApp app) (GnomeUIInfos desc)) (scm-name "gnome-app-create-menus")) (options (includes "#include " "#include ") (init-func "gnome_init_guile_glue") (libs "-lguilegnome") (extra-init-code "gnome_init_guile_support ();")) ;; ;; Cauldron ;; (define-flags GtkCauldronOptions (toplevel GTK_CAULDRON_TOPLEVEL) (dialog GTK_CAULDRON_DIALOG) (popup GTK_CAULDRON_POPUP) (space1 GTK_CAULDRON_SPACE1) (space2 GTK_CAULDRON_SPACE2) (space3 GTK_CAULDRON_SPACE3) (space4 GTK_CAULDRON_SPACE4) (space5 GTK_CAULDRON_SPACE5) (space6 GTK_CAULDRON_SPACE6) (space7 GTK_CAULDRON_SPACE7) (space8 GTK_CAULDRON_SPACE8) (space9 GTK_CAULDRON_SPACE9) (space10 GTK_CAULDRON_SPACE10) (space11 GTK_CAULDRON_SPACE11) (space12 GTK_CAULDRON_SPACE12) (space13 GTK_CAULDRON_SPACE13) (space14 GTK_CAULDRON_SPACE14) (space15 GTK_CAULDRON_SPACE15) (ignoreescape GTK_CAULDRON_IGNOREESCAPE) (ignoreenter GTK_CAULDRON_IGNOREENTER) (grab GTK_CAULDRON_GRAB))