graphic_hd.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. /*
  24. * $XConsortium: graphic_hd.h /main/5 1996/06/11 17:29:02 cde-hal $
  25. * $XConsortium: graphic_hd.h /main/5 1996/06/11 17:29:02 cde-hal $
  26. *
  27. * Copyright (c) 1992 HAL Computer Systems International, Ltd.
  28. * All rights reserved. Unpublished -- rights reserved under
  29. * the Copyright Laws of the United States. USE OF A COPYRIGHT
  30. * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
  31. * OR DISCLOSURE.
  32. *
  33. * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
  34. * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
  35. * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
  36. * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
  37. * INTERNATIONAL, LTD.
  38. *
  39. * RESTRICTED RIGHTS LEGEND
  40. * Use, duplication, or disclosure by the Government is subject
  41. * to the restrictions as set forth in subparagraph (c)(l)(ii)
  42. * of the Rights in Technical Data and Computer Software clause
  43. * at DFARS 252.227-7013.
  44. *
  45. * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
  46. * 1315 Dell Avenue
  47. * Campbell, CA 95008
  48. *
  49. */
  50. #ifndef _graphic_hd_h
  51. #define _graphic_hd_h 1
  52. #include "object/tuple.h"
  53. #include "object/pstring.h"
  54. #include "object/compressed_pstring.h"
  55. #include "oliasdb/olias_consts.h"
  56. #include "api/smart_ptr.h"
  57. /*************************************/
  58. // The graphic class
  59. /*************************************/
  60. class graphic : public mmdb_tuple
  61. {
  62. public:
  63. graphic() : mmdb_tuple(NUM_GRAPHIC_FIELDS, GRAPHIC_CODE) {};
  64. virtual ~graphic() {};
  65. MMDB_SIGNATURES(graphic);
  66. protected:
  67. };
  68. typedef graphic* graphicPtr;
  69. /*************************************/
  70. // The graphic_smart_ptr class
  71. /*************************************/
  72. class graphic_smart_ptr : public smart_ptr
  73. {
  74. public:
  75. graphic_smart_ptr(info_lib* lib_ptr, const char* ibase_name, const char* locator);
  76. graphic_smart_ptr(info_base* ibase_ptr, const char* locator);
  77. graphic_smart_ptr(info_base* ibase_ptr, const oid_t& id);
  78. virtual ~graphic_smart_ptr() {};
  79. const char* locator();
  80. const char* file_name();
  81. const char* version();
  82. int type() const;
  83. unsigned short coding();
  84. unsigned short width();
  85. unsigned short height();
  86. int data_size();
  87. const char* data();
  88. const char* title();
  89. unsigned int llx() ;
  90. unsigned int lly() ;
  91. unsigned int urx() ;
  92. unsigned int ury() ;
  93. protected:
  94. int f_type;
  95. unsigned short f_width, f_height, f_coding;
  96. unsigned int f_llx, f_lly, f_urx, f_ury;
  97. Boolean _converted;
  98. Boolean _convert_to_ints();
  99. void init ();
  100. #ifdef C_API
  101. static buffer* local_graphic_buffer_ptr;
  102. friend void initialize_MMDB();
  103. friend void quit_MMDB();
  104. #endif
  105. };
  106. typedef graphic_smart_ptr* graphic_smart_ptrPtr;
  107. #endif