~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/wx/src/gen/wxTextAttr.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-07 15:07:37 UTC
  • mfrom: (1.2.1 upstream) (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090507150737-i4yb5elwinm7r0hc
Tags: 1:13.b-dfsg1-1
* Removed another bunch of non-free RFCs from original tarball
  (closes: #527053).
* Fixed build-dependencies list by adding missing comma. This requires
  libsctp-dev again. Also, added libsctp1 dependency to erlang-base and
  erlang-base-hipe packages because the shared library is loaded via
  dlopen now and cannot be added using dh_slibdeps (closes: #526682).
* Weakened dependency of erlang-webtool on erlang-observer to recommends
  to avoid circular dependencies (closes: #526627).
* Added solaris-i386 to HiPE enabled architectures.
* Made script sources in /usr/lib/erlang/erts-*/bin directory executable,
  which is more convenient if a user wants to create a target Erlang system.
* Shortened extended description line for erlang-dev package to make it
  fit 80x25 terminals.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
 
5
%% 
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%% 
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%% This file is generated DO NOT EDIT
 
19
 
 
20
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html">wxTextAttr</a>.
 
21
%% @type wxTextAttr().  An object reference, The representation is internal
 
22
%% and can be changed without notice. It can't be used for comparsion
 
23
%% stored on disc or distributed for use on other nodes.
 
24
 
 
25
-module(wxTextAttr).
 
26
-include("wxe.hrl").
 
27
-export([destroy/1,getAlignment/1,getBackgroundColour/1,getFlags/1,getFont/1,
 
28
  getLeftIndent/1,getLeftSubIndent/1,getRightIndent/1,getTabs/1,getTextColour/1,
 
29
  hasBackgroundColour/1,hasFont/1,hasTextColour/1,isDefault/1,new/0,
 
30
  new/1,new/2,setAlignment/2,setBackgroundColour/2,setFlags/2,setFont/2,
 
31
  setFont/3,setLeftIndent/2,setLeftIndent/3,setRightIndent/2,setTabs/2,
 
32
  setTextColour/2]).
 
33
 
 
34
%% inherited exports
 
35
-export([parent_class/1]).
 
36
 
 
37
%% @hidden
 
38
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
 
39
 
 
40
%% @spec () -> wxTextAttr()
 
41
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
 
42
new() ->
 
43
  wxe_util:construct(?wxTextAttr_new_0,
 
44
  <<>>).
 
45
 
 
46
%% @spec (ColText::wx:colour()) -> wxTextAttr()
 
47
%% @equiv new(ColText, [])
 
48
new(ColText)
 
49
 when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
 
50
  new(ColText, []).
 
51
 
 
52
%% @spec (ColText::wx:colour(), [Option]) -> wxTextAttr()
 
53
%% Option = {colBack, wx:colour()} | {font, wxFont:wxFont()} | {alignment, WxTextAttrAlignment}
 
54
%% WxTextAttrAlignment = integer()
 
55
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
 
56
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
 
57
new(ColText, Options)
 
58
 when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4,is_list(Options) ->
 
59
  MOpts = fun({colBack, ColBack}, Acc) -> [<<1:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary,0:32>>|Acc];
 
60
          ({font, #wx_ref{type=FontT,ref=FontRef}}, Acc) ->   ?CLASS(FontT,wxFont),[<<2:32/?UI,FontRef:32/?UI>>|Acc];
 
61
          ({alignment, Alignment}, Acc) -> [<<3:32/?UI,Alignment:32/?UI>>|Acc];
 
62
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
63
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
64
  wxe_util:construct(?wxTextAttr_new_2,
 
65
  <<(wxe_util:colour_bin(ColText)):16/binary, BinOpt/binary>>).
 
66
 
 
67
%% @spec (This::wxTextAttr()) -> WxTextAttrAlignment
 
68
%% WxTextAttrAlignment = integer()
 
69
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetalignment">external documentation</a>.
 
70
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
 
71
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
72
  ?CLASS(ThisT,wxTextAttr),
 
73
  wxe_util:call(?wxTextAttr_GetAlignment,
 
74
  <<ThisRef:32/?UI>>).
 
75
 
 
76
%% @spec (This::wxTextAttr()) -> wx:colour()
 
77
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetbackgroundcolour">external documentation</a>.
 
78
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
79
  ?CLASS(ThisT,wxTextAttr),
 
80
  wxe_util:call(?wxTextAttr_GetBackgroundColour,
 
81
  <<ThisRef:32/?UI>>).
 
82
 
 
83
%% @spec (This::wxTextAttr()) -> wxFont:wxFont()
 
84
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetfont">external documentation</a>.
 
85
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
86
  ?CLASS(ThisT,wxTextAttr),
 
87
  wxe_util:call(?wxTextAttr_GetFont,
 
88
  <<ThisRef:32/?UI>>).
 
89
 
 
90
%% @spec (This::wxTextAttr()) -> integer()
 
91
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftindent">external documentation</a>.
 
92
getLeftIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
93
  ?CLASS(ThisT,wxTextAttr),
 
94
  wxe_util:call(?wxTextAttr_GetLeftIndent,
 
95
  <<ThisRef:32/?UI>>).
 
96
 
 
97
%% @spec (This::wxTextAttr()) -> integer()
 
98
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftsubindent">external documentation</a>.
 
99
getLeftSubIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
100
  ?CLASS(ThisT,wxTextAttr),
 
101
  wxe_util:call(?wxTextAttr_GetLeftSubIndent,
 
102
  <<ThisRef:32/?UI>>).
 
103
 
 
104
%% @spec (This::wxTextAttr()) -> integer()
 
105
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetrightindent">external documentation</a>.
 
106
getRightIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
107
  ?CLASS(ThisT,wxTextAttr),
 
108
  wxe_util:call(?wxTextAttr_GetRightIndent,
 
109
  <<ThisRef:32/?UI>>).
 
110
 
 
111
%% @spec (This::wxTextAttr()) -> [integer()]
 
112
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettabs">external documentation</a>.
 
113
getTabs(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
114
  ?CLASS(ThisT,wxTextAttr),
 
115
  wxe_util:call(?wxTextAttr_GetTabs,
 
116
  <<ThisRef:32/?UI>>).
 
117
 
 
118
%% @spec (This::wxTextAttr()) -> wx:colour()
 
119
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettextcolour">external documentation</a>.
 
120
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
121
  ?CLASS(ThisT,wxTextAttr),
 
122
  wxe_util:call(?wxTextAttr_GetTextColour,
 
123
  <<ThisRef:32/?UI>>).
 
124
 
 
125
%% @spec (This::wxTextAttr()) -> bool()
 
126
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasbackgroundcolour">external documentation</a>.
 
127
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
128
  ?CLASS(ThisT,wxTextAttr),
 
129
  wxe_util:call(?wxTextAttr_HasBackgroundColour,
 
130
  <<ThisRef:32/?UI>>).
 
131
 
 
132
%% @spec (This::wxTextAttr()) -> bool()
 
133
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasfont">external documentation</a>.
 
134
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
135
  ?CLASS(ThisT,wxTextAttr),
 
136
  wxe_util:call(?wxTextAttr_HasFont,
 
137
  <<ThisRef:32/?UI>>).
 
138
 
 
139
%% @spec (This::wxTextAttr()) -> bool()
 
140
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhastextcolour">external documentation</a>.
 
141
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
142
  ?CLASS(ThisT,wxTextAttr),
 
143
  wxe_util:call(?wxTextAttr_HasTextColour,
 
144
  <<ThisRef:32/?UI>>).
 
145
 
 
146
%% @spec (This::wxTextAttr()) -> integer()
 
147
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetflags">external documentation</a>.
 
148
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
149
  ?CLASS(ThisT,wxTextAttr),
 
150
  wxe_util:call(?wxTextAttr_GetFlags,
 
151
  <<ThisRef:32/?UI>>).
 
152
 
 
153
%% @spec (This::wxTextAttr()) -> bool()
 
154
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrisdefault">external documentation</a>.
 
155
isDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
156
  ?CLASS(ThisT,wxTextAttr),
 
157
  wxe_util:call(?wxTextAttr_IsDefault,
 
158
  <<ThisRef:32/?UI>>).
 
159
 
 
160
%% @spec (This::wxTextAttr(), Alignment::WxTextAttrAlignment) -> ok
 
161
%% WxTextAttrAlignment = integer()
 
162
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetalignment">external documentation</a>.
 
163
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
 
164
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},Alignment)
 
165
 when is_integer(Alignment) ->
 
166
  ?CLASS(ThisT,wxTextAttr),
 
167
  wxe_util:cast(?wxTextAttr_SetAlignment,
 
168
  <<ThisRef:32/?UI,Alignment:32/?UI>>).
 
169
 
 
170
%% @spec (This::wxTextAttr(), ColBack::wx:colour()) -> ok
 
171
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetbackgroundcolour">external documentation</a>.
 
172
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
 
173
 when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
 
174
  ?CLASS(ThisT,wxTextAttr),
 
175
  wxe_util:cast(?wxTextAttr_SetBackgroundColour,
 
176
  <<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
 
177
 
 
178
%% @spec (This::wxTextAttr(), Flags::integer()) -> ok
 
179
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetflags">external documentation</a>.
 
180
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
 
181
 when is_integer(Flags) ->
 
182
  ?CLASS(ThisT,wxTextAttr),
 
183
  wxe_util:cast(?wxTextAttr_SetFlags,
 
184
  <<ThisRef:32/?UI,Flags:32/?UI>>).
 
185
 
 
186
%% @spec (This::wxTextAttr(), Font::wxFont:wxFont()) -> ok
 
187
%% @equiv setFont(This,Font, [])
 
188
setFont(This,Font)
 
189
 when is_record(This, wx_ref),is_record(Font, wx_ref) ->
 
190
  setFont(This,Font, []).
 
191
 
 
192
%% @spec (This::wxTextAttr(), Font::wxFont:wxFont(), [Option]) -> ok
 
193
%% Option = {flags, integer()}
 
194
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetfont">external documentation</a>.
 
195
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
 
196
 when is_list(Options) ->
 
197
  ?CLASS(ThisT,wxTextAttr),
 
198
  ?CLASS(FontT,wxFont),
 
199
  MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
 
200
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
201
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
202
  wxe_util:cast(?wxTextAttr_SetFont,
 
203
  <<ThisRef:32/?UI,FontRef:32/?UI, BinOpt/binary>>).
 
204
 
 
205
%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
 
206
%% @equiv setLeftIndent(This,Indent, [])
 
207
setLeftIndent(This,Indent)
 
208
 when is_record(This, wx_ref),is_integer(Indent) ->
 
209
  setLeftIndent(This,Indent, []).
 
210
 
 
211
%% @spec (This::wxTextAttr(), Indent::integer(), [Option]) -> ok
 
212
%% Option = {subIndent, integer()}
 
213
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetleftindent">external documentation</a>.
 
214
setLeftIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent, Options)
 
215
 when is_integer(Indent),is_list(Options) ->
 
216
  ?CLASS(ThisT,wxTextAttr),
 
217
  MOpts = fun({subIndent, SubIndent}, Acc) -> [<<1:32/?UI,SubIndent:32/?UI>>|Acc];
 
218
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
219
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
220
  wxe_util:cast(?wxTextAttr_SetLeftIndent,
 
221
  <<ThisRef:32/?UI,Indent:32/?UI, BinOpt/binary>>).
 
222
 
 
223
%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
 
224
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetrightindent">external documentation</a>.
 
225
setRightIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
 
226
 when is_integer(Indent) ->
 
227
  ?CLASS(ThisT,wxTextAttr),
 
228
  wxe_util:cast(?wxTextAttr_SetRightIndent,
 
229
  <<ThisRef:32/?UI,Indent:32/?UI>>).
 
230
 
 
231
%% @spec (This::wxTextAttr(), Tabs::[integer()]) -> ok
 
232
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettabs">external documentation</a>.
 
233
setTabs(#wx_ref{type=ThisT,ref=ThisRef},Tabs)
 
234
 when is_list(Tabs) ->
 
235
  ?CLASS(ThisT,wxTextAttr),
 
236
  wxe_util:cast(?wxTextAttr_SetTabs,
 
237
  <<ThisRef:32/?UI,(length(Tabs)):32/?UI,
 
238
        (<< <<C:32/?I>> || C <- Tabs>>)/binary, 0:(((0+length(Tabs)) rem 2)*32)>>).
 
239
 
 
240
%% @spec (This::wxTextAttr(), ColText::wx:colour()) -> ok
 
241
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettextcolour">external documentation</a>.
 
242
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
 
243
 when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
 
244
  ?CLASS(ThisT,wxTextAttr),
 
245
  wxe_util:cast(?wxTextAttr_SetTextColour,
 
246
  <<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
 
247
 
 
248
%% @spec (This::wxTextAttr()) -> ok
 
249
%% @doc Destroys this object, do not use object again
 
250
destroy(Obj=#wx_ref{type=Type}) -> 
 
251
  ?CLASS(Type,wxTextAttr),
 
252
  wxe_util:destroy(?wxTextAttr_destroy,Obj),
 
253
  ok.