efl: forward typedef to avoid including useless headers.
authorGustavo Sverzut Barbieri <barbieri@gmail.com>
Thu, 10 Jan 2013 02:18:10 +0000 (02:18 +0000)
committerGustavo Sverzut Barbieri <barbieri@gmail.com>
Thu, 10 Jan 2013 02:18:10 +0000 (02:18 +0000)
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

src/lib/ecore/Ecore_Getopt.h
src/lib/ecore_evas/Ecore_Evas.h
src/lib/ecore_evas/Ecore_Evas_Types.h
src/lib/ecore_evas/ecore_evas_util.c
src/lib/ecore_input/Ecore_Input.h

index 3574ba5..d4ce3aa 100644 (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
 {
index 9792e07..2393e31 100644 (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
index 395c4c0..b819e85 100644 (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_ */
index 85ff2bd..86745c9 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 
 #include <Ecore.h>
+#include <Ecore_Getopt.h>
 #include "ecore_private.h"
 
 #include "ecore_evas_private.h"
index d1feb22..ec40af8 100644 (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;