Thanks for your answer. I attached the main header file gtk.h and the gtkwindow.h which contains gtk_windows_new().
When there is a need I can give more examples or header files.
Here, the name should be: gtk_window_new NOT gtk_windows_new, So, please be more "careful".
Now, the header file contains some code snippet:
#ifdef G_OS_WIN32
/* Reserve old names for DLL ABI backward compatibility */
#define gtk_window_set_icon_from_file gtk_window_set_icon_from_file_utf8
#define gtk_window_set_default_icon_from_file gtk_window_set_default_icon_from_file_utf8
#endif
GType gtk_window_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_window_new (GtkWindowType type);
void gtk_window_set_title (GtkWindow *window,
const gchar *title);
But here G_OS_WIN32 is not defined. So, if you have enable the codecompletion's option:
Parse preprocessor directives, which means the code:
will be evaluated, and it return "false", so this branch does not parsed.
Many solutions:
1, find where G_OS_WIN32 was defined, suppose it was defined in "aaa.h", then you can add "aaa.h" to priority headers set, so the "aaa.h" will have a more precedence, and when parsing gtkwindow.h, this preprocessor directive will become true.
2, disable the option: Parse preprocessor directives in CC's option
3, maybe, you can use gcc's preprocessor feature, like gcc -E to generate some dummy header files, which contains all the preprocessed texts, and put such dummy header file in your projects.
Note: The parser in our CC does not do a full parsing like a compiler did. A full parsing contains too many things for a single translate unit, like it should expand all the header files and evaluate and expand all the macro expansions. Our parser just only parser every file once.
This is what I did to solve this problem:
I have see that I should have a macro defined, so I did:
1, create a dummy header file under my project root folder, and named "aaa.h".
aaa.h contains only one line:
2, add this file to project. Also, add "aaa.h" to priority headers list in CC option.
3, Add one token replacement(replace GSEAL(X) to X) in CC option.
See: http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#AAAAA_-.3E_.2A
Otherwise, this macro will let our parser fail in parsing such statement in "gtkwindow.h"
struct _GtkWindow
{
GtkBin bin;
gchar *GSEAL (title);
gchar *GSEAL (wmclass_name);
gchar *GSEAL (wmclass_class);
gchar *GSEAL (wm_role);
So, the parser see it like below:
struct _GtkWindow
{
GtkBin bin;
gchar *title;
gchar *wmclass_name;
gchar *wmclass_class;
gchar *wm_role;
Now, it works Here (windowsXP, c::b trunk) screen shot below:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2012-02-15091943.png)
PS: it looks like the priority header change will take effect when I restart C::B. (I will look into in the future :))