~ubuntu-branches/ubuntu/warty/dasher/warty

« back to all changes in this revision

Viewing changes to Src/DasherCore/DasherTypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2003-06-05 11:10:04 UTC
  • Revision ID: james.westby@ubuntu.com-20030605111004-kqiutbrlvs7td9ic
Tags: upstream-3.2.10
ImportĀ upstreamĀ versionĀ 3.2.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// DasherTypes.h
 
2
//
 
3
/////////////////////////////////////////////////////////////////////////////
 
4
//
 
5
// Copyright (c) 2001-2002 David Ward
 
6
//
 
7
/////////////////////////////////////////////////////////////////////////////
 
8
 
 
9
 
 
10
#ifndef __DasherTypes_h__
 
11
#define __DasherTypes_h__
 
12
 
 
13
#include <string>
 
14
 
 
15
namespace Dasher
 
16
{
 
17
        /* TODO: note by IAM 08/2002 {{{
 
18
        
 
19
        MS docs tell us the __int64 type has no ANSI equivalent
 
20
        I've checked and currently a 32bit long leads to problems.
 
21
        The code could probably be altered to get around this 64bit
 
22
        precision requirement. If not a custom class could be found
 
23
        (or implemented fairly easily). However, as GCC supports
 
24
        "long long int" I'm giving this low priority until someone
 
25
        complains...
 
26
        
 
27
        "ISO C99 supports data types for integers that are at least 64 bits wide,
 
28
        and as an extension GCC supports them in C89 mode and in C++."
 
29
        
 
30
        I've heard some compilers have a "quad int". If "long long int" does not
 
31
        work, try that.
 
32
        }}} */
 
33
        #ifdef _MSC_VER
 
34
                typedef __int64 myint;
 
35
                #define LLONG_MAX 9223372036854775807
 
36
                #define LLONG_MIN (-LLONG_MAX - 1)
 
37
        #else
 
38
                typedef long long int myint;
 
39
                #define LLONG_MAX 9223372036854775807LL
 
40
                #define LLONG_MIN (-LLONG_MAX - 1LL)
 
41
        #endif
 
42
        
 
43
        // Using a signed symbol type allows "Out of band" ie negative {{{
 
44
        // values to be used to flag non-symbol data. For example commands
 
45
        // in dasher nodes.
 
46
        //typedef unsigned int symbol; // }}}
 
47
        typedef int symbol;
 
48
 
 
49
#ifdef _MSC_VER // Not needed on UNIX, and break the QT build
 
50
        typedef unsigned int uint;
 
51
        typedef unsigned short ushort;
 
52
#endif
 
53
 
 
54
        namespace Opts
 
55
        {
 
56
                // Numbers should be applied to elements of the following two enumerations as these preferences may be stored to file. Constancy between
 
57
                // versions is a good idea. It should *not* be assumed that the numbers map onto anything useful. Different codepages may be appropriate on different systems for different character sets.
 
58
                enum FileEncodingFormats {UserDefault=-1, AlphabetDefault=-2, UTF8=65001, UTF16LE=1200, UTF16BE=1201};
 
59
                enum AlphabetTypes {MyNone=0, Arabic=1256, Baltic=1257, CentralEurope=1250, ChineseSimplified=936, ChineseTraditional=950, Cyrillic=1251, Greek=1253, Hebrew=1255, Japanese=932, Korean=949, Thai=874, Turkish=1254, VietNam=1258, Western=1252};
 
60
                enum ScreenOrientations {Alphabet=-2, LeftToRight=0, RightToLeft=1, TopToBottom=2, BottomToTop=3};
 
61
                // TODO: Possibly make colors long and add an RGB item to this {{{
 
62
                // Would allow literal as well as semantic colors for
 
63
                // greater flexibility. }}}
 
64
                enum ColorSchemes {Nodes1=0, Nodes2=1, Special1=2, Special2=3, Groups=4, Objects=5};
 
65
                enum FontSize {Normal=1, Big=2, VBig=4};
 
66
        }
 
67
 
 
68
        struct ControlTree {
 
69
          void* pointer;
 
70
          int data;
 
71
          int type;
 
72
          int colour;
 
73
          std::string text;
 
74
          ControlTree *parent;
 
75
          ControlTree *children;
 
76
          ControlTree *next;
 
77
        };
 
78
}
 
79
 
 
80
#endif /* #ifndef __DasherTypes_h__ */