wimp theme



Hi,
I have some time to devote to the wimp theme in gtk+. I'd like to help improve the code. I found a place in

#if 0
 /* TODO: this crashes. need to figure out why and how to fix it */
 if (xp_theme_get_system_font(klazz, type, out_lf))
   return TRUE;
 else
#endif

that I'd like to work on fixing.

I think the problem is in
static HTHEME
xp_theme_get_handle_by_class (XpThemeClass klazz)
{
 if (!open_themes[klazz] && open_theme_data_func)
   {
open_themes[klazz] = open_theme_data_func(NULL, class_descriptors[klazz]);
   }
 return open_themes[klazz];
}

I think the NULL why there is trouble. I'm compiling with msvc and using buffer over run check /GS and after calling that function 2 things happen. the first time it returns NULL.
the second time it returns a mangled pointer and the stack is trashed.

Also, doing some invesitegation i could not find any examples that called that function passing NULL.
It is even some what documented as requiring a non-null pointer as it says:
"[in] Handle of the window for which theme data is required."


I'm very new to this code though and to the interworkings of a theme engine, so it is not clear to me how to go about getting that hwnd. Any pointers would be great, as well as suggestions on where to focus my energies :-)

-todd





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]