OpenIndiana and Solaris port
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / oliasdb / graphic_hd.h
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 librararies 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
51
52 #ifndef _graphic_hd_h
53 #define _graphic_hd_h 1
54
55 #include "object/tuple.h"
56 #include "object/pstring.h"
57 #include "object/compressed_pstring.h"
58 #include "oliasdb/olias_consts.h"
59 #include "api/smart_ptr.h"
60
61 /*************************************/
62 // The graphic class
63 /*************************************/
64
65 class graphic : public tuple
66 {
67
68 public:
69    graphic() : tuple(NUM_GRAPHIC_FIELDS, GRAPHIC_CODE) {};
70    virtual ~graphic() {};
71
72    MMDB_SIGNATURES(graphic);
73
74 protected:
75 };
76
77 typedef graphic* graphicPtr;
78
79 /*************************************/
80 // The graphic_smart_ptr class
81 /*************************************/
82 class graphic_smart_ptr : public smart_ptr
83 {
84 public:
85
86    graphic_smart_ptr(info_lib* lib_ptr, const char* ibase_name, const char* locator);
87    graphic_smart_ptr(info_base* ibase_ptr, const char* locator);
88    graphic_smart_ptr(info_base* ibase_ptr, const oid_t& id);
89    virtual ~graphic_smart_ptr() {};
90
91    const char* locator();
92    const char* file_name();
93    const char* version();
94
95    int type() const;
96    unsigned short coding();
97    unsigned short width();
98    unsigned short height();
99    int data_size();
100    const char* data();
101    const char* title();
102
103    unsigned int llx() ;
104    unsigned int lly() ;
105    unsigned int urx() ;
106    unsigned int ury() ;
107
108 protected:
109
110    int f_type;
111    unsigned short f_width, f_height, f_coding;
112    unsigned int f_llx, f_lly, f_urx, f_ury;
113    Boolean _converted;
114
115    Boolean _convert_to_ints();
116
117    void init ();
118
119 #ifdef C_API
120    static buffer* local_graphic_buffer_ptr;
121    friend void initialize_MMDB();
122    friend void quit_MMDB();
123 #endif
124 };
125
126
127 typedef graphic_smart_ptr* graphic_smart_ptrPtr;
128
129 #endif