Back to index

im-sdk  12.3.91
xaux_so_common.h
Go to the documentation of this file.
00001 /*
00002 Copyright 1990-2003 Sun Microsystems, Inc. All Rights Reserved.
00003 
00004 Permission is hereby granted, free of charge, to any person obtaining a
00005 copy of this software and associated documentation files (the
00006 "Software"), to deal in the Software without restriction, including
00007 without limitation the rights to use, copy, modify, merge, publish,
00008 distribute, sublicense, and/or sell copies of the Software, and to
00009 permit persons to whom the Software is furnished to do so, subject to
00010 the following conditions: The above copyright notice and this
00011 permission notice shall be included in all copies or substantial
00012 portions of the Software.
00013 
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00016 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00018 IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
00019 FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
00020 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
00021 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
00022 ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
00023 
00024 
00025 Except as contained in this notice, the names of The Open Group and/or
00026 Sun Microsystems, Inc. shall not be used in advertising or otherwise to
00027 promote the sale, use or other dealings in this Software without prior
00028 written authorization from The Open Group and/or Sun Microsystems,
00029 Inc., as applicable.
00030 
00031 
00032 X Window System is a trademark of The Open Group
00033 
00034 OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
00035 logo, LBX, X Window System, and Xinerama are trademarks of the Open
00036 Group. All other trademarks and registered trademarks mentioned herein
00037 are the property of their respective owners. No right, title or
00038 interest in or to any trademark, service mark, logo or trade name of
00039 Sun Microsystems, Inc. or its licensors is granted.
00040 
00041 */
00042 
00043 #ifndef       XAUX_SO_COMMON_H
00044 #define       XAUX_SO_COMMON_H
00045 
00046 #pragma ident "$Id$"
00047 
00048 #define       XAUX_SO_NATOMS_READLIST            XAUX_MAXNPROPS_INIT
00049 
00050 typedef struct _aux_icid {
00051        aux_t *                     aux;
00052        int                  icid;
00053        int                  imid;
00054        Display                     *dpy;  /* display */
00055        Bool                 server;       /* True if attached to htt_xbe */
00056        struct _aux_icid *   prev;
00057        struct _aux_icid *   next;
00058 } aux_icid_t;
00059 
00060 typedef enum xaux_so_extstate_enum {
00061        Initial,
00062        Launched,
00063        Connected,
00064        ErrorTemp,
00065        ErrorPerm,
00066        Disconnected
00067 } xaux_so_extstate_t;
00068 
00069 typedef struct _xaux_so_setv_state {
00070        Bool          stored;
00071        int           seqno;
00072        aux_data_t    aux_data_;
00073        aux_data_t    *aux_data;
00074        int           segno;
00075        int           int_next;
00076        int           str_next;
00077        int           str_yet;
00078        int           outbufsz;
00079        char          *outbuf;
00080        int           maxnprops;
00081        int           nprops;
00082        unsigned char **props;
00083 } xaux_so_setv_state_t;
00084 
00085 #include      <sys/types.h>
00086 
00087 #define       XAUX_SO_EXECMNG_LOGSIZE                   8
00088 #define       XAUX_SO_EXECMNG_FAILSINPERIOD_TRIES       5
00089 #define       XAUX_SO_EXECMNG_FAILSINPERIOD_PERIOD      5
00090 
00091 typedef struct xaux_so_execmng_log_struct {
00092        time_t               time;
00093        xaux_so_extstate_t   state;
00094 } xaux_so_execmng_log_t;
00095 
00096 typedef struct xaux_so_execmng_data_struct {
00097        xaux_so_execmng_log_t       log[XAUX_SO_EXECMNG_LOGSIZE];
00098 } xaux_so_execmng_data_t;
00099 
00100 #define       XAUX_SO_NOTIFY_STATE_ID                   0x60
00101 #define       XAUX_SO_NOTIFY_STATE_OK                   1
00102 #define       XAUX_SO_NOTIFY_STATE_STANDBY              2
00103 #define       XAUX_SO_NOTIFY_STATE_NOTAVAILABLE  3
00104 
00105 #define       XAUX_SO_NOTIFY_FLOWSTATE_ID        0xf0 /* tentative */
00106 #define       XAUX_SO_NOTIFY_FLOWSTATE_OK        0
00107 #define       XAUX_SO_NOTIFY_FLOWSTATE_STOP             1
00108 #define       XAUX_SO_FLOWSTATE_TH_OK                   2
00109 #define       XAUX_SO_FLOWSTATE_TH_STOP          10
00110 
00111 typedef struct xaux_so_class_struct {
00112        struct xaux_so_struct       *so;   /* back reference to xaux_so_t */
00113        const char    *classname;   /* aux_name */
00114        char          *shortname;   /* last part of aux_name */
00115        int           index;        /* aux_index */
00116        const char    *extexec;     /* full path of aux_ext executable */
00117        Window        sowin;        /* aux.so's window */
00118        Window        extwin;              /* aux_ext's window */
00119        Atom          atom_classname;      /* "${CLASSNAME}" */
00120        Atom          atom_sowin;   /* "${CLASSNAME}_sowin" */
00121        Atom          atom_extwin;  /* "${CLASSNAME}_extwin" */
00122        Atom          atom_sx;      /* "${CLASSNAME}_sx" */
00123        Atom          atom_xs;      /* "${CLASSNAME}_xs" */
00124        xaux_atommng_data_t  *atommng_data;       /* atommng data */
00125        xaux_so_execmng_data_t      *execmng_data;       /* execmng data */
00126        xaux_so_setv_state_t *pending_setv;       /* pending setvalue */
00127        const CARD16  *utfname;     /* UTF-16 version of classname */
00128        xaux_so_extstate_t   extstate;     /* state of ext process */
00129        Bool          started;      /* True between START and DONE */
00130        aux_icid_t *  ic;           /* IC (tentative) */
00131        xaux_propq_t  *propq;              /* outgoing property queue */
00132 } xaux_so_class_t;
00133 
00134 typedef struct xaux_so_struct {
00135        xaux_so_class_t      *classes;     /* classes */
00136 } xaux_so_t;
00137 
00138 /*
00139  * return these values as major/minor of extversion
00140  * when so module can know the external program is not available
00141  * without actually attempting to execute it.
00142  * e.g. not exist or insufficient permission
00143  */
00144 #define XAUX_EXTVERS_MAJOR_NOTAVAIL     -1       /* defined */
00145 #define XAUX_EXTVERS_MINOR_NOTAVAIL     -1       /* not defined but use -1 */
00146 
00147 extern const int xaux_so_default_extversion[2];
00148 extern const int xaux_so_setvalue_id_sendversion;
00149 extern const char *xaux_so_extexec_path;
00150 
00151 extern aux_method_t VersionQueryAux_methods;
00152 
00153 #endif /* !XAUX_SO_COMMON_H */