home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / Puppeteer1.1 / Source / Puppeteer.h < prev    next >
Encoding:
Text File  |  1994-03-23  |  3.0 KB  |  110 lines

  1. /*
  2.  * Puppeteer 1.1
  3.  *
  4.  * Copyright (c) 1994 Primitive Software Ltd.  All rights reserved.
  5.  *
  6.  * Author: Dave Griffiths <dave@prim.demon.co.uk>
  7.  */
  8.  
  9. #import <appkit/appkit.h>
  10.  
  11. @interface Puppeteer:Object
  12. {
  13.     char *appName;        // The application name
  14.     id appSpeaker;        // The main puppet speaker
  15.     id journalSpeaker;    // The puppet's journal speaker
  16.     port_t appPort;        // Port used by appSpeaker
  17.     BOOL enabled;        // YES if strings are attached
  18.     int pid;        // The application's pid
  19.     int context;        // The application's postscript context
  20.     DPSContext ctxt;
  21. }
  22.  
  23. /*
  24.  * Return an instance of puppeteer connected to the given app, or nil on failure.
  25.  */
  26. + connectToApp:(const char *)theName launch:(BOOL)launch;
  27. /*
  28.  * Connect to the specified app. Returns YES on success.
  29.  */
  30. - (BOOL)connect:(const char *)theName launch:(BOOL)launch;
  31. /*
  32.  * This is the method which actually posts the events to the puppet.
  33.  */
  34. - postEvent:(NXEvent *)event;
  35. /*
  36.  * Post a string to the puppet's key window.
  37.  */
  38. - postKeyboardString:(const char *)keyString flags:(int)flags;
  39. /*
  40.  * Post a keyboard event.
  41.  */
  42. - postKeyboardEvent:(int)eventType window:(int)window flags:(int)flags 
  43.     charCode:(char)charCode;
  44. /*
  45.  * Uses postKeyboardEvent to send key down and key up events for the given character.
  46.  */
  47. - postKeyCode:(char)charCode window:(int)window flags:(int)flags;
  48. /*
  49.  * Post a mouse event.
  50.  */
  51. - postMouseEvent:(int)eventType window:(int)window flags:(int)flags 
  52.     x:(double)x y:(double)y click:(int)click;
  53. /*
  54.  * Post events for a single mouse click.
  55.  */
  56. - postSingleClick:(int)window flags:(int)flags x:(double)x y:(double)y;
  57. - postDoubleClick:(int)window flags:(int)flags x:(double)x y:(double)y;
  58. - postTripleClick:(int)window flags:(int)flags x:(double)x y:(double)y;
  59. /*
  60.  * Activate/deactivate the application.
  61.  */
  62. - postActivate:(BOOL)activate;
  63. /*
  64.  * Drag the given window. Pseudo window numbers may be specified.
  65.  */
  66. - dragWindow:(int)winNumber deltaX:(double)x deltaY:(double)y;
  67. /*
  68.  * Return the application's pid.
  69.  */
  70. - (int)getPid;
  71. /*
  72.  * Returns a list of this application's windows. A new list is created each time this
  73.  * method is called, and it is the caller's responsibility to free it and it's contents.
  74.  * Each object is of the WindowInfo class.
  75.  */
  76. - windowList;
  77. /*
  78.  * Returns the application's postscript context.
  79.  */
  80. - (int)getContext;
  81. /*
  82.  * Return the number of windows belonging to puppet.
  83.  */
  84. - (int)windowCount;
  85. /*
  86.  * The following three methods return a WindowInfo object corresponding to NX_KEYWINDOW,
  87.  * NX_MAINWINDOW and NX_MAINMENU respectively.
  88.  */
  89. - keyWindow;
  90. - mainWindow;
  91. - mainMenu;
  92. /*
  93.  * Returns a WindowInfo object for the given pseudo window number (eg NX_KEYWINDOW),
  94.  * or nil if it can't be determined.
  95.  */
  96. - windowForPseudoNumber:(int)pseudoNumber;
  97. /*
  98.  * Attach strings to puppet. This must be called before events can be posted to it.
  99.  */
  100. - attachStrings;
  101. /*
  102.  * Release strings from puppet. This must be called to enable the application to once
  103.  * more respond to real user events.
  104.  */
  105. - releaseStrings;
  106. - ping;
  107. - appSpeaker;
  108.  
  109. @end
  110.