aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-03-02 09:52:31 +0100
committerBjörn Gustavsson <[email protected]>2010-03-12 06:41:31 +0100
commit556b7f0aea69c7a82a2d0b4c844d07732d005288 (patch)
tree9634c0a57894a758c11cd33ea12adba202dc4163
parente68047c805927face88ef43fd6fdbc2a631b9d0a (diff)
downloadotp-556b7f0aea69c7a82a2d0b4c844d07732d005288.tar.gz
otp-556b7f0aea69c7a82a2d0b4c844d07732d005288.tar.bz2
otp-556b7f0aea69c7a82a2d0b4c844d07732d005288.zip
Fixed code generation from newer doxygen versions.
Also changed the wx.hrl output order. Tried to get it to work with both doxygen-1.4.6 and doxygen-1.6.3. Minor problems still exists with doxygen-1.6.3.
-rw-r--r--lib/wx/api_gen/README18
-rw-r--r--lib/wx/api_gen/gl_doxygen.conf17
-rw-r--r--lib/wx/api_gen/gl_gen.erl4
-rw-r--r--lib/wx/api_gen/gl_gen_c.erl3
-rw-r--r--lib/wx/api_gen/gl_gen_erl.erl11
-rw-r--r--lib/wx/api_gen/wx_doxygen.conf18
-rw-r--r--lib/wx/api_gen/wx_gen.erl50
-rw-r--r--lib/wx/api_gen/wx_gen.hrl2
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl27
-rw-r--r--lib/wx/api_gen/wxapi.conf10
10 files changed, 97 insertions, 63 deletions
diff --git a/lib/wx/api_gen/README b/lib/wx/api_gen/README
index 3c49f7b2a5..10b5209789 100644
--- a/lib/wx/api_gen/README
+++ b/lib/wx/api_gen/README
@@ -2,16 +2,20 @@ API GENERATION:
Most of the code in wx is generated.
Users of wxErlang should not normally need to regenerate the generated code,
as it is checked in by wxErlang developers, when changes are made.
- 2008-09-29 Code checked in is currently generated from wxwidgets 2.8.7.
+
+ Code checked in is currently generated from wxwidgets 2.8.10.
REQUIREMENTS:
The code generation requires doxygen (1.4.6) which is
used to parse wxWidgets c++ headers and generate xml files (in
wx_xml/).
- (2008-09-29 doxygen 1.4.6 is required.
- Later versions of Doxygen - up to 1.5.6 at least - have a bug in the xml generation
- which causes us problems. This has been logged and we are waiting for a fix.)
+ 2008-09-29 doxygen 1.4.6 is required.
+ Later versions of Doxygen - up to 1.5.6 at least - have a bug in the xml generation
+ which causes us problems. This has been logged and we are waiting for a fix.
+
+ doxygen 1.6.1 and doxygen 1.6.3 might work but is not what I use, i.e.
+ review the diffs.
CONFIGURATION:
wxapi.conf contains the specification to the code generator. The code
@@ -22,5 +26,11 @@ CONFIGURATION:
and running make. Sometimes the code generator will require changes,
I havn't thought of everything yet.
+RUNNING:
+ I use the following alias wxgen='make WXGTK_DIR=/opt/local/include/wx-2.8/ GL_DIR=/home/dgud/opengl'
+
+ I keep the opengl headers separate so I don't go backwards in version when generating the code
+ from another machine.
+
CONTRIBUTION:
Send me patches or update the svn version.
diff --git a/lib/wx/api_gen/gl_doxygen.conf b/lib/wx/api_gen/gl_doxygen.conf
index e29a3654b5..c9bdb6a408 100644
--- a/lib/wx/api_gen/gl_doxygen.conf
+++ b/lib/wx/api_gen/gl_doxygen.conf
@@ -8,7 +8,7 @@ PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY = ./
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
+#USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
@@ -20,7 +20,7 @@ STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
+# DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
SEPARATE_MEMBER_PAGES = NO
@@ -175,17 +175,20 @@ PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = NO
+EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = \
APIENTRY="" \
+ APIENTRYP="*" \
+ GLAPIENTRY="" \
+ GLAPIENTRYP="*" \
WINGDIAPI="" \
GLAPI="" \
GL_GLEXT_PROTOTYPES="1"
-EXPAND_AS_DEFINED = YES
+EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
@@ -214,9 +217,9 @@ DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 0
+#MAX_DOT_GRAPH_WIDTH = 1024
+#MAX_DOT_GRAPH_HEIGHT = 1024
+#MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index 91a6a1adbf..ac5671ae53 100644
--- a/lib/wx/api_gen/gl_gen.erl
+++ b/lib/wx/api_gen/gl_gen.erl
@@ -47,9 +47,9 @@ safe(What, QuitOnErr) ->
io:format("Completed succesfully~n~n", []),
QuitOnErr andalso gen_util:halt(0)
catch Err:Reason ->
- catch gen_util:close(),
io:format("Error ~p: ~p:~p~n ~p~n",
[get(current_func),Err,Reason,erlang:get_stacktrace()]),
+ (catch gen_util:close()),
timer:sleep(1999),
QuitOnErr andalso gen_util:halt(1)
end.
@@ -605,7 +605,7 @@ is_equal(F1=#func{type=T1,params=A1},F2=#func{type=T2,params=A2}) ->
true -> ok;
false ->
%% io:format("A1: ~p~nA2: ~p~n",[A1,A2]),
- ?warning("Skipped Ext Not Equal ~p ~p~n",
+ ?warning("Keeping Ext Not Equal ~p ~p~n",
[F1#func.name,F2#func.name])
end,
Equal.
diff --git a/lib/wx/api_gen/gl_gen_c.erl b/lib/wx/api_gen/gl_gen_c.erl
index 864ce8b1ac..3293050ab9 100644
--- a/lib/wx/api_gen/gl_gen_c.erl
+++ b/lib/wx/api_gen/gl_gen_c.erl
@@ -136,8 +136,7 @@ declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=binary,size=Sz}}) ->
true = is_number(Sz), %% Assert
w(" ~s ~s[~p];~n", [T,N,Sz]),
A;
-declare_var(A=#arg{name=N,in=false,
- type=#type{name=T="GLUquadric",base=B,by_val=false,single=true}}) ->
+declare_var(A=#arg{in=false, type=#type{name="GLUquadric",by_val=false,single=true}}) ->
A;
declare_var(A=#arg{name=N,in=false,
type=#type{name=T,base=B,by_val=false,single=true}}) ->
diff --git a/lib/wx/api_gen/gl_gen_erl.erl b/lib/wx/api_gen/gl_gen_erl.erl
index 07e4d6f783..ce35484561 100644
--- a/lib/wx/api_gen/gl_gen_erl.erl
+++ b/lib/wx/api_gen/gl_gen_erl.erl
@@ -178,9 +178,16 @@ gen_funcs(F) ->
erase(current_func),
w(".~n~n",[]).
-gen_export([F|_]) when is_list(F) ->
+gen_export(F) ->
+ try gen_export_1(F)
+ catch E:R ->
+ io:format("Crash ~p:~p in ~p ~n",[E,R, erlang:get_stacktrace()]),
+ io:format("Func = ~p~n ~p", [F, get(F)])
+ end.
+
+gen_export_1([F|_]) when is_list(F) ->
gen_export2(get(F));
-gen_export(F) when is_list(F) ->
+gen_export_1(F) when is_list(F) ->
gen_export2(get(F)).
gen_export2(#func{name=Name,alt={vector,VecPos,Vec}}) ->
diff --git a/lib/wx/api_gen/wx_doxygen.conf b/lib/wx/api_gen/wx_doxygen.conf
index 1fc57486e6..c4e01ab36d 100644
--- a/lib/wx/api_gen/wx_doxygen.conf
+++ b/lib/wx/api_gen/wx_doxygen.conf
@@ -8,7 +8,7 @@ PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY = ./
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
+#USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
@@ -20,7 +20,7 @@ STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
+# DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
SEPARATE_MEMBER_PAGES = NO
@@ -73,11 +73,11 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = @WXGTK_DIR@/wx/ wx_extra/
-#FILE_PATTERNS = *.h
+# FILE_PATTERNS = *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS = mac/* mgl/* msw/* os2/* x11/* gtk1/* cocoa/* motif/* msdos/* palmos/* private/*
+EXCLUDE_PATTERNS = mac/* mgl/* msw/* os2/* x11/* gtk1/* cocoa/* motif/* msdos/* palmos/* private/* vms_x_fix.h
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
@@ -176,10 +176,11 @@ PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = NO
+EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
+
PREDEFINED = \
wxUSE_MENUS=1 \
wxUSE_TOOLBAR=1 \
@@ -215,6 +216,7 @@ PREDEFINED = \
wxUSE_LISTBOX=1 \
wxUSE_BMPBUTTON=1 \
wxUSE_CHECKBOX=1 \
+ wxUSE_CHECKLISTBOX=1 \
wxUSE_TREECTRL=1 \
wxUSE_LISTCTRL=1 \
wxUSE_BOOKCTRL=1 \
@@ -251,12 +253,13 @@ PREDEFINED = \
wxUSE_CLIPBOARD=1 \
wxABI_VERSION=20809 \
__WXGTK24__=1 \
+ __WXGTK20__=1 \
__WXGTK__=1 \
WXDLLEXPORT=""
# WXWIN_COMPATIBILITY_2_6=1 \
-EXPAND_AS_DEFINED = YES
+EXPAND_AS_DEFINED = WX_FORWARD_TO_SCROLL_HELPER __WXGTK20__
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
@@ -285,9 +288,6 @@ DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl
index 2ed4476440..c075324c1f 100644
--- a/lib/wx/api_gen/wx_gen.erl
+++ b/lib/wx/api_gen/wx_gen.erl
@@ -255,19 +255,24 @@ parse_attr(Defs, Class, Ev, Info = #hs{acc=AccList0}) ->
parse_attr1([{{attr,_}, #xmlElement{content=C, attributes=Attrs}}|R], AttrList0, Opts, Res) ->
Parse = fun(Con, Ac) -> parse_param(Con, Opts, Ac) end,
Param0 = foldl(Parse, #param{}, drop_empty(C)),
- case keysearch(prot, #xmlAttribute.name, Attrs) of
- {value, #xmlAttribute{value = "public"}} ->
- {Acc,AttrList} = attr_acc(Param0, AttrList0),
- parse_attr1(R,AttrList,Opts,
- [Param0#param{in=false,prot=public,acc=Acc}|Res]);
- {value, #xmlAttribute{value = "protected"}} ->
- {Acc,AttrList} = attr_acc(Param0, AttrList0),
- parse_attr1(R,AttrList,Opts,
- [Param0#param{in=false,prot=protected,acc=Acc}|Res]);
- {value, #xmlAttribute{value = "private"}} ->
- {Acc,AttrList} = attr_acc(Param0, AttrList0),
- parse_attr1(R,AttrList,Opts,
- [Param0#param{in=false,prot=private,acc=Acc}|Res])
+ case Param0 of
+ #param{where=nowhere} ->
+ parse_attr1(R,AttrList0,Opts,Res);
+ _ ->
+ case keysearch(prot, #xmlAttribute.name, Attrs) of
+ {value, #xmlAttribute{value = "public"}} ->
+ {Acc,AttrList} = attr_acc(Param0, AttrList0),
+ parse_attr1(R,AttrList,Opts,
+ [Param0#param{in=false,prot=public,acc=Acc}|Res]);
+ {value, #xmlAttribute{value = "protected"}} ->
+ {Acc,AttrList} = attr_acc(Param0, AttrList0),
+ parse_attr1(R,AttrList,Opts,
+ [Param0#param{in=false,prot=protected,acc=Acc}|Res]);
+ {value, #xmlAttribute{value = "private"}} ->
+ {Acc,AttrList} = attr_acc(Param0, AttrList0),
+ parse_attr1(R,AttrList,Opts,
+ [Param0#param{in=false,prot=private,acc=Acc}|Res])
+ end
end;
parse_attr1([{_Id,_}|R],AttrList,Info, Res) ->
parse_attr1(R,AttrList,Info, Res);
@@ -591,17 +596,17 @@ parse_param(#xmlElement{name=array,content=C},_Opts, T = #param{type=Type0}) ->
[#xmlText{value=RealVar}] = C,
[Name] = string:tokens(RealVar, "() "),
T#param{name=Name};
-%% #type{mod=[const]} ->
-%% T#param{type=Type0#type{single=array, by_val=true}};
-%% _ ->
-%% T#param{type=Type0#type{single=array, by_val=false}}
_ ->
T#param{type=Type0#type{single=array, by_val=true}}
end;
parse_param(#xmlElement{name=name,content=[C]}, _, T) ->
%% Attributes have this
- #xmlText{value=Name} = C,
- T#param{name=Name};
+ case C of
+ #xmlText{value=Name="ms_classInfo"} ->
+ T#param{name=Name, where=nowhere};
+ #xmlText{value=Name} ->
+ T#param{name=Name}
+ end;
%% Skipped: Attributes have this
parse_param(#xmlElement{name=definition}, _, T) -> T;
parse_param(#xmlElement{name=argsstring}, _, T) -> T;
@@ -610,6 +615,7 @@ parse_param(#xmlElement{name=detaileddescription}, _, T) -> T;
parse_param(#xmlElement{name=inbodydescription}, _, T) -> T;
parse_param(#xmlElement{name=location}, _, T) -> T;
parse_param(#xmlElement{name=referencedby}, _, T) -> T;
+parse_param(#xmlElement{name=reimplements}, _, T) -> T;
parse_param(Other=#xmlElement{name=Name}, _, T) ->
io:format("Unhandled Param ~p ~p ~n in ~p~n", [Name,Other,T]),
?error(unhandled_param).
@@ -1274,11 +1280,11 @@ extract_enum(#xmlElement{name=memberdef,content=C}, Class, File) ->
undefined ->
%% io:format("1Enum name ~p~n", [Name]),
%% [io:format(" ~s ~p~n", [D,V]) || {D,V} <- Vals],
- put({enum, Name}, #enum{vals=Vals});
+ put({enum, Name}, #enum{vals=Vals, from={File,Class,Name0}});
E = #enum{vals=undefined} ->
%% io:format("2Enum name ~p~n", [Name]),
%% [io:format(" ~s ~p~n", [D,V]) || {D,V} <- Vals],
- put({enum, Name}, E#enum{vals=Vals});
+ put({enum, Name}, E#enum{vals=Vals, from={File,Class,Name0}});
#enum{vals=Vals} -> ok;
%% io:format("Same? ~p ~n", [PVals == Vals])
#enum{vals=OldVals} ->
@@ -1352,7 +1358,7 @@ extract_defs(Defs, File) ->
{Vals,_Skip} ->
%% io:format("Defs file ~p~n", [File]),
%% [io:format(" ~s ~p~n", [D,V]) || {D,V} <- Vals, not is_integer(V)]
- put({enum, {define,"From " ++ File ++ ".h"}}, #enum{vals=Vals})
+ put({enum, {define,"From " ++ File ++ ".h"}}, #enum{vals=Vals, from={File, undefined, "@define"}})
end.
extract_defs2(#xmlElement{name=memberdef,content=C},{Acc,Skip}) ->
diff --git a/lib/wx/api_gen/wx_gen.hrl b/lib/wx/api_gen/wx_gen.hrl
index b34d399358..7e6cf22499 100644
--- a/lib/wx/api_gen/wx_gen.hrl
+++ b/lib/wx/api_gen/wx_gen.hrl
@@ -72,7 +72,7 @@
}
).
--record(enum, {skip="", as_atom=false, vals}).
+-record(enum, {from, skip="", as_atom=false, vals}).
-record(const,{name,val,enum,is_const}).
-define(error(What),
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index d75442d307..7962dd9fbf 100644
--- a/lib/wx/api_gen/wx_gen_erl.erl
+++ b/lib/wx/api_gen/wx_gen_erl.erl
@@ -1035,29 +1035,34 @@ gen_enums_ints() ->
" href, target %% string()~n"
" }).~n", []),
w("~n%% Hardcoded Defines~n", []),
- Enums = [E || E = {{enum,_},#enum{as_atom=false}} <- get()],
+ Enums = [E || {{enum,_},E = #enum{as_atom=false}} <- get()],
w("-define(wxDefaultSize, {-1,-1}).~n", []),
w("-define(wxDefaultPosition, {-1,-1}).~n", []),
w("~n%% Global Variables~n", []),
[w("-define(~s, wxe_util:get_const(~s)).~n", [Gvar, Gvar]) ||
{Gvar,_,_Id} <- get(gvars)],
w("~n%% Enum and defines~n", []),
- foldl(fun({{enum,Type},Enum= #enum{as_atom=false}}, Done) ->
- build_enum_ints(Type,Enum,Done);
+ foldl(fun(Enum= #enum{vals=Vals}, Done) when Vals =/= [] ->
+ build_enum_ints(Enum,Done);
(_,Done) -> Done
end, gb_sets:empty(), lists:sort(Enums)),
close().
-build_enum_ints(Type,#enum{vals=Vals},Done) ->
- case Type of
- [$@|_] -> ok; % anonymous
- {Class,[$@|_]} when Vals =/= [] -> w("% From class ~s~n", [Class]);
- {Class,Enum} when Vals =/= [] -> w("% From ~s::~s~n", [Class,Enum]);
- _ when Vals =/= [] -> w("% Type ~s~n", [Type]);
- _ -> ok
+build_enum_ints(#enum{from=From, vals=Vals},Done) ->
+ case From of
+ {File, undefined, [$@|_]} ->
+ w("% From \"~s.h\"~n",[File]);
+ {File, undefined, Name} ->
+ w("% From \"~s.h\": ~s~n",[File, Name]);
+ {_File, Class,[$@|_]} ->
+ w("% From class ~s~n",[Class]);
+ {_File, Class, Name} ->
+ w("% From class ~s::~s~n",[Class, Name])
end,
- Format = fun(#const{name=Name,val=Value,is_const=true}) when is_integer(Value) ->
+ Format = fun(#const{name="wxEVT_" ++ _}) ->
+ ignore; %% Ignore event macros they are not valid in our event model
+ (#const{name=Name,val=Value,is_const=true}) when is_integer(Value) ->
w("-define(~s, ~p).~n", [enum_name(Name),Value]);
(#const{name=Name,val=Value,is_const=false}) when is_integer(Value) ->
w("-define(~s, wxe_util:get_const(~s)).~n", [enum_name(Name),enum_name(Name)]);
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index 4f7bbfedef..c91a9d7fff 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -27,7 +27,11 @@
wxFONTENCODING_UTF32,wxFONTENCODING_UTF16,
wxDEFAULT_CONTROL_BORDER,wxMOD_CMD,
wxMAJOR_VERSION, wxMINOR_VERSION,
- wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER,wxBETA_NUMBER
+ wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER,wxBETA_NUMBER,
+ %%
+ wxALWAYS_NATIVE_DOUBLE_BUFFER,
+ wxGAUGE_EMULATE_INDETERMINATE_MODE,
+ wxTR_DEFAULT_STYLE
]}.
{gvars,
@@ -702,7 +706,7 @@
['wxCheckBox','~wxCheckBox','Create','GetValue','Get3StateValue',
'Is3rdStateAllowedForUser','Is3State','IsChecked','SetValue',
'Set3StateValue']}.
-{class, wxCheckListBox, wxListBox, [{skip,[{wxCheckListBox,8}]}],
+{class, wxCheckListBox, wxListBox, [{skip,[{wxCheckListBox,8}]}],
[{'wxCheckListBox',[{"pos",{def, "wxDefaultPosition"}},
{"size",{def, "wxDefaultSize"}},
{"choices",{def, ""}}]},
@@ -1686,7 +1690,7 @@
{class, wxSplitterEvent, wxNotifyEvent,
- [
+ [{acc, [{x, skip}, {y, skip}, {pos, skip}, {win, skip}, {pt, skip}]}, %% arrgh doxygen bugs
{event,
[wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,