change the deprecated func to siggetmask
authorJuan Zhao <juan.j.zhao@intel.com>
Fri, 13 Sep 2013 09:44:43 +0000 (17:44 +0800)
committerJuan Zhao <juan.j.zhao@intel.com>
Wed, 9 Oct 2013 03:31:58 +0000 (11:31 +0800)
The warning will be like this:
src/menu_screen.c: In function '_resume_cb':
src/menu_screen.c:361:2: warning: 'siggetmask' is deprecated (declared at /usr/include/signal.h:203)
   utilx_hide_fake_effect(
   ^

add the function string and retrun value

1. move to use PRINT_LOCATIONS to add the X related function name info
2. some of the function needs to return some value to use, in this case
    the do{} while(0) won't provide any value back, so we need to modify
    the usage to ({xxx;}).

configure.ac
packaging/x2w.spec
src/x2w.c
src/x2w.h

index 976551f..86e7c24 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT([ecore_x_hook)], [0.0.1], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([x2w)], [0.0.1], [enlightenment-devel@lists.sourceforge.net])
 AC_PREREQ([2.52])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
index ec0b559..c1b90a1 100644 (file)
@@ -1,7 +1,7 @@
 Name:       x2w
 Summary:    Figure out the changes to enable wayland
 Version:    0.1
-Release:    1
+Release:    2
 Group:      System/Libraries
 License:    LGPL-2.1
 Source0:    %{name}-%{version}.tar.bz2
index 2439e78..fd67822 100644 (file)
--- a/src/x2w.c
+++ b/src/x2w.c
@@ -1,5 +1,9 @@
 #include <stdlib.h>
+#include "x2w.h"
 void ecore_x_func_is_used()
 {
+       int win,w,h;
+       ecore_x_window_size_get(win, &w, &h);
+       w=elm_win_xwindow_get(w);
        return;
 }
index 5b70efa..e59fada 100644 (file)
--- a/src/x2w.h
+++ b/src/x2w.h
 extern "C" {
 #endif
 
-#if defined(__GNUC__) && __GNUC__ >= 4
-#define X2W_DEPRECATED __attribute__ ((deprecated))
-#else
-#define X2W_DEPRECATED
-#endif
-
 #include <stdio.h>
 
-#define ROOT_WIN_ID 1
-#define MAGIC_WIN_ID 0
-#define FAKE_DISPLAY 0
-#define WIDTH 720
-#define HEIGHT 1280
-#define PRINT_LOG(string) fprintf(stderr, "%s\n", string);
+#define ROOT_WIN_ID    1
+#define FAKE_RETURN_INT        ROOT_WIN_ID
+#define FAKE_RETURN_POINTER    NULL
+#define WIDTH  720
+#define HEIGHT 1280
 #define PRINT_LOCATIONS(string) fprintf(stderr, "file: %s, \tfunc: %s, \tline: %d, using %s\n", __FILE__, __FUNCTION__, __LINE__, string);
 #define PRINT_LOCATION fprintf(stderr, "file: %s, \tfunc: %s, \tline: %d\n", __FILE__, __FUNCTION__, __LINE__);
-#define PRINT_SCREENSIZE_SUGGESTION fprintf(stderr, "if it is to get screen size, please use ecore_evas_screen_geometry_get API instead.\n");
+#define DO_PRAGMA _Pragma ("GCC warning \"X-func\"")
+
+#define RETURN_INT(a) ({DO_PRAGMA PRINT_LOCATIONS(a); FAKE_RETURN_INT;})
+#define RETURN_POINTER(a) ({DO_PRAGMA PRINT_LOCATIONS(a); FAKE_RETURN_POINTER;})
+#define RETURN_VOID(a) do {DO_PRAGMA PRINT_LOCATIONS(a);} while(0)
 
-void ecore_x_func_is_used(void) X2W_DEPRECATED;
+#define elm_win_xwindow_get(win)                       \
+       RETURN_INT("e_lm_win_xwindow_get")
 
 #define ecore_x_window_size_get(win, w, h)             \
-do {                                                   \
-       ecore_x_func_is_used();                         \
+({                                                     \
+       DO_PRAGMA                                       \
        PRINT_LOCATIONS("e_core_x_window_size_get")     \
        *w=(int)WIDTH;                                  \
        *h=(int)HEIGHT;                                 \
-} while (0)
-
-
-#define ecore_x_window_root_first_get()                                        \
-do {                                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                                  \
-} while (0)
+})
 
+#define ecore_x_window_root_first_get()                        \
+       RETURN_INT("e_core_x_window_root_first_get")
 
 #define ecore_x_icccm_name_class_set(win, n, c)                \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-/*what's this API used for*/
-#define elm_win_xwindow_get(win)               ({      \
-               ecore_x_func_is_used();                 \
-               PRINT_LOCATION                          \
-               ROOT_WIN_ID;            \
-})
+       RETURN_VOID("e_core_x_icccm_name_class_set")
 
 #define ecore_x_window_prop_string_set(win, type, str) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_VOID("e_core_x_window_prop_string_set")
 
-#define ecore_x_display_get()                  ({      \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-       FAKE_DISPLAY;})
+#define ecore_x_display_get()                          \
+       RETURN_INT("e_core_x_display_get")
 
-#define ecore_x_window_root_get(win)           ({      \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-       ROOT_WIN_ID;})
+#define ecore_x_window_root_get(win)                   \
+       RETURN_INT("e_core_x_window_root_get")
 
-#define utilx_hide_fake_effect(dpy, win)               \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_focus_get()             ({      \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-       ROOT_WIN_ID;})
+#define ecore_x_window_focus_get()                     \
+       RETURN_INT("e_core_x_window_focus_get")         \
 
 #define ecore_x_event_mask_set(w, mask)                        \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_VOID("e_core_x_event_mask_set")
 
 
-#define ecore_x_window_prop_card32_get(win, atom, val, len) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+#define ecore_x_window_prop_card32_get(win, atom, val, len)    \
+       RETURN_INT("e_core_x_window_prop_card32_get")
 
-#define ecore_x_window_prop_property_set(win, type, format, size, data, number) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+#define ecore_x_window_prop_property_set(win, type, format, size, data, number)        \
+       RETURN_VOID("e_core_x_window_prop_property_set")
 
-#define ecore_x_sync()                                 \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+#define ecore_x_sync()                         \
+       RETURN_VOID("e_core_x_sync")
 
-#define ecore_x_init(name)                             \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+#define ecore_x_init(name)                     \
+       RETURN_INT("e_core_x_init")
 
 
 #define ecore_x_dpi_get()                              \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_INT("e_core_x_dpi_get")
 
 #define ecore_x_default_screen_get(void)               \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_INT("e_core_x_default_screen_get")
 
 #define ecore_x_screen_size_get(screen, w, h)          \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_VOID("e_core_x_screen_size_get")
 
 #define ecore_x_window_cursor_set(win, c)              \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_VOID("e_core_x_window_cursor_set")
 
 #define ecore_x_cursor_shape_get(shape)                        \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_INT("e_core_x_cursor_shape_get")
 
 #define ecore_x_icccm_title_get(win)                   \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_input_new(parent, x, y, w, h) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_event_mask_unset(w, mask) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_icccm_title_set(win, t)\
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_netwm_name_set(win, name) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_netwm_pid_set(win, pid) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_netwm_pid_get(win, pid) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_delete_request_send(win) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_icccm_name_class_set(win, n, c) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_netwm_window_type_set(win, type) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_pointer_ungrab(void)           \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define elm_config_preferred_engine_set(engine) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_icccm_transient_for_set(win,forwin) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_client_manage(win) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_prop_window_get( win,  atom, val, len) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_e_virtual_keyboard_state_get(win) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_window_prop_xid_get(win, atom, type, lst, len) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define  ecore_x_window_prop_property_get(win, property, type, size, data, num) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_netwm_name_get(win, name) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_shape_input_rectangle_set(win, x, y, w, h) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define XIQueryVersion( dpy, major_version_inout, minor_version_inout ) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define XIGetProperty(display,deviceid,property,offset,length,delete_property,type,type_return,format_return,num_items_return, bytes_after_return, data)  \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define XIQueryDevice( dpy,deviceid,ndevices_return) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define XIFreeDeviceInfo(info) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_prop_string_set(win, type, str) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-
-#define ecore_x_e_illume_keyboard_geometry_set(win, x, y, w, h) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_e_virtual_keyboard_state_set(win, state) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_prop_card32_set(win, atom, val, num) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define  ecore_x_window_prop_xid_set(win, atom, type, lst, num) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_window_prop_window_list_get(win, atom, plst) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
-
-#define ecore_x_netwm_opacity_set(win, opacity) \
-do {                                                   \
-       ecore_x_func_is_used();                         \
-       PRINT_LOCATION                                  \
-} while (0)
+       RETURN_POINT("e_core_x_icccm_title_get")
+
+#define ecore_x_window_input_new(parent, x, y, w, h)   \
+       RETURN_INT("e_core_x_window_input_new")
+
+#define ecore_x_event_mask_unset(w, mask)              \
+       RETURN_VOID("e_core_x_event_mask_unset")
+
+#define ecore_x_icccm_title_set(win, t)                        \
+       RETURN_VOID("e_core_x_icccm_title_set")
+
+#define ecore_x_netwm_name_set(win, name)              \
+       RETURN_VOID("e_core_x_netwm_name_set")
+
+#define ecore_x_netwm_pid_set(win, pid)                        \
+       RETURN_VOID("e_core_x_netwm_pid_set")
+
+
+#define ecore_x_netwm_pid_get(win, pid)                        \
+       RETURN_INT("e_core_x_netwm_pid_get")
+
+#define ecore_x_window_delete_request_send(win)                        \
+       RETURN_VOID("e_core_x_window_delete_request_send")
+
+#define ecore_x_netwm_window_type_set(win, type)               \
+       RETURN_VOID("e_core_x_netwm_window_type_set")
+
+#define ecore_x_pointer_ungrab(void)                   \
+       RETURN_VOID("e_core_x_pointer_ungrab")
+
+
+#define ecore_x_icccm_transient_for_set(win,forwin)            \
+       RETURN_VOID("e_core_x_icccm_transient_for_set")
+
+#define ecore_x_window_client_manage(win)                      \
+       RETURN_VOID("ecore_x_window_client_manage")
+
+#define ecore_x_window_prop_window_get( win,  atom, val, len)  \
+       RETURN_INT("ecore_x_window_prop_window_get")
+
+#define ecore_x_e_virtual_keyboard_state_get(win)              \
+       RETURN_INT("e_core_x_e_virtual_keyboard_state_get")
+
+/*check values*/
+#define ecore_x_window_prop_xid_get(win, atom, type, lst, len) \
+       RETURN_INT("e_core_x_window_prop_xid_get")
+
+#define  ecore_x_window_prop_property_get(win, property, type, size, data, num)        \
+       RETURN_INT("e_core_x_window_prop_property_get")
+
+#define ecore_x_netwm_name_get(win, name)              \
+       RETURN_INT("e_core_x_netwm_name_get")
+
+#define ecore_x_window_shape_input_rectangle_set(win, x, y, w, h)      \
+       RETURN_VOID(e_core_x_window_shape_input_rectangle_set)
+
+#define ecore_x_window_prop_string_set(win, type, str)                 \
+       RETURN_VOID("e_core_x_window_prop_string_set")
+
+#define ecore_x_e_illume_keyboard_geometry_set(win, x, y, w, h)                \
+       RETURN_VOID("e_core_x_e_illume_keyboard_geometry_set")
+
+#define ecore_x_e_virtual_keyboard_state_set(win, state)               \
+       RETURN_VOID("e_core_x_e_virtual_keyboard_state_set")
+
+#define ecore_x_window_prop_card32_set(win, atom, val, num)    \
+       RETURN_VOID("e_core_x_window_prop_card32_set")
+
+#define  ecore_x_window_prop_xid_set(win, atom, type, lst, num)        \
+       RETURN_VOID("e_core_x_window_prop_xid_set")
+
+#define ecore_x_window_prop_window_list_get(win, atom, plst)   \
+       RETURN_INT("e_core_x_window_prop_window_list_get")
+
+#define ecore_x_netwm_opacity_set(win, opacity)                        \
+       RETURN_VOID("e_core_x_netwm_opacity_set")
+
+#define utilx_hide_fake_effect(dpy, win)               \
+       RETURN_VOID("u_tilx_hide_fake_effect")
+
+#define XIQueryVersion( dpy, major_version_inout, minor_version_inout )        \
+       RETURN_INT("X_IQueryVersion")
+
+#define XIGetProperty(dis,dev,prop,o,l,d,t,ct,f,n, b, d2)      \
+       RETURN_INT("X_IGetProperty")
 
+#define XIQueryDevice( dpy,deviceid,ndevices_return)           \
+       RETURN_POINT("X_IQueryDevice")
 
+#define XIFreeDeviceInfo(info)                                 \
+       RETURN_VOID("X_IFreeDeviceInfo")
 
 #ifdef __cplusplus
 } /* extern "C" */