ColorMain.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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: ColorMain.h /main/5 1995/10/30 13:08:51 rswiston $ */
  24. /************************************<+>*************************************
  25. ****************************************************************************
  26. **
  27. ** File: ColorMain.h
  28. **
  29. ** Project: DT 3.0
  30. **
  31. ** This file contains function definitions for the corresponding .c
  32. ** file
  33. **
  34. **
  35. ** (c) Copyright Hewlett-Packard Company, 1990.
  36. **
  37. **
  38. **
  39. ****************************************************************************
  40. ************************************<+>*************************************/
  41. #ifndef _colormain_h
  42. #define _colormain_h
  43. #include <Xm/ColorObjP.h>
  44. /* #defines */
  45. #define PALETTE_SUFFIX ".dp"
  46. /* defines for foreground colors */
  47. #define DYNAMIC 0
  48. #define BLACK 1
  49. #define WHITE 2
  50. /* selections */
  51. #define GET_TYPE_MONITOR 1
  52. #define GET_PALETTE_NAME 2
  53. #define GET_UPDATE 3
  54. /* typedef statements */
  55. /* ColorSet data structure */
  56. typedef struct {
  57. XColor fg;
  58. XColor bg;
  59. XColor ts;
  60. XColor bs;
  61. XColor sc;
  62. } ColorSet;
  63. /* Palette info */
  64. typedef struct _palette {
  65. char *name;
  66. char *desc;
  67. char *directory;
  68. int item_position;
  69. int num_of_colors;
  70. ColorSet color[XmCO_MAX_NUM_COLORS];
  71. struct _palette *next;
  72. short active;
  73. short inactive;
  74. short primary;
  75. short secondary;
  76. } palette;
  77. /* External variable definitions */
  78. /* Palettes exist in a linked list */
  79. extern palette *pHeadPalette;
  80. extern palette *pCurrentPalette;
  81. extern palette *pOldPalette;
  82. /* atoms used in selection communication with color server */
  83. extern Atom XA_CUSTOMIZE;
  84. extern Atom XA_PALETTE_NAME;
  85. extern Atom XA_TYPE_MONITOR;
  86. extern Atom XA_UPDATE;
  87. extern Widget modifyColorButton;
  88. extern int TypeOfMonitor;
  89. extern Bool UsePixmaps;
  90. extern int FgColor;
  91. extern Widget paletteList;
  92. extern char *defaultName;
  93. extern Bool WaitSelection;
  94. extern int NumOfPalettes;
  95. extern XColor saved_color[2];
  96. /* External Interface */
  97. extern void _DtTurnOnHourGlass( Widget );
  98. extern void _DtTurnOffHourGlass( Widget );
  99. extern void Customize( Widget shell) ;
  100. extern void CreatePaletteButtons( Widget parent) ;
  101. extern Boolean InitializePaletteList(
  102. Widget shell,
  103. Widget list,
  104. #if NeedWidePrototypes
  105. int startup) ;
  106. #else
  107. Boolean startup) ;
  108. #endif
  109. extern void DeletePaletteFromLinkList( Widget list) ;
  110. extern void CopyPixel( ColorSet srcPixels[XmCO_MAX_NUM_COLORS],
  111. ColorSet dstPixels[XmCO_MAX_NUM_COLORS],
  112. int numOfColors) ;
  113. extern void SaveOrgPalette( void ) ;
  114. extern void RestoreOrgPalette( void ) ;
  115. extern void UpdateDefaultPalette( void ) ;
  116. extern void show_selection(
  117. Widget w,
  118. XtPointer client_data,
  119. Atom *selection,
  120. Atom *type,
  121. XtPointer value,
  122. unsigned long *length,
  123. int *format) ;
  124. extern void restoreColor( Widget shell, XrmDatabase db) ;
  125. extern void saveColor( int fd) ;
  126. extern void SameName(
  127. Widget w,
  128. struct _palette *tmpPalette,
  129. char *name) ;
  130. extern void InitializeAtoms( void ) ;
  131. extern void GetDefaultPal( Widget shell) ;
  132. extern void CreateDialogBoxD( Widget parent) ;
  133. extern void AddToDialogBox( void ) ;
  134. extern void CreateTopColor1( void ) ;
  135. extern void CreateTopColor2( void ) ;
  136. extern void CreateBottomColor( void ) ;
  137. #endif /* _colormain_h */
  138. /* DON'T ADD ANYTHING AFTER THIS #endif */