Action.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $TOG: Action.h /main/4 1998/05/06 15:55:18 rafi $ */
  24. /*
  25. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  28. * (c) Copyright 1993, 1994 Novell, Inc.
  29. */
  30. #ifndef _Dt_Action_h
  31. #define _Dt_Action_h
  32. #include <X11/Intrinsic.h>
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /*
  37. * Argument types
  38. */
  39. #define DtACTION_FILE 1 /* file argument */
  40. #define DtACTION_BUFFER 2 /* buffer argument */
  41. #define DtACTION_STRING 3 /* string argument */
  42. #define DtACTION_NULLARG 4 /* untyped return-only argument */
  43. typedef struct {
  44. void *bp; /* location of buffer */
  45. int size; /* size of buffer in bytes */
  46. char *type; /* (opt.) type of buffer */
  47. char *name; /* (opt.) name of buffer object */
  48. Boolean writable; /* allow changes to buffer object? */
  49. } DtActionBuffer;
  50. typedef struct {
  51. char *name;
  52. } DtActionFile;
  53. typedef struct {
  54. /*
  55. * Structure containing argument information
  56. */
  57. int argClass; /* see argument types */
  58. union {
  59. DtActionFile file;
  60. DtActionBuffer buffer;
  61. } u;
  62. } DtActionArg;
  63. /*
  64. * DtActionStatus codes
  65. */
  66. typedef enum {
  67. DtACTION_OK, /* If not any of the below */
  68. DtACTION_INVALID_ID, /* ID is not valid */
  69. DtACTION_INVOKED, /* the action invocation step is done */
  70. DtACTION_STATUS_UPDATE, /* status update */
  71. DtACTION_DONE, /* normal action termination code */
  72. DtACTION_FAILED, /* error running action */
  73. DtACTION_CANCELED /* normal action termination by cancel*/
  74. } DtActionStatus;
  75. typedef void (*DtDbReloadCallbackProc)(
  76. XtPointer clientData);
  77. /*
  78. * DtActionInvocationID is the fundamental user-space handle to invoked
  79. * actions.
  80. */
  81. typedef unsigned long DtActionInvocationID;
  82. typedef void (*DtActionCallbackProc) (
  83. DtActionInvocationID id,
  84. XtPointer client_data,
  85. DtActionArg *actionArgPtr,
  86. int actionArgCount,
  87. DtActionStatus status);
  88. /*
  89. * Functions
  90. */
  91. extern Boolean DtActionExists(
  92. char *actionName);
  93. extern char * DtActionLabel(
  94. char *actionName);
  95. extern char * DtActionDescription(
  96. char *actionName);
  97. extern void DtDbReloadNotify (
  98. DtDbReloadCallbackProc proc,
  99. XtPointer clientData);
  100. extern void DtDbLoad(void);
  101. extern DtActionInvocationID DtActionInvoke (
  102. Widget w,
  103. char *action,
  104. DtActionArg *args,
  105. int argCount,
  106. char *termOpts,
  107. char *execHost,
  108. char *contextDir,
  109. int useIndicator,
  110. DtActionCallbackProc statusUpdateCb,
  111. XtPointer client_data);
  112. extern char * DtActionIcon(
  113. char *actionName);
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif /* _Dt_Action_h */