# aq.tcl - miscellaneous aq procedures
#
######################################################################
# Copyright 1992-2000 by Jay Sekora.  This file may be freely        #
# distributed, modified or unmodified, for any purpose, provided     #
# that this copyright notice is retained verbatim in all copies and  #
# no attempt is made to obscure the authorship of this file.  If you #
# distribute any modified versions, I ask, but do not require, that  #
# you clearly mark any changes you make as such and that you provide #
# your users with instructions for getting the original sources.     #
######################################################################

package provide aq 0.1

# following has side-effect of making sure ::aq namespace is defined
namespace eval ::aq {
  namespace export {[a-z]*}
  catch {
    package require jldb
    # following likely to fail, because done by other libraries too
    namespace import ::jldb::shortcuts::*
  }
}

namespace eval ::aq::cmd {
  namespace export {[a-z]*}
}

######################################################################
# global variables:
#
global J_PREFS env
::aq::default J_PREFS(autoposition) 0
::aq::default J_PREFS(confirm) 1
::aq::default J_PREFS(printer) lp
#
######################################################################


######################################################################
# ::aq::cmd::prompt_tcl - prompt for a tcl command and execute it
######################################################################

::aq::command_register \
  ::aq::cmd::prompt_tcl {Issue Tcl Command...}
proc ::aq::cmd::prompt_tcl { w args } {
  # set `w' global variable to `w' local variable:
  uplevel #0 [list set w $w]
  
  ::aq::prompt_tcl
}

######################################################################
# ::aq::cmd::prompt_unix - prompt for a unix command and execute it
######################################################################

::aq::command_register \
  ::aq::cmd::prompt_unix {Issue Unix Command...}
proc ::aq::cmd::prompt_unix { w args } {
  # set `w' global variable to `w' local variable (need to make sure
  #   it's actually accessible in some fashion from ::aq::prompt_unix)
  uplevel #0 [list set w $w]
  
  ::aq::prompt_unix
}

######################################################################
# ::aq::cmd::global_pref_panel - pop up global preferences panel
######################################################################

::aq::command_register \
  ::aq::cmd::global_pref_panel {Global Preferences...}
proc ::aq::cmd::global_pref_panel { w args } {
  j:global_pref_panel
}
