efl: forward typedef to avoid including useless headers.

do not include Ecore_Input.h just to get Ecore_Window and Ecore_Getopt
to get handful typedefs.

NOTE: why do we have the #ifdefs around these predefs? At least GCC does not warn if we typedef twice the same thing (if they are identical)



SVN revision: 82499
This commit is contained in:
Gustavo Sverzut Barbieri 2013-01-10 02:18:10 +00:00
parent 7b0ae69adc
commit 532284dbbe
5 changed files with 41 additions and 6 deletions

View File

@ -86,12 +86,21 @@ typedef enum {
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL = 3
} Ecore_Getopt_Desc_Arg_Requirement;
typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
typedef struct _Ecore_Getopt_Desc_Store Ecore_Getopt_Desc_Store;
typedef struct _Ecore_Getopt_Desc_Callback Ecore_Getopt_Desc_Callback;
typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
typedef struct _Ecore_Getopt Ecore_Getopt;
#ifndef _ECORE_GETOPT_PREDEF
typedef struct _Ecore_Getopt Ecore_Getopt;
#define _ECORE_GETOPT_PREDEF 1
#endif
#ifndef _ECORE_GETOPT_DESC_PREDEF
typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
#define _ECORE_GETOPT_DESC_PREDEF 1
#endif
#ifndef _ECORE_GETOPT_VALUE_PREDEF
typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
#define _ECORE_GETOPT_VALUE_PREDEF 1
#endif
union _Ecore_Getopt_Value
{

View File

@ -4,8 +4,6 @@
#include "Ecore_Evas_Types.h"
#include <Evas.h>
#include <Ecore_Getopt.h>
#include <Ecore_Input.h>
#ifdef EAPI
# undef EAPI

View File

@ -1,6 +1,12 @@
#ifndef _ECORE_EVAS_TYPES_H_
#define _ECORE_EVAS_TYPES_H_
#ifdef _WIN32
# include <stddef.h>
#else
# include <inttypes.h>
#endif
#ifndef _ECORE_X_H
#define _ECORE_X_WINDOW_PREDEF
typedef unsigned int Ecore_X_Window;
@ -34,5 +40,22 @@ typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for s
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
#endif
#ifndef _ECORE_GETOPT_PREDEF
typedef struct _Ecore_Getopt Ecore_Getopt;
#define _ECORE_GETOPT_PREDEF 1
#endif
#ifndef _ECORE_GETOPT_DESC_PREDEF
typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
#define _ECORE_GETOPT_DESC_PREDEF 1
#endif
#ifndef _ECORE_GETOPT_VALUE_PREDEF
typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
#define _ECORE_GETOPT_VALUE_PREDEF 1
#endif
#ifndef _ECORE_WINDOW_PREDEF
typedef uintptr_t Ecore_Window;
#define _ECORE_WINDOW_PREDEF 1
#endif
#endif /* _ECORE_EVAS_TYPES_H_ */

View File

@ -6,6 +6,7 @@
#include <string.h>
#include <Ecore.h>
#include <Ecore_Getopt.h>
#include "ecore_private.h"
#include "ecore_evas_private.h"

View File

@ -61,7 +61,11 @@ extern "C" {
#define ECORE_EVENT_LOCK_SHIFT 0x0300
#define ECORE_EVENT_MODIFIER_ALTGR 0x0400 /**< @since 1.7 */
#ifndef _ECORE_WINDOW_PREDEF
typedef uintptr_t Ecore_Window;
#define _ECORE_WINDOW_PREDEF 1
#endif
typedef struct _Ecore_Event_Key Ecore_Event_Key;
typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;