2
0

cmnrtns.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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: cmnrtns.h /main/5 1995/11/01 16:11:28 rswiston $ */
  24. #include <Dt/IconFile.h>
  25. /***************************************************************************/
  26. /* */
  27. /* cmnrtns.h */
  28. /* */
  29. /***************************************************************************/
  30. #ifndef _CMNRTNS_H_INCLUDED
  31. #define _CMNRTNS_H_INCLUDED
  32. #ifndef STORAGECLASS
  33. #ifdef NOEXTERN
  34. #define STORAGECLASS
  35. #else
  36. #define STORAGECLASS extern
  37. #endif
  38. #endif
  39. /***************************************************************************/
  40. /* */
  41. /* Macro Declarations */
  42. /* */
  43. /***************************************************************************/
  44. #define SET_ICONGADGET_ICON_AND_EXT(widIconGadget,pszIconFileName, pszBuffer) {\
  45. sprintf(pszBuffer, "%s%s", pszIconFileName, bShowPixmaps ? PIXMAP_EXT : BITMAP_EXT); \
  46. XtVaSetValues (widIconGadget, \
  47. XmNimageName, "", \
  48. NULL); \
  49. /*printf("setting icon to = '%s'\n", pszBuffer);*/ \
  50. XtVaSetValues (widIconGadget, \
  51. XmNimageName, pszBuffer, \
  52. NULL); \
  53. }
  54. #define SET_ICONGADGET_ICON(widIconGadget,pszIconFileName) { \
  55. /*printf("setting icon to = '%s'\n", pszIconFileName);*/ \
  56. XtVaSetValues (widIconGadget, \
  57. XmNimageName, "", \
  58. NULL); \
  59. XtVaSetValues (widIconGadget, \
  60. XmNimageName, pszIconFileName, \
  61. NULL); \
  62. }
  63. #define FIND_ICONGADGET_ICON(pszIcon,pszFile,size) { \
  64. pszFile = (char *)NULL; \
  65. pszFile = _DtGetIconFileName(XtScreen(CreateActionAppShell), \
  66. NULL, \
  67. pszIcon, \
  68. NULL, \
  69. size); \
  70. }
  71. #define CHANGE_ICONGADGET_ICON(widIconGadget,buffer,name,size,type) { \
  72. sprintf(buffer, "%s.%s.%s", name, size, type); \
  73. if (check_file_exists(buffer)) { \
  74. SET_ICONGADGET_ICON(widIconGadget, buffer); \
  75. } else { \
  76. SET_ICONGADGET_ICON(widIconGadget, ""); \
  77. } \
  78. }
  79. #define SET_TOGGLEBUTTON(widToggleButton,bState) { \
  80. XtVaSetValues (widToggleButton, \
  81. XmNset, bState, \
  82. NULL); \
  83. }
  84. /***************************************************************************/
  85. /* */
  86. /* Prototypes for functions */
  87. /* */
  88. /***************************************************************************/
  89. ushort WriteDefinitionFile(char *, ActionData *);
  90. ushort WriteActionFile(ActionData *);
  91. void Change_IconGadget_IconType(Widget, char *);
  92. void load_icons (Widget wid, XtPointer client_data,
  93. XmFileSelectionBoxCallbackStruct *cbs);
  94. void GetWidgetTextString(Widget, char **);
  95. void PutWidgetTextString (Widget wid, char *pszText);
  96. char * GetCoreName(char *pszFullName);
  97. char **GetIconSearchPathList(void);
  98. void FreeIconSearchPathList(char **);
  99. void TurnOnHourGlassAllWindows();
  100. void TurnOffHourGlassAllWindows();
  101. char * ReplaceSpaces(char *pszName);
  102. void SetIconData(Widget, char *, enum icon_size_range);
  103. char * GetCorrectIconType(char *);
  104. char * CreateMaskName(char *);
  105. IconData * GetIconDataFromWid(Widget);
  106. #endif /* _CMNRTNS_H_INCLUDED */