winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
1042 discussions
Start a n
N
ew thread
Piotr Caban : jscript: Inherit some Function functions from Object.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 8d6d266977c9a6a93532f560f94630f4a1d61528 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d6d266977c9a6a93532f560f…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Aug 14 11:58:31 2009 +0200 jscript: Inherit some Function functions from Object. --- dlls/jscript/function.c | 36 ------------------------------------ dlls/jscript/tests/api.js | 1 + 2 files changed, 1 insertions(+), 36 deletions(-) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 6ac668c..661b93c 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -40,12 +40,8 @@ static const WCHAR prototypeW[] = {'p','r','o','t','o','t', 'y', 'p','e',0}; static const WCHAR lengthW[] = {'l','e','n','g','t','h',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR applyW[] = {'a','p','p','l','y',0}; static const WCHAR callW[] = {'c','a','l','l',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static IDispatch *get_this(DISPPARAMS *dp) { @@ -290,13 +286,6 @@ static HRESULT Function_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISP return S_OK; } -static HRESULT Function_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Function_apply(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -311,27 +300,6 @@ static HRESULT Function_call(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA return E_NOTIMPL; } -static HRESULT Function_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Function_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Function_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - HRESULT Function_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { @@ -394,11 +362,7 @@ static void Function_destructor(DispatchEx *dispex) static const builtin_prop_t Function_props[] = { {applyW, Function_apply, PROPF_METHOD}, {callW, Function_call, PROPF_METHOD}, - {hasOwnPropertyW, Function_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Function_isPrototypeOf, PROPF_METHOD}, {lengthW, Function_length, 0}, - {propertyIsEnumerableW, Function_propertyIsEnumerable, PROPF_METHOD}, - {toLocaleStringW, Function_toLocaleString, PROPF_METHOD}, {toStringW, Function_toString, PROPF_METHOD} }; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 4c1e24f..7273309 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1393,5 +1393,6 @@ testObjectInherit(new Date(), false, false, false); testObjectInherit(new Boolean(true), false, true, false); testObjectInherit(new Array(), false, false, true); testObjectInherit(new Error(), false, true, true); +testObjectInherit(testObjectInherit, false, true, true); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some Error functions from Object.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 28734e3756761867d94eca0eb870a36a8f6da3b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28734e3756761867d94eca0eb…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Aug 14 11:58:10 2009 +0200 jscript: Inherit some Error functions from Object. --- dlls/jscript/error.c | 50 ++++++++------------------------------------ dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/tests/api.js | 1 + 4 files changed, 12 insertions(+), 43 deletions(-) diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 25a3836..70fd008 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -38,10 +38,6 @@ static const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n' static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0}; static const WCHAR numberW[] = {'n','u','m','b','e','r',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static HRESULT Error_number(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) @@ -116,28 +112,6 @@ static HRESULT Error_toString(DispatchEx *dispex, LCID lcid, WORD flags, return S_OK; } -static HRESULT Error_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Error_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - - -static HRESULT Error_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Error_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -166,11 +140,8 @@ static void Error_destructor(DispatchEx *dispex) static const builtin_prop_t Error_props[] = { {descriptionW, Error_description, 0}, - {hasOwnPropertyW, Error_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Error_isPrototypeOf, PROPF_METHOD}, {messageW, Error_message, 0}, {numberW, Error_number, 0}, - {propertyIsEnumerableW, Error_propertyIsEnumerable, PROPF_METHOD}, {toStringW, Error_toString, PROPF_METHOD} }; @@ -185,11 +156,8 @@ static const builtin_info_t Error_info = { static const builtin_prop_t ErrorInst_props[] = { {descriptionW, Error_description, 0}, - {hasOwnPropertyW, Error_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Error_isPrototypeOf, PROPF_METHOD}, {messageW, Error_message, 0}, {numberW, Error_number, 0}, - {propertyIsEnumerableW, Error_propertyIsEnumerable, PROPF_METHOD} }; static const builtin_info_t ErrorInst_info = { @@ -201,21 +169,21 @@ static const builtin_info_t ErrorInst_info = { NULL }; -static HRESULT alloc_error(script_ctx_t *ctx, BOOL error_prototype, +static HRESULT alloc_error(script_ctx_t *ctx, DispatchEx *prototype, DispatchEx *constr, ErrorInstance **ret) { ErrorInstance *err; - DispatchEx *inherit; HRESULT hres; err = heap_alloc_zero(sizeof(ErrorInstance)); if(!err) return E_OUTOFMEMORY; - inherit = error_prototype ? ctx->object_constr : ctx->error_constr; - hres = init_dispex_from_constr(&err->dispex, ctx, - error_prototype ? &Error_info : &ErrorInst_info, - constr ? constr : inherit); + if(prototype) + hres = init_dispex(&err->dispex, ctx, &Error_info, prototype); + else + hres = init_dispex_from_constr(&err->dispex, ctx, &ErrorInst_info, + constr ? constr : ctx->error_constr); if(FAILED(hres)) { heap_free(err); return hres; @@ -231,7 +199,7 @@ static HRESULT create_error(script_ctx_t *ctx, DispatchEx *constr, ErrorInstance *err; HRESULT hres; - hres = alloc_error(ctx, FALSE, constr, &err); + hres = alloc_error(ctx, NULL, constr, &err); if(FAILED(hres)) return hres; @@ -366,7 +334,7 @@ static HRESULT URIErrorConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, dispex->ctx->uri_error_constr); } -HRESULT init_error_constr(script_ctx_t *ctx) +HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype) { static const WCHAR nameW[] = {'n','a','m','e',0}; static const WCHAR ErrorW[] = {'E','r','r','o','r',0}; @@ -392,7 +360,7 @@ HRESULT init_error_constr(script_ctx_t *ctx) HRESULT hres; for(i=0; i<7; i++) { - hres = alloc_error(ctx, i==0, NULL, &err); + hres = alloc_error(ctx, i==0 ? object_prototype : NULL, NULL, &err); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index f0dadc3..e843fac 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -766,7 +766,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = init_error_constr(ctx); + hres = init_error_constr(ctx, object_prototype); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 2adcc86..807225a 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -229,7 +229,7 @@ HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); HRESULT create_array_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_date_constr(script_ctx_t*,DispatchEx*,DispatchEx**); -HRESULT init_error_constr(script_ctx_t*); +HRESULT init_error_constr(script_ctx_t*,DispatchEx*); HRESULT create_number_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_regexp_constr(script_ctx_t*,DispatchEx*,DispatchEx**); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 05cb2b2..4c1e24f 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1392,5 +1392,6 @@ testObjectInherit(new Number(1), false, false, false); testObjectInherit(new Date(), false, false, false); testObjectInherit(new Boolean(true), false, true, false); testObjectInherit(new Array(), false, false, true); +testObjectInherit(new Error(), false, true, true); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some Array functions from Object.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 4791cdb11f78752a0696105e612e5364531071e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4791cdb11f78752a0696105e6…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Aug 14 11:55:15 2009 +0200 jscript: Inherit some Array functions from Object. --- dlls/jscript/array.c | 40 ++++++---------------------------------- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/tests/api.js | 1 + 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index b2bd5b2..a491367 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -43,10 +43,6 @@ static const WCHAR spliceW[] = {'s','p','l','i','c','e',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR unshiftW[] = {'u','n','s','h','i','f','t',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR default_separatorW[] = {',',0}; @@ -743,27 +739,6 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA return E_NOTIMPL; } -static HRESULT Array_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Array_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Array_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Array_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -810,12 +785,9 @@ static void Array_on_put(DispatchEx *dispex, const WCHAR *name) static const builtin_prop_t Array_props[] = { {concatW, Array_concat, PROPF_METHOD}, - {hasOwnPropertyW, Array_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Array_isPrototypeOf, PROPF_METHOD}, {joinW, Array_join, PROPF_METHOD}, {lengthW, Array_length, 0}, {popW, Array_pop, PROPF_METHOD}, - {propertyIsEnumerableW, Array_propertyIsEnumerable, PROPF_METHOD}, {pushW, Array_push, PROPF_METHOD}, {reverseW, Array_reverse, PROPF_METHOD}, {shiftW, Array_shift, PROPF_METHOD}, @@ -888,7 +860,7 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP return S_OK; } -static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **ret) +static HRESULT alloc_array(script_ctx_t *ctx, DispatchEx *object_prototype, ArrayInstance **ret) { ArrayInstance *array; HRESULT hres; @@ -897,8 +869,8 @@ static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **r if(!array) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->array_constr); + if(object_prototype) + hres = init_dispex(&array->dispex, ctx, &Array_info, object_prototype); else hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->object_constr); @@ -911,12 +883,12 @@ static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **r return S_OK; } -HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { ArrayInstance *array; HRESULT hres; - hres = alloc_array(ctx, FALSE, &array); + hres = alloc_array(ctx, object_prototype, &array); if(FAILED(hres)) return hres; @@ -931,7 +903,7 @@ HRESULT create_array(script_ctx_t *ctx, DWORD length, DispatchEx **ret) ArrayInstance *array; HRESULT hres; - hres = alloc_array(ctx, TRUE, &array); + hres = alloc_array(ctx, NULL, &array); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index c06d6f9..f0dadc3 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -754,7 +754,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_array_constr(ctx, &ctx->array_constr); + hres = create_array_constr(ctx, object_prototype, &ctx->array_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index d5f9dd5..2adcc86 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -226,7 +226,7 @@ HRESULT init_global(script_ctx_t*); HRESULT init_function_constr(script_ctx_t*,DispatchEx*); HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); -HRESULT create_array_constr(script_ctx_t*,DispatchEx**); +HRESULT create_array_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_date_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT init_error_constr(script_ctx_t*); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index e02baec..05cb2b2 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1391,5 +1391,6 @@ testObjectInherit(/test/g, false, true, true); testObjectInherit(new Number(1), false, false, false); testObjectInherit(new Date(), false, false, false); testObjectInherit(new Boolean(true), false, true, false); +testObjectInherit(new Array(), false, false, true); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some Boolean function from Object.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: da6398dccda2af8ee9c4af29b5e191cecc887f2c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da6398dccda2af8ee9c4af29b…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Aug 14 11:54:51 2009 +0200 jscript: Inherit some Boolean function from Object. --- dlls/jscript/bool.c | 51 ++++++-------------------------------------- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/tests/api.js | 1 + 4 files changed, 10 insertions(+), 46 deletions(-) diff --git a/dlls/jscript/bool.c b/dlls/jscript/bool.c index bfacebf..336f7e9 100644 --- a/dlls/jscript/bool.c +++ b/dlls/jscript/bool.c @@ -30,12 +30,7 @@ typedef struct { } BoolInstance; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; /* ECMA-262 3rd Edition 15.6.4.2 */ static HRESULT Bool_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -66,13 +61,6 @@ static HRESULT Bool_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA return S_OK; } -static HRESULT Bool_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - TRACE("\n"); - return Bool_toString(dispex, lcid, flags, dp, retv, ei, sp); -} - /* ECMA-262 3rd Edition 15.6.4.3 */ static HRESULT Bool_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) @@ -92,27 +80,6 @@ static HRESULT Bool_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM return S_OK; } -static HRESULT Bool_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Bool_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Bool_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Bool_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -131,10 +98,6 @@ static HRESULT Bool_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS } static const builtin_prop_t Bool_props[] = { - {hasOwnPropertyW, Bool_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Bool_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Bool_propertyIsEnumerable, PROPF_METHOD}, - {toLocaleStringW, Bool_toLocaleString, PROPF_METHOD}, {toStringW, Bool_toString, PROPF_METHOD}, {valueOfW, Bool_valueOf, PROPF_METHOD} }; @@ -188,7 +151,7 @@ static HRESULT BoolConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP return S_OK; } -static HRESULT alloc_bool(script_ctx_t *ctx, BOOL use_constr, BoolInstance **ret) +static HRESULT alloc_bool(script_ctx_t *ctx, DispatchEx *object_prototype, BoolInstance **ret) { BoolInstance *bool; HRESULT hres; @@ -197,10 +160,10 @@ static HRESULT alloc_bool(script_ctx_t *ctx, BOOL use_constr, BoolInstance **ret if(!bool) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&bool->dispex, ctx, &Bool_info, ctx->bool_constr); + if(object_prototype) + hres = init_dispex(&bool->dispex, ctx, &Bool_info, object_prototype); else - hres = init_dispex(&bool->dispex, ctx, &Bool_info, NULL); + hres = init_dispex_from_constr(&bool->dispex, ctx, &Bool_info, ctx->bool_constr); if(FAILED(hres)) { heap_free(bool); @@ -211,12 +174,12 @@ static HRESULT alloc_bool(script_ctx_t *ctx, BOOL use_constr, BoolInstance **ret return S_OK; } -HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { BoolInstance *bool; HRESULT hres; - hres = alloc_bool(ctx, FALSE, &bool); + hres = alloc_bool(ctx, object_prototype, &bool); if(FAILED(hres)) return hres; @@ -231,7 +194,7 @@ HRESULT create_bool(script_ctx_t *ctx, VARIANT_BOOL b, DispatchEx **ret) BoolInstance *bool; HRESULT hres; - hres = alloc_bool(ctx, TRUE, &bool); + hres = alloc_bool(ctx, NULL, &bool); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 58a8f8f..c06d6f9 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -758,7 +758,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_bool_constr(ctx, &ctx->bool_constr); + hres = create_bool_constr(ctx, object_prototype, &ctx->bool_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 56d1d93..d5f9dd5 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -227,7 +227,7 @@ HRESULT init_function_constr(script_ctx_t*,DispatchEx*); HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); HRESULT create_array_constr(script_ctx_t*,DispatchEx**); -HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); +HRESULT create_bool_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_date_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT init_error_constr(script_ctx_t*); HRESULT create_number_constr(script_ctx_t*,DispatchEx*,DispatchEx**); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 3f34987..e02baec 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1390,5 +1390,6 @@ testObjectInherit(new String("test"), false, true, false); testObjectInherit(/test/g, false, true, true); testObjectInherit(new Number(1), false, false, false); testObjectInherit(new Date(), false, false, false); +testObjectInherit(new Boolean(true), false, true, false); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some Date functions from Object.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: b1d0b1c739ded6ca3e4d56fcc6ca0927e610d014 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b1d0b1c739ded6ca3e4d56fcc…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Aug 14 11:53:57 2009 +0200 jscript: Inherit some Date functions from Object. --- dlls/jscript/date.c | 43 +++++++++---------------------------------- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/tests/api.js | 1 + 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 04ec0ee..a607c80 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -47,7 +47,6 @@ typedef struct { static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; @@ -652,27 +651,6 @@ static HRESULT Date_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DI return S_OK; } -static HRESULT Date_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Date_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Date_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Date_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { @@ -2076,9 +2054,6 @@ static const builtin_prop_t Date_props[] = { {getUTCMonthW, Date_getUTCMonth, PROPF_METHOD}, {getUTCSecondsW, Date_getUTCSeconds, PROPF_METHOD}, {getYearW, Date_getYear, PROPF_METHOD}, - {hasOwnPropertyW, Date_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Date_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Date_propertyIsEnumerable, PROPF_METHOD}, {setDateW, Date_setDate, PROPF_METHOD}, {setFullYearW, Date_setFullYear, PROPF_METHOD}, {setHoursW, Date_setHours, PROPF_METHOD}, @@ -2113,7 +2088,7 @@ static const builtin_info_t Date_info = { NULL }; -static HRESULT create_date(script_ctx_t *ctx, BOOL use_constr, DOUBLE time, DispatchEx **ret) +static HRESULT create_date(script_ctx_t *ctx, DispatchEx *object_prototype, DOUBLE time, DispatchEx **ret) { DateInstance *date; HRESULT hres; @@ -2125,10 +2100,10 @@ static HRESULT create_date(script_ctx_t *ctx, BOOL use_constr, DOUBLE time, Disp if(!date) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&date->dispex, ctx, &Date_info, ctx->date_constr); + if(object_prototype) + hres = init_dispex(&date->dispex, ctx, &Date_info, object_prototype); else - hres = init_dispex(&date->dispex, ctx, &Date_info, NULL); + hres = init_dispex_from_constr(&date->dispex, ctx, &Date_info, ctx->date_constr); if(FAILED(hres)) { heap_free(date); return hres; @@ -2540,7 +2515,7 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP lltime = ((LONGLONG)time.dwHighDateTime<<32) + time.dwLowDateTime; - hres = create_date(dispex->ctx, TRUE, lltime/10000-TIME_EPOCH, &date); + hres = create_date(dispex->ctx, NULL, lltime/10000-TIME_EPOCH, &date); if(FAILED(hres)) return hres; break; @@ -2563,7 +2538,7 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP if(FAILED(hres)) return hres; - hres = create_date(dispex->ctx, TRUE, time_clip(num_val(&num)), &date); + hres = create_date(dispex->ctx, NULL, time_clip(num_val(&num)), &date); if(FAILED(hres)) return hres; break; @@ -2576,7 +2551,7 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP DateConstr_UTC(dispex, lcid, flags, dp, &ret_date, ei, sp); - hres = create_date(dispex->ctx, TRUE, num_val(&ret_date), &date); + hres = create_date(dispex->ctx, NULL, num_val(&ret_date), &date); if(FAILED(hres)) return hres; @@ -2623,12 +2598,12 @@ static const builtin_info_t DateConstr_info = { NULL }; -HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { DispatchEx *date; HRESULT hres; - hres = create_date(ctx, FALSE, 0.0, &date); + hres = create_date(ctx, object_prototype, 0.0, &date); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 8229f24..58a8f8f 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -762,7 +762,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_date_constr(ctx, &ctx->date_constr); + hres = create_date_constr(ctx, object_prototype, &ctx->date_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index bd7e711..56d1d93 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -228,7 +228,7 @@ HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); HRESULT create_array_constr(script_ctx_t*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); -HRESULT create_date_constr(script_ctx_t*,DispatchEx**); +HRESULT create_date_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT init_error_constr(script_ctx_t*); HRESULT create_number_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index f0719f5..3f34987 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1389,5 +1389,6 @@ Object.prototype._test = "test"; testObjectInherit(new String("test"), false, true, false); testObjectInherit(/test/g, false, true, true); testObjectInherit(new Number(1), false, false, false); +testObjectInherit(new Date(), false, false, false); reportSuccess();
1
0
0
0
Vincent Povirk : windowscodecs: Implement conversion from 8bppIndexed to 32bppBGRA.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 4d1e72d0b335824e2c35fea834fabe2aabc23b18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d1e72d0b335824e2c35fea83…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 13 14:07:04 2009 -0500 windowscodecs: Implement conversion from 8bppIndexed to 32bppBGRA. --- dlls/windowscodecs/converter.c | 55 ++++++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 1 + 2 files changed, 56 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index a564fcb..bd06c5a 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -38,6 +38,7 @@ struct FormatConverter; enum pixelformat { format_1bppIndexed, format_4bppIndexed, + format_8bppIndexed, format_16bppBGR555, format_16bppBGR565, format_24bppBGR, @@ -189,6 +190,59 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe return res; } return S_OK; + case format_8bppIndexed: + if (prc) + { + HRESULT res; + UINT x, y; + BYTE *srcdata; + UINT srcstride, srcdatasize; + const BYTE *srcrow; + const BYTE *srcbyte; + BYTE *dstrow; + DWORD *dstpixel; + WICColor colors[256]; + IWICPalette *palette; + UINT actualcolors; + + res = PaletteImpl_Create(&palette); + if (FAILED(res)) return res; + + res = IWICBitmapSource_CopyPalette(This->source, palette); + if (SUCCEEDED(res)) + res = IWICPalette_GetColors(palette, 256, colors, &actualcolors); + + IWICPalette_Release(palette); + + if (FAILED(res)) return res; + + srcstride = prc->Width; + srcdatasize = srcstride * prc->Height; + + srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize); + if (!srcdata) return E_OUTOFMEMORY; + + res = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); + + if (SUCCEEDED(res)) + { + srcrow = srcdata; + dstrow = pbBuffer; + for (y=0; y<prc->Height; y++) { + srcbyte=(const BYTE*)srcrow; + dstpixel=(DWORD*)dstrow; + for (x=0; x<prc->Width; x++) + *dstpixel++ = colors[*srcbyte++]; + srcrow += srcstride; + dstrow += cbStride; + } + } + + HeapFree(GetProcessHeap(), 0, srcdata); + + return res; + } + return S_OK; case format_16bppBGR555: if (prc) { @@ -370,6 +424,7 @@ static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRec static const struct pixelformatinfo supported_formats[] = { {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL}, {format_4bppIndexed, &GUID_WICPixelFormat4bppIndexed, NULL}, + {format_8bppIndexed, &GUID_WICPixelFormat8bppIndexed, NULL}, {format_16bppBGR555, &GUID_WICPixelFormat16bppBGR555, NULL}, {format_16bppBGR565, &GUID_WICPixelFormat16bppBGR565, NULL}, {format_24bppBGR, &GUID_WICPixelFormat24bppBGR, NULL}, diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index a95274e..4191366 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -791,6 +791,7 @@ static struct regsvr_decoder const decoder_list[] = { static GUID const * const converter_formats[] = { &GUID_WICPixelFormat1bppIndexed, &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, &GUID_WICPixelFormat16bppBGR555, &GUID_WICPixelFormat16bppBGR565, &GUID_WICPixelFormat24bppBGR,
1
0
0
0
Vincent Povirk : windowscodecs: Implement conversion from 4bppIndexed to 32bppBGRA.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 9c1db8d82810389a33462cc535ccf4374c4e3bbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c1db8d82810389a33462cc53…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 13 14:01:39 2009 -0500 windowscodecs: Implement conversion from 4bppIndexed to 32bppBGRA. --- dlls/windowscodecs/converter.c | 59 ++++++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 1 + 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index 8e98bc6..a564fcb 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -37,6 +37,7 @@ struct FormatConverter; enum pixelformat { format_1bppIndexed, + format_4bppIndexed, format_16bppBGR555, format_16bppBGR565, format_24bppBGR, @@ -131,6 +132,63 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe return res; } return S_OK; + case format_4bppIndexed: + if (prc) + { + HRESULT res; + UINT x, y; + BYTE *srcdata; + UINT srcstride, srcdatasize; + const BYTE *srcrow; + const BYTE *srcbyte; + BYTE *dstrow; + DWORD *dstpixel; + WICColor colors[16]; + IWICPalette *palette; + UINT actualcolors; + + res = PaletteImpl_Create(&palette); + if (FAILED(res)) return res; + + res = IWICBitmapSource_CopyPalette(This->source, palette); + if (SUCCEEDED(res)) + res = IWICPalette_GetColors(palette, 16, colors, &actualcolors); + + IWICPalette_Release(palette); + + if (FAILED(res)) return res; + + srcstride = (prc->Width+1)/2; + srcdatasize = srcstride * prc->Height; + + srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize); + if (!srcdata) return E_OUTOFMEMORY; + + res = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); + + if (SUCCEEDED(res)) + { + srcrow = srcdata; + dstrow = pbBuffer; + for (y=0; y<prc->Height; y++) { + srcbyte=(const BYTE*)srcrow; + dstpixel=(DWORD*)dstrow; + for (x=0; x<prc->Width; x+=2) { + BYTE srcval; + srcval=*srcbyte++; + *dstpixel++ = colors[srcval>>4]; + if (x+1 < prc->Width) *dstpixel++ = colors[srcval&0xf]; + } + srcrow += srcstride; + dstrow += cbStride; + } + } + + HeapFree(GetProcessHeap(), 0, srcdata); + + return res; + } + return S_OK; case format_16bppBGR555: if (prc) { @@ -311,6 +369,7 @@ static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRec static const struct pixelformatinfo supported_formats[] = { {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL}, + {format_4bppIndexed, &GUID_WICPixelFormat4bppIndexed, NULL}, {format_16bppBGR555, &GUID_WICPixelFormat16bppBGR555, NULL}, {format_16bppBGR565, &GUID_WICPixelFormat16bppBGR565, NULL}, {format_24bppBGR, &GUID_WICPixelFormat24bppBGR, NULL}, diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 7c7d2cf..a95274e 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -790,6 +790,7 @@ static struct regsvr_decoder const decoder_list[] = { static GUID const * const converter_formats[] = { &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat4bppIndexed, &GUID_WICPixelFormat16bppBGR555, &GUID_WICPixelFormat16bppBGR565, &GUID_WICPixelFormat24bppBGR,
1
0
0
0
Vincent Povirk : windowscodecs: Implement conversion from 24bppBGR to 32bppBGRA.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 1a62109b70e0e6a61141f8269c77dd1129c2dc71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a62109b70e0e6a61141f8269…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 13 13:56:02 2009 -0500 windowscodecs: Implement conversion from 24bppBGR to 32bppBGRA. --- dlls/windowscodecs/converter.c | 45 ++++++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 1 + 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index 7213151..8e98bc6 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -39,6 +39,7 @@ enum pixelformat { format_1bppIndexed, format_16bppBGR555, format_16bppBGR565, + format_24bppBGR, format_32bppBGR, format_32bppBGRA }; @@ -226,6 +227,49 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe return res; } return S_OK; + case format_24bppBGR: + if (prc) + { + HRESULT res; + UINT x, y; + BYTE *srcdata; + UINT srcstride, srcdatasize; + const BYTE *srcrow; + const BYTE *srcpixel; + BYTE *dstrow; + BYTE *dstpixel; + + srcstride = 3 * prc->Width; + srcdatasize = srcstride * prc->Height; + + srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize); + if (!srcdata) return E_OUTOFMEMORY; + + res = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); + + if (SUCCEEDED(res)) + { + srcrow = srcdata; + dstrow = pbBuffer; + for (y=0; y<prc->Height; y++) { + srcpixel=srcrow; + dstpixel=dstrow; + for (x=0; x<prc->Width; x++) { + *dstpixel++=*srcpixel++; /* blue */ + *dstpixel++=*srcpixel++; /* green */ + *dstpixel++=*srcpixel++; /* red */ + *dstpixel++=255; /* alpha */ + } + srcrow += srcstride; + dstrow += cbStride; + } + } + + HeapFree(GetProcessHeap(), 0, srcdata); + + return res; + } + return S_OK; case format_32bppBGR: if (prc) { @@ -269,6 +313,7 @@ static const struct pixelformatinfo supported_formats[] = { {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL}, {format_16bppBGR555, &GUID_WICPixelFormat16bppBGR555, NULL}, {format_16bppBGR565, &GUID_WICPixelFormat16bppBGR565, NULL}, + {format_24bppBGR, &GUID_WICPixelFormat24bppBGR, NULL}, {format_32bppBGR, &GUID_WICPixelFormat32bppBGR, copypixels_to_32bppBGR}, {format_32bppBGRA, &GUID_WICPixelFormat32bppBGRA, copypixels_to_32bppBGRA}, {0} diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index b8280ac..7c7d2cf 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -792,6 +792,7 @@ static GUID const * const converter_formats[] = { &GUID_WICPixelFormat1bppIndexed, &GUID_WICPixelFormat16bppBGR555, &GUID_WICPixelFormat16bppBGR565, + &GUID_WICPixelFormat24bppBGR, &GUID_WICPixelFormat32bppBGR, &GUID_WICPixelFormat32bppBGRA, NULL
1
0
0
0
Vincent Povirk : windowscodecs: Implement conversion from 1bppIndexed to 32bppBGRA.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 3e5cdea0b471dda247a8de27062c17b9a371f99f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e5cdea0b471dda247a8de270…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 13 13:48:22 2009 -0500 windowscodecs: Implement conversion from 1bppIndexed to 32bppBGRA. --- dlls/windowscodecs/converter.c | 65 ++++++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 1 + 2 files changed, 66 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index fb8bd87..7213151 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); struct FormatConverter; enum pixelformat { + format_1bppIndexed, format_16bppBGR555, format_16bppBGR565, format_32bppBGR, @@ -66,6 +67,69 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe { switch (source_format) { + case format_1bppIndexed: + if (prc) + { + HRESULT res; + UINT x, y; + BYTE *srcdata; + UINT srcstride, srcdatasize; + const BYTE *srcrow; + const BYTE *srcbyte; + BYTE *dstrow; + DWORD *dstpixel; + WICColor colors[2]; + IWICPalette *palette; + UINT actualcolors; + + res = PaletteImpl_Create(&palette); + if (FAILED(res)) return res; + + res = IWICBitmapSource_CopyPalette(This->source, palette); + if (SUCCEEDED(res)) + res = IWICPalette_GetColors(palette, 2, colors, &actualcolors); + + IWICPalette_Release(palette); + + if (FAILED(res)) return res; + + srcstride = (prc->Width+7)/8; + srcdatasize = srcstride * prc->Height; + + srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize); + if (!srcdata) return E_OUTOFMEMORY; + + res = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); + + if (SUCCEEDED(res)) + { + srcrow = srcdata; + dstrow = pbBuffer; + for (y=0; y<prc->Height; y++) { + srcbyte=(const BYTE*)srcrow; + dstpixel=(DWORD*)dstrow; + for (x=0; x<prc->Width; x+=8) { + BYTE srcval; + srcval=*srcbyte++; + *dstpixel++ = colors[srcval>>7&1]; + if (x+1 < prc->Width) *dstpixel++ = colors[srcval>>6&1]; + if (x+2 < prc->Width) *dstpixel++ = colors[srcval>>5&1]; + if (x+3 < prc->Width) *dstpixel++ = colors[srcval>>4&1]; + if (x+4 < prc->Width) *dstpixel++ = colors[srcval>>3&1]; + if (x+5 < prc->Width) *dstpixel++ = colors[srcval>>2&1]; + if (x+6 < prc->Width) *dstpixel++ = colors[srcval>>1&1]; + if (x+7 < prc->Width) *dstpixel++ = colors[srcval&1]; + } + srcrow += srcstride; + dstrow += cbStride; + } + } + + HeapFree(GetProcessHeap(), 0, srcdata); + + return res; + } + return S_OK; case format_16bppBGR555: if (prc) { @@ -202,6 +266,7 @@ static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRec } static const struct pixelformatinfo supported_formats[] = { + {format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL}, {format_16bppBGR555, &GUID_WICPixelFormat16bppBGR555, NULL}, {format_16bppBGR565, &GUID_WICPixelFormat16bppBGR565, NULL}, {format_32bppBGR, &GUID_WICPixelFormat32bppBGR, copypixels_to_32bppBGR}, diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 7886a6d..b8280ac 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -789,6 +789,7 @@ static struct regsvr_decoder const decoder_list[] = { }; static GUID const * const converter_formats[] = { + &GUID_WICPixelFormat1bppIndexed, &GUID_WICPixelFormat16bppBGR555, &GUID_WICPixelFormat16bppBGR565, &GUID_WICPixelFormat32bppBGR,
1
0
0
0
Vincent Povirk : windowscodecs: Implement conversion from 16bppBGR565 to 32bppBGRA.
by Alexandre Julliard
14 Aug '09
14 Aug '09
Module: wine Branch: master Commit: 7bbe731252338053e895413cd40beac1113c4050 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7bbe731252338053e895413cd…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 13 13:34:20 2009 -0500 windowscodecs: Implement conversion from 16bppBGR565 to 32bppBGRA. --- dlls/windowscodecs/converter.c | 50 ++++++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 1 + 2 files changed, 51 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index c53a0cd..fb8bd87 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -37,6 +37,7 @@ struct FormatConverter; enum pixelformat { format_16bppBGR555, + format_16bppBGR565, format_32bppBGR, format_32bppBGRA }; @@ -113,6 +114,54 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe return res; } return S_OK; + case format_16bppBGR565: + if (prc) + { + HRESULT res; + UINT x, y; + BYTE *srcdata; + UINT srcstride, srcdatasize; + const BYTE *srcrow; + const WORD *srcpixel; + BYTE *dstrow; + DWORD *dstpixel; + + srcstride = 2 * prc->Width; + srcdatasize = srcstride * prc->Height; + + srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize); + if (!srcdata) return E_OUTOFMEMORY; + + res = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); + + if (SUCCEEDED(res)) + { + srcrow = srcdata; + dstrow = pbBuffer; + for (y=0; y<prc->Height; y++) { + srcpixel=(const WORD*)srcrow; + dstpixel=(DWORD*)dstrow; + for (x=0; x<prc->Width; x++) { + WORD srcval; + srcval=*srcpixel++; + *dstpixel++=0xff000000 | /* constant 255 alpha */ + ((srcval << 8) & 0xf80000) | /* r */ + ((srcval << 3) & 0x070000) | /* r - 3 bits */ + ((srcval << 5) & 0x00fc00) | /* g */ + ((srcval >> 1) & 0x000300) | /* g - 2 bits */ + ((srcval << 3) & 0x0000f8) | /* b */ + ((srcval >> 2) & 0x000007); /* b - 3 bits */ + } + srcrow += srcstride; + dstrow += cbStride; + } + } + + HeapFree(GetProcessHeap(), 0, srcdata); + + return res; + } + return S_OK; case format_32bppBGR: if (prc) { @@ -154,6 +203,7 @@ static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRec static const struct pixelformatinfo supported_formats[] = { {format_16bppBGR555, &GUID_WICPixelFormat16bppBGR555, NULL}, + {format_16bppBGR565, &GUID_WICPixelFormat16bppBGR565, NULL}, {format_32bppBGR, &GUID_WICPixelFormat32bppBGR, copypixels_to_32bppBGR}, {format_32bppBGRA, &GUID_WICPixelFormat32bppBGRA, copypixels_to_32bppBGRA}, {0} diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index f8e2f3f..7886a6d 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -790,6 +790,7 @@ static struct regsvr_decoder const decoder_list[] = { static GUID const * const converter_formats[] = { &GUID_WICPixelFormat16bppBGR555, + &GUID_WICPixelFormat16bppBGR565, &GUID_WICPixelFormat32bppBGR, &GUID_WICPixelFormat32bppBGRA, NULL
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
105
Older →
Jump to page:
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
Results per page:
10
25
50
100
200