Elm: fix compilation on OS that are not using X
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 20 Mar 2012 04:41:24 +0000 (04:41 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 20 Mar 2012 04:41:24 +0000 (04:41 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69516 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/examples/win_example.c

index d942c3b..8923af3 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * gcc -o win_example win_example.c `pkg-config --cflags --libs elementary ecore-x`
  */
-#include <Elementary.h>
-#include <Ecore_X.h>
 #ifdef HAVE_CONFIG_H
 # include "elementary_config.h"
 #else
@@ -10,6 +8,12 @@
 # define PACKAGE_DATA_DIR "../../data"
 #endif
 
+#ifdef HAVE_ELEMENTARY_X
+# include <Ecore_X.h>
+#endif
+
+#include <Elementary.h>
+
 static void
 _btn_activate_cb(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
 {
@@ -158,8 +162,10 @@ _main_win_del_cb(void *data __UNUSED__, Evas_Object *obj, void *event __UNUSED__
 static void
 _force_focus_cb(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
 {
+#ifdef HAVE_ELEMENTARY_X
    Ecore_X_Window xwin = elm_win_xwindow_get(data);
    ecore_x_window_focus(xwin);
+#endif
 }
 
 static void