Wsm.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. /* $XConsortium: Wsm.h /main/5 1996/05/20 16:08:50 drk $
  24. *
  25. * (c) Copyright 1996 Digital Equipment Corporation.
  26. * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
  27. * (c) Copyright 1993,1994,1996 International Business Machines Corp.
  28. * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
  29. * (c) Copyright 1993,1994,1996 Novell, Inc.
  30. * (c) Copyright 1996 FUJITSU LIMITED.
  31. * (c) Copyright 1996 Hitachi.
  32. */
  33. #ifndef _Dt_Wsm_h
  34. #define _Dt_Wsm_h
  35. #include <X11/Intrinsic.h>
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. /*
  40. * Constants
  41. */
  42. #define DtWSM_REASON_ADD 0
  43. #define DtWSM_REASON_DELETE 1
  44. #define DtWSM_REASON_BACKDROP 2
  45. #define DtWSM_REASON_TITLE 3
  46. #define DtWSM_REASON_CURRENT 4
  47. /*
  48. * Types
  49. */
  50. /* Which style is the workspace background image */
  51. typedef enum {
  52. DtWSM_BACKDROP_IMAGETYPE_TILED = 0,
  53. DtWSM_BACKDROP_IMAGETYPE_CENTER = 1,
  54. DtWSM_BACKDROP_IMAGETYPE_FIT = 2,
  55. DtWSM_BACKDROP_IMAGETYPE_FILL = 3
  56. } DtWsmBackdropImageType;
  57. /* Workspace property information */
  58. typedef struct _DtWsmWorkspaceInfo {
  59. Atom workspace;
  60. unsigned long bg;
  61. unsigned long fg;
  62. Atom backdropName;
  63. int colorSetId;
  64. char *pchTitle;
  65. Window *backdropWindows;
  66. int numBackdropWindows;
  67. DtWsmBackdropImageType imageType; /**< Tiled, Center, Fit, Fill */
  68. } DtWsmWorkspaceInfo;
  69. /* Workspace modified callback reasons */
  70. typedef int DtWsmWsReason;
  71. /* Workspace callback context (opaque) */
  72. typedef struct _DtWsmCBContext * DtWsmCBContext;
  73. /* Workspace callback prototype */
  74. typedef void (*DtWsmWsChangeProc)(
  75. Widget widget,
  76. Atom aWs,
  77. XtPointer client_data);
  78. /* Workspace modified callback prototype */
  79. typedef void (*DtWsmWsModifiedProc)(
  80. Widget widget,
  81. Atom aWs,
  82. DtWsmWsReason reason,
  83. XtPointer client_data);
  84. /*
  85. * Functions
  86. */
  87. extern void DtWsmAddWorkspaceFunctions(
  88. Display *display,
  89. Window client);
  90. extern void DtWsmRemoveWorkspaceFunctions(
  91. Display *display,
  92. Window client);
  93. extern int DtWsmGetWorkspaceInfo(
  94. Display *display,
  95. Window root,
  96. Atom aWS,
  97. DtWsmWorkspaceInfo **ppWsInfo);
  98. extern void DtWsmFreeWorkspaceInfo(
  99. DtWsmWorkspaceInfo *pWsInfo);
  100. extern int DtWsmGetWorkspaceList(
  101. Display *display,
  102. Window root,
  103. Atom **ppWorkspaceList,
  104. int *pNumWorkspaces);
  105. extern int DtWsmGetCurrentWorkspace(
  106. Display *display,
  107. Window root,
  108. Atom *paWorkspace);
  109. extern DtWsmCBContext DtWsmAddCurrentWorkspaceCallback(
  110. Widget widget,
  111. DtWsmWsChangeProc ws_change,
  112. XtPointer client_data);
  113. extern void DtWsmRemoveWorkspaceCallback(
  114. DtWsmCBContext pCbCtx);
  115. extern int DtWsmSetCurrentWorkspace(
  116. Widget widget,
  117. Atom aWs);
  118. extern int DtWsmGetWorkspacesOccupied(
  119. Display *display,
  120. Window window,
  121. Atom **ppaWs,
  122. unsigned long *pNumWs);
  123. extern void DtWsmSetWorkspacesOccupied(
  124. Display *display,
  125. Window window,
  126. Atom *pWsHints,
  127. unsigned long numHints);
  128. extern void DtWsmOccupyAllWorkspaces(
  129. Display *display,
  130. Window window);
  131. extern DtWsmCBContext DtWsmAddWorkspaceModifiedCallback(
  132. Widget widget,
  133. DtWsmWsModifiedProc ws_modified,
  134. XtPointer client_data);
  135. extern Window DtWsmGetCurrentBackdropWindow(
  136. Display *display,
  137. Window root);
  138. extern int DtWsmSetWorkspaceTitle(
  139. Widget widget,
  140. Atom aWs,
  141. char *title);
  142. extern int DtWsmChangeBackdrop(
  143. Display *display,
  144. Window root,
  145. char *path,
  146. Pixmap pixmap);
  147. extern int DtWsmAddWorkspace(
  148. Widget widget,
  149. char *title);
  150. extern int DtWsmDeleteWorkspace(
  151. Widget widget,
  152. Atom aWs);
  153. #ifdef __cplusplus
  154. }
  155. #endif
  156. #endif /* _Dt_Wsm_h */