home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / desqview / dvglu101.arc / -README.101 next >
Encoding:
Text File  |  1988-08-14  |  5.9 KB  |  117 lines

  1.                         DV-GLUE v1.01 upgrade kit
  2.                         -------------------------
  3.  
  4. Unpack this archive in the directory containing DV-GLUE 1.00, then type
  5.  
  6.         UPDATE
  7.  
  8. to install the updated object modules into TVAPIS.LIB.
  9.  
  10.         Ralf Brown
  11.         August 13, 1988
  12. ---------------------------------
  13. Known bugs:
  14.         1.00 TVapp_new() crashes when loading a new program if any other
  15.                 windows are open
  16.         1.01 TVapp_new() does wierd things when closing the new program.
  17.                 I'm still trying to figure out how to get rid of this,
  18.                 but it no longer locks up the system (at least not
  19.                 immediately; it does put the current process into a somewhat
  20.                 unstable state.)
  21.  
  22. ---------------------------------
  23. Updated function descriptions:
  24.  
  25. OBJECT TVtask_new(OBJECT parent,char *title,int row,int col,int rows,int cols,
  26.                   char far *stack,int stacksize,void far (*startaddr)(int),
  27.                   int switch_menu)
  28.         create a new thread as a child of "parent", whose window has title
  29.         "title" (or the title of the parent, if title == NULL).  The window
  30.         will be at (row,col) and will be "rows" lines high by "cols" columns
  31.         wide.  If stack == NULL, a stack of size "stacksize" will be malloc'd,
  32.         otherwise the given stack will be used by the new task.  The task will
  33.         begin by executing the function "startaddr", passing in the segment of
  34.         its parent task's handle.
  35.  
  36.         If "rows" is negative, then the window will have the same number of
  37.         rows as the parent window; similarly for "cols".  If both "rows"
  38.         and "cols" are zero, no new window will be created.
  39.  
  40.         If "switch_menu" is TRUE, the new task will be placed on the Switch
  41.         Windows menu.
  42.  
  43. OBJECT TVapp_new(OBJECT win,int row,int col,int rows,int cols,int switch_menu,
  44.                  char *program, char *argv0, char *argv1, ..., NULL )
  45.         Start a new application as a child of the task owning "win".  The
  46.         new window will be at (row,col) and will be rows by cols in size.
  47.         Load "program", and start it executing with the remaining arguments as
  48.         command line.  If "switch_menu" is TRUE, the program will be listed
  49.         on the Switch Windows menu.
  50.  
  51.         Returns the new application's handle, or NIL on error.  The external
  52.         int _doserrno is set if the error was encountered while loading the
  53.         program.  If it is 0 but the return value is NIL, then a new task
  54.         for the program could not be started.
  55.  
  56. int TVwin_async(OBJECT win,void far (*func)(void),int stacksize)
  57.         Defines a notification handler for the window "win".  You may share a
  58.         handler among multiple windows, as the events which apply to a single
  59.         window identify which window was affected.
  60.  
  61.         "stacksize" specifies how many bytes to allocate from the heap for a
  62.         local stack which will be used inside the handler.  If "stacksize"
  63.         is zero, the default of 512 bytes will be used.
  64.  
  65.         Returns 0 on success, EOF on failure.
  66.  
  67.         This function will not work in huge model at present.  A supporting
  68.         function would have to be recoded entirely in assembler to get around
  69.         the huge model function entry code.
  70.  
  71.         You may do pretty much anything inside the handler, except call
  72.         TVustack() or TVostack() [which will cause a crash] or call malloc()
  73.         and friends [which simply won't work].  Also to be avoided is
  74.         TVwin_async(our_window,NULL,n), as that does a free() on the stack
  75.         your code is executing on!
  76.  
  77. The last function (for now), is a higher-level version of TVwin_async(),
  78. which allows a separate handler for each possible event which DESQview can
  79. notify a program of.
  80.  
  81. void (*UIsignal(int signal,OBJECT win,void (*handler)(),
  82.                 int stacksize))(NOTIFY_MSG *)
  83.         Installs a handler for the specified event notification (the valid
  84.         signals are the same as for TVwin_notify() and TVwin_cancel()), and
  85.         returns a pointer to the previous handler, or SIGNAL_ERROR if it was
  86.         unable to install the handler.  The handler takes a single argument,
  87.         which is a pointer to the notification message provided by DESQview,
  88.         with one exception.  The exception is that the first byte has already
  89.         had the MS_NOTIFY offset subtracted from it, so the handler can
  90.         directly compare the first byte to the event numbers (for those
  91.         handlers that take care of multiple events).
  92.  
  93.         "stacksize" specifies the size of the local stack which will be
  94.         allocated from the heap.  If "stacksize" is zero, the default of 512
  95.         bytes will be used, of which about 470 will be available to your
  96.         function.
  97.  
  98.         The specified event is enabled when "handler" is non-NULL, but not
  99.         automatically disabled when "handler" is NULL.  This is because of the
  100.         assumption that you want any event you are trapping to actually occur,
  101.         but don't necessarily want to disable the action when you are no
  102.         longer interested in trapping the event (such as moving the window).
  103.         If you want the action disabled when you remove the handler, you must
  104.         explicitly call TVwin_disallow().
  105.  
  106.         As with TVwin_async(), you may do pretty much anything inside the
  107.         handler, except call TVustack(), TVostack(), and the various malloc()
  108.         functions.  The first two will cause a crash, the latter simply won't
  109.         work.
  110.  
  111.         You may define a handler for the same signal for multiple windows, but
  112.         only the last-used handler for a given signal is actually called,
  113.         regardless of which window gets the notification.  BEWARE!
  114.  
  115.         DO NOT mix this function with the TVwin_async() function, as that
  116.         will cause unpredictable results.
  117.