home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / extensions / lib / PEX / include / cpx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-15  |  9.1 KB  |  306 lines

  1. /* $XConsortium: cpx.h,v 5.1 91/02/16 09:49:00 rws Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
  5.  
  6.                         All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the names of Sun Microsystems,
  13. the X Consortium, and MIT not be used in advertising or publicity 
  14. pertaining to distribution of the software without specific, written 
  15. prior permission.  
  16.  
  17. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
  18. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  19. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  20. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24. ******************************************************************/
  25.  
  26. #ifndef PHG_CPX_H_INCLUDED
  27. #define PHG_CPX_H_INCLUDED
  28.  
  29. #include "cpa.h"
  30. #include "cpb.h"
  31.  
  32. typedef struct Cpx_css_srvr {
  33.     Cpx_css_srvr_type    type;
  34.     Display        *display;    /* NULL on CLNT_SS servers */
  35.     Phg_pex_ext_info    pex_info;    /* not used on CLNT_SS servers */
  36.     struct {
  37.     unsigned master: 1;
  38.     unsigned uses_monitor_css: 1;
  39.     }            flags;
  40.     union {
  41.     Cp_a    a;    /* server support of workstations and structures */
  42.     Cp_b    b;    /* client side SS in this process (PM or client) */
  43.     }                model;
  44.     struct Cpx_css_srvr    *next;
  45.  
  46.     Ws_handle        (*open_ws)();
  47.     void        (*close_ws)();
  48.     void        (*ws_redraw_all)();
  49.     void        (*ws_update)();
  50.     void        (*set_disp_state)();
  51.     void        (*message)();
  52.     void        (*set_rep)();
  53.     void        (*set_filter)();
  54.     void        (*set_colour_model)();
  55.     void        (*set_hlhsr_mode)();
  56.     void        (*set_view_input_prio)();
  57.     void        (*set_ws_win)();
  58.     void        (*set_ws_vp)();
  59.     void        (*add_el)();
  60.     void        (*copy_all_els)();
  61.     void        (*open_struct)();
  62.     void        (*close_struct)();
  63.     void        (*set_el_ptr)();
  64.     void        (*set_edit_mode)();
  65.     void        (*delete_el)();
  66.     void        (*delete_struct)();
  67.     void        (*delete_struct_net)();
  68.     void        (*delete_all_structs)();
  69.     void        (*change_struct_id)();
  70.     void        (*change_struct_refs)();
  71.     void        (*change_struct_idrefs)();
  72.     void        (*post_struct)();
  73.     void        (*unpost_struct)();
  74.     void        (*unpost_all)();
  75.     void        (*ar_archive)();
  76.     void        (*inp_init_dev)();
  77.     void        (*inp_set_mode)();
  78.     void        (*inp_request)();
  79.     void        (*inp_sample)();
  80.     void        (*set_err_hand_mode)();
  81.     void        (*el_search)();
  82.     void        (*inc_spa_search)();
  83.  
  84.     /* inquiry functions */
  85.     void        (*inq_colour_model)();
  86.     void        (*inq_struct_status)();
  87.     void        (*inq_struct_ids)();
  88.     void        (*inq_el_ptr)();
  89.     void        (*inq_el_type_size)();
  90.     void        (*inq_el_content)();
  91.     void        (*inq_indices)();
  92.     void        (*inq_filter)();
  93.     void        (*inq_posted)();
  94.     void        (*inq_inp_dev_state)();
  95.     void        (*inq_wss_posted_to)();
  96.     void        (*inq_hierarchy)();
  97.     void        (*inq_representation)();
  98.     void        (*inq_view_rep)();
  99.     void        (*inq_hlhsr_mode)();
  100.     void        (*inq_disp_update_state)();
  101.     void        (*inq_ws_xform)();
  102.     void        (*inq_text_extent)();
  103.     void        (*inq_colr_map_meth_st)();
  104.  
  105.     void        (*close_phigs)();
  106.     
  107.     int            (*struct_exists)();
  108.  
  109.     /* Other non-PHIGS functions */
  110.     void        (*destroy)();
  111.     int            (*full_copy_to_type_a)();
  112.     int            (*full_copy_to_type_b)();
  113.     void        (*inq_win_info)();
  114.     void        (*inq_dpy_and_drawable)();
  115.     void        (*drawable_pick)();
  116.     void        (*map_points)();
  117.     void        (*redraw_regions)();
  118.     void        (*ws_synch)();
  119. } Cpx_css_srvr;
  120.  
  121.  
  122. /* List handling utilities. */
  123. #define CPX_ADD_TO_LIST( _t, _l, _i ) \
  124.     {register _t **_p; for ( _p = &(_l); *_p; _p = &(*_p)->next ); *_p=(_i);}
  125.  
  126. #define CPX_FOR_ALL_DISPLAYS(_c,_s) \
  127.     for ( (_s) = (_c)->displays; (_s); (_s) = (_s)->next )
  128.  
  129. #define CPX_FOR_ALL_SERVERS(_c,_s) \
  130.     for ( (_s) = (_c)->css_srvr_list; (_s); (_s) = (_s)->next )
  131.  
  132. #define CPX_FOR_ALL_SS_SERVERS(_c,_s) \
  133.     CPX_FOR_ALL_SERVERS(_c,_s) { \
  134.     if ( (_s)->type == CP_PEX_SRVR_SS )
  135. #define CPX_END_FOR_ALL_SS_SERVERS    }
  136.  
  137. #define CPX_MASTER_SERVER( _c, _ms ) \
  138.     { \
  139.     CPX_FOR_ALL_SERVERS(_c,_ms) \
  140.         if ( (_ms)->flags.master ) break; \
  141.     }
  142.  
  143. #define CPX_FOR_ALL_WS(_c,_w) \
  144.     for ( (_w) = (_c)->ws_list; (_w); (_w) = (_w)->next )
  145.  
  146. #define CPX_WSID_FROM_DRAWABLE(_cph, _draw_id, _ws_id)        \
  147.     {                                \
  148.     register Ws *_wsp;                \
  149.     for (_wsp = (_cph)->ws_list; _wsp; _wsp = _wsp->next)    \
  150.         if ( _wsp->drawable_id == (_draw_id) )            \
  151.         break;                        \
  152.     (_ws_id) = (_wsp ? _wsp->wsrid : NULL);        \
  153.     }
  154.  
  155. #define PADDING(n) ( ((n)%4 == 0) ? 0 : 4 - ((n)%4) )
  156.  
  157. #define CPX_BY_SID    1
  158. #define CPX_BY_WSID    1
  159. #define CPX_BY_XID    2
  160. #define CPX_BY_DISPLAY    3
  161. #define CPX_BY_NAME    4
  162. #define CPX_BY_SS_TYPE    5
  163.  
  164. /* CP vector functions */
  165. extern void
  166.     /* Used by client side only, in alphabetic order. */
  167.     phg_cpxc_add_el(),
  168.     phg_cpxc_close_struct(),
  169.     phg_cpxc_change_struct_id(),
  170.     phg_cpxc_close(),
  171.     phg_cpxc_close_ws(),
  172.     phg_cpxc_copy_all_els(),
  173.     phg_cpxc_delete_all_structs(),
  174.     phg_cpxc_delete_el(),
  175.     phg_cpxc_delete_struct(),
  176.     phg_cpxc_delete_struct_net(),
  177.     phg_cpxc_emerg_close(),
  178.     phg_cpxc_error_sync(),
  179.     phg_cpxc_inq_wss_posted_to(),
  180.     phg_cpxc_open_struct(),
  181.     phg_cpxc_open_ws(),
  182.     phg_cpxc_set_edit_mode(),
  183.     phg_cpxc_set_el_ptr(),
  184.  
  185.     /* Used by monitor only, in alphabetic order. */
  186.     phg_cpm_open_ws(),
  187.     phg_cpm_close_ws(),
  188.     phg_cpm_open_struct(),
  189.     phg_cpm_add_el(),
  190.     phg_cpm_change_struct_id(),
  191.     phg_cpm_change_struct_refs(),
  192.     phg_cpm_change_struct_idrefs(),
  193.     phg_cpm_close_struct(),
  194.     phg_cpm_copy_all_els(),
  195.     phg_cpm_delete_all_structs(),
  196.     phg_cpm_delete_el(),
  197.     phg_cpm_delete_struct(),
  198.     phg_cpm_delete_struct_net(),
  199.     phg_cpm_inq_wss_posted_to(),
  200.     phg_cpm_set_edit_mode(),
  201.     phg_cpm_set_el_ptr(),
  202.  
  203.     /* Used in both client and monitor, in alphabetic order. */
  204.     phg_cpx_ar_archive(),
  205.     phg_cpx_ar_close(),
  206.     phg_cpx_ar_delete(),
  207.     phg_cpx_ar_get_hierarchy(),
  208.     phg_cpx_ar_get_names(),
  209.     phg_cpx_ar_open(),
  210.     phg_cpx_ar_retrieve(),
  211.     phg_cpx_change_struct_refs(),
  212.     phg_cpx_change_struct_idrefs(),
  213.     phg_cpx_dummy_await_event(),
  214.     phg_cpx_dummy_flush_dev(),
  215.     phg_cpx_dummy_inq_overflow(),
  216.     phg_cpx_dummy_inq_more_events(),
  217.     phg_cpx_el_search(),
  218.     phg_cpx_inc_spa_search(),
  219.     phg_cpx_inp_init_dev(),
  220.     phg_cpx_inp_request(),
  221.     phg_cpx_inp_sample(),
  222.     phg_cpx_inp_set_mode(),
  223.     phg_cpx_inq_ar_conflicting(),
  224.     phg_cpx_inq_colour_model(),
  225.     phg_cpx_inq_colr_map_meth_st(),
  226.     phg_cpx_inq_disp_update_state(),
  227.     phg_cpx_inq_dpy_and_drawable(),
  228.     phg_cpx_inq_el_content(),
  229.     phg_cpx_inq_el_ptr(),
  230.     phg_cpx_inq_el_type_size(),
  231.     phg_cpx_inq_filter(),
  232.     phg_cpx_inq_hierarchy(),
  233.     phg_cpx_inq_hlhsr_mode(),
  234.     phg_cpx_inq_indices(),
  235.     phg_cpx_inq_inp_dev_state(),
  236.     phg_cpx_inq_posted(),
  237.     phg_cpx_inq_rep(),
  238.     phg_cpx_inq_struct_ids(),
  239.     phg_cpx_inq_struct_status(),
  240.     phg_cpx_inq_text_extent(),
  241.     phg_cpx_inq_view_rep(),
  242.     phg_cpx_inq_win_info(),
  243.     phg_cpx_inq_ws_xform(),
  244.     phg_cpx_message(),
  245.     phg_cpx_post_struct(),
  246.     phg_cpx_set_colour_model(),
  247.     phg_cpx_set_err_hand_mode(),
  248.     phg_cpx_set_filter(),
  249.     phg_cpx_set_hlhsr_mode(),
  250.     phg_cpx_set_rep(),
  251.     phg_cpx_set_view_input_priority(),
  252.     phg_cpx_set_ws_win(),
  253.     phg_cpx_set_ws_vp(),
  254.     phg_cpx_unpost_all(),
  255.     phg_cpx_unpost_struct(),
  256.     phg_cpx_ws_drawable_pick(),
  257.     phg_cpx_ws_map_points(),
  258.     phg_cpx_ws_redraw_all(),
  259.     phg_cpx_ws_redraw_regions(),
  260.     phg_cpx_ws_set_disp_state(),
  261.     phg_cpx_ws_synch(),
  262.     phg_cpx_ws_update()
  263.     ;
  264.  
  265. /* Startup functions. */
  266. extern Cpx_css_srvr*    phg_cpa_init();
  267. extern Cpx_css_srvr*    phg_cpa_pm_init();
  268. extern Cpx_css_srvr*    phg_cpb_init();
  269. extern Cpx_css_srvr*    phg_cpbc_init();
  270. extern Cpx_css_srvr*    phg_cpb_pm_init();
  271. extern Cpx_css_srvr*    phg_cpb_create();
  272.  
  273. /* Connection utilities. */
  274. extern void        phg_cpx_link_css_srvr();
  275. extern void        phg_cpx_unlink_css_srvr();
  276. extern void        phg_cpx_sync_servers();
  277. extern void        phg_cpx_destroy_all_css_servers();
  278. extern void        phg_cpx_unlink_ws();
  279. extern int        phg_cpx_full_copy_a_to_a();
  280. extern int        phg_cpx_full_copy_a_to_b();
  281. extern int        phg_cpx_full_copy_b_to_a();
  282. extern Display*        phg_cpx_connection_exists();
  283. extern void        phg_cpx_instance_connection();
  284. extern void        phg_cpx_release_connection();
  285.  
  286. extern void        phg_cpx_disconnect_all_servers();
  287. extern Cpx_css_srvr*    phg_cpx_css_srvr_exists();
  288. extern void        phg_cpx_release_css_srvr();
  289.  
  290. /* Toolkit handlers. */
  291. extern Widget          phg_cpm_toolkit_add_connection();
  292. extern int          phg_cpm_toolkit_open_ws();
  293. extern void         phg_cpm_toolkit_close_ws();
  294.  
  295. /* Ws utilities */
  296. extern Ws_handle    phg_cpx_ws_exists();
  297. extern int        phg_cpx_load_structures();
  298. extern void             phg_cpx_get_win_info();
  299.  
  300. /* Other. */
  301. extern Cp_handle    phg_cpxc_open();
  302. extern int        phg_cpx_full_copy_a_to_a();
  303. extern int        phg_cpx_el_data_to_pex();
  304.  
  305. #endif
  306.