summaryrefslogtreecommitdiffstats
path: root/applications/rview/rviewTypeMan.hh
blob: f8a07ad6230b1d88a148d6357bdd3a2406909aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* This file is part of rasdaman community.
*
* Rasdaman community is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Rasdaman community is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
rasdaman GmbH.
*
* For more information please see <http://www.rasdaman.org>
* or contact Peter Baumann via <baumann@rasdaman.com>.
/

/**
 *	COMMENTS:
 *		None
 */

/**
*	@file rviewTypeMan.hh
*
*	@ingroup Applications
*/

#ifndef _RVIEW_TYPE_MAN_H_
#define _RVIEW_TYPE_MAN_H_


#ifdef __GNUG__
#pragma interface
#endif


#include "rviewUtils.hh"
#include "rviewDisplay.hh"



class rviewTypeMan: public rviewFrame
{
  public:

  rviewTypeMan(rviewFrame *parentWindow);
  rviewTypeMan(rviewFrame *parentWindow, const r_Type *type);
  ~rviewTypeMan(void);

  void unlinkParent(void);

  void setType(const r_Type *type);
  void label(void);
  int  process(wxObject &obj, wxEvent &evt);
  void OnSize(int w, int h);
  int convert(r_Ref<r_GMarray> &src, r_Ref<r_GMarray> &dest);


  protected:

  void clearData(void);

  wxPanel *panel;
  wxGroupBox **structures;
  rviewCheckBox **members;
  unsigned int *offsets;
  unsigned char *primtypes;
  unsigned int numStruct, numMembers, typeDepth;
  unsigned int baseTypeLength;
  r_Type *myType;
  rviewFrame *parent;
  rviewButton *closeBut, *convertBut;
  const char **typeNames;
  DynamicString baseTypeName;


  private:

  void initShare(rviewFrame *parentWindow);
  void parseStructType(const r_Structure_Type *tp, unsigned int &nums, unsigned int &numm, unsigned int depth, unsigned int offset=0, wxRect *bbox=NULL);
  void parsePrimitiveType(const r_Primitive_Type *tp, const char *name, unsigned int &numm, unsigned int offset=0, wxRect *bbox=NULL);

  static const char structName[];
  static const char marrayName[];
  static const char typeBool[];
  static const char typeChar[];
  static const char typeOctet[];
  static const char typeShort[];
  static const char typeUShort[];
  static const char typeLong[];
  static const char typeULong[];
  static const char typeFloat[];
  static const char typeDouble[];

  // constants
  static const int tman_width;
  static const int tman_height;
  static const int tman_border;
  static const int tman_basewidth;
  static const int tman_cheight;
  static const int tman_bheight;
  static const int tman_bwidth;
};

#endif