PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/nx-3.5.0/nx-X11/lib/Xaw/MultiSrcP.h

#
C Header | 182 lines | 62 code | 20 blank | 100 comment | 0 complexity | 6b116379580ea36e7d020a4b9df1e94d MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.0
  1. /* $Xorg: MultiSrcP.h,v 1.4 2001/02/09 02:03:45 xorgcvs Exp $ */
  2. /*
  3. * Copyright 1991 by OMRON Corporation
  4. *
  5. * Permission to use, copy, modify, distribute, and sell this software and its
  6. * documentation for any purpose is hereby granted without fee, provided that
  7. * the above copyright notice appear in all copies and that both that
  8. * copyright notice and this permission notice appear in supporting
  9. * documentation, and that the name OMRON not be used in
  10. * advertising or publicity pertaining to distribution of the software without
  11. * specific, written prior permission. OMRON make no representations
  12. * about the suitability of this software for any purpose. It is provided
  13. * "as is" without express or implied warranty.
  14. *
  15. * OMRON DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  16. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  17. * EVENT SHALL OMRON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  18. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  19. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  20. * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. * PERFORMANCE OF THIS SOFTWARE.
  22. *
  23. * Author: Li Yuhong OMRON Corporation
  24. */
  25. /***********************************************************
  26. Copyright 1987, 1988, 1991, 1994, 1998 The Open Group
  27. Permission to use, copy, modify, distribute, and sell this software and its
  28. documentation for any purpose is hereby granted without fee, provided that
  29. the above copyright notice appear in all copies and that both that
  30. copyright notice and this permission notice appear in supporting
  31. documentation.
  32. The above copyright notice and this permission notice shall be included in
  33. all copies or substantial portions of the Software.
  34. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  35. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  36. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  37. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  38. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  39. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  40. Except as contained in this notice, the name of The Open Group shall not be
  41. used in advertising or otherwise to promote the sale, use or other dealings
  42. in this Software without prior written authorization from The Open Group.
  43. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
  44. All Rights Reserved
  45. Permission to use, copy, modify, and distribute this software and its
  46. documentation for any purpose and without fee is hereby granted,
  47. provided that the above copyright notice appear in all copies and that
  48. both that copyright notice and this permission notice appear in
  49. supporting documentation, and that the name of Digital not be
  50. used in advertising or publicity pertaining to distribution of the
  51. software without specific, written prior permission.
  52. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  53. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  54. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  55. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  56. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  57. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  58. SOFTWARE.
  59. ******************************************************************/
  60. /* $XFree86: xc/lib/Xaw/MultiSrcP.h,v 1.8 2001/01/17 19:42:28 dawes Exp $ */
  61. /*
  62. * MultiSrcP.h - Private Header for Multi Text Source.
  63. *
  64. * This is the private header file for the Multi Text Source.
  65. * It is intended to be used with the Text widget, the simplest way to use
  66. * this text source is to use the MultiText Object.
  67. *
  68. * Date: June 29, 1989
  69. *
  70. * By: Chris D. Peterson
  71. * MIT X Consortium
  72. * kit@expo.lcs.mit.edu
  73. */
  74. /*
  75. * This file was changed from AsciiSrcP.h.
  76. *
  77. * By Li Yuhong, Sept. 18, 1990
  78. */
  79. #ifndef _XawMultiSrcP_h
  80. #define _XawMultiSrcP_h
  81. #include <X11/Xfuncproto.h>
  82. #include <X11/Xaw/TextSrcP.h>
  83. #include <X11/Xaw/MultiSrc.h>
  84. #ifdef L_tmpnam
  85. #define TMPSIZ L_tmpnam
  86. #else
  87. #ifdef PATH_MAX
  88. #define TMPSIZ PATH_MAX
  89. #else
  90. #define TMPSIZ 1024 /* bytes to allocate for tmpnam */
  91. #endif
  92. #endif
  93. typedef struct _MultiPiece { /* Piece of the text file of BUFSIZ allocated
  94. characters */
  95. wchar_t* text; /* The text in this buffer */
  96. XawTextPosition used; /* The number of characters of this buffer
  97. that have been used */
  98. struct _MultiPiece *prev, *next; /* linked list pointers */
  99. } MultiPiece;
  100. /* New fields for the MultiSrc object class */
  101. typedef struct _MultiSrcClassPart {
  102. XtPointer extension;
  103. } MultiSrcClassPart;
  104. /* Full class record */
  105. typedef struct _MultiSrcClassRec {
  106. ObjectClassPart object_class;
  107. TextSrcClassPart text_src_class;
  108. MultiSrcClassPart multi_src_class;
  109. } MultiSrcClassRec;
  110. extern MultiSrcClassRec multiSrcClassRec;
  111. /* New fields for the MultiSrc object */
  112. typedef struct _MultiSrcPart {
  113. /* resources */
  114. XIC ic; /* for X Input Method */
  115. XtPointer string; /* either the string, or the file name, depend-
  116. ing upon the `type'. ALWAYS IN MB FORMAT */
  117. XawAsciiType type; /* either string or disk */
  118. XawTextPosition piece_size; /* Size of text buffer for each piece */
  119. Boolean data_compression; /* compress to minimum memory automatically
  120. on save? */
  121. #ifdef OLDXAW
  122. XtCallbackList callback;
  123. #endif
  124. Boolean use_string_in_place;/* Use the string passed in place */
  125. int multi_length; /* length field for multi string emulation */
  126. /* private */
  127. Boolean is_tempfile; /* Is this a temporary file? */
  128. #ifdef OLDXAW
  129. Boolean changes;
  130. #endif
  131. Boolean allocated_string; /* Have I allocated the
  132. string in multi_src->string? */
  133. XawTextPosition length; /* length of file - IN CHARACTERS, NOT BYTES */
  134. MultiPiece *first_piece; /* first piece of the text */
  135. #ifndef OLDXAW
  136. XtPointer pad[4]; /* for future use and keep binary compatability */
  137. #endif
  138. } MultiSrcPart;
  139. /* Full instance record */
  140. typedef struct _MultiSrcRec {
  141. ObjectPart object;
  142. TextSrcPart text_src;
  143. MultiSrcPart multi_src;
  144. } MultiSrcRec;
  145. _XFUNCPROTOBEGIN
  146. void _XawMultiSourceFreeString
  147. (
  148. Widget w
  149. );
  150. _XFUNCPROTOEND
  151. #endif /* _XawMultiSrcP_h */